From 75c61fb5657a557d80bd3901c019a9e0d43ceacc Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 24 Oct 2019 08:25:49 +0200 Subject: [PATCH 1/7] cleanup --- scripts/install | 1 - scripts/upgrade | 1 - 2 files changed, 2 deletions(-) diff --git a/scripts/install b/scripts/install index 3219d11..c82280a 100755 --- a/scripts/install +++ b/scripts/install @@ -6,7 +6,6 @@ # IMPORT GENERIC HELPERS #================================================= -source detect_arch source _common.sh source ynh_detect_arch__2 source /usr/share/yunohost/helpers diff --git a/scripts/upgrade b/scripts/upgrade index 38d7f60..f486d9a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -6,7 +6,6 @@ # IMPORT GENERIC HELPERS #================================================= -source detect_arch source _common.sh source ynh_detect_arch__2 source ynh_check_app_version_changed From aca238a3084e7e8eed8656905e24f1bbf1612f64 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 24 Oct 2019 20:25:01 +0200 Subject: [PATCH 2/7] Apply example_ynh --- conf/config.ini | 2 +- scripts/backup | 3 ++- scripts/install | 6 +++--- scripts/remove | 8 ++++---- scripts/upgrade | 2 ++ 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/conf/config.ini b/conf/config.ini index e65100e..f005993 100644 --- a/conf/config.ini +++ b/conf/config.ini @@ -1,7 +1,7 @@ [server] hidden_host = port = __PORT__ -bind = localhost +bind = 127.0.0.1 tls_cert_path = tls_key_path = templates_parent_dir = diff --git a/scripts/backup b/scripts/backup index a21be75..4340e07 100755 --- a/scripts/backup +++ b/scripts/backup @@ -6,6 +6,7 @@ # 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 /usr/share/yunohost/helpers @@ -44,7 +45,7 @@ ynh_systemd_action --service_name=$app --action="stop" #================================================= ynh_print_info --message="Backing up the main app directory..." -ynh_backup "$final_path" +ynh_backup --src_path="$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/install b/scripts/install index c82280a..367bbd5 100755 --- a/scripts/install +++ b/scripts/install @@ -57,7 +57,7 @@ final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" # Register (book) web path -ynh_webpath_register $app $domain $path_url +ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST @@ -76,7 +76,7 @@ ynh_app_setting_set --app=$app --key=single_user --value=$single_user #================================================= # FIND AND OPEN A PORT #================================================= -ynh_print_info --message="Configuring firewall ..." +ynh_print_info --message="Configuring firewall..." # Find a free port port=$(ynh_find_port --port=8095) @@ -123,7 +123,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # SETUP SYSTEMD #================================================= -ynh_print_info --message="Configuring a systemd service ..." +ynh_print_info --message="Configuring a systemd service..." # Create a dedicated systemd config ynh_add_systemd_config diff --git a/scripts/remove b/scripts/remove index c09197b..72e5063 100755 --- a/scripts/remove +++ b/scripts/remove @@ -29,7 +29,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # Remove a service from the admin panel, added by `yunohost service add` -if yunohost service status $app >/dev/null 2>&1 +if ynh_exec_warn_less yunohost service status $app >/dev/null then ynh_print_info --message="Removing $app service..." yunohost service remove $app @@ -46,7 +46,7 @@ ynh_remove_systemd_config #================================================= # REMOVE THE MYSQL DATABASE #================================================= -ynh_print_info --message="Removing the MySQL database" +ynh_print_info --message="Removing the MySQL database..." # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name @@ -54,7 +54,7 @@ ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_print_info --message="Removing app main directory" +ynh_print_info --message="Removing app main directory..." # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -62,7 +62,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_print_info --message="Removing nginx web server configuration" +ynh_print_info --message="Removing nginx web server configuration..." # Remove the dedicated nginx config ynh_remove_nginx_config diff --git a/scripts/upgrade b/scripts/upgrade index f486d9a..f8dc3f4 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -99,6 +99,7 @@ ynh_abort_if_errors #================================================= # STOP SYSTEMD SERVICE #================================================= +ynh_print_info --message="Stopping a systemd service..." ynh_systemd_action --service_name=$app --action=stop @@ -135,6 +136,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # MAKE UPGRADE #================================================= +ynh_print_info --message="Making the upgrade..." chown -R "$app":"$app" "$final_path" From 246b2dd93b79f9344c6ea1df78c69b60c8b8fa9c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 25 Oct 2019 02:27:34 +0200 Subject: [PATCH 3/7] Add systemd --- conf/systemd.service | 2 +- scripts/backup | 4 ++-- scripts/change_url | 4 ++-- scripts/install | 7 ++++--- scripts/remove | 8 ++++++++ scripts/restore | 2 +- scripts/upgrade | 8 ++++---- 7 files changed, 22 insertions(+), 13 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 8399c8b..be2c2fb 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=Write Freely Service +Description=Write Freely __APP__ Service After=network.target [Service] diff --git a/scripts/backup b/scripts/backup index 4340e07..f8f57ec 100755 --- a/scripts/backup +++ b/scripts/backup @@ -38,7 +38,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) #================================================= ynh_print_info --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped Write Freely" #================================================= # BACKUP THE APP MAIN DIR @@ -75,7 +75,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Serving on" #================================================= # END OF SCRIPT diff --git a/scripts/change_url b/scripts/change_url index 75ebae9..264bcbb 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -58,7 +58,7 @@ fi #================================================= ynh_print_info --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped Write Freely" #================================================= # MODIFY URL IN NGINX CONF @@ -112,7 +112,7 @@ ynh_store_file_checksum --file="$final_path/config.ini" #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Serving on" #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index 367bbd5..048978d 100755 --- a/scripts/install +++ b/scripts/install @@ -175,18 +175,19 @@ chown -R "$app":"$app" "$final_path" #================================================= # if using yunohost version 3.2 or more in the 'manifest.json', a description can be added -yunohost service add $app --description "$app daemon for WriteFreely" --log_type systemd +yunohost service add $app --description "$app daemon for WriteFreely" --log "/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_systemd_action --service_name=$app --action=start +# Start a systemd service +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Serving on" #================================================= # SETUP SSOWAT #================================================= -ynh_print_info --message="Configuring SSOwat ..." +ynh_print_info --message="Configuring SSOwat..." # Make app public if necessary if [ $is_public -eq 1 ] diff --git a/scripts/remove b/scripts/remove index 72e5063..a4c8a5f 100755 --- a/scripts/remove +++ b/scripts/remove @@ -67,6 +67,14 @@ ynh_print_info --message="Removing nginx web server configuration..." # Remove the dedicated nginx config ynh_remove_nginx_config +#================================================= +# REMOVE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Removing logrotate configuration..." --time --weight=1 + +# Remove the app-specific logrotate config +ynh_remove_logrotate + #================================================= # CLOSE A PORT #================================================= diff --git a/scripts/restore b/scripts/restore index 023dde1..c6a9c8d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -102,7 +102,7 @@ yunohost service add $app --description "$app daemon for WriteFreely" --log_type #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Serving on" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index f8dc3f4..ede9882 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -87,9 +87,9 @@ ynh_print_info --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 - ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -101,7 +101,7 @@ ynh_abort_if_errors #================================================= ynh_print_info --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action=stop +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped Write Freely" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -184,9 +184,9 @@ fi #================================================= # START SERVICE #================================================= -ynh_print_info --message="Starting a systemd service.." +ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action=start +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped Write Freely" #================================================= # RELOAD NGINX From 759d61f0f51ce86fef7121056071759636590713 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 25 Oct 2019 19:24:43 +0200 Subject: [PATCH 4/7] Fix upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index ede9882..7f0d51c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -186,7 +186,7 @@ fi #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped Write Freely" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Stopped Write Freely" #================================================= # RELOAD NGINX From 7664361efc0d6fb58d20ca5bbe4acb6b1ccb3bd6 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 25 Oct 2019 19:25:35 +0200 Subject: [PATCH 5/7] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 7f0d51c..c98b470 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -186,7 +186,7 @@ fi #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Stopped Write Freely" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Serving on" #================================================= # RELOAD NGINX From 32373d4889692d36461e726477874f6145a11e32 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 21 Nov 2019 19:52:51 +0100 Subject: [PATCH 6/7] Remove Jessie --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index f03b31f..18ef83b 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,6 @@ If User Mode is configured Multiple users, the app be used by multiple users * x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/writefreely%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/writefreely/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/writefreely%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/writefreely/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/writefreely%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/writefreely/) ## Limitations From a00d0a3aa7df4f8caf89a350f3eea5f1540912c8 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 21 Nov 2019 22:49:40 +0100 Subject: [PATCH 7/7] Upgrade to 0.11.1 --- README.md | 2 +- arm64_compilation | 62 +++++++++++++++++++++++++++++++++++++++++++++++ conf/arm.src | 6 ++--- conf/arm64.src | 6 ++--- conf/config.ini | 8 ++++++ conf/x86-64.src | 6 ++--- manifest.json | 2 +- 7 files changed, 81 insertions(+), 11 deletions(-) create mode 100644 arm64_compilation diff --git a/README.md b/README.md index 18ef83b..bc0b3e5 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Can be run as Single User Blog or Multi User Instance. Each User can be limited from 1 to unlimited blogs. -**Shipped version:** v0.10.0 +**Shipped version:** v0.11.1 ## Important points to read before installing diff --git a/arm64_compilation b/arm64_compilation new file mode 100644 index 0000000..75462c5 --- /dev/null +++ b/arm64_compilation @@ -0,0 +1,62 @@ +#!/bin/bash + +GO_VERSION="1.13.4" +NODE_VERSION="v13.1.0" +WRITEFREELY_VERSION="0.11.1" + +# Install Go for ARM64 + +cd +rm -rf ~/gitwork +wget https://dl.google.com/go/$GO_VERSION.linux-arm64.tar.gz +tar -zxvf go$GO_VERSION.linux-arm64.tar.gz +rm go$GO_VERSION.linux-arm64.tar.gz +rm -rf /usr/local/go/ +mv go /usr/local/ +export GOROOT=/usr/local/go +mkdir -p ~/gitwork/go/src +mkdir ~/gitwork/go/bin +mkdir ~/gitwork/go/pkg +export GOPATH=~/gitwork/go +export PATH=$PATH:/usr/local/go/bin +export PATH="$PATH:$GOPATH/bin" +go version + +# Install Nodejs for ARM64 + +wget https://nodejs.org/dist/v13.1.0/node-$NODE_VERSION-linux-arm64.tar.xz +tar -xvf node-$NODE_VERSION-linux-arm64.tar.xz +rm node-$NODE_VERSION-linux-arm64.tar.xz +rm -rf /usr/local/node-$NODE_VERSION-linux-arm64/ +cp -rp node-$NODE_VERSION-linux-arm64 /usr/local/ +rm -rf node-$NODE_VERSION-linux-arm64 +ln -s /usr/local/node-$NODE_VERSION-linux-arm64 /usr/local/node +export PATH=$PATH:/usr/local/node/bin +node --version + +# Build writefreely + +go get -u github.com/go-bindata/go-bindata/... +go get -d github.com/writeas/writefreely/cmd/writefreely + +cd $GOPATH/src/github.com/writeas/writefreely + +git checkout -b v$WRITEFREELY_VERSION + +# If running Go 1.11+ +export GO111MODULE=on + +make build # Compile the application + +# Create the package + +cd +wget https://github.com/writeas/writefreely/releases/download/v0.11.1/writefreely_$WRITEFREELY_VERSION_linux_amd64.tar.gz +rm -rf writefreely +tar -zxvf writefreely_$WRITEFREELY_VERSION_linux_amd64.tar.gz +rm writefreely_$WRITEFREELY_VERSION_linux_amd64.tar.gz +rm -rf writefreely/writefreely + +cp $GOPATH/src/github.com/writeas/writefreely/cmd/writefreely/writefreely writefreely/writefreely + +tar -zcvf writefreely_$WRITEFREELY_VERSION_linux_arm64.tar.gz writefreely \ No newline at end of file diff --git a/conf/arm.src b/conf/arm.src index c59cf88..7afd99d 100644 --- a/conf/arm.src +++ b/conf/arm.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://github.com/writeas/writefreely/releases/download/v0.10.0/writefreely_0.10.0_linux_arm7.tar.gz -SOURCE_SUM=a746db116272d5ded74cd5556b56ed2f2c4f6af1785f44e6254b63adee0a7d92 +SOURCE_URL=https://github.com/writeas/writefreely/releases/download/v0.11.1/writefreely_0.11.1_linux_arm7.tar.gz +SOURCE_SUM=d13d95d65bdae06a71a370acf80a6bb709949ab28e9d80034da9c4d943173698 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=false +SOURCE_IN_SUBDIR=true SOURCE_FILENAME= diff --git a/conf/arm64.src b/conf/arm64.src index ecd8b77..feacfa4 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://github.com/YunoHost-Apps/writefreely_ynh/releases/download/v0.10.0/writefreely_0.10.0_linux_arm64.tar.gz -SOURCE_SUM=da7593fad065e17dae12ff64f501143694d585b4f0e021a60d25b02e58d127d2 +SOURCE_URL=https://github.com/YunoHost-Apps/writefreely_ynh/releases/download/v0.11.1/writefreely_0.11.1_linux_arm64.tar.gz +SOURCE_SUM=3976b00bf8dd0a068ed4b8c6952c6abc5702c2f13b04eb6b39e289ae22336606 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=false +SOURCE_IN_SUBDIR=true SOURCE_FILENAME= diff --git a/conf/config.ini b/conf/config.ini index f005993..97aff4d 100644 --- a/conf/config.ini +++ b/conf/config.ini @@ -4,6 +4,7 @@ port = __PORT__ bind = 127.0.0.1 tls_cert_path = tls_key_path = +autocert = false templates_parent_dir = static_parent_dir = pages_parent_dir = @@ -23,9 +24,14 @@ site_name = WriteFreely site_description = WriteFreely_Blogs host = __DOMAIN_URL__ theme = write +editor = disable_js = false webfonts = true landing = +simple_nav = false +wf_modesty = false +chorus = false +disable_drafts = false single_user = __SINGLEUSER__ open_registration = true min_username_len = 3 @@ -35,3 +41,5 @@ public_stats = true private = false local_timeline = true user_invites = +default_visibility = + diff --git a/conf/x86-64.src b/conf/x86-64.src index ab1ad89..32e32af 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://github.com/writeas/writefreely/releases/download/v0.10.0/writefreely_0.10.0_linux_amd64.tar.gz -SOURCE_SUM=11498cfc579b94326bdae0b61a992ba4ee3a0200a83920043c1d8ea3bdce8380 +SOURCE_URL=https://github.com/writeas/writefreely/releases/download/v0.11.1/writefreely_0.11.1_linux_amd64.tar.gz +SOURCE_SUM=694ece3eb07b6d067cc895445b645374693bb1ab4f721f6a8d619c263086d82e SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=false +SOURCE_IN_SUBDIR=true SOURCE_FILENAME= diff --git a/manifest.json b/manifest.json index b329790..a95e06b 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "For starting a minimalist, federated blog — or an entire community.", "fr": "Permet de créer un blog fédéré minimaliste ou une communauté entière." }, - "version": "0.10.0~ynh1", + "version": "0.11.1~ynh1", "url": "https://writefreely.org", "license": "AGPL-3.0-or-later", "maintainer": [