1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/vaultwarden_ynh.git synced 2024-09-03 18:26:31 +02:00

enable path_url

This commit is contained in:
yalh76 2020-03-21 14:04:37 +01:00
parent 10ec3941f7
commit 206f25cc0b
6 changed files with 27 additions and 4 deletions

View file

@ -22,7 +22,7 @@
# This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version.
# incorrect_path=1
port_already_use=0
change_url=0
change_url=1
;;; Levels
# If the level 5 (Package linter) is forced to 1. Please add justifications here.
Level 5=auto

View file

@ -138,7 +138,7 @@ ADMIN_TOKEN=__ADMIN_TOKEN__
## It's recommended to configure this value, otherwise certain functionality might not work,
## like attachment downloads, email links and U2F.
## For U2F to work, the server must use HTTPS, you can use Let's Encrypt for free certs
DOMAIN=https://__DOMAIN__
DOMAIN=https://__DOMAIN____PATH_URL__
## Yubico (Yubikey) Settings
## Set your Client ID and Secret Key for Yubikey OTP

View file

@ -30,6 +30,16 @@
},
"example": "example.com"
},
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for Bitwarden",
"fr": "Choisissez un chemin pour Bitwarden"
},
"example": "/bitwarden",
"default": "/bitwarden"
},
{
"name": "admin",
"type": "user",

View file

@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
ynh_print_info --message="Retrieve arguments from the manifest"
old_domain=$YNH_APP_OLD_DOMAIN
old_path=$YNH_APP_OLD_PATH
@ -108,8 +109,18 @@ fi
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# ...
# MODIFY A CONFIG FILE
#=================================================
ynh_print_info --message="Modifying a config file..."
config="$final_path/live/bitwarden_rs.env"
ynh_backup_if_checksum_is_different --file="$config"
ynh_replace_string --match_string="DOMAIN=https://$old_domain$old_path" --replace_string="DOMAIN=https://$new_domain$new_path" --target_file="$config"
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$config"
#=================================================
# GENERIC FINALISATION

View file

@ -27,7 +27,7 @@ ynh_abort_if_errors
ynh_print_info --message="Retrieving arguments from the manifest..."
domain=$YNH_APP_ARG_DOMAIN
path_url="/"
path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC
@ -158,6 +158,7 @@ cp -f ../conf/bitwarden_rs.env "$config"
ynh_replace_string --match_string="__ADMIN_TOKEN__" --replace_string="$admin_token" --target_file="$config"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config"
ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$config"
ynh_replace_string --match_string="__WEBSOCKET_PORT__" --replace_string="$websocket_port" --target_file="$config"
ynh_replace_string --match_string="__ROCKET_PORT__" --replace_string="$rocket_port" --target_file="$config"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$config"

View file

@ -161,6 +161,7 @@ cp -f ../conf/bitwarden_rs.env "$config"
ynh_replace_string --match_string="__ADMIN_TOKEN__" --replace_string="$admin_token" --target_file="$config"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config"
ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$config"
ynh_replace_string --match_string="__WEBSOCKET_PORT__" --replace_string="$websocket_port" --target_file="$config"
ynh_replace_string --match_string="__ROCKET_PORT__" --replace_string="$rocket_port" --target_file="$config"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$config"