1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/icecoder_ynh.git synced 2024-09-03 19:26:10 +02:00

Merge pull request #14 from YunoHost-Apps/testing

Update about URL process and multi-instances
This commit is contained in:
Stylix58 2021-03-25 07:45:58 +01:00 committed by GitHub
commit b4ab76fc2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 27 deletions

View file

@ -6,7 +6,7 @@
"en": "Code editor awesomeness ...in your browser",
"fr": "Un éditeur de code impressionnant ...dans votre navigateur"
},
"version": "1.1~ynh1",
"version": "1.1~ynh3",
"url": "https://icecoder.net/",
"license": "AGPL-3.0-only",
"maintainer": {
@ -17,7 +17,7 @@
"requirements": {
"yunohost": ">= 4.1.3"
},
"multi_instance": false,
"multi_instance": true,
"services": [
"nginx",
"php7.3-fpm"

View file

@ -21,8 +21,7 @@ ynh_abort_if_errors
#=================================================
domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH/icecoder
is_public=$YNH_APP_ARG_IS_PUBLIC
path_url=$(($YNH_APP_ARG_PATH+"icecoder"))
### If it's a multi-instance app, meaning it can be installed several times independently
### The id of the app as stated in the manifest is available as $YNH_APP_ID
@ -55,7 +54,15 @@ final_path=$path_url
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
# Register (book) web path
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
if [[ $path_url =~ my_webapp ]]
then
ynh_webpath_register --app=$app --domain=$domain --path_url=$YNH_APP_ARG_PATH
chown -R my_webapp $final_path
else
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
chown -R www-data.www-data $final_path
fi
#=================================================
# STORE SETTINGS FROM MANIFEST
@ -65,26 +72,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# FIND AND OPEN A PORT
#=================================================
ynh_script_progression --message="Finding an available port..." --weight=1
### Use these lines if you have to open a port for the application
### `ynh_find_port` will find the first available port starting from the given port.
### If you're not using these lines:
### - Remove the section "CLOSE A PORT" in the remove script
# Find an available port
port=$(ynh_find_port --port=8095)
ynh_app_setting_set --app=$app --key=port --value=$port
# Optional: Expose this port publicly
# (N.B.: you only need to do this if the app actually needs to expose the port publicly.
# If you do this and the app doesn't actually need you are CREATING SECURITY HOLES IN THE SERVER !)
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -129,8 +116,6 @@ ynh_use_logrotate
#=================================================
ynh_script_progression --message="Configuring permissions..." --weight=1
# Configure internal permissions for ICEcoder
chown -R my_webapp $final_path
#=================================================
# END OF SCRIPT