diff --git a/README.md b/README.md index 3d4a281..300a790 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ [![Integration level](https://dash.yunohost.org/integration/writefreely.svg)](https://dash.yunohost.org/appci/app/writefreely) ![](https://ci-apps.yunohost.org/ci/badges/writefreely.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/writefreely.maintain.svg) [![Install WriteFreely with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=writefreely) -> *This package allow you to install WriteFreely quickly and simply on a YunoHost server. -If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* +> *This package allows you to install WriteFreely quickly and simply on a YunoHost server. +If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview WriteFreely is a beautifully pared-down blogging platform that's simple on the surface, yet powerful underneath. @@ -39,7 +39,7 @@ Additionals parameters can be configure in Settings / admin settings. ## YunoHost specific features -#### Multi-users support +#### Multi-user support No LDAP and no HTTP auth supported diff --git a/arm64_compilation b/arm64_compilation deleted file mode 100644 index 75462c5..0000000 --- a/arm64_compilation +++ /dev/null @@ -1,62 +0,0 @@ -#!/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/check_process b/check_process index 0d64cc3..8573b79 100644 --- a/check_process +++ b/check_process @@ -13,30 +13,27 @@ setup_private=1 setup_public=1 upgrade=1 - # 0.8.1 + # 0.8.1~ynh4 upgrade=1 from_commit=093ec18f9f5282e1a137c0ac5444a414ee2b83bc - # 0.11.2 + # 0.11.2~ynh1 upgrade=1 from_commit=45584b220e911c573643cb1e213e75fc42547818 # 0.12.0~ynh1 upgrade=1 from_commit=4b7c851074c4e785c414944905a8cfb2a0d19ff1 + # 0.12.0~ynh3 + upgrade=1 from_commit=5ac207e14985bda77dc797353902548696622b41 backup_restore=1 multi_instance=1 - # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. - # incorrect_path=1 port_already_use=0 change_url=0 -;;; Levels - # If the level 5 (Package linter) is forced to 1. Please add justifications here. - Level 5=auto ;;; Options Email=yalh@yahoo.com Notification=all ;;; Upgrade options ; commit=093ec18f9f5282e1a137c0ac5444a414ee2b83bc - name=0.8.1 + name=0.8.1~ynh4 ; commit=45584b220e911c573643cb1e213e75fc42547818 - name=0.11.2 + name=0.11.2~ynh1 ; commit=4b7c851074c4e785c414944905a8cfb2a0d19ff1 name=0.12.0~ynh1 - - + ; commit=5ac207e14985bda77dc797353902548696622b41 + name=0.12.0~ynh3 diff --git a/issue_template.md b/issue_template.md index fb9fd35..306e3cd 100644 --- a/issue_template.md +++ b/issue_template.md @@ -6,11 +6,11 @@ about: When creating a bug report, please use the following template to provide **How to post a meaningful bug report** 1. *Read this whole template first.* -2. *Make sure you are on the right place:* +2. *Determine if you are on the right place:* - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* - - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* - - *In doubt, ask here and we will figure it out together.* -3. *Delete these italic comments as you write over them below, and remove this guide.* + - *Otherwise, the issue may be due to WriteFreely itself. Refer to its documentation or repository for help.* + - *When in doubt, post here and we will figure it out together.* +3. *Delete the italic comments as you write over them below, and remove this guide.* --- ### Describe the bug @@ -22,7 +22,7 @@ about: When creating a bug report, please use the following template to provide - Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* - YunoHost version: x.x.x - I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* -- Are you in a special context or did you perform some particular tweaking on your YunoHost instance ?: *no / yes* +- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* - If yes, please explain: - Using, or trying to install package version/branch: - If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* @@ -36,8 +36,8 @@ about: When creating a bug report, please use the following template to provide - *If you used the webadmin, please perform the equivalent command from the CLI first.* - *If the error occurs in your browser, explain what you did:* 1. *Go to '...'* - 2. *Click on '....'* - 3. *Scroll down to '....'* + 2. *Click on '...'* + 3. *Scroll down to '...'* 4. *See error* ### Expected behavior diff --git a/manifest.json b/manifest.json index 24f1563..55b7045 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.12.0~ynh3", + "version": "0.12.0~ynh4", "url": "https://writefreely.org", "license": "AGPL-3.0-or-later", "maintainer": [ @@ -18,7 +18,7 @@ "name": "yalh76" }], "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.1.3" }, "multi_instance": true, "services": [ @@ -41,7 +41,7 @@ "type": "user", "ask": { "en": "Choose an admin user", - "fr": "Choisissez l’administrateur" + "fr": "Choisissez l'administrateur" }, "example": "johndoe" }, diff --git a/pull_request_template.md b/pull_request_template.md index f941977..6c28fc5 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -13,6 +13,4 @@ ## Package_check results --- -*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* - -[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/writefreely_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/writefreely_ynh%20PR-NUM-%20(USERNAME)/) +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/_common.sh b/scripts/_common.sh index eea5970..0414a4f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -#pkg_dependencies="deb1 deb2" +#pkg_dependencies="" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index f047368..7c2dd83 100755 --- a/scripts/install +++ b/scripts/install @@ -66,7 +66,6 @@ ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin -ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=single_user --value=$single_user #================================================= @@ -189,15 +188,18 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring permissions..." # Make app public if necessary if [ $is_public -eq 1 ] then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission="main" --add="visitors" fi +ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --auth_header="false" --show_tile="false" --protected="true" + #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 0c80ca6..2a07d1c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,9 +21,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) admin=$(ynh_app_setting_get --app=$app --key=admin) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) - db_name=$(ynh_app_setting_get --app=$app --key=db_name) port=$(ynh_app_setting_get --app=$app --key=port) @@ -41,27 +39,6 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi - -# If db_name doesn't exist, create it -if [ -z "$db_name" ]; then - db_name=$(ynh_sanitize_dbid --db_name=$app) - ynh_app_setting_set --app=$app --key=db_name --value=$db_name -fi - -# If final_path doesn't exist, create it -if [ -z "$final_path" ]; then - final_path=/var/www/$app - ynh_app_setting_set --app=$app --key=final_path --value=$final_path -fi - # Remove old variables ynh_app_setting_delete --app=$app --key=site_name ynh_app_setting_delete --app=$app --key=site_description @@ -80,6 +57,18 @@ then yunohost firewall disallow TCP $port 2>&1 fi +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + +# Create a permission if needed +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 #================================================= @@ -189,18 +178,6 @@ ynh_script_progression --message="Starting a systemd service..." ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Serving on" -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." - -# Make app public if necessary -if [ $is_public -eq 1 ] -then - # unprotected_uris allows SSO credentials to be passed anyway - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" -fi - #================================================= # RELOAD NGINX #=================================================