1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/writefreely_ynh.git synced 2024-09-03 20:36:02 +02:00

Apply last example_ynh

This commit is contained in:
yalh76 2021-06-25 01:58:51 +02:00
parent 8be9f23d23
commit 6fc40509fd
12 changed files with 49 additions and 31 deletions

View file

@ -36,10 +36,13 @@ forest = false
disable_drafts = false
single_user = __SINGLE_USER__
open_registration = true
open_deletion = true
min_username_len = 3
max_blogs = 4
federation = true
public_stats = true
monetization = false
notes_only = false
private = false
local_timeline = true
user_invites =

View file

@ -15,10 +15,10 @@ location ~ ^/(css|img|js|fonts)/ {
}
location __PATH__/ {
proxy_pass http://localhost:__PORT__;
proxy_set_header Host $http_host;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://127.0.0.1:__PORT__;
proxy_redirect off;
# Include SSOWAT user panel.

0
doc/.gitkeep Normal file
View file

8
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,8 @@
* Any known limitations, constrains or stuff not working, such as (but not limited to):
* **WriteFreely** require a dedicated **root domain**, eg. writefreely.domain.tld
* i386 architectures not supported
* No LDAP and no HTTP auth supported
* Other infos that people should be aware of, such as:
* If User Mode is configured Multiple users, the app be used by multiple users
* Additionals parameters can be configured in Settings / Admin settings.

0
doc/screenshots/.gitkeep Normal file
View file

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 KiB

View file

@ -8,6 +8,13 @@
},
"version": "0.13.0~ynh1",
"url": "https://writefreely.org",
"upstream": {
"license": "AGPL-3.0-or-later",
"website": "https://writefreely.org",
"demo": "https://write.as/new",
"userdoc": "https://writefreely.org/start",
"code": "https://github.com/writeas/writefreely"
},
"license": "AGPL-3.0-or-later",
"maintainer": {
"name": "yalh76"

View file

@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_clean_setup () {
ynh_clean_check_starting
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors

View file

@ -85,7 +85,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port
ynh_script_progression --message="Configuring system user..."
# Create a system user
ynh_system_user_create --username=$app --home_dir="$final_path"
ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
# CREATE A MYSQL DATABASE

View file

@ -32,7 +32,6 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
@ -59,7 +58,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_script_progression --message="Recreating the dedicated system user..."
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
# RESTORE THE APP MAIN DIR
@ -79,6 +78,7 @@ chown -R $app:www-data "$final_path"
#=================================================
ynh_script_progression --message="Restoring the MySQL database..."
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql

View file

@ -36,6 +36,30 @@ ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped Write Freely"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
@ -71,37 +95,13 @@ 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
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped Write Freely"
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE