mirror of
https://github.com/YunoHost-Apps/focalboard_ynh.git
synced 2024-09-03 18:36:19 +02:00
set path
This commit is contained in:
parent
386eb4146e
commit
1acc03352f
5 changed files with 29 additions and 21 deletions
|
@ -7,7 +7,7 @@
|
|||
"useSSL": false,
|
||||
"webpath": "./pack",
|
||||
"filesdriver": "local",
|
||||
"filespath": "./files",
|
||||
"filespath": "__FILES_PATH__/files",
|
||||
"telemetry": false,
|
||||
"session_expire_time": 2592000,
|
||||
"session_refresh_time": 18000,
|
||||
|
|
|
@ -41,6 +41,6 @@ location / {
|
|||
more_clear_input_headers 'Accept-Encoding';
|
||||
}
|
||||
|
||||
#location /uploads/ {
|
||||
# alias __FILES_PATH__/uploads/ ;
|
||||
#}
|
||||
location /uploads/ {
|
||||
alias __FILES_PATH__/uploads/ ;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=Focalboard server
|
||||
Description=Focalboard: kanban board
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
|
|
@ -39,7 +39,7 @@ ynh_script_progression --message="Validating installation parameters..." --weigh
|
|||
|
||||
[ $YNH_ARCH == "amd64" ] || ynh_die --message="Unfortunately, Focalboard only provides binaries for AMD64 systems."
|
||||
|
||||
final_path=/opt/yunohost/$app
|
||||
final_path=/var/www/$app
|
||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
||||
|
||||
# Register (book) web path
|
||||
|
|
|
@ -38,6 +38,18 @@ upgrade_type=$(ynh_check_app_version_changed)
|
|||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||
|
||||
# If db_name doesn't exist, create it
|
||||
if [ -z "$db_name" ]; then
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||
fi
|
||||
|
||||
# If final_path doesn't exist, create it
|
||||
if [ -z "$final_path" ]; then
|
||||
final_path=/var/www/$app
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
fi
|
||||
|
||||
if [ -z "$enable_public_boards" ]; then
|
||||
enable_public_boards="false"
|
||||
ynh_app_setting_set --app=$app --key=enable_public_boards --value=$enable_public_boards
|
||||
|
@ -55,6 +67,16 @@ if ! ynh_permission_exists --permission="api"; then
|
|||
ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --auth_header="false" --show_tile="false" --protected="true"
|
||||
fi
|
||||
|
||||
# Move files to new files path
|
||||
if [ -z "/opt/yunohost/$app/files" ]; then
|
||||
mkdir -p $files_path/files
|
||||
mv /opt/yunohost/$app/files $files_path/files
|
||||
|
||||
chmod -R 755 $files_path
|
||||
chmod -R o-rwx $files_path
|
||||
chown -R $app:www-data $files_path
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
|
@ -94,22 +116,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|||
then
|
||||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||
|
||||
# Create a temporary directory
|
||||
tmpdir="$(mktemp -d)"
|
||||
|
||||
# Backup the config file in the temp dir
|
||||
cp -a "$final_path/config.json" "$tmpdir/config.json"
|
||||
|
||||
# Remove the app directory securely
|
||||
ynh_secure_remove --file="$final_path"
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path" #--keep="config.json"
|
||||
# Copy the admin saved settings from tmp directory to final path
|
||||
cp -a "$tmpdir/config.json" "$final_path/config.json"
|
||||
|
||||
# Remove the tmp directory securely
|
||||
ynh_secure_remove --file="$tmpdir"
|
||||
ynh_setup_source --dest_dir="/var/www/$app"
|
||||
fi
|
||||
|
||||
chmod 750 "$final_path"
|
||||
|
|
Loading…
Add table
Reference in a new issue