feat: enabled multi-domain setup
This commit is contained in:
@@ -22,7 +22,7 @@ function check_for_hash() {
|
||||
function create_and_upload() {
|
||||
local sum=$1
|
||||
local backup_file
|
||||
backup_file="$(date +%Y/%m/backup-%d-%H-%M-%S.tar.gz)"
|
||||
backup_file="$(date +%Y/%m/${DATABASE_URL}_backup-%d-%H-%M-%S.tar.gz)"
|
||||
echo "Uploading ${backup_file}"
|
||||
tar -zc . | aws s3 cp - "s3://${S3_BUCKET}/${backup_file}"
|
||||
aws s3api put-object --bucket "${S3_BUCKET}" --key "sums/${sum}"
|
||||
@@ -35,13 +35,13 @@ pushd "${tmpdir}"
|
||||
rm -rf "${dumpfile}"
|
||||
touch "${dumpfile}"
|
||||
chmod ugo+w "${dumpfile}"
|
||||
sudo -u postgres -- pg_dump --no-owner --no-privileges --clean --if-exists --quote-all-identifiers "${DATABASE_URL}" -f "${dumpfile}"
|
||||
sudo -u postgres -- pg_dump --no-owner --no-privileges --clean --if-exists --quote-all-identifiers "bitwarden_${DATABASE_URL}" -f "${dumpfile}"
|
||||
|
||||
"${scriptpath}/pgdump-sort" "${dumpfile}" "sorted.sql"
|
||||
|
||||
cp -r "${ROOT_DIR}/data" "./data"
|
||||
cp "${ROOT_DIR}/.env" "./.env"
|
||||
cp "${ROOT_DIR}/bitwarden.exceede.com.conf" "./bitwarden.exceede.com.conf"
|
||||
cp -r "${ROOT_DIR}/data/${DATABASE_URL}" "./data"
|
||||
cp "${ETC_DIR}/${DATABASE_URL}.conf" "./.env"
|
||||
cp "${ROOT_DIR}/${DATABASE_URL}.conf" "./${DATABASE_URL}.conf"
|
||||
|
||||
rm -rf ./data/icon_cache
|
||||
|
||||
|
||||
Reference in New Issue
Block a user