diff --git a/app/Console/Commands/V2rayInit.php b/app/Console/Commands/V2rayInit.php new file mode 100644 index 000000000..acc1edef1 --- /dev/null +++ b/app/Console/Commands/V2rayInit.php @@ -0,0 +1,29 @@ +setName('v2ray:init'); + $this->setDescription('Init v2ray Users'); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $users = User::all(); + foreach ($users as $user){ + if(strlen($user->v2ray_uuid) == 0){ + $user->v2ray_uuid = Tools::genUUID(); + $user->save(); + } + } + } +} \ No newline at end of file diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 1d990b701..c06c7e9b1 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -14,6 +14,7 @@ class Kernel Commands\Migration::class, Commands\GenLang::class, Commands\CreateAdmin::class, + Commands\V2rayInit::class, ]; public function __construct() diff --git a/app/Services/Factories/Pay.php b/app/Services/Factories/Pay.php index 0eeea3e28..55ad71d98 100644 --- a/app/Services/Factories/Pay.php +++ b/app/Services/Factories/Pay.php @@ -16,6 +16,7 @@ public static function newPaypalClient() $apiContext = new ApiContext( new OAuthTokenCredential(config('paypal.client_id'), config('paypal.secret')) ); + $apiContext->setConfig(config('paypal')); return $apiContext; } } \ No newline at end of file diff --git a/composer.json b/composer.json index 39ad2a8c8..c485a0c68 100755 --- a/composer.json +++ b/composer.json @@ -7,10 +7,10 @@ "tracy/tracy": "^2.4", "shadowsocks/shadowsocks": "0.1.*", "zircote/swagger-php": "^2.0", - "illuminate/pagination": "^5.4", + "illuminate/pagination": "^5.5", "martinlindhe/laravel-vue-i18n-generator": "^0.1.13", - "illuminate/events": "^5.4", - "pongtan/fake-laravel": "^0.0.1", + "illuminate/events": "^5.5", + "pongtan/fake-laravel": "^5.5", "paypal/rest-api-sdk-php": "^1.12", "latrell/alipay": "^1.2" }, diff --git a/composer.lock b/composer.lock index d6d146679..a8088bf6d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "789ed21aa70d0da454a85dd3657dc030", + "content-hash": "baf6d96a91614a40ea2d29ef910f235e", "packages": [ { "name": "aws/aws-sdk-php", @@ -1903,20 +1903,20 @@ }, { "name": "pongtan/fake-laravel", - "version": "v0.0.1", + "version": "5.5.1", "source": { "type": "git", "url": "https://github.com/Pongtan/fake-laravel.git", - "reference": "3064120acf840ff20d8ced97b42d3c0dea338823" + "reference": "071d6b47bb26bce468a9acc57d1922a8e5bab1aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Pongtan/fake-laravel/zipball/3064120acf840ff20d8ced97b42d3c0dea338823", - "reference": "3064120acf840ff20d8ced97b42d3c0dea338823", + "url": "https://api.github.com/repos/Pongtan/fake-laravel/zipball/071d6b47bb26bce468a9acc57d1922a8e5bab1aa", + "reference": "071d6b47bb26bce468a9acc57d1922a8e5bab1aa", "shasum": "" }, "require": { - "illuminate/contracts": "^5.4" + "illuminate/contracts": "^5.5" }, "require-dev": { "phpunit/phpunit": "~5.0" @@ -1944,7 +1944,7 @@ "app", "laravel" ], - "time": "2017-07-06T12:40:25+00:00" + "time": "2017-11-19T13:20:53+00:00" }, { "name": "pongtan/framework", @@ -2096,21 +2096,22 @@ }, { "name": "pongtan/utils", - "version": "v0.1.2", + "version": "v0.1.3", "source": { "type": "git", "url": "https://github.com/Pongtan/utils.git", - "reference": "3f86eba48a2ce6c3cd4343b0c95581fdc1540f45" + "reference": "3c8283fe80e433b1e707858755967dde517986c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Pongtan/utils/zipball/3f86eba48a2ce6c3cd4343b0c95581fdc1540f45", - "reference": "3f86eba48a2ce6c3cd4343b0c95581fdc1540f45", + "url": "https://api.github.com/repos/Pongtan/utils/zipball/3c8283fe80e433b1e707858755967dde517986c2", + "reference": "3c8283fe80e433b1e707858755967dde517986c2", "shasum": "" }, "require": { "monolog/monolog": "^1.19", - "psr/log": "^1.0" + "psr/log": "^1.0", + "ramsey/uuid": "^3.7" }, "require-dev": { "phpunit/phpunit": "~6.0" @@ -2140,7 +2141,7 @@ "Pongtan", "utils" ], - "time": "2017-07-09T07:34:38+00:00" + "time": "2017-11-19T13:34:39+00:00" }, { "name": "predis/predis", @@ -3778,23 +3779,23 @@ }, { "name": "phploc/phploc", - "version": "4.0.0", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phploc.git", - "reference": "7335bb2173c687759631fe4901db6897245f6e2b" + "reference": "6a8a9416517b82d6326ac9c2d040ad53c13654eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phploc/zipball/7335bb2173c687759631fe4901db6897245f6e2b", - "reference": "7335bb2173c687759631fe4901db6897245f6e2b", + "url": "https://api.github.com/repos/sebastianbergmann/phploc/zipball/6a8a9416517b82d6326ac9c2d040ad53c13654eb", + "reference": "6a8a9416517b82d6326ac9c2d040ad53c13654eb", "shasum": "" }, "require": { "php": "^5.6 || ^7.0", "sebastian/finder-facade": "^1.1", "sebastian/version": "^2.0", - "symfony/console": "^2.7|^3.0" + "symfony/console": "^2.7|^3.0|^4.0" }, "bin": [ "phploc" @@ -3823,7 +3824,7 @@ ], "description": "A tool for quickly measuring the size of a PHP project.", "homepage": "https://github.com/sebastianbergmann/phploc", - "time": "2017-06-06T13:07:11+00:00" + "time": "2017-11-18T17:35:43+00:00" }, { "name": "phpmd/phpmd", @@ -4627,20 +4628,20 @@ }, { "name": "sebastian/finder-facade", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/finder-facade.git", - "reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9" + "reference": "4a3174709c2dc565fe5fb26fcf827f6a1fc7b09f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9", - "reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9", + "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/4a3174709c2dc565fe5fb26fcf827f6a1fc7b09f", + "reference": "4a3174709c2dc565fe5fb26fcf827f6a1fc7b09f", "shasum": "" }, "require": { - "symfony/finder": "~2.3|~3.0", + "symfony/finder": "~2.3|~3.0|~4.0", "theseer/fdomdocument": "~1.3" }, "type": "library", @@ -4662,7 +4663,7 @@ ], "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", "homepage": "https://github.com/sebastianbergmann/finder-facade", - "time": "2016-02-17T07:02:23+00:00" + "time": "2017-11-18T17:31:49+00:00" }, { "name": "sebastian/global-state", diff --git a/config/v2ray.php b/config/v2ray.php new file mode 100644 index 000000000..dc9be372e --- /dev/null +++ b/config/v2ray.php @@ -0,0 +1,6 @@ + 2, + 'level' => 2, +]; diff --git a/databases/2017_11_19_205437_update_user_table.php b/databases/2017_11_19_205437_update_user_table.php new file mode 100644 index 000000000..48258d67c --- /dev/null +++ b/databases/2017_11_19_205437_update_user_table.php @@ -0,0 +1,31 @@ +string('v2ray_uuid')->default(""); + $table->integer('v2ray_level')->default(2); + $table->integer('v2ray_alter_id')->default(2); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + } +}