2019-08-05 01:29:15 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# COMMON VARIABLES
|
|
|
|
#=================================================
|
|
|
|
|
2022-09-03 17:36:52 +02:00
|
|
|
pkg_image="vaultwarden/server"
|
|
|
|
|
2019-08-05 01:29:15 +02:00
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2023-12-03 12:08:34 +01:00
|
|
|
_download_vaultwarden_from_docker() {
|
|
|
|
|
|
|
|
# Download, check integrity, uncompress the source of vaultwarden from app.src to his build directory
|
|
|
|
docker_arg=""
|
|
|
|
# Fixup for armhf
|
2023-12-03 16:40:08 +01:00
|
|
|
if [ "$YNH_ARCH" == "armhf" ]; then
|
2023-12-03 12:08:34 +01:00
|
|
|
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
|
2023-12-03 13:54:05 +01:00
|
|
|
|
2023-12-03 16:40:08 +01:00
|
|
|
# Move files from the extract to the live directory
|
|
|
|
ynh_secure_remove --file="$install_dir/live/"
|
2023-12-03 13:54:05 +01:00
|
|
|
mkdir -p "$install_dir/live/"
|
2023-12-03 16:40:08 +01:00
|
|
|
mv -f "$install_dir/build/"{vaultwarden,web-vault} "$install_dir/live/"
|
2023-12-03 13:54:05 +01:00
|
|
|
ynh_secure_remove --file="$install_dir/build"
|
|
|
|
|
2024-01-25 19:10:21 +01:00
|
|
|
# fixes the libssl.so.3 not found bug since libssl3 is not available on bullseye
|
|
|
|
if [ ! -f /usr/lib/x86_64-linux-gnu/libssl.so.3 ]; then
|
|
|
|
ln -s /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/x86_64-linux-gnu/libssl.so.3
|
|
|
|
fi
|
|
|
|
|
2023-12-03 13:54:05 +01:00
|
|
|
chmod 750 "$install_dir"
|
|
|
|
chmod -R o-rwx "$install_dir"
|
2024-01-25 18:32:28 +01:00
|
|
|
chown -R $app:$app "$install_dir"
|
2023-12-03 12:08:34 +01:00
|
|
|
}
|
|
|
|
|
2019-08-05 01:29:15 +02:00
|
|
|
#=================================================
|
|
|
|
# EXPERIMENTAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# FUTURE OFFICIAL HELPERS
|
|
|
|
#=================================================
|