3.2 KiB
3.2 KiB
Setup
Install
Setup assumes that I don't have access to the host except through Portainer.
This demonstrates that access to docker is the only real requirement to host git.limbosolutions.com
Requirements
- Docker Currently hosted on an ubuntu lxc container with docker and portainer + information.
- On instructions replace githost with host ip or address
Services (Stacks)
If portainer installed use portainer (https://githost:9443) to setup/manage services
Required environment variables (.env):
GITEA_APP_DATA-VOLUME_NAME=gitea_app_data
GITEA_DB_DATA_VOLUME_NAME=gitea_db_data
GITEA_DB-DUMPS_VOLUME_NAME=gitea_db-dumps
DEFAULT_NETWORK_NAME=gitea_default
# gitea mysql dbname
DB_NAME=??
# gitea mysql user
DB_USER=??
# gitea mysql password
DB_PASSWORD=??
# gitea mysql root password
DB_ROOT_PASSWORD=??
#git tea access port
GITEA_PORT=80
#duplicati access port
DUPLICATI_PORT=8200
Gitea
Duplicati
Requirements:
After starting stack:
- Access duplicati (http://ipaddress:8200) and set a password
Restore
Requirements
- Host setup with docker and portainer + information
Process
- Recreate stack gitea Docker Compose removing read only restrictions on duplicati volumes
- Check every Container is ok and running
- Stop every Container except duplicati and portainer note: restore of portainer/duplicati not tested
- Enter Duplicati (http://hostip:8200)
- Import Backup job (if not possible next steps must be adapted)
- Restore with permissions checked
- All Imported jobs schedules must be disabled (or disable write permissions on backup host)
- Recreate duplicati local database (home-> backup-> advanced-> database-> Recreate (delete and repair))
- Restore all files (except portainer and duplicati data) to original location
- If database engine is diferent do not restore db_data and check restore database before next stepswith this processs because duplicati is running!
- Recreate stack gitea Docker Compose with original read only restrictions on duplicati volumes
- Confirm everything is ok and running
- Return to duplicati on schedule job add script to run-script-before-required /data/myScripts/backupdb.sh
- Execute a backup
- Reenable Scheduling
Database
Only required if database data files not recovarable. (Example: diferent database engine from backup)
- Start Portainer container (if stopped in restore process)
- Start Database container (if stopped in restore process)
- Enter Database container bash (by using portainer)
- Execute:
#select a file to import
ls /db-dumps
#select a file to import
DB_FILE= "file name to import"
#
mysql --host db -uroot -p ${MYSQL_DATABASE} < /db-dumps/$DB_FILE
#enter root password (root password is in enviromnent variable ${MYSQL_ROOT_PASSWORD})
network related
If ip changed. change dns servers (git.lan) and reverse proxy (git.limbosoluttions.com) to new ip.