-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from linuxserver/master-rebase-plus-encryption
- Loading branch information
Showing
8 changed files
with
93 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,36 @@ | ||
#!/usr/bin/with-contenv bash | ||
# shellcheck shell=bash | ||
|
||
mkdir -p /run/duplicati-temp | ||
|
||
if [[ -f "/config/Duplicati-server.sqlite" ]]; then | ||
# Existing install | ||
if [[ -n ${SETTINGS_ENCRYPTION_KEY} ]]; then | ||
# Enable settings encryption | ||
true | ||
else | ||
# Disable settings encryption | ||
printf "true" > /run/s6/container_environment/DUPLICATI__DISABLE_DB_ENCRYPTION | ||
echo "*** Missing encryption key, unable to encrypt your settings database ***" | ||
echo "*** Please set a value for SETTINGS_ENCRYPTION_KEY and recreate the container ***" | ||
fi | ||
else | ||
# New install | ||
if [[ -z ${DUPLICATI__WEBSERVICE_PASSWORD} ]]; then | ||
printf "changeme" > /run/s6/container_environment/DUPLICATI__WEBSERVICE_PASSWORD | ||
fi | ||
if [[ -n ${SETTINGS_ENCRYPTION_KEY} ]]; then | ||
# Enable settings encryption | ||
true | ||
else | ||
# Halt init | ||
echo "*** Missing encryption key, unable to encrypt your settings database ***" | ||
echo "*** Please set a value for SETTINGS_ENCRYPTION_KEY and recreate the container ***" | ||
sleep infinity | ||
fi | ||
fi | ||
|
||
# permissions | ||
lsiown -R abc:abc \ | ||
/config | ||
/config \ | ||
/run/duplicati-temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters