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
\ No newline at end of file
data
sec
\ No newline at end of file
......@@ -11,9 +11,18 @@ services:
environment:
EXEC_INTERVAL_MINUTE: 10
RUN_ON_STARTUP: true
RESTIC_USER: $USER
RESTIC_PASSWORD: '%24---%40'
# %24 means $, %40 means @
RESTIC_USER_FILE: /run/secrets/USERNAME
RESTIC_PASSWORD_FILE: /run/secrets/PASSWORD
# DEBUG: true
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 @@
RESTIC_DIR="${HOME}/.backupbox-phys"
if [ -z "$RESTIC_USER" ]; then
echo "Please provide your restic user from the backupbox web interface: "
if [ -z $RESTIC_HOST ]; then
echo "Please provide your restic host from the backupbox web interface: "
exit 1
fi
if [ -z $RESTIC_HOST ]; then
echo "Please provide your restic host from the backupbox web interface: "
if [ -f "$RESTIC_USER_FILE" ]; then
RESTIC_USER=$(cat $RESTIC_USER_FILE)
elif [ -z "$RESTIC_USER" ]; then
echo "Please provide your restic user from the backupbox web interface: "
exit 1
fi
......
*
!.gitignore
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment