feat: rename to vaultwarden
This commit is contained in:
+3
-3
@@ -1,7 +1,7 @@
|
||||
FROM rclone/rclone:1.55.0
|
||||
FROM rclone/rclone:1.55.1
|
||||
|
||||
LABEL "repository"="https://github.com/ttionya/BitwardenRS-Backup" \
|
||||
"homepage"="https://github.com/ttionya/BitwardenRS-Backup" \
|
||||
LABEL "repository"="https://github.com/ttionya/vaultwarden-backup" \
|
||||
"homepage"="https://github.com/ttionya/vaultwarden-backup" \
|
||||
"maintainer"="ttionya <git@ttionya.com>"
|
||||
|
||||
COPY scripts/*.sh /app/
|
||||
|
||||
+15
-15
@@ -8,42 +8,42 @@ function clear_dir() {
|
||||
|
||||
function backup_init() {
|
||||
NOW="$(date +"${BACKUP_FILE_DATE_FORMAT}")"
|
||||
# backup bitwarden_rs database file
|
||||
# backup vaultwarden database file
|
||||
BACKUP_FILE_DB="${BACKUP_DIR}/db.${NOW}.sqlite3"
|
||||
# backup bitwarden_rs config file
|
||||
# backup vaultwarden config file
|
||||
BACKUP_FILE_CONFIG="${BACKUP_DIR}/config.${NOW}.json"
|
||||
# backup bitwarden_rs rsakey files
|
||||
# backup vaultwarden rsakey files
|
||||
BACKUP_FILE_RSAKEY="${BACKUP_DIR}/rsakey.${NOW}.tar"
|
||||
# backup bitwarden_rs attachments directory
|
||||
# backup vaultwarden attachments directory
|
||||
BACKUP_FILE_ATTACHMENTS="${BACKUP_DIR}/attachments.${NOW}.tar"
|
||||
# backup bitwarden_rs sends directory
|
||||
# backup vaultwarden sends directory
|
||||
BACKUP_FILE_SENDS="${BACKUP_DIR}/sends.${NOW}.tar"
|
||||
# backup zip file
|
||||
BACKUP_FILE_ZIP="${BACKUP_DIR}/backup.${NOW}.${ZIP_TYPE}"
|
||||
}
|
||||
|
||||
function backup_db() {
|
||||
color blue "backup bitwarden_rs sqlite database"
|
||||
color blue "backup vaultwarden sqlite database"
|
||||
|
||||
if [[ -f "${DATA_DB}" ]]; then
|
||||
sqlite3 "${DATA_DB}" ".backup '${BACKUP_FILE_DB}'"
|
||||
else
|
||||
color yellow "not found bitwarden_rs sqlite database, skipping"
|
||||
color yellow "not found vaultwarden sqlite database, skipping"
|
||||
fi
|
||||
}
|
||||
|
||||
function backup_config() {
|
||||
color blue "backup bitwarden_rs config"
|
||||
color blue "backup vaultwarden config"
|
||||
|
||||
if [[ -f "${DATA_CONFIG}" ]]; then
|
||||
cp -f "${DATA_CONFIG}" "${BACKUP_FILE_CONFIG}"
|
||||
else
|
||||
color yellow "not found bitwarden_rs config, skipping"
|
||||
color yellow "not found vaultwarden config, skipping"
|
||||
fi
|
||||
}
|
||||
|
||||
function backup_rsakey() {
|
||||
color blue "backup bitwarden_rs rsakey"
|
||||
color blue "backup vaultwarden rsakey"
|
||||
|
||||
local FIND_RSAKEY=$(find "${DATA_RSAKEY_DIRNAME}" -name "${DATA_RSAKEY_BASENAME}*" | xargs -I {} basename {})
|
||||
local FIND_RSAKEY_COUNT=$(echo "${FIND_RSAKEY}" | wc -l)
|
||||
@@ -55,12 +55,12 @@ function backup_rsakey() {
|
||||
|
||||
tar -tf "${BACKUP_FILE_RSAKEY}"
|
||||
else
|
||||
color yellow "not found bitwarden_rs rsakey, skipping"
|
||||
color yellow "not found vaultwarden rsakey, skipping"
|
||||
fi
|
||||
}
|
||||
|
||||
function backup_attachments() {
|
||||
color blue "backup bitwarden_rs attachments"
|
||||
color blue "backup vaultwarden attachments"
|
||||
|
||||
if [[ -d "${DATA_ATTACHMENTS}" ]]; then
|
||||
tar -c -C "${DATA_ATTACHMENTS_DIRNAME}" -f "${BACKUP_FILE_ATTACHMENTS}" "${DATA_ATTACHMENTS_BASENAME}"
|
||||
@@ -69,12 +69,12 @@ function backup_attachments() {
|
||||
|
||||
tar -tf "${BACKUP_FILE_ATTACHMENTS}"
|
||||
else
|
||||
color yellow "not found bitwarden_rs attachments directory, skipping"
|
||||
color yellow "not found vaultwarden attachments directory, skipping"
|
||||
fi
|
||||
}
|
||||
|
||||
function backup_sends() {
|
||||
color blue "backup bitwarden_rs sends"
|
||||
color blue "backup vaultwarden sends"
|
||||
|
||||
if [[ -d "${DATA_SENDS}" ]]; then
|
||||
tar -c -C "${DATA_SENDS_DIRNAME}" -f "${BACKUP_FILE_SENDS}" "${DATA_SENDS_BASENAME}"
|
||||
@@ -83,7 +83,7 @@ function backup_sends() {
|
||||
|
||||
tar -tf "${BACKUP_FILE_SENDS}"
|
||||
else
|
||||
color yellow "not found bitwarden_rs sends directory, skipping"
|
||||
color yellow "not found vaultwarden sends directory, skipping"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ if [[ "$1" == "mail" ]]; then
|
||||
|
||||
init_env
|
||||
|
||||
send_mail "BitwardenRS Backup Test" "Your SMTP looks configured correctly."
|
||||
send_mail "vaultwarden Backup Test" "Your SMTP looks configured correctly."
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
+2
-2
@@ -95,12 +95,12 @@ function send_mail_content() {
|
||||
|
||||
# successful
|
||||
if [[ "$1" == "TRUE" && "${MAIL_WHEN_SUCCESS}" == "TRUE" ]]; then
|
||||
send_mail "BitwardenRS Backup Success" "$2"
|
||||
send_mail "vaultwarden Backup Success" "$2"
|
||||
fi
|
||||
|
||||
# failed
|
||||
if [[ "$1" == "FALSE" && "${MAIL_WHEN_FAILURE}" == "TRUE" ]]; then
|
||||
send_mail "BitwardenRS Backup Failed" "$2"
|
||||
send_mail "vaultwarden Backup Failed" "$2"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
+20
-20
@@ -16,7 +16,7 @@ function clear_extract_dir() {
|
||||
}
|
||||
|
||||
function restore_zip() {
|
||||
color blue "restore bitwarden_rs backup zip file"
|
||||
color blue "restore vaultwarden backup zip file"
|
||||
|
||||
local FIND_FILE_DB
|
||||
local FIND_FILE_CONFIG
|
||||
@@ -31,9 +31,9 @@ function restore_zip() {
|
||||
fi
|
||||
|
||||
if [[ $? == 0 ]]; then
|
||||
color green "extract bitwarden_rs backup zip file successful"
|
||||
color green "extract vaultwarden backup zip file successful"
|
||||
else
|
||||
color red "extract bitwarden_rs backup zip file failed"
|
||||
color red "extract vaultwarden backup zip file failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -63,44 +63,44 @@ function restore_zip() {
|
||||
}
|
||||
|
||||
function restore_db() {
|
||||
color blue "restore bitwarden_rs sqlite database"
|
||||
color blue "restore vaultwarden sqlite database"
|
||||
|
||||
cp -f "${RESTORE_FILE_DB}" "${DATA_DB}"
|
||||
|
||||
if [[ $? == 0 ]]; then
|
||||
color green "restore bitwarden_rs sqlite database successful"
|
||||
color green "restore vaultwarden sqlite database successful"
|
||||
else
|
||||
color red "restore bitwarden_rs sqlite database failed"
|
||||
color red "restore vaultwarden sqlite database failed"
|
||||
fi
|
||||
}
|
||||
|
||||
function restore_config() {
|
||||
color blue "restore bitwarden_rs config"
|
||||
color blue "restore vaultwarden config"
|
||||
|
||||
cp -f "${RESTORE_FILE_CONFIG}" "${DATA_CONFIG}"
|
||||
|
||||
if [[ $? == 0 ]]; then
|
||||
color green "restore bitwarden_rs config successful"
|
||||
color green "restore vaultwarden config successful"
|
||||
else
|
||||
color red "restore bitwarden_rs config failed"
|
||||
color red "restore vaultwarden config failed"
|
||||
fi
|
||||
}
|
||||
|
||||
function restore_rsakey() {
|
||||
color blue "restore bitwarden_rs rsakey"
|
||||
color blue "restore vaultwarden rsakey"
|
||||
|
||||
mkdir "${DATA_RSAKEY_DIRNAME}"
|
||||
tar -x -C "${DATA_RSAKEY_DIRNAME}" -f "${RESTORE_FILE_RSAKEY}"
|
||||
|
||||
if [[ $? == 0 ]]; then
|
||||
color green "restore bitwarden_rs rsakey successful"
|
||||
color green "restore vaultwarden rsakey successful"
|
||||
else
|
||||
color red "restore bitwarden_rs rsakey failed"
|
||||
color red "restore vaultwarden rsakey failed"
|
||||
fi
|
||||
}
|
||||
|
||||
function restore_attachments() {
|
||||
color blue "restore bitwarden_rs attachments"
|
||||
color blue "restore vaultwarden attachments"
|
||||
|
||||
# When customizing the attachments folder, the root directory of the tar file
|
||||
# is the directory name at the time of packing
|
||||
@@ -114,14 +114,14 @@ function restore_attachments() {
|
||||
rm -rf "${DATA_ATTACHMENTS_EXTRACT}"
|
||||
|
||||
if [[ $? == 0 ]]; then
|
||||
color green "restore bitwarden_rs attachments successful"
|
||||
color green "restore vaultwarden attachments successful"
|
||||
else
|
||||
color red "restore bitwarden_rs attachments failed"
|
||||
color red "restore vaultwarden attachments failed"
|
||||
fi
|
||||
}
|
||||
|
||||
function restore_sends() {
|
||||
color blue "restore bitwarden_rs sends"
|
||||
color blue "restore vaultwarden sends"
|
||||
|
||||
# When customizing the sends folder, the root directory of the tar file
|
||||
# is the directory name at the time of packing
|
||||
@@ -135,9 +135,9 @@ function restore_sends() {
|
||||
rm -rf "${DATA_SENDS_EXTRACT}"
|
||||
|
||||
if [[ $? == 0 ]]; then
|
||||
color green "restore bitwarden_rs sends successful"
|
||||
color green "restore vaultwarden sends successful"
|
||||
else
|
||||
color red "restore bitwarden_rs sends failed"
|
||||
color red "restore vaultwarden sends failed"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -210,14 +210,14 @@ function check_empty_input() {
|
||||
if [[ -z "${RESTORE_FILE_ZIP}${RESTORE_FILE_DB}${RESTORE_FILE_CONFIG}${RESTORE_FILE_RSAKEY}${RESTORE_FILE_ATTACHMENTS}${RESTORE_FILE_SENDS}" ]]; then
|
||||
color yellow "Empty input"
|
||||
color none ""
|
||||
color none "Find out more at https://github.com/ttionya/BitwardenRS-Backup#restore"
|
||||
color none "Find out more at https://github.com/ttionya/vaultwarden-backup#restore"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
function check_data_dir_exist() {
|
||||
if [[ ! -d "${DATA_DIR}" ]]; then
|
||||
color red "Bitwarden data directory not found"
|
||||
color red "vaultwarden data directory not found"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user