Skip to content

Commit

Permalink
Installation Count
Browse files Browse the repository at this point in the history
  • Loading branch information
andreapollastri committed Apr 15, 2021
1 parent 6f1086c commit f8025b7
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 12 deletions.
51 changes: 51 additions & 0 deletions app/Console/Commands/ActiveSetupCount.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace App\Console\Commands;

use App\Models\Server;
use phpseclib3\Net\SSH2;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Http;

class ActiveSetupCount extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'cipi:activesetupcount';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Active Setup Count';

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}

/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
sleep(rand(0,9));

// Useful to daily count how many Cipi Control Panel installations are active
// around the world and show the total value into cipi.sh official website
file_get_contents(config('cipi.activesetupcount'));

return 0;
}
}
2 changes: 2 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ protected function schedule(Schedule $schedule)
$schedule->command('servers:setupcheck')->everyMinute();

$schedule->command('cipi:update')->dailyAt('04:05');

$schedule->command('cipi:activesetupcount')->dailyAt('22:01');
}

/**
Expand Down
25 changes: 13 additions & 12 deletions config/cipi.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@
return [

//Panel Credential
'username' => env('CIPI_USERNAME', 'administrator'),
'password' => env('CIPI_PASSWORD', '12345678'),
'username' => env('CIPI_USERNAME', 'administrator'),
'password' => env('CIPI_PASSWORD', '12345678'),

//JWT Settings
'jwt_secret' => env('JWT_SECRET', config('app.key')),
'jwt_access' => env('JWT_ACCESS', 900),
'jwt_refresh' => env('JWT_REFRESH', 7200),
'jwt_secret' => env('JWT_SECRET', config('app.key')),
'jwt_access' => env('JWT_ACCESS', 900),
'jwt_refresh' => env('JWT_REFRESH', 7200),

//Branding
'name' => env('CIPI_NAME', 'Cipi Control Panel'),
'website' => env('CIPI_WEBSITE', 'https://cipi.sh'),
'docs' => env('CIPI_DOCS', 'https://cipi.sh/docs.html'),
'background' => env('CIPI_BACKGROUNG', 'clouds'),
'name' => env('CIPI_NAME', 'Cipi Control Panel'),
'website' => env('CIPI_WEBSITE', 'https://cipi.sh'),
'docs' => env('CIPI_DOCS', 'https://cipi.sh/docs.html'),
'background' => env('CIPI_BACKGROUNG', 'clouds'),
'activesetupcount' => env('CIPI_ACTIVESETUPCOUNT', 'https://service.cipi.sh/setupcount'),

//Global Settings
'phpvers' => ['8.0','7.4','7.3'],
'services' => ['nginx','php','mysql','redis','supervisor'],
'default_php' => '8.0',
'phpvers' => ['8.0','7.4','7.3'],
'services' => ['nginx','php','mysql','redis','supervisor'],
'default_php' => '8.0',

];

0 comments on commit f8025b7

Please sign in to comment.