This is the server portion of Backup-chan, an automatic backup system.
- Install MariaDB.
- Create the Backup-chan database by running the following in the MariaDB shell (replace values depending on your setup):
CREATE DATABASE dbname CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'yourusername'@'localhost' IDENTIFIED BY 'yourpassword'; -- Skip this if you already have a user. GRANT ALL PRIVILEGES ON dbname.* TO 'yourusername'@'localhost'; FLUSH PRIVILEGES;
- Now you can exit the shell by entering
\q
- Now you can exit the shell by entering
- Install program dependencies:
pip install -r requirements.txt - Copy
config.jsonc.exampletoconfig.jsonc. Modify as necessary. Unless stated otherwise, most options have default values. - Run
migrate.pyto create required database tables.
If you're running for development purposes, simply running main.py should be enough.
If you plan to use this installation in a production environment (with your real backups), you should use a WSGI server. See here on how to set one up. Remember to start only one worker, otherwise every job will start multiple times.
Backup-chan provides waitress_serve.py for launching a production server using waitress. Configure it using waitress_config.jsonc (see waitress_config.jsonc.example for an example configuration).
Once it's run, you can access the web UI through the browser or use a dedicated client.
When updating Backup-chan, the database schema might change. New migrations are added into the migrations folder. Run new
migrations like so:
./migrate.py 002_datetime_created_at.sql
./migrate.py 003_backup_recycled.sql
...- Enable it in your config
- Run
passwd.pyand enter the password you'd like to use - The password is now saved and can be used to log in.
See API.md for details on creating and managing an API key.