1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/uptime-kuma_ynh.git synced 2024-10-01 13:34:58 +02:00

cleanup + simplify manifest (we can't postinstall because of websocket)

This commit is contained in:
Hadrien 2021-11-02 02:18:11 +03:00
parent cb3b3de289
commit 8c70744924
7 changed files with 29 additions and 52 deletions

View file

@ -39,13 +39,13 @@ It is a self-hosted monitoring tool like "Uptime Robot".
## Disclaimers / important information ## Disclaimers / important information
- Not working yet
- Requires a full dedicated domain - Requires a full dedicated domain
- Uses N to install specific nodejs version
- ARM architecture not supported - ARM architecture not supported
- This app needs a manual post-install
- No upgrade script in this package - No upgrade script in this package
- does not properly use port reserved by yunohost - No restore script in this package
- needs post-install - Backup script is untested in this package
- Uses N to install specific nodejs version
<!-- * Any known limitations, constrains or stuff not working, such as (but not limited to): <!-- * Any known limitations, constrains or stuff not working, such as (but not limited to):
* requiring a full dedicated domain ? * requiring a full dedicated domain ?
* architectures not supported ? * architectures not supported ?

View file

@ -35,13 +35,13 @@ It is a self-hosted monitoring tool like "Uptime Robot".
## Avertissements / informations importantes ## Avertissements / informations importantes
- Not working yet
- Requires a full dedicated domain - Requires a full dedicated domain
- Uses N to install specific nodejs version
- ARM architecture not supported - ARM architecture not supported
- This app needs a manual post-install
- No upgrade script in this package - No upgrade script in this package
- does not properly use port reserved by yunohost - No restore script in this package
- needs post-install - Backup script is untested in this package
- Uses N to install specific nodejs version
<!-- * Any known limitations, constrains or stuff not working, such as (but not limited to): <!-- * Any known limitations, constrains or stuff not working, such as (but not limited to):
* requiring a full dedicated domain ? * requiring a full dedicated domain ?
* architectures not supported ? * architectures not supported ?

View file

@ -1,8 +1,9 @@
- Not working yet
- Requires a full dedicated domain - Requires a full dedicated domain
- ARM architecture not supported - ARM architecture not supported
- This app needs a manual post-install
- No upgrade script in this package - No upgrade script in this package
- needs post-install - No restore script in this package
- Backup script is untested in this package
- Uses N to install specific nodejs version - Uses N to install specific nodejs version
<!-- * Any known limitations, constrains or stuff not working, such as (but not limited to): <!-- * Any known limitations, constrains or stuff not working, such as (but not limited to):
* requiring a full dedicated domain ? * requiring a full dedicated domain ?

View file

@ -38,31 +38,10 @@
"fr": "Cette app a besoin de tout un sous-domaine à elle toute seule." "fr": "Cette app a besoin de tout un sous-domaine à elle toute seule."
} }
}, },
{
"name": "admin",
"type": "user"
},
{ {
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"default": true "default": true
},
{
"name": "password",
"type": "password"
},
{
"name": "language",
"type": "string",
"ask": {
"en": "Choose the application language",
"fr": "Choisissez la langue de l'application"
},
"choices": [
"fr",
"en"
],
"default": "fr"
} }
] ]
} }

View file

@ -6,7 +6,7 @@
# dependencies used by the app # dependencies used by the app
# pkg_dependencies="npm git nodejs" # pkg_dependencies="npm git nodejs"
pkg_dependencies="" # pkg_dependencies=""
nodejs_version=14.18.1 nodejs_version=14.18.1

View file

@ -26,10 +26,10 @@ ynh_abort_if_errors
path_url=/ path_url=/
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
admin=$YNH_APP_ARG_ADMIN # admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
language=$YNH_APP_ARG_LANGUAGE # language=$YNH_APP_ARG_LANGUAGE
password=$YNH_APP_ARG_PASSWORD # password=$YNH_APP_ARG_PASSWORD
### If it's a multi-instance app, meaning it can be installed several times independently ### 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 ### The id of the app as stated in the manifest is available as $YNH_APP_ID
@ -72,9 +72,9 @@ ynh_script_progression --message="Storing installation settings..." --time --wei
# Subpath not supported # Subpath not supported
ynh_app_setting_set --app=$app --key=path --value=/ ynh_app_setting_set --app=$app --key=path --value=/
ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=admin --value=$admin # ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=password --value=$password # ynh_app_setting_set --app=$app --key=password --value=$password
ynh_app_setting_set --app=$app --key=language --value=$language # ynh_app_setting_set --app=$app --key=language --value=$language
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
@ -212,7 +212,7 @@ ynh_add_nginx_config
#================================================= #=================================================
ynh_script_progression --message="Installing Uptime Kuma npm dependencies..." --time --weight=5 ynh_script_progression --message="Installing Uptime Kuma npm dependencies..." --time --weight=5
# ynh_exec_warn_less ynh_exec_as $app $ynh_npm install # ynh_exec_warn_less ynh_exec_as $app $ynh_npm install
cd $final_path && $ynh_npm install ynh_exec_warn_less cd $final_path && $ynh_npm install
# cd $final_path && /usr/local/n/versions/node/14.18.1/bin/npm install # cd $final_path && /usr/local/n/versions/node/14.18.1/bin/npm install
ynh_script_progression --message="Downloading Uptime Kuma frontend..." --time --weight=1 ynh_script_progression --message="Downloading Uptime Kuma frontend..." --time --weight=1
ynh_exec_warn_less wget https://github.com/louislam/uptime-kuma/releases/download/1.10.0/dist.tar.gz ynh_exec_warn_less wget https://github.com/louislam/uptime-kuma/releases/download/1.10.0/dist.tar.gz
@ -301,22 +301,19 @@ ynh_add_systemd_config
# SETUP APPLICATION WITH CURL # SETUP APPLICATION WITH CURL
#================================================= #=================================================
### Use these lines only if the app installation needs to be finalized through ### We cannot use it since this app uses websocket exclusively.
### web forms. We generally don't want to ask the final user,
### so we're going to use curl to automatically fill the fields and submit the
### forms.
# Set the app as temporarily public for curl call # # Set the app as temporarily public for curl call
ynh_script_progression --message="Configuring SSOwat..." --time --weight=1 # ynh_script_progression --message="Configuring SSOwat..." --time --weight=1
# Making the app public for curl # # Making the app public for curl
ynh_permission_update --permission="main" --add="visitors" # ynh_permission_update --permission="main" --add="visitors"
# Installation with curl # # Installation with curl
# ynh_script_progression --message="Finalizing installation..." --time --weight=1 # ynh_script_progression --message="Finalizing installation..." --time --weight=1
# ynh_local_curl "/" "key1=value1" "key2=value2" "key3=value3" # ynh_local_curl "/" "key1=value1" "key2=value2" "key3=value3"
# Remove the public access # # Remove the public access
ynh_permission_update --permission="main" --remove="visitors" # ynh_permission_update --permission="main" --remove="visitors"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
@ -409,7 +406,7 @@ fi
### does have for example an admin interface or an API. ### does have for example an admin interface or an API.
# Only the admin can access the admin panel of the app (if the app has an admin panel) # Only the admin can access the admin panel of the app (if the app has an admin panel)
ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin # ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin
# Everyone can access the API part # Everyone can access the API part
# We don't want to display the tile in the SSO so we put --show_tile="false" # We don't want to display the tile in the SSO so we put --show_tile="false"

View file

@ -121,7 +121,7 @@ chown -R $app:www-data "$datadir"
ynh_script_progression --message="Reinstalling dependencies..." --time --weight=1 ynh_script_progression --message="Reinstalling dependencies..." --time --weight=1
# Define and install dependencies # Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies # ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# RESTORE THE MYSQL DATABASE # RESTORE THE MYSQL DATABASE