Skip to content

Update, back up and restore

All your data is in the Docker volume cyproxy-data. See Data files.

Update

git pull
docker compose pull
docker compose up -d

If you build the image from source, run git pull, then docker compose up -d --build.

To stay on one release, set CYPROXY_VERSION in .env. For example: 0.1.0. The console shows the version at the bottom of the sidebar.

After an update from a version without tool review

  • The tools of the integrations are approved as they are.
  • Write tools need approval, unless you turn this off.

After an update from a version without encryption

The first start encrypts the stored keys, sign-in tokens and authenticator secrets. Cyproxy does this one time. After that, it refuses a plain secret.

  • If you do not set CYPROXY_ENCRYPTION_KEY, you do nothing.
  • If you set CYPROXY_ENCRYPTION_KEY (or CYPROXY_ENCRYPTION_KEY_FILE) at the same update, also set CYPROXY_CONVERT_PLAIN=1 in .env for the first start. Remove it after that start.

See When Cyproxy accepts a plain secret.

Back up

This command writes cyproxy-backup.tgz to the current folder:

docker run --rm -v cyproxy-data:/data:ro -v "$PWD":/backup alpine tar czf /backup/cyproxy-backup.tgz -C /data .

The stored keys in the backup are encrypted. See What is encrypted.

  • If you did not set CYPROXY_ENCRYPTION_KEY, the backup also contains the encryption key, in the file master-key. A person who has the backup can read your keys. Keep the backup in a safe location.
  • If you set CYPROXY_ENCRYPTION_KEY, the backup does not contain the key. Keep a copy of the key in a different safe location, for example a password manager. Without the key, nobody can read the stored keys in the backup.

Restore

This replaces the data in the volume:

docker compose down
docker run --rm -v cyproxy-data:/data -v "$PWD":/backup alpine sh -c 'rm -rf /data/* && tar xzf /backup/cyproxy-backup.tgz -C /data'
docker compose up -d

Use the same encryption key as when you made the backup. If Cyproxy made the key, the key is in the backup and you do nothing.

Restore the complete volume, as the command above does. Do not copy single files from a backup that you made before the update to a version with encryption. Cyproxy refuses a plain secret file when the installation has an encryption key or encrypted secrets. If you must restore a plain file, start Cyproxy one time with CYPROXY_CONVERT_PLAIN=1. See When Cyproxy accepts a plain secret.

Restore without the encryption key

If the key is lost, nobody can get the encrypted items back. Cyproxy does not start, and the log names the file that it cannot read. It does not change the file. To use the other data again, move each file that the log names out of the volume, then start Cyproxy again:

File What you lose What you do then
secrets.json All integration keys, vendor sign-ins and the model key of the Agent. Enter the keys again and sign in to the vendors again.
users.json The owner account: the password and the authenticator app. Cyproxy names this file only if the authenticator app is set up. Create the owner account again on the setup page.
store.json Collections, access tokens, connected apps and usage. Cyproxy names this file only if it contains data of a vendor sign-in. Make new access tokens and connect the AI clients again.

Change the encryption key

Use this procedure to change the key, or to move from the key that Cyproxy made to your own key. Make a backup first.

  1. Stop Cyproxy:
docker compose stop
  1. Make a new key:
openssl rand -base64 32
  1. In .env, set the new key and the old key.

If you supplied the old key:

CYPROXY_ENCRYPTION_KEY=the-new-key
CYPROXY_ENCRYPTION_KEY_OLD=the-old-key

If Cyproxy made the old key:

CYPROXY_ENCRYPTION_KEY=the-new-key
CYPROXY_ENCRYPTION_KEY_OLD_FILE=/data/master-key
  1. Encrypt the data again:
docker compose run --rm cyproxy .venv/bin/python -m cyproxy --rekey

The command changes all files or no file. If it shows an error, nothing changed. It deletes master-key from the volume when your own key replaces it.

  1. Remove the old key from .env. Start Cyproxy:
docker compose up -d

Backups from before the change need the old key.

Reset the owner password

If you forgot the owner password, make a new temporary password:

docker exec cyproxy .venv/bin/python -m cyproxy --reset-password

The command shows a new temporary password and signs you out on all devices. The temporary password is also in the file admin-password in the data volume. Sign in with your email address and the temporary password, then set a new password. Your authenticator app stays on.

If you set CYPROXY_ADMIN_PASSWORD, the command does not work. Change the value in .env and run docker compose up -d.

Reset the authenticator app

If you lost your phone and your recovery codes, reset the app:

docker exec cyproxy .venv/bin/python -m cyproxy --reset-mfa

Sign in with your password. If Require an authenticator app is on, set up the app again before you use the console. See Authenticator app.

Delete everything

This deletes all your data:

docker compose down -v