From 11f1dc25d3f7e11b847bd2b42e16cb5a4eca1bfc Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 11 Jan 2021 20:08:21 +0100 Subject: [PATCH 01/22] Fix --- README.md | 12 +++--------- check_process | 5 ----- issue_template.md | 2 +- manifest.json | 2 +- scripts/_common.sh | 4 ++++ scripts/upgrade | 31 ------------------------------- 6 files changed, 9 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 1597851..72bf502 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ ![Misskey](https://raw.githubusercontent.com/syuilo/misskey/develop/assets/title.png) ================================================================ -# Misskey for Yunohost +# Misskey for YunoHost [![Integration level](https://dash.yunohost.org/integration/misskey.svg)](https://dash.yunohost.org/appci/app/misskey) ![](https://ci-apps.yunohost.org/ci/badges/misskey.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/misskey.maintain.svg) -[![Install misskey with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=misskey) - +[![Install misskey with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=misskey) > *This package allows you to install Misskey quickly and simply on a YunoHost server. @@ -12,7 +11,6 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ![](https://藍.moe/aiart/31.png) - ## Overview [Misskey](https://join.misskey.page/en/) is a forever evolving, sophisticated microblogging platform that support Fediverse. It provide another flavour to decentralised network. Why don't you take a short break from the hustle and bustle of the city, and dive into a new Internet? @@ -23,8 +21,6 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ![](https://raw.githubusercontent.com/syuilo/misskey/develop/assets/ss/user.jpg) - - ## Other instances to join * [Instances](https://join.misskey.page/en/wiki/instances/) @@ -66,10 +62,8 @@ $ screen -r --- -Developer info ----------------- +## Developer info -**Only if you want to use a testing branch for coding, instead of merging directly into master.** Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/misskey_ynh/tree/testing). To try the testing branch, please proceed like that. diff --git a/check_process b/check_process index d8c9d41..a7d6130 100644 --- a/check_process +++ b/check_process @@ -18,13 +18,8 @@ upgrade=0 from_commit=CommitHash backup_restore=0 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=1 -;;; Levels - # If the level 5 (Package linter) is forced to 1. Please add justifications here. - Level 5=auto ;;; Options Email=anmol@datamol.org Notification=all diff --git a/issue_template.md b/issue_template.md index 87b88d4..4f952c5 100644 --- a/issue_template.md +++ b/issue_template.md @@ -31,7 +31,7 @@ about: When creating a bug report, please use the following template to provide - *If you performed a command from the CLI, the command itself is enough. For example:* ```sh - sudo yunohost app install REPLACEBYYOURAPP + sudo yunohost app install misskey ``` - *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:* diff --git a/manifest.json b/manifest.json index b2ae1b0..821d126 100644 --- a/manifest.json +++ b/manifest.json @@ -12,7 +12,7 @@ "name": "Anmol" }, "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 3.8.1" }, "multi_instance": true, "services": ["nginx"], diff --git a/scripts/_common.sh b/scripts/_common.sh index e7669fb..0ad4945 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -3,10 +3,14 @@ #================================================= # COMMON VARIABLES #================================================= + MEMORY_NEEDED="2560" + # dependencies used by the app pkg_dependencies=" build-essential python ffmpeg redis-server redis-tools postgresql postgresql-contrib" + NODEJS_VERSION="12" + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 87c2f97..6b34a64 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,12 +29,6 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) # CHECK VERSION #================================================= -### This helper will compare the version of the currently installed app and the version of the upstream package. -### $upgrade_type can have 2 different values -### - UPGRADE_APP if the upstream app version has changed -### - UPGRADE_PACKAGE if only the YunoHost package has changed -### ynh_check_app_version_changed will stop the upgrade if the app is up to date. -### UPGRADE_APP should be used to upgrade the core app only if there's an upgrade to do. upgrade_type=$(ynh_check_app_version_changed) #================================================= @@ -77,18 +71,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK THE PATH -#================================================= - -# Normalize the URL path syntax -# N.B. : this is for app installations before YunoHost 2.7 -# where this value might be something like /foo/ or foo/ -# instead of /foo .... -# If nobody installed your app before 2.7, then you may -# safely remove this line -path_url=$(ynh_normalize_url_path --path_url=$path_url) - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -172,7 +154,6 @@ pushd "$final_path" NODE_ENV=production yarn build popd - #================================================= # SETUP SYSTEMD #================================================= @@ -216,18 +197,6 @@ ynh_script_progression --message="Starting a systemd service..." ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="All workers started" -#================================================= -# 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 #================================================= From 57b6937c9c0e1c9cd70a2376d62c566b6f31164b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 11 Jan 2021 21:17:52 +0100 Subject: [PATCH 02/22] Fix --- README.md | 13 ++---- conf/nginx.conf | 59 ++++++++++++------------- conf/systemd.service | 1 + manifest.json | 3 +- scripts/backup | 5 --- scripts/install | 102 +++---------------------------------------- 6 files changed, 41 insertions(+), 142 deletions(-) diff --git a/README.md b/README.md index 72bf502..f7e33bf 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,13 @@ ![Misskey](https://raw.githubusercontent.com/syuilo/misskey/develop/assets/title.png) -================================================================ # Misskey for YunoHost -[![Integration level](https://dash.yunohost.org/integration/misskey.svg)](https://dash.yunohost.org/appci/app/misskey) ![](https://ci-apps.yunohost.org/ci/badges/misskey.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/misskey.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/misskey.svg)](https://dash.yunohost.org/appci/app/misskey) ![](https://ci-apps.yunohost.org/ci/badges/misskey.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/misskey.maintain.svg) [![Install misskey with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=misskey) - > *This package allows you to install Misskey 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.* -![](https://藍.moe/aiart/31.png) - ## Overview - [Misskey](https://join.misskey.page/en/) is a forever evolving, sophisticated microblogging platform that support Fediverse. It provide another flavour to decentralised network. Why don't you take a short break from the hustle and bustle of the city, and dive into a new Internet? **Shipped version:** 12.47.1 @@ -35,8 +30,8 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in #### Support -LDAP supported : **No** -Can the app be used by multiple users ? : **Yes** + * LDAP supported: **No** + * Can the app be used by multiple users?: **Yes** #### Using *screen* in case of disconnects @@ -70,5 +65,5 @@ To try the testing branch, please proceed like that. ``` sudo yunohost app install https://github.com/YunoHost-Apps/misskey_ynh/tree/testing --debug or -sudo yunohost app upgrade REPLACEBYYOURAPP -u https://github.com/YunoHost-Apps/misskey_ynh/tree/testing --debug +sudo yunohost app upgrade misskey -u https://github.com/YunoHost-Apps/misskey_ynh/tree/testing --debug ``` diff --git a/conf/nginx.conf b/conf/nginx.conf index ab47769..05f1836 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,35 +1,32 @@ location / { - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - - - - # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file - #client_max_body_size 50M; - - - proxy_pass http://127.0.0.1:__PORT__; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto https; - proxy_http_version 1.1; - proxy_redirect off; - - # For WebSocket - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $connection_upgrade; - - # Cache settings - #proxy_cache cache1; - proxy_cache_lock on; - proxy_cache_use_stale updating; - add_header X-Cache $upstream_cache_status; - - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; + # Force usage of https + if ($scheme = http) { + rewrite ^ https://$server_name$request_uri? permanent; } + + # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file + #client_max_body_size 50M; + + proxy_pass http://127.0.0.1:__PORT__; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto https; + proxy_http_version 1.1; + proxy_redirect off; + + # For WebSocket + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + + # Cache settings + #proxy_cache cache1; + proxy_cache_lock on; + proxy_cache_use_stale updating; + add_header X-Cache $upstream_cache_status; + + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; +} diff --git a/conf/systemd.service b/conf/systemd.service index b1791db..2d4101f 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,6 @@ [Unit] Description=__APP__ daemon running + [Service] Type=simple User=__APP__ diff --git a/manifest.json b/manifest.json index 821d126..b366c96 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,8 @@ "id": "misskey", "packaging_format": 1, "description": { - "en": "Microblogging platform" + "en": "Microblogging platform", + "fr": "Microblogging platform" }, "version": "12.47.1~ynh1", "url": "https://join.misskey.page/en/", diff --git a/scripts/backup b/scripts/backup index 38ccd53..9253ced 100755 --- a/scripts/backup +++ b/scripts/backup @@ -37,11 +37,6 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) #================================================= ynh_print_info --message="Declaring files to be backed up..." -### N.B. : the following 'ynh_backup' calls are only a *declaration* of what needs -### to be backuped and not an actual copy of any file. The actual backup that -### creates and fill the archive with the files happens in the core after this -### script is called. Hence ynh_backups calls takes basically 0 seconds to run. - #================================================= # BACKUP THE APP MAIN DIR #================================================= diff --git a/scripts/install b/scripts/install index 4b8e30a..54ccf55 100755 --- a/scripts/install +++ b/scripts/install @@ -29,33 +29,13 @@ domain=$YNH_APP_ARG_DOMAIN path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC -### If it's a multi-instance app, meaning it can be installed several times independently -### The id of the app as stated in the manifest is available as $YNH_APP_ID -### The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2", ...) -### The app instance name is available as $YNH_APP_INSTANCE_NAME -### - the first time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample -### - the second time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample__2 -### - ynhexample__{N} for the subsequent installations, with N=3,4, ... -### The app instance name is probably what interests you most, since this is -### guaranteed to be unique. This is a good unique identifier to define installation path, -### db names, ... app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -### About --weight and --time -### ynh_script_progression will show to your final users the progression of each scripts. -### In order to do that, --weight will represent the relative time of execution compared to the other steps in the script. -### --time is a packager option, it will show you the execution time since the previous call. -### This option should be removed before releasing your app. -### Use the execution time, given by --time, to estimate the weight of a step. -### A common way to do it is to set a weight equal to the execution time in second +1. -### The execution time is given for the duration since the previous call. So the weight should be applied to this previous call. ynh_script_progression --message="Validating installation parameters..." -### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". -### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app" final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -71,7 +51,6 @@ 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=is_public --value=$is_public - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -79,37 +58,19 @@ ynh_app_setting_set --app=$app --key=is_public --value=$is_public #================================================= ynh_script_progression --message="Configuring firewall..." -### Use these lines if you have to open a port for the application -### `ynh_find_port` will find the first available port starting from the given port. -### If you're not using these lines: -### - Remove the section "CLOSE A PORT" in the remove script - # Find an available port port=$(ynh_find_port --port=3020) ynh_app_setting_set --app=$app --key=port --value=$port -# Optional: Expose this port publicly -# (N.B. : you only need to do this if the app actually needs to expose the port publicly. -# If you do this and the app doesn't actually need you are CREATING SECURITY HOLES IN THE SERVER !) - -# Open the port -# ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port - #================================================= # INSTALL DEPENDENCIES #================================================= ynh_script_progression --message="Installing dependencies..." -### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package. -### Those deb packages will be installed as dependencies of this package. -### If you're not using this helper: -### - Remove the section "REMOVE DEPENDENCIES" in the remove script -### - Remove the variable "pkg_dependencies" in _common.sh -### - As well as the section "REINSTALL DEPENDENCIES" in the restore script -### - And the section "UPGRADE DEPENDENCIES" in the upgrade script - ynh_install_nodejs --nodejs_version=$NODEJS_VERSION + ynh_install_app_dependencies $pkg_dependencies + ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= @@ -132,10 +93,6 @@ ynh_psql_execute_as_root --sql="ALTER USER $db_user CREATEDB;" #================================================= ynh_script_progression --message="Setting up source files..." -### `ynh_setup_source` is used to install an app from a zip or tar.gz file, -### downloaded from an upstream source, like a git repository. -### `ynh_setup_source` use the file conf/app.src - ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" @@ -188,17 +145,6 @@ ynh_system_user_create --username=$app #================================================= ynh_script_progression --message="Configuring a systemd service..." -### `ynh_systemd_config` is used to configure a systemd script for an app. -### It can be used for apps that use sysvinit (with adaptation) or systemd. -### Have a look at the app to be sure this app needs a systemd script. -### `ynh_systemd_config` will use the file conf/systemd.service -### If you're not using these lines: -### - You can remove those files in conf/. -### - Remove the section "BACKUP SYSTEMD" in the backup script -### - Remove also the section "STOP AND REMOVE SERVICE" in the remove script -### - As well as the section "RESTORE SYSTEMD" in the restore script -### - And the section "SETUP SYSTEMD" in the upgrade script - # Create a dedicated systemd config ynh_add_systemd_config @@ -242,10 +188,6 @@ popd # STORE THE CONFIG FILE CHECKSUM #================================================= -### `ynh_store_file_checksum` is used to store the checksum of a file. -### That way, during the upgrade script, by using `ynh_backup_if_checksum_is_different`, -### you can make a backup of this file before modifying it again if the admin had modified it. - # Calculate and store the config file checksum into the app settings ynh_store_file_checksum --file="$config" @@ -255,57 +197,25 @@ ynh_store_file_checksum --file="$config" # SECURE FILES AND DIRECTORIES #================================================= -### For security reason, any app should set the permissions to root: before anything else. -### Then, if write authorization is needed, any access should be given only to directories -### that really need such authorization. - # Set permissions to app files chown -R $app: $final_path -### Additional options starting with 3.8: -### -### --needs_exposed_ports "$port" a list of ports that needs to be publicly exposed -### which will then be checked by YunoHost's diagnosis system -### (N.B. DO NOT USE THIS is the port is only internal !!!) -### -### --test_status "some command" a custom command to check the status of the service -### (only relevant if 'systemctl status' doesn't do a good job) -### -### --test_conf "some command" some command similar to "nginx -t" that validates the conf of the service -### -### Re-calling 'yunohost service add' during the upgrade script is the right way -### to proceed if you later realize that you need to enable some flags that -### weren't enabled on old installs (be careful it'll override the existing -### service though so you should re-provide all relevant flags when doing so) -### - #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." -### `ynh_systemd_action` is used to start a systemd service for an app. -### Only needed if you have configure a systemd service -### If you're not using these lines: -### - Remove the section "STOP SYSTEMD SERVICE" and "START SYSTEMD SERVICE" in the backup script -### - As well as the section "START SYSTEMD SERVICE" in the restore script -### - As well as the section"STOP SYSTEMD SERVICE" and "START SYSTEMD SERVICE" in the upgrade script -### - And the section "STOP SYSTEMD SERVICE" and "START SYSTEMD SERVICE" in the change_url script - # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="All workers started" - - +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="All workers started" #================================================= # SETUP SSOWAT #================================================= ynh_script_progression --message="Configuring SSOwat..." -# 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="/" + ynh_permission_update --permission "main" --add "visitors" fi #================================================= @@ -319,4 +229,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" \ No newline at end of file +ynh_script_progression --message="Installation of $app completed" From 0895d1a43f8377ccc9fc25d5adfa8923d3d39a50 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 11 Jan 2021 21:19:18 +0100 Subject: [PATCH 03/22] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index f7e33bf..ac592d4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -![Misskey](https://raw.githubusercontent.com/syuilo/misskey/develop/assets/title.png) # Misskey for YunoHost [![Integration level](https://dash.yunohost.org/integration/misskey.svg)](https://dash.yunohost.org/appci/app/misskey) ![](https://ci-apps.yunohost.org/ci/badges/misskey.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/misskey.maintain.svg) From d180a4063f91c58db24c5d3b0604fc4d0952a60b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 11 Jan 2021 21:44:02 +0100 Subject: [PATCH 04/22] Fix --- README.md | 2 +- conf/app.src | 4 +- conf/systemd.service | 4 +- manifest.json | 2 +- scripts/_common.sh | 96 +++++++++++++++++++++++++++++++++++++++++++- scripts/backup | 5 --- scripts/install | 79 +++++++++++++----------------------- scripts/remove | 12 ------ scripts/restore | 19 +++++---- scripts/upgrade | 16 +++++--- scripts/ynh_add_swap | 93 ------------------------------------------ 11 files changed, 151 insertions(+), 181 deletions(-) delete mode 100644 scripts/ynh_add_swap diff --git a/README.md b/README.md index ac592d4..ae85039 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview [Misskey](https://join.misskey.page/en/) is a forever evolving, sophisticated microblogging platform that support Fediverse. It provide another flavour to decentralised network. Why don't you take a short break from the hustle and bustle of the city, and dive into a new Internet? -**Shipped version:** 12.47.1 +**Shipped version:** 12.66.0 ## Screenshots diff --git a/conf/app.src b/conf/app.src index 0bcd834..bd824a3 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/syuilo/misskey/archive/12.47.1.tar.gz -SOURCE_SUM=59154273ae1f20187cc69689f4c03eb230c2d3a47e830affb0aaa57b71c49b0b +SOURCE_URL=https://github.com/syuilo/misskey/archive/12.66.0.tar.gz +SOURCE_SUM=bdba1e3c1fd0de1044df068464850c3230c9c7218d8a691493602ab8b5f80f5c SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/systemd.service b/conf/systemd.service index 2d4101f..51357a2 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -4,9 +4,11 @@ Description=__APP__ daemon running [Service] Type=simple User=__APP__ -ExecStart=/usr/local/bin/npm start +Group=__APP__ WorkingDirectory=__FINALPATH__ +Environment="PATH=__ENV_PATH__" Environment="NODE_ENV=production" +ExecStart=__YNH_NPM__ start TimeoutSec=60 StandardOutput=syslog StandardError=syslog diff --git a/manifest.json b/manifest.json index b366c96..68670da 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Microblogging platform", "fr": "Microblogging platform" }, - "version": "12.47.1~ynh1", + "version": "12.66.0~ynh1", "url": "https://join.misskey.page/en/", "license": "AGPL-3.0-or-later", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 0ad4945..5fa2131 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,7 +9,7 @@ MEMORY_NEEDED="2560" # dependencies used by the app pkg_dependencies=" build-essential python ffmpeg redis-server redis-tools postgresql postgresql-contrib" -NODEJS_VERSION="12" +nodejs_version=12 #================================================= # PERSONAL HELPERS @@ -22,3 +22,97 @@ NODEJS_VERSION="12" #================================================= # FUTURE OFFICIAL HELPERS #================================================= + +#!/bin/bash + +# Add swap +# +# usage: ynh_add_swap --size=SWAP in Mb +# | arg: -s, --size= - Amount of SWAP to add in Mb. +ynh_add_swap () { + # Declare an array to define the options of this helper. + declare -Ar args_array=( [s]=size= ) + local size + # Manage arguments with getopts + ynh_handle_getopts_args "$@" + + local swap_max_size=$(( $size * 1024 )) + + local free_space=$(df --output=avail / | sed 1d) + # Because we don't want to fill the disk with a swap file, divide by 2 the available space. + local usable_space=$(( $free_space / 2 )) + + SD_CARD_CAN_SWAP=${SD_CARD_CAN_SWAP:-0} + + # Swap on SD card only if it's is specified + if ynh_is_main_device_a_sd_card && [ "$SD_CARD_CAN_SWAP" == "0" ] + then + ynh_print_warn --message="The main mountpoint of your system '/' is on an SD card, swap will not be added to prevent some damage of this one, but that can cause troubles for the app $app. If you still want activate the swap, you can relaunch the command preceded by 'SD_CARD_CAN_SWAP=1'" + return + fi + + # Compare the available space with the size of the swap. + # And set a acceptable size from the request + if [ $usable_space -ge $swap_max_size ] + then + local swap_size=$swap_max_size + elif [ $usable_space -ge $(( $swap_max_size / 2 )) ] + then + local swap_size=$(( $swap_max_size / 2 )) + elif [ $usable_space -ge $(( $swap_max_size / 3 )) ] + then + local swap_size=$(( $swap_max_size / 3 )) + elif [ $usable_space -ge $(( $swap_max_size / 4 )) ] + then + local swap_size=$(( $swap_max_size / 4 )) + else + echo "Not enough space left for a swap file" >&2 + local swap_size=0 + fi + + # If there's enough space for a swap, and no existing swap here + if [ $swap_size -ne 0 ] && [ ! -e /swap_$app ] + then + # Preallocate space for the swap file, fallocate may sometime not be used, use dd instead in this case + if ! fallocate -l ${swap_size}K /swap_$app + then + dd if=/dev/zero of=/swap_$app bs=1024 count=${swap_size} + fi + chmod 0600 /swap_$app + # Create the swap + mkswap /swap_$app + # And activate it + swapon /swap_$app + # Then add an entry in fstab to load this swap at each boot. + echo -e "/swap_$app swap swap defaults 0 0 #Swap added by $app" >> /etc/fstab + fi +} + +ynh_del_swap () { + # If there a swap at this place + if [ -e /swap_$app ] + then + # Clean the fstab + sed -i "/#Swap added by $app/d" /etc/fstab + # Desactive the swap file + swapoff /swap_$app + # And remove it + rm /swap_$app + fi +} + +# Check if the device of the main mountpoint "/" is an SD card +# +# [internal] +# +# return 0 if it's an SD card, else 1 +ynh_is_main_device_a_sd_card () { + local main_device=$(lsblk --output PKNAME --noheadings $(findmnt / --nofsroot --uniq --output source --noheadings --first-only)) + + if echo $main_device | grep --quiet "mmc" && [ $(tail -n1 /sys/block/$main_device/queue/rotational) == "0" ] + then + return 0 + else + return 1 + fi +} \ No newline at end of file diff --git a/scripts/backup b/scripts/backup index 9253ced..a64c9b1 100755 --- a/scripts/backup +++ b/scripts/backup @@ -49,17 +49,12 @@ ynh_backup --src_path="$final_path" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= - #================================================= # BACKUP SYSTEMD #================================================= ynh_backup --src_path="/etc/systemd/system/$app.service" - #================================================= # BACKUP THE POSTGRESQL DATABASE #================================================= diff --git a/scripts/install b/scripts/install index 54ccf55..64397aa 100755 --- a/scripts/install +++ b/scripts/install @@ -8,7 +8,6 @@ source _common.sh source /usr/share/yunohost/helpers -source ynh_add_swap #================================================= # MANAGE SCRIPT FAILURE @@ -67,9 +66,9 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= ynh_script_progression --message="Installing dependencies..." -ynh_install_nodejs --nodejs_version=$NODEJS_VERSION +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" @@ -79,8 +78,8 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st ynh_script_progression --message="Creating a POSTGRESQL database..." # Create postgresql database -db_name="${app}" -db_user=$app +db_name=$(ynh_sanitize_dbid --db_name=$app) +db_user=$db_name db_pwd=$(ynh_string_random --length=8) ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd @@ -123,7 +122,7 @@ ynh_script_progression --message="Configuring nginx web server..." ### `ynh_add_nginx_config` will use the file conf/nginx.conf # Create a dedicated nginx config -ynh_add_nginx_config 'port' +ynh_add_nginx_config #================================================= # CREATE DEDICATED USER @@ -133,56 +132,17 @@ ynh_script_progression --message="Configuring system user..." # Create a system user ynh_system_user_create --username=$app - -#================================================= -# SPECIFIC SETUP -#================================================= -# ... -#================================================= - -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." - -# Create a dedicated systemd config -ynh_add_systemd_config - - -# Set right permissions for curl install -chown -R $app: $final_path - - -# Remove the public access -if [ $is_public -eq 0 ] -then - ynh_app_setting_delete --app=$app --key=skipped_uris -fi - #================================================= # MODIFY A CONFIG FILE #================================================= -### `ynh_replace_string` is used to replace a string in a file. -### (It's compatible with sed regular expressions syntax) +cp -f ../conf/default.yml "$final_path/.config/default.yml" -config="$final_path/.config/default.yml" -cp -f ../conf/default.yml "$config" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$app" --target_file="$config" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config" - - -#================================================= -# INSTALLING MISKKEY -#================================================= -pushd "$final_path" - yarn add ts-node webpack - NODE_ENV=production yarn build - yarn run init -popd +ynh_replace_string --match_string="__DB_USER__" --replace_string="$app" --target_file="$final_path/.config/default.yml" +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/.config/default.yml" +ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/.config/default.yml" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/.config/default.yml" +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/.config/default.yml" #================================================= # STORE THE CONFIG FILE CHECKSUM @@ -191,6 +151,16 @@ popd # Calculate and store the config file checksum into the app settings ynh_store_file_checksum --file="$config" +#================================================= +# INSTALLING MISKKEY +#================================================= + +pushd "$final_path" + ynh_exec_warn_lessyarn add ts-node webpack + ynh_exec_warn_less NODE_ENV=production yarn build + ynh_exec_warn_less yarn run init +popd + #================================================= # GENERIC FINALIZATION #================================================= @@ -200,6 +170,13 @@ ynh_store_file_checksum --file="$config" # Set permissions to app files chown -R $app: $final_path +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 + +yunohost service add $app --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log" + #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index 2be780a..1a9cc3b 100755 --- a/scripts/remove +++ b/scripts/remove @@ -8,7 +8,6 @@ source _common.sh source /usr/share/yunohost/helpers -source ynh_add_swap #================================================= # LOAD SETTINGS @@ -77,20 +76,9 @@ ynh_script_progression --message="Removing nginx web server configuration..." -- # Remove the dedicated nginx config ynh_remove_nginx_config - # Remove swap ynh_del_swap -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - #================================================= # SPECIFIC REMOVE #================================================= diff --git a/scripts/restore b/scripts/restore index 3155710..727741e 100755 --- a/scripts/restore +++ b/scripts/restore @@ -9,7 +9,6 @@ #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 -source ../settings/scripts/ynh_add_swap #================================================= # MANAGE SCRIPT FAILURE @@ -49,7 +48,10 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS #================================================= +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR @@ -88,7 +90,6 @@ if [ $total_memory -lt $MEMORY_NEEDED ]; then swap_needed=$(($MEMORY_NEEDED - $total_memory)) fi - #================================================= # SPECIFIC RESTORATION #================================================= @@ -97,8 +98,10 @@ fi ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies -ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies + ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" @@ -115,25 +118,26 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" #================================================= # INSTALLING MISKKEY #================================================= + pushd "$final_path" yarn add ts-node webpack NODE_ENV=production yarn build popd - #================================================= # RESTORE SYSTEMD #================================================= ynh_script_progression --message="Restoring the systemd configuration..." + ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service +systemctl enable $app.service --quiet #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "A short description of the app" --log "systemd" --line_match="All workers started" +yunohost service add $app --description "A interplanetary blogging platform" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE @@ -142,7 +146,6 @@ ynh_script_progression --message="Starting a systemd service..." ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="All workers started" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 6b34a64..eb19f38 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -8,7 +8,6 @@ source _common.sh source /usr/share/yunohost/helpers -source ynh_add_swap #================================================= # LOAD SETTINGS @@ -105,8 +104,10 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Upgrading dependencies..." -ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies + ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= @@ -149,11 +150,14 @@ ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_f #================================================= # Updating process MISSKEY #================================================= + pushd "$final_path" - yarn add ts-node webpack - NODE_ENV=production yarn build + ynh_exec_warn_lessyarn add ts-node webpack + ynh_exec_warn_less NODE_ENV=production yarn build + ynh_exec_warn_less yarn run init popd + #================================================= # SETUP SYSTEMD #================================================= @@ -188,7 +192,7 @@ chown -R $app: $final_path #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app service" ---log_type "systemd" +yunohost service add $app --description "A interplanetary blogging platform" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/ynh_add_swap b/scripts/ynh_add_swap deleted file mode 100644 index 2fd2d8c..0000000 --- a/scripts/ynh_add_swap +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash - -# Add swap -# -# usage: ynh_add_swap --size=SWAP in Mb -# | arg: -s, --size= - Amount of SWAP to add in Mb. -ynh_add_swap () { - # Declare an array to define the options of this helper. - declare -Ar args_array=( [s]=size= ) - local size - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - - local swap_max_size=$(( $size * 1024 )) - - local free_space=$(df --output=avail / | sed 1d) - # Because we don't want to fill the disk with a swap file, divide by 2 the available space. - local usable_space=$(( $free_space / 2 )) - - SD_CARD_CAN_SWAP=${SD_CARD_CAN_SWAP:-0} - - # Swap on SD card only if it's is specified - if ynh_is_main_device_a_sd_card && [ "$SD_CARD_CAN_SWAP" == "0" ] - then - ynh_print_warn --message="The main mountpoint of your system '/' is on an SD card, swap will not be added to prevent some damage of this one, but that can cause troubles for the app $app. If you still want activate the swap, you can relaunch the command preceded by 'SD_CARD_CAN_SWAP=1'" - return - fi - - # Compare the available space with the size of the swap. - # And set a acceptable size from the request - if [ $usable_space -ge $swap_max_size ] - then - local swap_size=$swap_max_size - elif [ $usable_space -ge $(( $swap_max_size / 2 )) ] - then - local swap_size=$(( $swap_max_size / 2 )) - elif [ $usable_space -ge $(( $swap_max_size / 3 )) ] - then - local swap_size=$(( $swap_max_size / 3 )) - elif [ $usable_space -ge $(( $swap_max_size / 4 )) ] - then - local swap_size=$(( $swap_max_size / 4 )) - else - echo "Not enough space left for a swap file" >&2 - local swap_size=0 - fi - - # If there's enough space for a swap, and no existing swap here - if [ $swap_size -ne 0 ] && [ ! -e /swap_$app ] - then - # Preallocate space for the swap file, fallocate may sometime not be used, use dd instead in this case - if ! fallocate -l ${swap_size}K /swap_$app - then - dd if=/dev/zero of=/swap_$app bs=1024 count=${swap_size} - fi - chmod 0600 /swap_$app - # Create the swap - mkswap /swap_$app - # And activate it - swapon /swap_$app - # Then add an entry in fstab to load this swap at each boot. - echo -e "/swap_$app swap swap defaults 0 0 #Swap added by $app" >> /etc/fstab - fi -} - -ynh_del_swap () { - # If there a swap at this place - if [ -e /swap_$app ] - then - # Clean the fstab - sed -i "/#Swap added by $app/d" /etc/fstab - # Desactive the swap file - swapoff /swap_$app - # And remove it - rm /swap_$app - fi -} - -# Check if the device of the main mountpoint "/" is an SD card -# -# [internal] -# -# return 0 if it's an SD card, else 1 -ynh_is_main_device_a_sd_card () { - local main_device=$(lsblk --output PKNAME --noheadings $(findmnt / --nofsroot --uniq --output source --noheadings --first-only)) - - if echo $main_device | grep --quiet "mmc" && [ $(tail -n1 /sys/block/$main_device/queue/rotational) == "0" ] - then - return 0 - else - return 1 - fi -} \ No newline at end of file From 6c40efb59643e82a99a8097fa1505d45e421229d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 11 Jan 2021 21:51:57 +0100 Subject: [PATCH 05/22] fix --- manifest.json | 4 ++++ scripts/install | 22 +++++++++++----------- scripts/restore | 2 +- scripts/upgrade | 2 +- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/manifest.json b/manifest.json index 68670da..a8fe4c5 100644 --- a/manifest.json +++ b/manifest.json @@ -35,6 +35,10 @@ "en": "Is it a public application?", "fr": "Est-ce une application publique ?" }, + "help": { + "en": "If enabled, Misskey will be accessible by people who do not have an account. This can be changed later via the webadmin.", + "fr": "Si cette case est cochée, Misskey sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." + }, "default": true } ] diff --git a/scripts/install b/scripts/install index 64397aa..ef5ab4f 100755 --- a/scripts/install +++ b/scripts/install @@ -55,7 +55,7 @@ ynh_app_setting_set --app=$app --key=is_public --value=$is_public #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Configuring firewall..." +ynh_script_progression --message="Finding an available port..." # Find an available port port=$(ynh_find_port --port=3020) @@ -101,18 +101,18 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # ADD SWAP IF NEEDED #================================================= -ynh_script_progression --message="Adding swap is needed..." +# ynh_script_progression --message="Adding swap is needed..." -total_memory=$(ynh_get_ram --total) -swap_needed=0 +# total_memory=$(ynh_get_ram --total) +# swap_needed=0 -if [ $total_memory -lt $MEMORY_NEEDED ]; then - # Need a minimum of 2.5Go of memory - swap_needed=$(($MEMORY_NEEDED - $total_memory)) -fi +# if [ $total_memory -lt $MEMORY_NEEDED ]; then +# # Need a minimum of 2.5Go of memory +# swap_needed=$(($MEMORY_NEEDED - $total_memory)) +# fi -ynh_script_progression --message="Adding $swap_needed Mo to swap..." -ynh_add_swap --size=$swap_needed +# ynh_script_progression --message="Adding $swap_needed Mo to swap..." +# ynh_add_swap --size=$swap_needed #================================================= # NGINX CONFIGURATION @@ -149,7 +149,7 @@ ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_f #================================================= # Calculate and store the config file checksum into the app settings -ynh_store_file_checksum --file="$config" +ynh_store_file_checksum --file="$final_path/.config/default.yml" #================================================= # INSTALLING MISKKEY diff --git a/scripts/restore b/scripts/restore index 727741e..951c0a0 100755 --- a/scripts/restore +++ b/scripts/restore @@ -137,7 +137,7 @@ systemctl enable $app.service --quiet #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "A interplanetary blogging platform" --log="/var/log/$app/$app.log" +yunohost service add $app --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index eb19f38..ce7dea0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -192,7 +192,7 @@ chown -R $app: $final_path #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "A interplanetary blogging platform" --log="/var/log/$app/$app.log" +yunohost service add $app --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE From 655608b1ccce08e5e2ec75396f32b6f8ca39d14c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 11 Jan 2021 21:55:40 +0100 Subject: [PATCH 06/22] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index ef5ab4f..c60b8e0 100755 --- a/scripts/install +++ b/scripts/install @@ -156,7 +156,7 @@ ynh_store_file_checksum --file="$final_path/.config/default.yml" #================================================= pushd "$final_path" - ynh_exec_warn_lessyarn add ts-node webpack + ynh_exec_warn_less yarn add ts-node webpack ynh_exec_warn_less NODE_ENV=production yarn build ynh_exec_warn_less yarn run init popd From 1a883d40d58a7c97bbc8f950045517072404a43b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 15 Feb 2021 23:38:17 +0100 Subject: [PATCH 07/22] Fix --- README.md | 2 +- conf/app.src | 4 ++-- conf/nginx.conf | 2 -- manifest.json | 6 +++--- pull_request_template.md | 4 +--- scripts/_common.sh | 4 ++-- scripts/install | 41 +++++++++++++++++----------------------- scripts/restore | 21 ++++++++++---------- scripts/upgrade | 34 +++++++++++++++++---------------- 9 files changed, 54 insertions(+), 64 deletions(-) diff --git a/README.md b/README.md index ae85039..d62e09e 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview [Misskey](https://join.misskey.page/en/) is a forever evolving, sophisticated microblogging platform that support Fediverse. It provide another flavour to decentralised network. Why don't you take a short break from the hustle and bustle of the city, and dive into a new Internet? -**Shipped version:** 12.66.0 +**Shipped version:** 12.69.0 ## Screenshots diff --git a/conf/app.src b/conf/app.src index bd824a3..44fb126 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/syuilo/misskey/archive/12.66.0.tar.gz -SOURCE_SUM=bdba1e3c1fd0de1044df068464850c3230c9c7218d8a691493602ab8b5f80f5c +SOURCE_URL=https://github.com/syuilo/misskey/archive/12.69.0.tar.gz +SOURCE_SUM=9cc9b284dee849ad6f4570204263fc8b949a975f0b230047fe08a7e35b804f73 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/nginx.conf b/conf/nginx.conf index 05f1836..216e7dd 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,3 @@ - location / { # Force usage of https @@ -6,7 +5,6 @@ location / { rewrite ^ https://$server_name$request_uri? permanent; } - # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file #client_max_body_size 50M; proxy_pass http://127.0.0.1:__PORT__; diff --git a/manifest.json b/manifest.json index a8fe4c5..46efca9 100644 --- a/manifest.json +++ b/manifest.json @@ -4,16 +4,16 @@ "packaging_format": 1, "description": { "en": "Microblogging platform", - "fr": "Microblogging platform" + "fr": "Platforme de Microblogging" }, - "version": "12.66.0~ynh1", + "version": "12.69.0~ynh1", "url": "https://join.misskey.page/en/", "license": "AGPL-3.0-or-later", "maintainer": { "name": "Anmol" }, "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.0.0" }, "multi_instance": true, "services": ["nginx"], diff --git a/pull_request_template.md b/pull_request_template.md index 5d5c08b..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/misskey_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/misskey_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 5fa2131..e33d6ad 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,9 +7,9 @@ MEMORY_NEEDED="2560" # dependencies used by the app -pkg_dependencies=" build-essential python ffmpeg redis-server redis-tools postgresql postgresql-contrib" +pkg_dependencies="build-essential python ffmpeg redis-server redis-tools postgresql postgresql-contrib" -nodejs_version=12 +NODEJS_VERSION="12" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index c60b8e0..ac4d408 100755 --- a/scripts/install +++ b/scripts/install @@ -66,10 +66,11 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= ynh_script_progression --message="Installing dependencies..." -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies $pkg_dependencies +curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= @@ -79,13 +80,9 @@ ynh_script_progression --message="Creating a POSTGRESQL database..." # Create postgresql database db_name=$(ynh_sanitize_dbid --db_name=$app) -db_user=$db_name -db_pwd=$(ynh_string_random --length=8) ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd ynh_psql_test_if_first_run -ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd -ynh_psql_execute_as_root --sql="ALTER USER $db_user CREATEDB;" +ynh_psql_setup_db --db_user=$db_name --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -117,9 +114,7 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." - -### `ynh_add_nginx_config` will use the file conf/nginx.conf +ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated nginx config ynh_add_nginx_config @@ -133,22 +128,19 @@ ynh_script_progression --message="Configuring system user..." ynh_system_user_create --username=$app #================================================= -# MODIFY A CONFIG FILE +# SETUP SYSTEMD #================================================= +ynh_script_progression --message="Configuring a systemd service..." -cp -f ../conf/default.yml "$final_path/.config/default.yml" - -ynh_replace_string --match_string="__DB_USER__" --replace_string="$app" --target_file="$final_path/.config/default.yml" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/.config/default.yml" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/.config/default.yml" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/.config/default.yml" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/.config/default.yml" +# Create a dedicated systemd config +ynh_add_systemd_config #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= -# Calculate and store the config file checksum into the app settings +ynh_add_config --template="../conf/default.yml" --destination="$final_path/.config/default.yml" + ynh_store_file_checksum --file="$final_path/.config/default.yml" #================================================= @@ -173,7 +165,7 @@ chown -R $app: $final_path #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1 +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log" @@ -183,22 +175,23 @@ yunohost service add $app --description="A interplanetary blogging platform" --l ynh_script_progression --message="Starting a systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="All workers started" +ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="All workers started" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring permissions..." --weight=1 +# Make app public if necessary if [ $is_public -eq 1 ] then - ynh_permission_update --permission "main" --add "visitors" + ynh_permission_update --permission="main" --add="visitors" fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/restore b/scripts/restore index 951c0a0..5d58a93 100755 --- a/scripts/restore +++ b/scripts/restore @@ -45,7 +45,6 @@ ynh_webpath_available --domain=$domain --path_url=$path_url \ test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " -#================================================= # STANDARD RESTORATION STEPS #================================================= # RESTORE THE NGINX CONFIGURATION @@ -98,13 +97,12 @@ fi ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies $pkg_dependencies ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" - #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= @@ -112,7 +110,6 @@ ynh_script_progression --message="Restoring the PostgreSQL database..." ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd -ynh_psql_execute_as_root --sql="ALTER USER $db_user CREATEDB;" ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" #================================================= @@ -144,15 +141,17 @@ yunohost service add $app --description="A interplanetary blogging platform" --l #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="All workers started" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="All workers started" + +#================================================= +# RELOAD NGINX AND PHP-FPM +#================================================= +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 + +ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -#=============================================== -# RESTORE THE NGINX CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_script_progression --message="Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index ce7dea0..5fed64a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,8 +21,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) 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) - -db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) +db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) #================================================= # CHECK VERSION @@ -56,6 +55,13 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path 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 + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -77,7 +83,7 @@ ynh_abort_if_errors #================================================= ynh_script_progression --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped" +ynh_systemd_action --service_name=$app --action=stop --log_path=systemd --line_match="Stopped" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -104,16 +110,18 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Upgrading dependencies..." -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies $pkg_dependencies +curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= # 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 @@ -139,13 +147,9 @@ ynh_add_swap --size=$swap_needed # SPECIFIC UPGRADE #================================================= -config="$final_path/.config/default.yml" -cp -f ../conf/default.yml "$config" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$app" --target_file="$config" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config" +ynh_add_config --template="../conf/default.yml" --destination="$final_path/.config/default.yml" + +ynh_store_file_checksum --file="$final_path/.config/default.yml" #================================================= # Updating process MISSKEY @@ -157,11 +161,11 @@ pushd "$final_path" ynh_exec_warn_less yarn run init popd - #================================================= # SETUP SYSTEMD #================================================= ynh_script_progression --message="Upgrading systemd configuration..." + # Create a dedicated systemd config ynh_add_systemd_config @@ -169,8 +173,6 @@ ynh_add_systemd_config # MODIFY A CONFIG FILE #================================================= -### 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 --file="$config" ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$final_path/.config/default.yml.backup" @@ -199,7 +201,7 @@ yunohost service add $app --description="A interplanetary blogging platform" --l #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="All workers started" +ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="All workers started" #================================================= # RELOAD NGINX From b05cedd565131630cac002f7ee3edae528b8afa6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 10 Mar 2021 23:52:38 +0100 Subject: [PATCH 08/22] Fix linter --- scripts/install | 1 - scripts/upgrade | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/scripts/install b/scripts/install index ac4d408..e5143f2 100755 --- a/scripts/install +++ b/scripts/install @@ -48,7 +48,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=is_public --value=$is_public #================================================= # STANDARD MODIFICATIONS diff --git a/scripts/upgrade b/scripts/upgrade index 5fed64a..8931984 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,7 +18,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) -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) db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) @@ -34,15 +33,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) From a8d0b5f86cd45336fb546df075f08140e7d52190 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 15 May 2021 17:46:44 +0200 Subject: [PATCH 09/22] Fix --- manifest.json | 10 +--------- scripts/install | 2 -- scripts/upgrade | 31 +++++++++---------------------- 3 files changed, 10 insertions(+), 33 deletions(-) diff --git a/manifest.json b/manifest.json index 46efca9..c38c28c 100644 --- a/manifest.json +++ b/manifest.json @@ -13,7 +13,7 @@ "name": "Anmol" }, "requirements": { - "yunohost": ">= 4.0.0" + "yunohost": ">= 4.2.4" }, "multi_instance": true, "services": ["nginx"], @@ -22,19 +22,11 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for Misskey", - "fr": "Choisissez un nom de domaine pour Misskey" - }, "example": "example.com" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "help": { "en": "If enabled, Misskey will be accessible by people who do not have an account. This can be changed later via the webadmin.", "fr": "Si cette case est cochée, Misskey sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." diff --git a/scripts/install b/scripts/install index e5143f2..299263e 100755 --- a/scripts/install +++ b/scripts/install @@ -140,8 +140,6 @@ ynh_add_systemd_config ynh_add_config --template="../conf/default.yml" --destination="$final_path/.config/default.yml" -ynh_store_file_checksum --file="$final_path/.config/default.yml" - #================================================= # INSTALLING MISKKEY #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8931984..0d1fc9a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -120,18 +120,18 @@ ynh_system_user_create --username=$app #================================================= # ADD SWAP IF NEEDED #================================================= -ynh_script_progression --message="Adding swap if needed..." +# ynh_script_progression --message="Adding swap if needed..." -total_memory=$(ynh_get_ram --total) -swap_needed=0 +# total_memory=$(ynh_get_ram --total) +# swap_needed=0 -if [ $total_memory -lt $MEMORY_NEEDED ]; then - # Need a minimum of 8Go of memory - swap_needed=$(($MEMORY_NEEDED - $total_memory)) -fi +# if [ $total_memory -lt $MEMORY_NEEDED ]; then +# # Need a minimum of 8Go of memory +# swap_needed=$(($MEMORY_NEEDED - $total_memory)) +# fi -ynh_script_progression --message="Adding $swap_needed Mo to swap..." -ynh_add_swap --size=$swap_needed +# ynh_script_progression --message="Adding $swap_needed Mo to swap..." +# ynh_add_swap --size=$swap_needed #================================================= # SPECIFIC UPGRADE @@ -139,8 +139,6 @@ ynh_add_swap --size=$swap_needed ynh_add_config --template="../conf/default.yml" --destination="$final_path/.config/default.yml" -ynh_store_file_checksum --file="$final_path/.config/default.yml" - #================================================= # Updating process MISSKEY #================================================= @@ -159,17 +157,6 @@ ynh_script_progression --message="Upgrading systemd configuration..." # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# MODIFY A CONFIG FILE -#================================================= - -ynh_backup_if_checksum_is_different --file="$config" - -ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$final_path/.config/default.yml.backup" - -# Recalculate and store the checksum of the file for the next upgrade. -ynh_store_file_checksum --file="$config" - #================================================= # GENERIC FINALIZATION #================================================= From fb76a95446f08931269fd19f7f33988380020e09 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 15 May 2021 17:55:43 +0200 Subject: [PATCH 10/22] Update install --- scripts/install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index 299263e..15194b1 100755 --- a/scripts/install +++ b/scripts/install @@ -131,6 +131,9 @@ ynh_system_user_create --username=$app #================================================= ynh_script_progression --message="Configuring a systemd service..." +ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" +ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service" + # Create a dedicated systemd config ynh_add_systemd_config From 3d89521b905621888ef61b20cc955369a1a67e01 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 15 May 2021 18:03:14 +0200 Subject: [PATCH 11/22] Fix --- conf/default.yml | 4 ++-- scripts/install | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/default.yml b/conf/default.yml index 5e7b32b..bf55dca 100644 --- a/conf/default.yml +++ b/conf/default.yml @@ -62,7 +62,7 @@ db: db: __DB_NAME__ # Auth - user: __DB_USER__ + user: __DB_NAME__ pass: __DB_PWD__ # Whether disable Caching queries @@ -139,7 +139,7 @@ id: "aid" # port: 514 # Proxy for HTTP/HTTPS -#proxy: http://127.0.0.1:3128 +proxy: http://127.0.0.1:__PORT__ #proxyBypassHosts: [ # 'example.com', diff --git a/scripts/install b/scripts/install index 15194b1..aa425da 100755 --- a/scripts/install +++ b/scripts/install @@ -67,7 +67,7 @@ ynh_script_progression --message="Installing dependencies..." ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" From a4906b099362b8ab6dcc667a33f6e1f13625a47f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 15 May 2021 18:05:32 +0200 Subject: [PATCH 12/22] fix --- conf/systemd.service | 2 +- scripts/install | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 51357a2..162feb4 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,7 +6,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__ -Environment="PATH=__ENV_PATH__" +Environment=__YNH_NODE_LOAD_PATH__ Environment="NODE_ENV=production" ExecStart=__YNH_NPM__ start TimeoutSec=60 diff --git a/scripts/install b/scripts/install index aa425da..49f3079 100755 --- a/scripts/install +++ b/scripts/install @@ -131,9 +131,6 @@ ynh_system_user_create --username=$app #================================================= ynh_script_progression --message="Configuring a systemd service..." -ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" -ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service" - # Create a dedicated systemd config ynh_add_systemd_config From 41121d761210c9aa05c232c3809c5dd0ce6f73b9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 15 May 2021 18:17:31 +0200 Subject: [PATCH 13/22] Fix --- scripts/install | 21 +++++++++++---------- scripts/upgrade | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/install b/scripts/install index 49f3079..8954a19 100755 --- a/scripts/install +++ b/scripts/install @@ -83,6 +83,14 @@ ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_name --db_name=$db_name +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=2 + +# Create a system user +ynh_system_user_create --username=$app + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -113,23 +121,15 @@ ynh_setup_source --dest_dir="$final_path" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." +ynh_script_progression --message="Configuring NGINX web server..." --weight=3 # Create a dedicated nginx config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." - -# Create a system user -ynh_system_user_create --username=$app - #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." +ynh_script_progression --message="Configuring a systemd service..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config @@ -143,6 +143,7 @@ ynh_add_config --template="../conf/default.yml" --destination="$final_path/.conf #================================================= # INSTALLING MISKKEY #================================================= +ynh_script_progression --message="Installing Misskey..." --weight=15 pushd "$final_path" ynh_exec_warn_less yarn add ts-node webpack diff --git a/scripts/upgrade b/scripts/upgrade index 0d1fc9a..493b0da 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -84,7 +84,7 @@ then ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src - #ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$final_path" fi #================================================= From 726b578995ed1a1a887e77fdd3986795a3a89514 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 15 May 2021 18:30:49 +0200 Subject: [PATCH 14/22] Fix --- check_process | 9 +++------ conf/systemd.service | 3 --- scripts/_common.sh | 2 -- scripts/install | 32 +++++++------------------------- scripts/remove | 20 +++++++++----------- scripts/restore | 34 +++++----------------------------- scripts/upgrade | 2 +- 7 files changed, 25 insertions(+), 77 deletions(-) diff --git a/check_process b/check_process index a7d6130..889d10d 100644 --- a/check_process +++ b/check_process @@ -1,12 +1,10 @@ # See here for more information # https://github.com/YunoHost/package_check#syntax-check_process-file -# Move this file from check_process.default to check_process when you have filled it. - ;; Test complet ; Manifest - domain="domain.tld" (DOMAIN) - is_public=1 (PUBLIC|public=1|private=0) + domain="domain.tld" + is_public=1 ; Checks pkg_linter=1 setup_sub_dir=0 @@ -15,10 +13,9 @@ setup_private=0 setup_public=1 upgrade=0 - upgrade=0 from_commit=CommitHash + #upgrade=0 from_commit=CommitHash backup_restore=0 multi_instance=1 - port_already_use=0 change_url=1 ;;; Options Email=anmol@datamol.org diff --git a/conf/systemd.service b/conf/systemd.service index 162feb4..9540e71 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -10,9 +10,6 @@ Environment=__YNH_NODE_LOAD_PATH__ Environment="NODE_ENV=production" ExecStart=__YNH_NPM__ start TimeoutSec=60 -StandardOutput=syslog -StandardError=syslog -SyslogIdentifier=__APP__ Restart=always [Install] diff --git a/scripts/_common.sh b/scripts/_common.sh index e33d6ad..8304334 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -23,8 +23,6 @@ NODEJS_VERSION="12" # FUTURE OFFICIAL HELPERS #================================================= -#!/bin/bash - # Add swap # # usage: ynh_add_swap --size=SWAP in Mb diff --git a/scripts/install b/scripts/install index 8954a19..78fa0ed 100755 --- a/scripts/install +++ b/scripts/install @@ -33,7 +33,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." +ynh_script_progression --message="Validating installation parameters..." --weight=1 final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -44,7 +44,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." +ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url @@ -54,7 +54,7 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." +ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port port=$(ynh_find_port --port=3020) @@ -63,7 +63,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." +ynh_script_progression --message="Installing dependencies..." --weight=3 ynh_install_nodejs --nodejs_version=$NODEJS_VERSION @@ -75,7 +75,7 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st #================================================= # CREATE A POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Creating a POSTGRESQL database..." +ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2 # Create postgresql database db_name=$(ynh_sanitize_dbid --db_name=$app) @@ -94,30 +94,12 @@ ynh_system_user_create --username=$app #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." +ynh_script_progression --message="Setting up source files..." --weight=3 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" -#================================================= -# SPECIFIC SETUP -#================================================= -# ADD SWAP IF NEEDED -#================================================= -# ynh_script_progression --message="Adding swap is needed..." - -# total_memory=$(ynh_get_ram --total) -# swap_needed=0 - -# if [ $total_memory -lt $MEMORY_NEEDED ]; then -# # Need a minimum of 2.5Go of memory -# swap_needed=$(($MEMORY_NEEDED - $total_memory)) -# fi - -# ynh_script_progression --message="Adding $swap_needed Mo to swap..." -# ynh_add_swap --size=$swap_needed - #================================================= # NGINX CONFIGURATION #================================================= @@ -170,7 +152,7 @@ yunohost service add $app --description="A interplanetary blogging platform" --l #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="All workers started" diff --git a/scripts/remove b/scripts/remove index 1a9cc3b..217b3b1 100755 --- a/scripts/remove +++ b/scripts/remove @@ -31,14 +31,14 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # Remove the service from the list of services known by Yunohost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null then - ynh_script_progression --message="Removing $app service integration..." + ynh_script_progression --message="Removing $app service integration..." --weight=1 yunohost service remove $app fi #================================================= # STOP AND REMOVE SERVICE #================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." +ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 # Remove the dedicated systemd config ynh_remove_systemd_config @@ -46,7 +46,7 @@ ynh_remove_systemd_config #================================================= # REMOVE THE POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Removing the PostgreSQL database..." +ynh_script_progression --message="Removing the PostgreSQL database..." --weight=1 # Remove a database if it exists, along with the associated user ynh_psql_remove_db --db_user="$db_user" --db_name="$db_name" @@ -54,16 +54,17 @@ ynh_psql_remove_db --db_user="$db_user" --db_name="$db_name" #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." --time --weight=1 +ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies ynh_remove_app_dependencies + ynh_remove_nodejs #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --time --weight=1 +ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -71,14 +72,11 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." --time --weight=1 +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 # Remove the dedicated nginx config ynh_remove_nginx_config -# Remove swap -ynh_del_swap - #================================================= # SPECIFIC REMOVE #================================================= @@ -93,7 +91,7 @@ ynh_secure_remove --file="/var/log/$app/" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." +ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user ynh_system_user_delete --username=$app @@ -102,4 +100,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" +ynh_script_progression --message="Removal of $app completed" --last diff --git a/scripts/restore b/scripts/restore index 5d58a93..b92d080 100755 --- a/scripts/restore +++ b/scripts/restore @@ -33,7 +33,7 @@ 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=$app -db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) +db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -65,7 +65,7 @@ ynh_restore_file --origin_path="$final_path" ynh_script_progression --message="Recreating the dedicated system user..." # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # RESTORE USER RIGHTS @@ -74,21 +74,6 @@ ynh_system_user_create --username=$app # Restore permissions on app files chown -R $app: $final_path -#================================================= -# SPECIFIC RESTORATION -#================================================= -# ADD SWAP IF NEEDED -#================================================= -ynh_script_progression --message="Adding swap if needed..." - -total_memory=$(ynh_get_ram --total) -swap_needed=0 - -if [ $total_memory -lt $MEMORY_NEEDED ]; then - # Need a minimum of 8Go of memory - swap_needed=$(($MEMORY_NEEDED - $total_memory)) -fi - #================================================= # SPECIFIC RESTORATION #================================================= @@ -99,7 +84,7 @@ ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" @@ -110,16 +95,7 @@ ynh_script_progression --message="Restoring the PostgreSQL database..." ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd -ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" - -#================================================= -# INSTALLING MISKKEY -#================================================= - -pushd "$final_path" - yarn add ts-node webpack - NODE_ENV=production yarn build -popd +ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name #================================================= # RESTORE SYSTEMD @@ -154,4 +130,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade index 493b0da..ce22b48 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -102,7 +102,7 @@ ynh_script_progression --message="Upgrading dependencies..." ynh_install_nodejs --nodejs_version=$NODEJS_VERSION -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" From 398d324856573f873ee90649c0a9366772f0c1c7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 15 May 2021 18:40:32 +0200 Subject: [PATCH 15/22] Update check_process --- check_process | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/check_process b/check_process index 889d10d..fbce638 100644 --- a/check_process +++ b/check_process @@ -10,13 +10,13 @@ setup_sub_dir=0 setup_root=1 setup_nourl=0 - setup_private=0 + setup_private=1 setup_public=1 - upgrade=0 + upgrade=1 #upgrade=0 from_commit=CommitHash - backup_restore=0 + backup_restore=1 multi_instance=1 - change_url=1 + change_url=0 ;;; Options Email=anmol@datamol.org Notification=all From f21330f0858dc0652eeaa1a14bdc638ff6b09569 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 15 May 2021 18:51:38 +0200 Subject: [PATCH 16/22] Fix --- conf/nginx.conf | 2 +- scripts/restore | 18 ++++++------- scripts/upgrade | 68 ++++++++++++++++--------------------------------- 3 files changed, 32 insertions(+), 56 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 216e7dd..82bf4b1 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -23,7 +23,7 @@ location / { #proxy_cache cache1; proxy_cache_lock on; proxy_cache_use_stale updating; - add_header X-Cache $upstream_cache_status; + more_set_headers "X-Cache: $upstream_cache_status"; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; diff --git a/scripts/restore b/scripts/restore index b92d080..b8c4594 100755 --- a/scripts/restore +++ b/scripts/restore @@ -38,7 +38,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." +ynh_script_progression --message="Validating restoration parameters..." --weight=1 ynh_webpath_available --domain=$domain --path_url=$path_url \ || ynh_die --message="Path not available: ${domain}${path_url}" @@ -50,19 +50,19 @@ test ! -d $final_path \ # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" --weight=1 #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring the app main directory..." --weight=1 ynh_restore_file --origin_path="$final_path" #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." +ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" @@ -79,7 +79,7 @@ chown -R $app: $final_path #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION @@ -91,7 +91,7 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Restoring the PostgreSQL database..." +ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd @@ -100,7 +100,7 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name #================================================= # RESTORE SYSTEMD #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." +ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet @@ -108,14 +108,14 @@ systemctl enable $app.service --quiet #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="All workers started" diff --git a/scripts/upgrade b/scripts/upgrade index 156729c..d4bda93 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -31,7 +31,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If db_name doesn't exist, create it if [ -z "$db_name" ]; then @@ -55,7 +55,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade @@ -71,10 +71,18 @@ ynh_abort_if_errors #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." +ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action=stop --log_path=systemd --line_match="Stopped" +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -84,16 +92,16 @@ then ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$final_path" --keep="$final_path/.config/default.yml" fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." +ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=1 # Create a dedicated nginx config -ynh_add_nginx_config 'port' +ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES @@ -107,52 +115,20 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" -#================================================= -# 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 - -#================================================= -# SPECIFIC UPGRADE -#================================================= -# ADD SWAP IF NEEDED -#================================================= -# ynh_script_progression --message="Adding swap if needed..." - -# total_memory=$(ynh_get_ram --total) -# swap_needed=0 - -# if [ $total_memory -lt $MEMORY_NEEDED ]; then -# # Need a minimum of 8Go of memory -# swap_needed=$(($MEMORY_NEEDED - $total_memory)) -# fi - -# ynh_script_progression --message="Adding $swap_needed Mo to swap..." -# ynh_add_swap --size=$swap_needed - -#================================================= -# SPECIFIC UPGRADE -#================================================= - -ynh_add_config --template="../conf/default.yml" --destination="$final_path/.config/default.yml" - #================================================= # Updating process MISSKEY #================================================= pushd "$final_path" - ynh_exec_warn_lessyarn add ts-node webpack + ynh_exec_warn_less yarn install ynh_exec_warn_less NODE_ENV=production yarn build - ynh_exec_warn_less yarn run init + ynh_exec_warn_less yarn migrate popd #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Upgrading systemd configuration..." +ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config @@ -169,21 +145,21 @@ chown -R $app: $final_path #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="All workers started" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -191,4 +167,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" +ynh_script_progression --message="Upgrade of $app completed" --last From d7807e970413a223c5e85901065f4f134ed5a5f5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 15 May 2021 19:01:42 +0200 Subject: [PATCH 17/22] Upgrade to 12.81.0 --- README.md | 2 +- conf/app.src | 4 ++-- manifest.json | 10 +++++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d62e09e..32c98d5 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview [Misskey](https://join.misskey.page/en/) is a forever evolving, sophisticated microblogging platform that support Fediverse. It provide another flavour to decentralised network. Why don't you take a short break from the hustle and bustle of the city, and dive into a new Internet? -**Shipped version:** 12.69.0 +**Shipped version:** 12.81.0 ## Screenshots diff --git a/conf/app.src b/conf/app.src index 44fb126..ba373ff 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/syuilo/misskey/archive/12.69.0.tar.gz -SOURCE_SUM=9cc9b284dee849ad6f4570204263fc8b949a975f0b230047fe08a7e35b804f73 +SOURCE_URL=https://github.com/syuilo/misskey/archive/12.81.0.tar.gz +SOURCE_SUM=7534060ef796398650ca2f105bc51024ac1cefc6b1702dafd25101e7ccc6a929 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 87e3b55..eeefe75 100644 --- a/manifest.json +++ b/manifest.json @@ -6,8 +6,16 @@ "en": "Microblogging platform", "fr": "Platforme de Microblogging" }, - "version": "12.69.0~ynh1", + "version": "12.81.0~ynh1", "url": "https://join.misskey.page/en/", + "upstream": { + "license": "AGPL-3.0", + "website": "https://join.misskey.page", + "demo": "https://demo.example.com", + "admindoc": "https://yunohost.org/packaging_apps", + "userdoc": "https://yunohost.org/apps", + "code": "https://github.com/syuilo/misskey" + }, "license": "AGPL-3.0", "maintainer": { "name": "Anmol Sharma" From 812104a58db8a48c22b30489c9e37e24a46269c8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 15 May 2021 19:02:51 +0200 Subject: [PATCH 18/22] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 8304334..59495c0 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -113,4 +113,4 @@ ynh_is_main_device_a_sd_card () { else return 1 fi -} \ No newline at end of file +} From 74e8a34b74fd70872f34b8ef19ef0a45f594339a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 15 May 2021 19:04:32 +0200 Subject: [PATCH 19/22] Fix --- check_process | 2 +- manifest.json | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/check_process b/check_process index de03d0f..3c69d55 100644 --- a/check_process +++ b/check_process @@ -15,7 +15,7 @@ upgrade=1 #upgrade=0 from_commit=CommitHash backup_restore=1 - multi_instance=1 + multi_instance=0 change_url=0 ;;; Options Email= diff --git a/manifest.json b/manifest.json index eeefe75..c4e38ab 100644 --- a/manifest.json +++ b/manifest.json @@ -11,8 +11,6 @@ "upstream": { "license": "AGPL-3.0", "website": "https://join.misskey.page", - "demo": "https://demo.example.com", - "admindoc": "https://yunohost.org/packaging_apps", "userdoc": "https://yunohost.org/apps", "code": "https://github.com/syuilo/misskey" }, @@ -23,7 +21,7 @@ "requirements": { "yunohost": ">= 4.2.4" }, - "multi_instance": true, + "multi_instance": false, "services": ["nginx"], "arguments": { "install": [ From c3ed0d2ada36f0005bfdb1243fd772d0ef357bd0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 15 May 2021 19:06:23 +0200 Subject: [PATCH 20/22] Fix --- README.md | 2 +- check_process | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 32c98d5..5952490 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Important points to read before installing -1. **Misskey** require a dedicated **root domain**, eg. misskey.domain.tldYunoHost +1. **Misskey** require a dedicated **root domain**, eg. misskey.domain.tldYunoHost 2. **Misskey** can take quite some time to install( **more then 30 minutes** ). So take out some time and grab yourself a coffee. 3. If installing from command line use of **screen is rerecorded** to avoid disconnection.See below. 4. After installation first page can take time to load and may show timeout error. Give it time to make itself ready for you. **Refresh page after 2-3 minutes**. diff --git a/check_process b/check_process index 3c69d55..ce8e10f 100644 --- a/check_process +++ b/check_process @@ -1,6 +1,3 @@ -# See here for more information -# https://github.com/YunoHost/package_check#syntax-check_process-file - ;; Test complet ; Manifest domain="domain.tld" From 2249dd6de1d2ded99bfd6da25b7e1a299246f7f0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 15 May 2021 19:51:32 +0200 Subject: [PATCH 21/22] Update restore --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index b8c4594..fdd0dcc 100755 --- a/scripts/restore +++ b/scripts/restore @@ -50,7 +50,7 @@ test ! -d $final_path \ # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" --weight=1 +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR From 063ee0d4bf271f5537d2d2e19f32a10256b60e1e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 15 May 2021 19:56:45 +0200 Subject: [PATCH 22/22] Update upgrade --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index d4bda93..81932fe 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,6 +21,7 @@ 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_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) +port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # CHECK VERSION