Add new plugins registry (fix #31)
This commit is contained in:
parent
a5d0b3f137
commit
58437a1b97
|
|
@ -18,13 +18,6 @@ class MarketController extends Controller
|
||||||
*/
|
*/
|
||||||
protected $guzzle;
|
protected $guzzle;
|
||||||
|
|
||||||
/**
|
|
||||||
* Default request options for Guzzle HTTP client.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $guzzleConfig;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cache for plugins registry.
|
* Cache for plugins registry.
|
||||||
*
|
*
|
||||||
|
|
@ -35,10 +28,6 @@ class MarketController extends Controller
|
||||||
public function __construct(\GuzzleHttp\Client $guzzle)
|
public function __construct(\GuzzleHttp\Client $guzzle)
|
||||||
{
|
{
|
||||||
$this->guzzle = $guzzle;
|
$this->guzzle = $guzzle;
|
||||||
$this->guzzleConfig = [
|
|
||||||
'headers' => ['User-Agent' => config('secure.user_agent')],
|
|
||||||
'verify' => config('secure.certificates'),
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function marketData()
|
public function marketData()
|
||||||
|
|
@ -101,9 +90,7 @@ class MarketController extends Controller
|
||||||
|
|
||||||
// Download
|
// Download
|
||||||
try {
|
try {
|
||||||
$this->guzzle->request('GET', $url, array_merge($this->guzzleConfig, [
|
$this->guzzle->request('GET', $url, ['sink' => $tmp_path]);
|
||||||
'sink' => $tmp_path,
|
|
||||||
]));
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
report($e);
|
report($e);
|
||||||
|
|
||||||
|
|
@ -145,7 +132,7 @@ class MarketController extends Controller
|
||||||
if (app()->environment('testing') || ! $this->registryCache) {
|
if (app()->environment('testing') || ! $this->registryCache) {
|
||||||
try {
|
try {
|
||||||
$pluginsJson = $this->guzzle->request(
|
$pluginsJson = $this->guzzle->request(
|
||||||
'GET', config('plugins.registry'), $this->guzzleConfig
|
'GET', config('plugins.registry')
|
||||||
)->getBody();
|
)->getBody();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new Exception(trans('admin.plugins.market.connection-error', [
|
throw new Exception(trans('admin.plugins.market.connection-error', [
|
||||||
|
|
|
||||||
|
|
@ -31,5 +31,9 @@ return [
|
||||||
| Specify where to get plugins' metadata for plugin market.
|
| Specify where to get plugins' metadata for plugin market.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'registry' => env('PLUGINS_REGISTRY', 'https://work.prinzeugen.net/blessing-skin-server/plugins.json'),
|
'registry' => env(
|
||||||
|
'PLUGINS_REGISTRY',
|
||||||
|
'https://dev.azure.com/blessing-skin/0dc12c60-882a-46a2-90c6-9450490193a2/_apis/'.
|
||||||
|
'git/repositories/d5283b63-dfb0-497e-ad17-2860a547596f/Items?path=%2Fregistry.json'
|
||||||
|
),
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -11,18 +11,4 @@ return [
|
||||||
*/
|
*/
|
||||||
'cipher' => env('PWD_METHOD', 'SALTED2MD5'),
|
'cipher' => env('PWD_METHOD', 'SALTED2MD5'),
|
||||||
'salt' => env('SALT', ''),
|
'salt' => env('SALT', ''),
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| SSL Certificates
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| Describes the SSL certificate verification behavior of all Guzzle requests.
|
|
||||||
| By default, we use the CA bundle provided by Mozilla.
|
|
||||||
|
|
|
||||||
| See: http://docs.guzzlephp.org/en/stable/request-options.html#verify
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
'certificates' => env('SSL_CERT', storage_path('patches/ca-bundle.crt')),
|
|
||||||
'user_agent' => env('USER_AGENT', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36'),
|
|
||||||
];
|
];
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user