danielmarschall / oidplus

OIDplus 2.0 - An OpenSource online Registration Authority for OIDs and other Object Types
https://www.oidplus.com
Apache License 2.0
10 stars 6 forks source link

Feature request: an option to disable polyfill.min.js.php #5

Open tushev opened 1 year ago

tushev commented 1 year ago

On offline systems, or systems with limited connectivity, a request to polyfill.min.js.php leads to a very long response - because the file tries to contact polyfill.io domain and waits until timeout (bc firewall restricts the connectivity).

I would like to have an option either to disable this completely (=returning blank js), or stick to the version shipped with distro.

Currently I'm circumventing this by adding exit(); at the beginning of the file, this makes updates inconvenient as you have to resolve conflicts manually (I'm using git pull).

danielmarschall commented 1 year ago

Thank you for your suggestion and your continued support to OIDplus!

I am thinking about a "offline mode" base-configuration setting which could disable more than just the polyfill. After all, if a plugin needs Internet access, then I think an error message telling the user that OIDplus is in Offline-Mode is more friendly than weird Exceptions because an internal connection timeout happened.

These are all occurrences of url_get_contents (for GET requests) and CURLOPT_URL (for POST requests):

So these should be all Internet access possibilities.

What do you think?

tushev commented 1 year ago

@danielmarschall Yeah, I think this would be much better. After all, some people may prefer running an offline instance due to personal preferences or workplace requirements. Having an option to disable all communications (as in case with System Registration) would be great. Thanks!

danielmarschall commented 1 year ago

The latest version svn-1182 (gets released in approx 1 hour) introduces the following base configuration setting:

OIDplus::baseConfig()->setValue('OFFLINE_MODE', false);

It will disable the methods url_get_contents() and url_post_contents(), so that an Internet access is impossible, even if the plugin author missed to check for url_get_contents_available() and url_post_contents_available(), respectively.

Please notify me in case something doesn't work as expected, since this change affects a lot of things. Thanks!

tushev commented 1 year ago

@danielmarschall Thank you very much!!

Well, at the first glance everything's OK, and the pages load almost instantly on offline system.

The only thing missing is local version on Software update page (it says Local installation: unknown).

danielmarschall commented 2 hours ago

Polyfilling has been moved from the OIDplus Core into a new plugin ( #54 ). So, besides the offline-mode, polyfilling can also be disabled by disabling the plugin in the base configuration.