A CLI tool for securing script paths in your HTML output by proxying them through https://proxy.csidetm.com/
.
To run the latest version of this tool, use the following command:
npm_config_yes=true npx @cside.dev/cli@latest example.com
A little breakdown of what this command means:
-
npx
– Executes the CLI tool without requiring a global install. -
@cside.dev/cli@latest
– Ensures you're using the most up-to-date version. -
npm_config_yes=true
– Suppresses the installation confirmation prompt, making it CI-friendly. -
example.com
– Replace with your actual domain to correctly resolve relative paths.
This CLI processes all script paths in your HTML files and prefixes them with https://proxy.csidetm.com/
, ensuring they are proxied server-side.
Additionally, it injects a script that protects dynamically added scripts.
To see a list of available options, simply run:
npx @cside.dev/cli --help
which will return all the available options:
Usage: @cside.dev/cli <domain> [options]
Positionals:
domain The domain to process [string]
Options:
--version Show version number [boolean]
-d, --dir Directory which include html files to pro
cess. By default we'll try to look for a
`.next` and `dist` folder. [string]
-f Use a single file instead of a dir.
[string]
-s, --silent Disable outputting processed html files.
[boolean] [default: false]
--enable-first-party-proxy Enable first party proxy
[boolean] [default: false]
--enable-script-tracking Enable script tracking
[boolean] [default: true]
--enable-security-headers-check Enable security headers check
[boolean] [default: true]
--excluded-scripts Excluded scripts [array] [default: []]
-h, --help Show help [boolean]