Cloudflare worker to make troopmaster play nice
Go to file
2020-04-25 14:14:02 -07: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 initial commit 2020-04-23 16:18:28 -07:00
.prettierrc initial commit 2020-04-23 16:18:28 -07:00
index.js add semicolon 2020-04-25 14:14:02 -07:00
LICENSE initial commit 2020-04-23 16:18:28 -07:00
package-lock.json initial commit 2020-04-23 16:18:28 -07:00
package.json initial commit 2020-04-23 16:18:28 -07:00
README.md initial commit 2020-04-23 16:18:28 -07: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.

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