Skip to content
Snippets Groups Projects
Commit c921a961 authored by Chen Tao's avatar Chen Tao
Browse files

add secrets for USERNAME and PASSWORD

parent 7fd93552
No related branches found
No related tags found
No related merge requests found
data data
\ No newline at end of file sec
\ No newline at end of file
...@@ -11,9 +11,18 @@ services: ...@@ -11,9 +11,18 @@ services:
environment: environment:
EXEC_INTERVAL_MINUTE: 10 EXEC_INTERVAL_MINUTE: 10
RUN_ON_STARTUP: true RUN_ON_STARTUP: true
RESTIC_USER: $USER RESTIC_USER_FILE: /run/secrets/USERNAME
RESTIC_PASSWORD: '%24---%40' RESTIC_PASSWORD_FILE: /run/secrets/PASSWORD
# %24 means $, %40 means @
# DEBUG: true # DEBUG: true
RESTIC_HOST: restic-lab.phys.ethz.ch RESTIC_HOST: restic-lab.phys.ethz.ch
secrets:
- USERNAME
- PASSWORD
secrets:
USERNAME:
file: ./secrets/USERNAME
PASSWORD:
file: ./secrets/PASSWORD
\ No newline at end of file
...@@ -2,13 +2,15 @@ ...@@ -2,13 +2,15 @@
RESTIC_DIR="${HOME}/.backupbox-phys" RESTIC_DIR="${HOME}/.backupbox-phys"
if [ -z "$RESTIC_USER" ]; then if [ -z $RESTIC_HOST ]; then
echo "Please provide your restic user from the backupbox web interface: " echo "Please provide your restic host from the backupbox web interface: "
exit 1 exit 1
fi fi
if [ -z $RESTIC_HOST ]; then if [ -f "$RESTIC_USER_FILE" ]; then
echo "Please provide your restic host from the backupbox web interface: " RESTIC_USER=$(cat $RESTIC_USER_FILE)
elif [ -z "$RESTIC_USER" ]; then
echo "Please provide your restic user from the backupbox web interface: "
exit 1 exit 1
fi fi
......
*
!.gitignore
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment