home
·
contact
·
privacy
projects
/
config
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Extend Pleroma-from-source scripting.
[config]
/
buster
/
setup_scripts
/
restore_app.sh
diff --git
a/buster/setup_scripts/restore_app.sh
b/buster/setup_scripts/restore_app.sh
index a71ed8d737182053a64e39c486a9a78da999bec1..363a5f6edb4c859d7e81532ee317322b3a1fc270 100755
(executable)
--- a/
buster/setup_scripts/restore_app.sh
+++ b/
buster/setup_scripts/restore_app.sh
@@
-6,8
+6,8
@@
if [ "$#" -lt 2 ]; then
echo 'Need two arguments: service name and DB name.'
false
fi
echo 'Need two arguments: service name and DB name.'
false
fi
-if [ ! "$1" = "pleroma" ] && [ ! "$1" = "peertube" ]; then
- echo "Need legal service name (pleroma or peertube)."
+if [ ! "$1" = "pleroma
_otp" ] && [ ! "$1" = "pleroma_sourc
" ] && [ ! "$1" = "peertube" ]; then
+ echo "Need legal service name (pleroma
_otp or pleroma_source
or peertube)."
false
fi
app="$1"
false
fi
app="$1"
@@
-24,6
+24,11
@@
rm "${app}_backup/${db_name}.pgdump"
cd "${app}_backup"
for path in $(find . -type f); do
cd "${app}_backup"
for path in $(find . -type f); do
+ if [ "${app}" = "pleroma_source" ]; then
+ if [ "${path}" = '/opt/pleroma/config/prod.secret.exs' ]; then
+ continue # skip file that contains passwords
+ fi
+ fi
target_path=$(echo "${path}" | cut -c2-)
source_path=$(realpath "${path}")
dir=$(dirname "${target_path}")
target_path=$(echo "${path}" | cut -c2-)
source_path=$(realpath "${path}")
dir=$(dirname "${target_path}")
@@
-32,10
+37,10
@@
for path in $(find . -type f); do
done
# TODO: Horrible hack, improve.
done
# TODO: Horrible hack, improve.
-if [ "${app}" = "pleroma" ]; then
+if [ "${app}" = "pleroma
_otp
" ]; then
db_pw=$(cat /etc/pleroma/config.exs | grep password | sed 's/[ ]*password\: *//g' | sed 's/,//g' | sed 's/"//g')
elif [ "${app}" = "peertube" ]; then
db_pw=$(cat /etc/pleroma/config.exs | grep password | sed 's/[ ]*password\: *//g' | sed 's/,//g' | sed 's/"//g')
elif [ "${app}" = "peertube" ]; then
- db_pw=$(cat /var/www/peertube/config/
db_password
.yaml | grep password | head -1 | sed "s/[ ]*password\: *//g" | sed "s/'//g")
+ db_pw=$(cat /var/www/peertube/config/
production
.yaml | grep password | head -1 | sed "s/[ ]*password\: *//g" | sed "s/'//g")
fi
su postgres -lc "psql -c \"ALTER USER ${app} WITH PASSWORD '${db_pw}';\""
fi
su postgres -lc "psql -c \"ALTER USER ${app} WITH PASSWORD '${db_pw}';\""