Config encryption
How CrossWatch encrypts secret values in config.json, where the master key comes from, and what to back up.
CrossWatch can encrypt secret values before writing them to config.json.
This protects secrets at rest, but it does not protect a compromised host.
What gets encrypted
Secret fields are encrypted when CrossWatch saves config.json.
Common examples:
api_keyaccess_tokenrefresh_tokenclient_secretaccount_tokenpms_tokenpasswordkeys ending in
_token
Typical affected providers:
Plex
Trakt
SIMKL
AniList
MDBList
TMDb (Sync)
Tautulli
What stays plain text
Non-secret settings stay readable.
Examples:
server URLs
booleans
timeouts
page sizes
feature toggles
That keeps config.json usable for troubleshooting.
Stored format
Encrypted values are written with an enc:v1: prefix.
Example:
If a value does not use that prefix, CrossWatch treats it as plain text.
This lets older plain-text configs continue to load.
Master key source order
CrossWatch checks for the master key in this order:
CW_CONFIG_KEYCROSSWATCH_CONFIG_KEY/config/.cw_master_key
If an environment variable is set, it wins.
If not, CrossWatch falls back to /config/.cw_master_key.
Save and migration behavior
Existing plain-text secrets are not rewritten immediately.
They are encrypted the next time CrossWatch saves config.json through the normal save path.
That means:
old installs still load
encrypted and plain-text values can coexist during transition
a normal save migrates secret fields to encrypted form
If you still see plain-text secrets after enabling encryption, save the config once.
UI behavior
The browser does not decrypt secrets.
The backend handles decrypt and encrypt operations.
In normal config views:
the backend reads and decrypts secrets
the UI receives a redacted version
secret fields appear masked or empty
That means the browser does not need the master key.
Backup and restore
To restore an encrypted config, you need both:
config.jsonthe matching master key
If you restore config.json without the key, CrossWatch cannot decrypt stored secrets.
Recommended practice:
back up config and key together
store the key securely
avoid casual exports that include secrets or key material
Moving to another machine
When migrating CrossWatch:
Move
config.json.Move the matching master key, or set the same environment variable.
Start CrossWatch.
Verify provider authentication still works.
If you move only config.json, encrypted secrets will not load.
Key rotation
If you change the master key, existing secrets must be re-encrypted.
Safe flow:
Start with the old key.
Decrypt existing values.
Switch to the new key.
Save config again.
Do not replace the key and expect old encrypted values to keep working.
Troubleshooting
config.json still shows plain-text secrets
Check these first:
Has the config been saved since encryption was enabled?
Is another code path writing raw JSON?
Authentication broke after a restore or move
Check these first:
Is the correct master key present?
Did the environment variable change?
Is
/config/.cw_master_keymissing or different?
UI shows masked values
That usually means a secret is already stored.
It does not mean the real value is literally the mask.
Related pages
Last updated
Was this helpful?