Administration - duhdugg/preaction-cms GitHub Wiki

Administrative Scripts

copy the data/db.sqlite database to a timestamped and hashed file in the data/backups directory:
yarn backup-db

delete all sessions from the database:
yarn clear-sessions

generate a new randomly-generated password for the admin user:
yarn randomize-password

set password by prompt:
yarn set-password

the above will also accept whatever is piped into it, so this example is one way to generate and set a random password that is 8,192 alphanumeric characters in length:
dd if=/dev/urandom | strings -e s | sed 's/[^a-za-z0-9]//g' | tr -d '\n' | dd count=1 bs=8192 2> /dev/null | yarn set-password

create a gzipped tarball named preaction-cms.tar.gz containing data/db.sqlite, the build directory, the src/style directory, and any db-referenced files in the uploads directory:
yarn package