Skip to content

Allow to toggle update checker#375

Closed
Ayowel wants to merge 2 commits intoleenooks:masterfrom
Ayowel:feat/disable-update-check
Closed

Allow to toggle update checker#375
Ayowel wants to merge 2 commits intoleenooks:masterfrom
Ayowel:feat/disable-update-check

Conversation

@Ayowel
Copy link
Copy Markdown

@Ayowel Ayowel commented Aug 18, 2025

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).

* Allow to disable update checks
* Allow to configure a different remote for update checks
@Ayowel Ayowel force-pushed the feat/disable-update-check branch from e2a3ea2 to d8c4dac Compare August 18, 2025 19:35
Copy link
Copy Markdown

@williamdes williamdes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'),
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

@Ayowel Ayowel Aug 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

public function terminate(): void
{
Cache::remember('upstream_version',self::UPDATE_TIME,function() {
if (!(boolean)config('pla.update_check')) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesnt need to be cast boolean if the value set is boolean.

leenooks added a commit that referenced this pull request Aug 19, 2025
…ell as enable disabling calls to update server. Implements the requirement of #375
@leenooks
Copy link
Copy Markdown
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants