mirror of
https://github.com/YunoHost-Apps/seafile_ynh.git
synced 2024-09-03 20:26:01 +02:00
commit
29d8c51133
3 changed files with 2 additions and 35 deletions
|
@ -18,7 +18,7 @@ code = "https://github.com/haiwen/seafile-server"
|
||||||
cpe = "cpe:2.3:a:seafile:seafile"
|
cpe = "cpe:2.3:a:seafile:seafile"
|
||||||
|
|
||||||
[integration]
|
[integration]
|
||||||
yunohost = ">= 11.2.3"
|
yunohost = ">= 11.2.8"
|
||||||
architectures = ["amd64", "arm64", "armhf"]
|
architectures = ["amd64", "arm64", "armhf"]
|
||||||
multi_instance = false
|
multi_instance = false
|
||||||
ldap = true
|
ldap = true
|
||||||
|
@ -68,7 +68,6 @@ ram.runtime = "500M"
|
||||||
dir = "/opt/yunohost/__APP__"
|
dir = "/opt/yunohost/__APP__"
|
||||||
owner = "__APP__:rwX"
|
owner = "__APP__:rwX"
|
||||||
group = "__APP__:rX"
|
group = "__APP__:rX"
|
||||||
subdirs = ["installed", "logs"]
|
|
||||||
|
|
||||||
[resources.data_dir]
|
[resources.data_dir]
|
||||||
dir = "/home/yunohost.app/__APP__"
|
dir = "/home/yunohost.app/__APP__"
|
||||||
|
|
|
@ -11,9 +11,6 @@ source ./_common.sh
|
||||||
# Source YunoHost helpers
|
# Source YunoHost helpers
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
path=$new_path
|
|
||||||
domain=$new_domain
|
|
||||||
|
|
||||||
# Create special path with / at the end
|
# Create special path with / at the end
|
||||||
if [[ $path == '/' ]]
|
if [[ $path == '/' ]]
|
||||||
then
|
then
|
||||||
|
@ -22,35 +19,6 @@ else
|
||||||
path2=$path"/"
|
path2=$path"/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Patch helper
|
|
||||||
|
|
||||||
ynh_change_url_nginx_config() {
|
|
||||||
local old_nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
|
||||||
local new_nginx_conf_path=/etc/nginx/conf.d/$new_domain.d/$app.conf
|
|
||||||
|
|
||||||
# Change the domain for NGINX
|
|
||||||
if [ $change_domain -eq 1 ]
|
|
||||||
then
|
|
||||||
ynh_delete_file_checksum --file="$old_nginx_conf_path"
|
|
||||||
mv "$old_nginx_conf_path" "$new_nginx_conf_path"
|
|
||||||
ynh_store_file_checksum --file="$new_nginx_conf_path"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Change the path in the NGINX config file
|
|
||||||
if [ $change_path -eq 1 ]
|
|
||||||
then
|
|
||||||
# Make a backup of the original NGINX config file if modified
|
|
||||||
ynh_backup_if_checksum_is_different --file="$new_nginx_conf_path"
|
|
||||||
# Set global variables for NGINX helper
|
|
||||||
path="$new_path"
|
|
||||||
path_url="$new_path"
|
|
||||||
# Create a dedicated NGINX config
|
|
||||||
ynh_add_nginx_config
|
|
||||||
fi
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
|
||||||
}
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -27,6 +27,7 @@ fi
|
||||||
|
|
||||||
ynh_script_progression --message="Creating base directory..."
|
ynh_script_progression --message="Creating base directory..."
|
||||||
ln -s $data_dir $install_dir/seafile-data
|
ln -s $data_dir $install_dir/seafile-data
|
||||||
|
mkdir -p $install_dir/logs
|
||||||
|
|
||||||
if [ -n "$(ls -A $data_dir)" ]; then
|
if [ -n "$(ls -A $data_dir)" ]; then
|
||||||
old_data_dir_path="${data_dir}_$(date '+%Y%m%d.%H%M%S')"
|
old_data_dir_path="${data_dir}_$(date '+%Y%m%d.%H%M%S')"
|
||||||
|
@ -110,7 +111,6 @@ ln -s $install_dir/logs /var/log/seafile
|
||||||
|
|
||||||
# Add fail2ban
|
# Add fail2ban
|
||||||
ynh_script_progression --message="Configuring fail2ban..."
|
ynh_script_progression --message="Configuring fail2ban..."
|
||||||
touch $install_dir/logs/seahub.log
|
|
||||||
ynh_add_fail2ban_config --use_template
|
ynh_add_fail2ban_config --use_template
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue