mirror of
https://github.com/YunoHost-Apps/distbin_ynh.git
synced 2024-09-03 18:26:10 +02:00
Apply last example_ynh
This commit is contained in:
parent
8aa68f359f
commit
84c36f948e
7 changed files with 10 additions and 125 deletions
|
@ -15,11 +15,12 @@
|
||||||
setup_private=1
|
setup_private=1
|
||||||
setup_public=1
|
setup_public=1
|
||||||
upgrade=1
|
upgrade=1
|
||||||
|
upgrade=1 from_commit=d39e8118603e1cc7e00d1c414ad9b55da68bfc7a
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
incorrect_path=1
|
incorrect_path=1
|
||||||
port_already_use=0
|
port_already_use=0
|
||||||
change_url=0
|
change_url=1
|
||||||
;;; Levels
|
;;; Levels
|
||||||
Level 1=auto
|
Level 1=auto
|
||||||
Level 2=auto
|
Level 2=auto
|
||||||
|
|
|
@ -8,9 +8,10 @@ location __PATH__/ {
|
||||||
if ($scheme = http) {
|
if ($scheme = http) {
|
||||||
rewrite ^ https://$server_name$request_uri? permanent;
|
rewrite ^ https://$server_name$request_uri? permanent;
|
||||||
}
|
}
|
||||||
proxy_pass http://127.0.0.1:__PORT__/;
|
|
||||||
proxy_set_header Host $host;
|
proxy_pass http://127.0.0.1:__PORT__/;
|
||||||
proxy_buffering off;
|
proxy_set_header Host $host;
|
||||||
|
proxy_buffering off;
|
||||||
|
|
||||||
# Include SSOWAT user panel.
|
# Include SSOWAT user panel.
|
||||||
include conf.d/yunohost_panel.conf.inc;
|
include conf.d/yunohost_panel.conf.inc;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"en": "Distributed pastebin with ActivityPub.",
|
"en": "Distributed pastebin with ActivityPub.",
|
||||||
"fr": "Pastebin distribué utilisant le protocole ActivityPub."
|
"fr": "Pastebin distribué utilisant le protocole ActivityPub."
|
||||||
},
|
},
|
||||||
"version": "1.0~ynh4",
|
"version": "1.0~ynh5",
|
||||||
"url": "https://example.com",
|
"url": "https://example.com",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source ../settings/scripts/ynh_systemd_action
|
source ../settings/scripts/ynh_systemd_action
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
@ -48,20 +49,6 @@ ynh_print_info "Backing up nginx web server configuration..."
|
||||||
|
|
||||||
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP THE PHP-FPM CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_print_info "Backing up php-fpm configuration..."
|
|
||||||
|
|
||||||
#ynh_backup "/etc/php/7.0/fpm/pool.d/$app.conf"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP THE MYSQL DATABASE
|
|
||||||
#=================================================
|
|
||||||
ynh_print_info "Backing up the PostgreSQL database..."
|
|
||||||
|
|
||||||
#ynh_mysql_dump_db "$db_name" > db.sql
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC BACKUP
|
# SPECIFIC BACKUP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -78,12 +65,6 @@ ynh_print_info "Backing up systemd configuration..."
|
||||||
|
|
||||||
ynh_backup "/etc/systemd/system/$app.service"
|
ynh_backup "/etc/systemd/system/$app.service"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP A CRON FILE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#ynh_backup "/etc/cron.d/$app"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -104,24 +104,6 @@ ynh_print_info "Installing dependencies ..."
|
||||||
ynh_install_app_dependencies ca-certificates
|
ynh_install_app_dependencies ca-certificates
|
||||||
ynh_install_nodejs 8
|
ynh_install_nodejs 8
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CREATE A MYSQL DATABASE
|
|
||||||
#=================================================
|
|
||||||
ynh_print_info "Creating a mysql database ..."
|
|
||||||
|
|
||||||
### Use these lines if you need a database for the application.
|
|
||||||
### `ynh_mysql_setup_db` will create a database, an associated user and a ramdom password.
|
|
||||||
### The password will be stored as 'mysqlpwd' into the app settings,
|
|
||||||
### and will be available as $db_pwd
|
|
||||||
### If you're not using these lines:
|
|
||||||
### - Remove the section "BACKUP THE MYSQL DATABASE" in the backup script
|
|
||||||
### - Remove also the section "REMOVE THE MYSQL DATABASE" in the remove script
|
|
||||||
### - As well as the section "RESTORE THE MYSQL DATABASE" in the restore script
|
|
||||||
|
|
||||||
#db_name=$(ynh_sanitize_dbid $app)
|
|
||||||
#ynh_app_setting_set $app db_name $db_name
|
|
||||||
#ynh_mysql_setup_db $db_name $db_name
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -154,25 +136,6 @@ ynh_print_info "Configuring system user ..."
|
||||||
# Create a system user
|
# Create a system user
|
||||||
ynh_system_user_create "$app" "$final_path"
|
ynh_system_user_create "$app" "$final_path"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# PHP-FPM CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_print_info "Configuring php-fpm ..."
|
|
||||||
|
|
||||||
### `ynh_add_fpm_config` is used to set up a PHP config.
|
|
||||||
### You can remove it if your app doesn't use PHP.
|
|
||||||
### `ynh_add_fpm_config` will use the files conf/php-fpm.conf and conf/php-fpm.ini
|
|
||||||
### If you're not using these lines:
|
|
||||||
### - You can remove these files in conf/.
|
|
||||||
### - Remove the section "BACKUP THE PHP-FPM CONFIGURATION" in the backup script
|
|
||||||
### - Remove also the section "REMOVE PHP-FPM CONFIGURATION" in the remove script
|
|
||||||
### - As well as the section "RESTORE THE PHP-FPM CONFIGURATION" in the restore script
|
|
||||||
### With the reload at the end of the script.
|
|
||||||
### - And the section "PHP-FPM CONFIGURATION" in the upgrade script
|
|
||||||
|
|
||||||
# Create a dedicated php-fpm config
|
|
||||||
#ynh_add_fpm_config
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -224,37 +187,6 @@ ynh_print_info "Configuring a systemd service ..."
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP APPLICATION WITH CURL
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
### Use these lines only if the app installation needs to be finalized through
|
|
||||||
### 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 right permissions for curl install
|
|
||||||
#chown -R $app: $final_path
|
|
||||||
|
|
||||||
# Set the app as temporarily public for curl call
|
|
||||||
#ynh_print_info "Configuring ssowat ..."
|
|
||||||
#ynh_app_setting_set $app skipped_uris "/"
|
|
||||||
# Reload SSOwat config
|
|
||||||
#yunohost app ssowatconf
|
|
||||||
|
|
||||||
# Reload Nginx
|
|
||||||
#systemctl reload nginx
|
|
||||||
|
|
||||||
# Installation with curl
|
|
||||||
#ynh_print_info "Finalizing install ..."
|
|
||||||
#ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3"
|
|
||||||
|
|
||||||
# Remove the public access
|
|
||||||
#if [ $is_public -eq 0 ]
|
|
||||||
#then
|
|
||||||
# ynh_app_setting_delete $app skipped_uris
|
|
||||||
#fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY A CONFIG FILE
|
# MODIFY A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -29,7 +29,7 @@ final_path=$(ynh_app_setting_get $app final_path)
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Remove a service from the admin panel, added by `yunohost service add`
|
# Remove a service from the admin panel, added by `yunohost service add`
|
||||||
if yunohost service status | grep -q $app
|
if yunohost service status $app >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
ynh_print_info "Removing $app service"
|
ynh_print_info "Removing $app service"
|
||||||
yunohost service remove $app
|
yunohost service remove $app
|
||||||
|
@ -43,14 +43,6 @@ ynh_print_info "Stopping and removing the systemd service"
|
||||||
# Remove the dedicated systemd config
|
# Remove the dedicated systemd config
|
||||||
ynh_remove_systemd_config
|
ynh_remove_systemd_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE THE MYSQL DATABASE
|
|
||||||
#=================================================
|
|
||||||
ynh_print_info "Removing the PostgreSQL database"
|
|
||||||
|
|
||||||
# Remove a database if it exists, along with the associated user
|
|
||||||
#ynh_mysql_remove_db $db_name $db_name
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DEPENDENCIES
|
# REMOVE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -76,14 +68,6 @@ ynh_print_info "Removing nginx web server configuration"
|
||||||
# Remove the dedicated nginx config
|
# Remove the dedicated nginx config
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE PHP-FPM CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_print_info "Removing php-fpm configuration"
|
|
||||||
|
|
||||||
# Remove the dedicated php-fpm config
|
|
||||||
#ynh_remove_fpm_config
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE LOGROTATE CONFIGURATION
|
# REMOVE LOGROTATE CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -40,12 +40,6 @@ elif [ "$is_public" = "No" ]; then
|
||||||
is_public=0
|
is_public=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If db_name doesn't exist, create it
|
|
||||||
#if [ -z $db_name ]; then
|
|
||||||
# db_name=$(ynh_sanitize_dbid $app)
|
|
||||||
# ynh_app_setting_set $app db_name $db_name
|
|
||||||
#fi
|
|
||||||
|
|
||||||
# If final_path doesn't exist, create it
|
# If final_path doesn't exist, create it
|
||||||
if [ -z $final_path ]; then
|
if [ -z $final_path ]; then
|
||||||
final_path=/var/www/$app
|
final_path=/var/www/$app
|
||||||
|
@ -119,18 +113,10 @@ ynh_print_info "Making sure dedicated system user exists..."
|
||||||
# Create a dedicated user (if not existing)
|
# Create a dedicated user (if not existing)
|
||||||
ynh_system_user_create "$app" "$final_path"
|
ynh_system_user_create "$app" "$final_path"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# PHP-FPM CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_print_info "Upgrading php-fpm configuration..."
|
|
||||||
|
|
||||||
# Create a dedicated php-fpm config
|
|
||||||
#ynh_add_fpm_config
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DB FOLDER
|
# CREATE STORAGE FOLDER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
DIRECTORY="$final_path/db"
|
DIRECTORY="$final_path/db"
|
||||||
|
|
Loading…
Add table
Reference in a new issue