GradePush
FR GitHub Try the demo

Updates & backups

Back up PostgreSQL and GradePush’s keys together. A database backup alone is not enough to restore encrypted GitHub credentials.

Update GradePush

Version 0.2.0 uses a consolidated initial schema. For a 0.1.x test installation, back up the data and keys, then create a fresh installation. The procedure below applies to updates starting from 0.2.0.

install.sh is for a new installation. It refuses to overwrite an existing directory, so do not run it again for an update. Keep using your installation directory, Compose project, .env and data volumes. You do not repeat institution or GitHub setup.

  1. Open the latest release to find the version, published images and any migration or Compose configuration instructions.

  2. Make and verify a fresh backup.

  3. Edit the existing .env to select both images for the release. For example, for 0.2.0:

    GRADEPUSH_IMAGE=ghcr.io/gradepush/gradepush:0.2.0
    GRADEPUSH_PROXY_IMAGE=ghcr.io/gradepush/gradepush-caddy:0.2.0
    

    Replace 0.2.0 with the version you chose. You can use the full image references with @sha256:… supplied in the release notes instead. Pulling alone does not change the selected version.

  4. From the same installation directory, download the images and restart:

    docker compose pull
    docker compose up -d --wait
    docker compose logs --tail=100 app
    
  5. Open your domain, sign in and check a classroom. Startup applies database migrations automatically and stops if a migration fails.

If you prefer to edit compose.yaml, change the image versions for both app and caddy there instead. Update or remove any GRADEPUSH_IMAGE and GRADEPUSH_PROXY_IMAGE values in .env, since they override the defaults in the bundled Compose file.

If the release requires a new Compose configuration, save your current file and review the release's compose.self-host.yaml before applying it. Preserve the project name, database environment and volume names. Older Compose files may need this change before they support GRADEPUSH_PROXY_IMAGE.

Do not delete volumes or regenerate secrets during an update. An older application image may not support the migrated schema; a rollback can require restoring the pre-update database and matching keys.

Make a backup

Run these commands from your installation directory. Check that every command succeeds and that the dump is not empty before relying on the backup.

umask 077
mkdir -p backups
docker compose up -d db
docker compose exec -T db sh -c 'PGPASSWORD="$POSTGRES_PASSWORD" pg_dump --format=custom --no-owner --username="$POSTGRES_USER" "$POSTGRES_DB"' > backups/gradepush.dump
docker compose exec -T app cat /var/lib/gradepush/secret_key_base > backups/secret_key_base
docker compose exec -T app cat /var/lib/gradepush/credential_encryption_key > backups/credential_encryption_key

Store the backup files encrypted with access limited to authorized operators. Keep a copy outside the server. Preserve .env, compose.yaml and the caddy_data and caddy_config volumes as part of your recovery plan.

If SECRET_KEY_BASE or CREDENTIAL_ENCRYPTION_KEY is supplied through an external secret manager, back up that exact value there instead of relying on the generated volume file. A new credential key cannot decrypt an existing database.

Restore to a separate instance first

The following restore replaces existing objects and data in the configured database. Test it on a separate instance. Use the intended Compose project and its environment, and stop if any command fails.

Place the backup files in backups/ in the recovery installation directory. Use a compatible GradePush image and PostgreSQL version, and restore any externally supplied keys through their secret manager before starting the application.

docker compose up -d db
docker compose stop app
cat backups/gradepush.dump | docker compose exec -T db sh -c 'PGPASSWORD="$POSTGRES_PASSWORD" pg_restore --clean --if-exists --exit-on-error --single-transaction --no-owner --username="$POSTGRES_USER" --dbname="$POSTGRES_DB"'
cat backups/secret_key_base | docker compose run --rm --no-deps --entrypoint sh app -c 'umask 077; cat > /var/lib/gradepush/secret_key_base.tmp && mv /var/lib/gradepush/secret_key_base.tmp /var/lib/gradepush/secret_key_base'
cat backups/credential_encryption_key | docker compose run --rm --no-deps --entrypoint sh app -c 'umask 077; cat > /var/lib/gradepush/credential_encryption_key.tmp && mv /var/lib/gradepush/credential_encryption_key.tmp /var/lib/gradepush/credential_encryption_key'
docker compose up -d app

After restoring, check that you can sign in, open a classroom and access its GitHub repositories.

Search the docs

Search a topic, a feature or a command.