1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/vaultwarden_ynh.git synced 2024-09-03 18:26:31 +02:00
vaultwarden_ynh/scripts/_common.sh
Félix Piédallu 536cfd766c Cleanup scripts :
* reorder steps for more consistent scripts
* regroup the installation step in a single function in _common.sh
2023-12-03 13:54:05 +01:00

40 lines
1.3 KiB
Bash

#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
pkg_image="vaultwarden/server"
#=================================================
# PERSONAL HELPERS
#=================================================
_download_vaultwarden_from_docker() {
# Download, check integrity, uncompress the source of vaultwarden from app.src to his build directory
docker_arg=""
# Fixup for armhf
if [ $YNH_ARCH == "armhf" ]; then
docker_arg="--os_arch_variant=linux/arm/v7"
fi
ynh_docker_image_extract --dest_dir="$install_dir/build/" --image_spec="$pkg_image:$(ynh_app_upstream_version)" $docker_arg
mkdir -p "$install_dir/live/"
mv -f "$install_dir/build/vaultwarden" "$install_dir/live/vaultwarden"
rsync -a "$install_dir/build/web-vault/" "$install_dir/live/web-vault/"
ynh_secure_remove --file="$install_dir/build"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:$app "$install_dir"
}
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================