Conversation
* Allow to disable update checks * Allow to configure a different remote for update checks
e2a3ea2 to
d8c4dac
Compare
williamdes
left a comment
There was a problem hiding this comment.
Thanks, I will need this too when packaging this major version into Debian.
Update check will make no sense there.
| /* | ||
| * Configure the server used by PLA when checking for new updates. | ||
| */ | ||
| 'update_check_server' => env('APP_UPDATE_CHECK_SERVER', 'https://version.phpldapadmin.org'), |
There was a problem hiding this comment.
It doesnt make sense for the update server to be user configurable - the code to the update server is not publically available and a user changing it would not yield a result that they expect.
There was a problem hiding this comment.
It's not to self-host the update server, it's to allow reverse-proxying/caching it in environments where the PLA server does not have generic web access and an actual http(s) proxy is not possible/acceptable but a different host (e.g. an artifactory/Nexus server) does have access and exposes external sites.
There was a problem hiding this comment.
To enable proxying, then the implementation is simpler, the call to the update server (which is using GuzzleHttp\Client) supports a proxy argument.
I dont like the idea of changing the URL, but implementing the ability to proxy through a caching server is valid, so I've implemented that in commit 37b4db8.
app/Http/Middleware/CheckUpdate.php
Outdated
| public function terminate(): void | ||
| { | ||
| Cache::remember('upstream_version',self::UPDATE_TIME,function() { | ||
| if (!(boolean)config('pla.update_check')) { |
There was a problem hiding this comment.
This doesnt need to be cast boolean if the value set is boolean.
…ell as enable disabling calls to update server. Implements the requirement of #375
|
I've implemented the functionalty that this pull request was addressing - both disabling the query to the update server and supporting a proxy ability, to proxy updates to the server via a proxy. |
Having the ability to disable the update checker removes some noise (the error logs) in isolated environments and avoids "suspicious" outgoing traffic when performing network analysis on others.
Having the ability to configure a different server may be useful in isolated configurations with a reverse proxy to specific web resources (which would be the actual version site in this case).