Merge branch 'fix-chown'

This commit is contained in:
Jonas Nick 2019-07-26 13:58:23 +00:00
commit 415f0cbe0f
No known key found for this signature in database
GPG Key ID: 4861DBF262123605
2 changed files with 2 additions and 5 deletions

View File

@ -207,15 +207,13 @@ in {
preStart = '' preStart = ''
if ! test -e ${cfg.dataDir}; then if ! test -e ${cfg.dataDir}; then
mkdir -m 0770 -p '${cfg.dataDir}' mkdir -m 0770 -p '${cfg.dataDir}'
chown -R '${cfg.user}:${cfg.group}' '${cfg.dataDir}'
fi fi
if ! test -e ${cfg.dataDir}/blocks; then if ! test -e ${cfg.dataDir}/blocks; then
mkdir -m 0770 -p '${cfg.dataDir}/blocks' mkdir -m 0770 -p '${cfg.dataDir}/blocks'
chown -R '${cfg.user}:${cfg.group}' '${cfg.dataDir}/blocks'
fi fi
cp '${cfg.configFileOption}' '${cfg.dataDir}/bitcoin.conf' cp '${cfg.configFileOption}' '${cfg.dataDir}/bitcoin.conf'
chmod o-rw '${cfg.dataDir}/bitcoin.conf' chmod o-rw '${cfg.dataDir}/bitcoin.conf'
chown '${cfg.user}:${cfg.group}' '${cfg.dataDir}/bitcoin.conf' chown -R '${cfg.user}:${cfg.group}' '${cfg.dataDir}'
echo "rpcpassword=$(cat /secrets/bitcoin-rpcpassword)" >> '${cfg.dataDir}/bitcoin.conf' echo "rpcpassword=$(cat /secrets/bitcoin-rpcpassword)" >> '${cfg.dataDir}/bitcoin.conf'
chmod -R g+rX '${cfg.dataDir}/blocks' chmod -R g+rX '${cfg.dataDir}/blocks'
''; '';

View File

@ -180,11 +180,10 @@ in {
preStart = '' preStart = ''
if ! test -e ${cfg.dataDir}; then if ! test -e ${cfg.dataDir}; then
mkdir -m 0770 -p '${cfg.dataDir}' mkdir -m 0770 -p '${cfg.dataDir}'
chown '${cfg.user}:${cfg.group}' '${cfg.dataDir}'
fi fi
cp '${configFile}' '${cfg.dataDir}/liquid.conf' cp '${configFile}' '${cfg.dataDir}/liquid.conf'
chmod o-rw '${cfg.dataDir}/liquid.conf' chmod o-rw '${cfg.dataDir}/liquid.conf'
chown '${cfg.user}:${cfg.group}' '${cfg.dataDir}/liquid.conf' chown '${cfg.user}:${cfg.group}' '${cfg.dataDir}'
echo "rpcpassword=$(cat /secrets/liquid-rpcpassword)" >> '${cfg.dataDir}/liquid.conf' echo "rpcpassword=$(cat /secrets/liquid-rpcpassword)" >> '${cfg.dataDir}/liquid.conf'
echo "mainchainrpcpassword=$(cat /secrets/bitcoin-rpcpassword)" >> '${cfg.dataDir}/liquid.conf' echo "mainchainrpcpassword=$(cat /secrets/bitcoin-rpcpassword)" >> '${cfg.dataDir}/liquid.conf'
''; '';