sharpchi / moodle-filter_syntaxhighlighter

14 stars 10 forks source link

Avoid CDNs #2

Closed mserve closed 6 years ago

mserve commented 6 years ago

Hi Mark,

we are using the syntaxhighlighter Plugin in our in house Moodle Platform as we provide many courses on computer science and love syntax highlighting quite much ;) Unfortunately, due to high load on our WAN connection, loading the external CSS fails on rare occasions.

Although I understand the way you implemented the choice of a theme (i.e. avoiding to include all the CSS files into the plugin), it might be a reasonable solution to add a "use custom CSS URL" tick box which allows to set a custom base path other than the one of Cloudfare. This would also be interesting regarding privacy sensitive admins as Cloudflare might or might not use the data somehow (https://www.cloudflare.com/security-policy/) gathered by the CDNJS traffic.

Our local work arround was to manually change the base folder and put the CSS files to a local folder on our moodle web server (actually, just the plugin folder ;))

If I find some time, I'll try to add a setting box and do a PR, but this might take some weeks...

abias commented 6 years ago

Hi,

I wasn't aware that this plugin loads anything from a CDN before this post. For us, this approach is also quite discouraged because of data privacy regulations - the user's browser will access the CDN everytime the Moodle filter is delivered to him and within this access, he exposes his IP addresss (which is a personal data in some person's opinion) to the CDN.

However, I wouldn't be happy just to have a "custom CSS URL" to point to a local CSS file which I have to put manually onto the webserver. Is there any reason why you can't ship some CSS files within the plugin and give the admin the possibility to (optionally!) pick other CSS files from CDN?

Thanks, Alex

sharpchi commented 6 years ago

Thanks for the feedback chaps. Will look into it, though can't give a timescale right now.

mserve commented 6 years ago

Hi mark, I just forked to work on this, but you've been faster and there is a already new branch callled "cdn" using local styles. I'll switch to the branch on our dev machine next week and give some feedback. BR, Martin

sharpchi commented 6 years ago

I have, but I haven't thoroughly tested it yet. So feedback would be appreciated. Thanks. M

sharpchi commented 6 years ago

I've pushed this up to the Moodle repo