mirror of
https://github.com/YunoHost-Apps/vaultwarden_ynh.git
synced 2024-09-03 18:26:31 +02:00
[fix] Allow datadir in systemd sandboxing
[fix] .env was not found
This commit is contained in:
parent
c559e6fca1
commit
74c9464518
4 changed files with 11 additions and 11 deletions
|
@ -8,8 +8,8 @@ After=network.target
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
WorkingDirectory=__FINALPATH__/live/
|
WorkingDirectory=__FINALPATH__/live/
|
||||||
ReadWriteDirectories=__FINALPATH__/live/
|
ReadWriteDirectories=__FINALPATH__/live/ __DATADIR__
|
||||||
EnvironmentFile=__FINALPATH__/live/vaultwarden.env
|
EnvironmentFile=__FINALPATH__/live/.env
|
||||||
ExecStart=__FINALPATH__/live/vaultwarden
|
ExecStart=__FINALPATH__/live/vaultwarden
|
||||||
|
|
||||||
# Set reasonable connection and process limits
|
# Set reasonable connection and process limits
|
||||||
|
|
|
@ -114,7 +114,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Modifying a config file..."
|
ynh_script_progression --message="Modifying a config file..."
|
||||||
|
|
||||||
config="$final_path/live/vaultwarden.env"
|
config="$final_path/live/.env"
|
||||||
|
|
||||||
ynh_backup_if_checksum_is_different --file="$config"
|
ynh_backup_if_checksum_is_different --file="$config"
|
||||||
|
|
||||||
|
|
|
@ -156,10 +156,10 @@ chown -R $app:$app "$datadir"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Adding a configuration file..."
|
ynh_script_progression --message="Adding a configuration file..."
|
||||||
|
|
||||||
ynh_add_config --template="../conf/vaultwarden.env" --destination="$final_path/live/vaultwarden.env"
|
ynh_add_config --template="../conf/vaultwarden.env" --destination="$final_path/live/.env"
|
||||||
|
|
||||||
chmod 400 "$final_path/live/vaultwarden.env"
|
chmod 400 "$final_path/live/vaulwarden.env"
|
||||||
chown $app:$app "$final_path/live/vaultwarden.env"
|
chown $app:$app "$final_path/live/.env"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
|
|
|
@ -72,9 +72,9 @@ then
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
|
|
||||||
# Move config file
|
# Move config file
|
||||||
mv $final_path/live/bitwarden_rs.env $final_path/live/vaultwarden.env
|
mv $final_path/live/bitwarden_rs.env $final_path/live/.env
|
||||||
ynh_delete_file_checksum --file="/var/www/$old_app/live/bitwarden_rs.env"
|
ynh_delete_file_checksum --file="/var/www/$old_app/live/bitwarden_rs.env"
|
||||||
ynh_store_file_checksum --file="$final_path/live/vaultwarden.env"
|
ynh_store_file_checksum --file="$final_path/live/.env"
|
||||||
ynh_secure_remove --file="$final_path/live/bitwarden_rs"
|
ynh_secure_remove --file="$final_path/live/bitwarden_rs"
|
||||||
|
|
||||||
# Manage permissions
|
# Manage permissions
|
||||||
|
@ -214,10 +214,10 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating a configuration file..."
|
ynh_script_progression --message="Updating a configuration file..."
|
||||||
|
|
||||||
ynh_add_config --template="../conf/vaultwarden.env" --destination="$final_path/live/vaultwarden.env"
|
ynh_add_config --template="../conf/vaultwarden.env" --destination="$final_path/live/.env"
|
||||||
|
|
||||||
chmod 400 "$final_path/live/vaultwarden.env"
|
chmod 400 "$final_path/live/.env"
|
||||||
chown $app:$app "$final_path/live/vaultwarden.env"
|
chown $app:$app "$final_path/live/.env"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
|
|
Loading…
Add table
Reference in a new issue