Cloudflare worker to make troopmaster play nice
Find a file
2025-11-25 10:16:12 -08:00
src bring wrangler config up to date, include in repo 2025-11-25 10:01:40 -08:00
.cargo-ok initial commit 2020-04-23 16:18:28 -07:00
.eslintrc.js initial commit 2020-04-23 16:18:28 -07:00
.gitignore bring wrangler config up to date, include in repo 2025-11-25 10:01:40 -08:00
.mise.toml wrangler seems incompatible with bun 2025-11-25 10:16:12 -08:00
.prettierrc initial commit 2020-04-23 16:18:28 -07:00
LICENSE initial commit 2020-04-23 16:18:28 -07:00
package-lock.json Bump lodash from 4.17.15 to 4.17.19 2020-07-21 08:06:07 +00:00
package.json initial commit 2020-04-23 16:18:28 -07:00
README.md bring wrangler config up to date, include in repo 2025-11-25 10:01:40 -08:00
wrangler.toml bring wrangler config up to date, include in repo 2025-11-25 10:01:40 -08:00

Troopmaster Cloudflare worker

Allows for a site to use Troopmaster without having to redirect to the site and lose Google-foo.

The worker does a few things:

  • Does a server-side rather than client-side-after-the-fact https redirection
  • On a home page load, will insert a tracking image so that troopmaster cookies can be established for login
  • On a home page load, will insert the home page content and remove the Javascript on the page that tries to get it after the fact

If login gets "broken", its because the origin HTML has changed and the regexs need adjustment. There are http headers that tell you if this is happening.

Broken here would mean that clicking login forces you through the multiple drop downs to select site.

This section should be in your wrangler.toml file. Replace with the correct values of course. An example wrangler.toml file (for troop618.org) is included.

[vars]
TMSITEID = "203232"
TMSITENAME = "Troop618"