mirror of
https://github.com/YunoHost-Apps/vaultwarden_ynh.git
synced 2024-09-03 18:26:31 +02:00
Apply last example_ynh
This commit is contained in:
parent
7eb1ed5383
commit
81e072f426
3 changed files with 23 additions and 18 deletions
|
@ -98,6 +98,10 @@ ynh_setup_source --dest_dir="$final_path/build/" --source_id="app"
|
|||
# Download, check integrity, uncompress and patch the source from web.src
|
||||
ynh_setup_source --dest_dir="$final_path/live/web-vault/" --source_id="web"
|
||||
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R root:$app "$final_path"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -139,14 +143,6 @@ ynh_secure_remove --file="$final_path/.rustup"
|
|||
# Create datadir
|
||||
mkdir -p "$final_path"/live/data
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring a systemd service..."
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
# ADD A CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -157,6 +153,14 @@ ynh_add_config --template="../conf/bitwarden_rs.env" --destination="$final_path/
|
|||
chmod 400 "$final_path/live/bitwarden_rs.env"
|
||||
chown $app:$app "$final_path/live/bitwarden_rs.env"
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring a systemd service..."
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
@ -165,8 +169,6 @@ chown $app:$app "$final_path/live/bitwarden_rs.env"
|
|||
ynh_script_progression --message="Configuring log rotation..."
|
||||
|
||||
# Use logrotate to manage application logfile(s)
|
||||
chown -R "$app":"$app" "$final_path"
|
||||
mkdir -p "/var/log/$app"
|
||||
ynh_use_logrotate
|
||||
|
||||
#=================================================
|
||||
|
@ -190,6 +192,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l
|
|||
ynh_script_progression --message="Configuring Fail2Ban..."
|
||||
|
||||
# Create a dedicated Fail2Ban config
|
||||
mkdir -p "/var/log/$app"
|
||||
touch /var/log/"$app"/"$app".log
|
||||
ynh_add_fail2ban_config --logpath="/var/log/$app/$app.log" --failregex="^.*Username or password is incorrect\. Try again\. IP: <HOST>\. Username:.*$"
|
||||
|
||||
|
|
|
@ -76,7 +76,6 @@ ynh_script_progression --message="Restoring the Fail2Ban configuration..."
|
|||
|
||||
# Create a dedicated Fail2Ban config
|
||||
mkdir -p "/var/log/$app"
|
||||
chown -R "$app":"$app" "/var/log/$app"
|
||||
touch /var/log/"$app"/"$app".log
|
||||
|
||||
ynh_restore_file "/etc/fail2ban/jail.d/$app.conf"
|
||||
|
|
|
@ -162,6 +162,16 @@ then
|
|||
ynh_secure_remove --file="$final_path/.rustup"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# UPDATE A CONFIG FILE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Updating a config file..."
|
||||
|
||||
ynh_add_config --template="../conf/bitwarden_rs.env" --destination="$final_path/live/bitwarden_rs.env"
|
||||
|
||||
chmod 400 "$final_path/live/bitwarden_rs.env"
|
||||
chown $app:$app "$final_path/live/bitwarden_rs.env"
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
|
@ -170,13 +180,6 @@ ynh_script_progression --message="Upgrading systemd configuration..."
|
|||
# Create a dedicated systemd config
|
||||
ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
# UPDATE A CONFIG FILE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Updating a config file..."
|
||||
|
||||
ynh_add_config --template="../conf/bitwarden_rs.env" --destination="$final_path/live/bitwarden_rs.env"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue