mirror of
https://github.com/YunoHost-Apps/gotify_ynh.git
synced 2024-09-03 20:36:26 +02:00
commit
ff239dec91
12 changed files with 83 additions and 73 deletions
|
@ -20,7 +20,7 @@ Gotify is a simple server for sending and receiving messages in real-time per we
|
|||
## Configuration
|
||||
|
||||
How to configure this app:
|
||||
> Edit config.yml file via SSH.
|
||||
> Edit `config.yml` file via SSH.
|
||||
|
||||
## Documentation
|
||||
|
||||
|
@ -33,7 +33,7 @@ LDAP is not supported (blocked until Gotify core upstream implements it).
|
|||
|
||||
## Limitations
|
||||
|
||||
* Require dedicated domain like gotify.domain.tld.
|
||||
* Require dedicated domain like `gotify.domain.tld`
|
||||
|
||||
## Links
|
||||
|
||||
|
@ -44,8 +44,7 @@ LDAP is not supported (blocked until Gotify core upstream implements it).
|
|||
|
||||
---
|
||||
|
||||
Developers info
|
||||
----------------
|
||||
## Developers info
|
||||
|
||||
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/gotify_ynh/tree/testing).
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
[](https://dash.yunohost.org/appci/app/gotify)  
|
||||
[](https://install-app.yunohost.org/?app=gotify)
|
||||
|
||||
|
||||
*[Read this readme in english.](./README.md)*
|
||||
|
||||
> *Ce package vous permet d'installer Gotify rapidement et simplement sur un serveur Yunohost.
|
||||
|
@ -21,7 +20,7 @@ Gotify est un serveur simple permettant d'envoyer et de recevoir des messages vi
|
|||
## Configuration
|
||||
|
||||
Pour configurer Gotify :
|
||||
> Edit config.yml file via SSH.
|
||||
> Éditer le fichier `config.yml` avec SSH.
|
||||
|
||||
## Documentation
|
||||
|
||||
|
@ -34,7 +33,7 @@ Pas de support de LDAP (non implémenté upstream)
|
|||
|
||||
## Limitations
|
||||
|
||||
* Nécessite un domaine dédié comme par exemple gotify.domain.tld.
|
||||
* Nécessite un domaine dédié comme par exemple `gotify.domain.tld`
|
||||
|
||||
## Liens
|
||||
|
||||
|
@ -45,8 +44,7 @@ Pas de support de LDAP (non implémenté upstream)
|
|||
|
||||
---
|
||||
|
||||
Informations pour les développeurs
|
||||
----------------
|
||||
## Informations pour les développeurs
|
||||
|
||||
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/gotify_ynh/tree/testing).
|
||||
|
||||
|
|
|
@ -22,19 +22,6 @@
|
|||
incorrect_path=0
|
||||
port_already_use=1
|
||||
change_url=0
|
||||
;;; Levels
|
||||
Level 1=auto
|
||||
Level 2=auto
|
||||
Level 3=auto
|
||||
# Level 4: If the app supports LDAP and SSOwat, turn level 4 to '1' and add a link to an issue or a part of your code to show it.
|
||||
# If the app does not use LDAP nor SSOwat, and can't use them, turn level 4 to 'na' and explain as well.
|
||||
Level 4=0
|
||||
Level 5=auto
|
||||
Level 6=auto
|
||||
Level 7=auto
|
||||
Level 8=0
|
||||
Level 9=0
|
||||
Level 10=0
|
||||
;;; Upgrade options
|
||||
; commit=e0fbbb9a6d2fd87b4d42e85c0fc8f4e479689abc
|
||||
name=Mon Feb 18 21:55:49 2019 +0100 Merge branch 'master' of github.com:YunoHost-Apps/gotify_ynh
|
||||
|
|
|
@ -8,7 +8,7 @@ Type=simple
|
|||
User=__APP__
|
||||
Group=__APP__
|
||||
WorkingDirectory=__FINALPATH__/
|
||||
ExecStart=__FINALPATH__/gotify-linux-amd64
|
||||
ExecStart=__FINALPATH__/gotify-linux-__ARCHITECTURE__
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "A simple server for sending and receiving messages.",
|
||||
"fr": "Un simple serveur pour envoyer et recevoir des messages."
|
||||
},
|
||||
"version": "2.0.16~ynh2",
|
||||
"version": "2.0.16~ynh3",
|
||||
"url": "http://gotify.net",
|
||||
"license": "MIT",
|
||||
"maintainer": {
|
||||
|
@ -14,7 +14,7 @@
|
|||
"email": "plopoyop@gmail.com"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 3.7.0"
|
||||
"yunohost": ">= 3.8.1"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
|
|
|
@ -1,21 +1,27 @@
|
|||
#!/bin/bash
|
||||
|
||||
# ============= FUTURE YUNOHOST HELPER =============
|
||||
# Delete a file checksum from the app settings
|
||||
#
|
||||
# $app should be defined when calling this helper
|
||||
#
|
||||
# usage: ynh_remove_file_checksum file
|
||||
# | arg: file - The file for which the checksum will be deleted
|
||||
ynh_delete_file_checksum () {
|
||||
local checksum_setting_name=checksum_${1//[\/ ]/_} # Replace all '/' and ' ' by '_'
|
||||
ynh_app_setting_delete $app $checksum_setting_name
|
||||
}
|
||||
#=================================================
|
||||
# COMMON VARIABLES
|
||||
#=================================================
|
||||
|
||||
if [ -n "$(uname -m | grep 64)" ]; then
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# EXPERIMENTAL HELPERS
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# FUTURE OFFICIAL HELPERS
|
||||
#=================================================
|
||||
|
||||
if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then
|
||||
architecture="arm64"
|
||||
elif [ -n "$(uname -m | grep 64)" ]; then
|
||||
architecture="amd64"
|
||||
elif [ -n "$(uname -m | grep arm)" ]; then
|
||||
architecture="arm"
|
||||
architecture="arm-7"
|
||||
else
|
||||
ynh_die "Unable to detect your achitecture, please open a bug describing \
|
||||
your hardware and the result of the command \"uname -m\"." 1
|
||||
|
|
|
@ -13,13 +13,12 @@ source /usr/share/yunohost/helpers
|
|||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..."
|
||||
ynh_print_info --message="Loading installation settings..."
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -28,32 +27,37 @@ domain=$(ynh_app_setting_get $app domain)
|
|||
db_name=$(ynh_app_setting_get $app db_name)
|
||||
|
||||
#=================================================
|
||||
# STANDARD BACKUP STEPS
|
||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||
#=================================================
|
||||
ynh_print_info --message="Declaring files to be backed up..."
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the main app directory..." --weight=30
|
||||
|
||||
ynh_backup "$final_path"
|
||||
ynh_backup --src_path="$final_path"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up nginx web server configuration..." --weight=1
|
||||
|
||||
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE MYSQL DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the MySQL database..." --weight=20
|
||||
|
||||
ynh_mysql_dump_db "$db_name" > db.sql
|
||||
ynh_print_info --message="Backing up the MySQL database..."
|
||||
|
||||
ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||
|
||||
#=================================================
|
||||
# BACKUP SYSTEMD
|
||||
#=================================================
|
||||
|
||||
ynh_backup "/etc/systemd/system/$app.service"
|
||||
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)" --last
|
||||
ynh_backup --src_path="/etc/systemd/system/$app.service"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)"
|
||||
|
|
|
@ -16,7 +16,6 @@ source /usr/share/yunohost/helpers
|
|||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||
#=================================================
|
||||
|
@ -70,7 +69,7 @@ ynh_app_setting_set $app port $port
|
|||
#=================================================
|
||||
# CREATE A MYSQL DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating a MySQL database..." --weight=20
|
||||
ynh_script_progression --message="Creating a MySQL database..." --weight=10
|
||||
|
||||
db_name=$(ynh_sanitize_dbid $app)
|
||||
ynh_app_setting_set $app db_name $db_name
|
||||
|
@ -88,7 +87,7 @@ ynh_setup_source "$final_path" $architecture
|
|||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring nginx web server..." --weight=2
|
||||
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
|
||||
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
@ -101,12 +100,12 @@ ynh_script_progression --message="Configuring system user..." --weight=2
|
|||
# Create a system user
|
||||
ynh_system_user_create $app
|
||||
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_replace_string "__ARCHITECTURE__" $architecture "../conf/systemd.service"
|
||||
ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
|
@ -159,7 +158,7 @@ ynh_permission_update --permission "main" --add visitors
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..." --weight=1
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
systemctl reload nginx
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ final_path=$(ynh_app_setting_get $app final_path)
|
|||
# REMOVE SERVICE FROM ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
# Remove a service from the admin panel, added by `yunohost service add`
|
||||
if yunohost service status | grep -q $app
|
||||
then
|
||||
ynh_script_progression --message="Remove $app service" --weight=1
|
||||
|
@ -46,7 +45,7 @@ ynh_remove_systemd_config
|
|||
#=================================================
|
||||
# REMOVE THE MYSQL DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the MySQL database..." --weight=10
|
||||
ynh_script_progression --message="Removing the MySQL database..." --weight=6
|
||||
|
||||
# Remove a database if it exists, along with the associated user
|
||||
ynh_mysql_remove_db $db_user $db_name
|
||||
|
@ -54,7 +53,7 @@ ynh_mysql_remove_db $db_user $db_name
|
|||
#=================================================
|
||||
# REMOVE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing app main directory..." --weight=30
|
||||
ynh_script_progression --message="Removing app main directory..." --weight=10
|
||||
|
||||
# Remove the app directory securely
|
||||
ynh_secure_remove "$final_path"
|
||||
|
@ -62,7 +61,7 @@ ynh_secure_remove "$final_path"
|
|||
#=================================================
|
||||
# REMOVE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing nginx web server configuration..." --weight=5
|
||||
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=2
|
||||
|
||||
# Remove the dedicated nginx config
|
||||
ynh_remove_nginx_config
|
||||
|
@ -72,9 +71,13 @@ ynh_remove_nginx_config
|
|||
#=================================================
|
||||
# REMOVE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the dedicated system user..." --weight=5
|
||||
ynh_script_progression --message="Removing the dedicated system user..." --weight=1
|
||||
|
||||
# Delete a system user
|
||||
ynh_system_user_delete $app
|
||||
ynh_system_user_delete --username=$app
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Removal of $app completed" --last
|
|
@ -43,7 +43,7 @@ test ! -d $final_path \
|
|||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring nginx configuration..." --weight=1
|
||||
ynh_script_progression --message="Restoring NGINX configuration..." --weight=1
|
||||
|
||||
ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
|
@ -95,13 +95,18 @@ yunohost service add $app
|
|||
ynh_script_progression --message="Restoring service..." --weight=10
|
||||
|
||||
ynh_restore_file "/etc/systemd/system/$app.service"
|
||||
systemctl enable $app.service
|
||||
systemctl enable $app.service --quiet
|
||||
systemctl start $app
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server ..." --weight=1
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
systemctl reload nginx
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Restoration completed for $app" --last
|
||||
|
|
|
@ -86,9 +86,9 @@ ynh_setup_source "$final_path" $architecture
|
|||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2
|
||||
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
|
||||
|
||||
# Create a dedicated nginx config
|
||||
# Create a dedicated NGINX config
|
||||
if [ "$path_url" != "/" ]
|
||||
then
|
||||
ynh_replace_string "^#sub_path_only" "" "../conf/nginx.conf"
|
||||
|
@ -108,8 +108,6 @@ ynh_system_user_create $app
|
|||
# SPECIFIC UPGRADE
|
||||
#=================================================
|
||||
|
||||
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
|
||||
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
|
||||
ynh_backup_if_checksum_is_different "$final_path/config.yml"
|
||||
|
||||
cp ../conf/config.yml "$final_path/config.yml"
|
||||
|
@ -129,6 +127,7 @@ ynh_store_file_checksum "$final_path/config.yml"
|
|||
#=================================================
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_replace_string "__ARCHITECTURE__" $architecture "../conf/systemd.service"
|
||||
ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
|
@ -150,6 +149,12 @@ fi
|
|||
# check data directory permission
|
||||
chown -R $app: $final_path/data
|
||||
|
||||
#=================================================
|
||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
yunohost service add $app
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
|
@ -172,8 +177,12 @@ systemctl restart $app
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..." --weight=1
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
systemctl reload nginx
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Upgrade of $app completed" --last
|
Loading…
Add table
Reference in a new issue