Foxtrick CDN - foxtrick-ng/foxtrick GitHub Wiki

Introduction

The 'Foxtrick CDN' is basically a fancy way of saying the Foxtrick extension dynamically downloads some json files over the internet rather than bundling them with the extension. This is typically done for files that change often, and allows users to have up to date versions of these files without updating their Foxtrick version.

For foxtrick-ng the CDN is hosted via GitHub Pages on the cdn branch of the foxtrick-ng/foxtrick repo: https://foxtrick-ng.github.io/foxtrick/

The CDN files are stored in the res/ directory, and include:

  • Url, metadata and icons for the Links modules
  • NT/U21 coach data
  • Hattrick Editors and CHPP holders
  • Foxtrick staff assignments (developer/translator/helper/supporter)
  • HYC, HO, HTLS staff assignments

Automation

There are GitHub Actions that maintain current data in the CDN:

Update NT/U21 coaches in CDN

  • runs weekly
  • Python script maintainer/locale/updateCoaches.py updates res/staff/nt.json and res/staff/u20.json via CHPP.

Update Foxtrick staff in CDN

  • runs weekly
  • Python script maintainer/locale/updateFTStaff.py updates res/staff/foxtrick.json via CHPP.
  • This script only checks for user name changes or account closure on Hattrick. Any addition/removal or role change of users is currently done manually. (In the past the script also polled minj's supporter list on foxtrick.org, but this function has been removed.)

Merge master branch into CDN

  • runs automatically when changes are commited to res/ in master branch
  • Typically this would be after a PR is merged. This way PRs that update cdn content (eg links updates) can be made against the master branch and, once merged, the changes are propogated to the cdn branch automatically.

Deploy CDN content to Pages

Testing PRs that update files in res/

As long as you test 'in place' via Chrome's 'Load Unpacked' or with Mozilla's web-ext tool then Foxtrick will use the local files rather than the CDN and you will see your changes.

Foxtrick on Android and the CDN

Currently Foxtrick on Android uses a res/ directory bundled with the extension rather than the CDN. As such, it is important to merge the cdn branch back into master before releasing a new version of Foxtrick.