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

Merge pull request #44 from YunoHost-Apps/testing

2021.08.30~ynh1
This commit is contained in:
Fabian Wilkens 2021-09-02 20:48:33 +02:00 committed by GitHub
commit 42d12bd9aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 178 additions and 44 deletions

View file

@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
The Standard Notes syncing server. An end-to-end encrypted note-taking app. The Standard Notes syncing server. An end-to-end encrypted note-taking app.
**Shipped version:** 2021.07.24~ynh3 **Shipped version:** 2021.08.30~ynh1
**Demo:** https://standardnotes.org/demo **Demo:** https://standardnotes.org/demo
@ -25,9 +25,10 @@ The Standard Notes syncing server. An end-to-end encrypted note-taking app.
* Any known limitations, constrains or stuff not working, such as (but not limited to): * Any known limitations, constrains or stuff not working, such as (but not limited to):
* No single-sign on or LDAP integration * No single-sign on or LDAP integration
* The app requires at least 450MB of RAM to work properly. * Ram requirements (Swap memory will be created during install):
* The app requires at least 650MB of RAM to start. * The app requires at least 800MB of RAM to work properly.
* The app requires around 1800MB of disk. * The app requires at least 1000MB of RAM to start.
* The app requires at least 1500MB of RAM to install.
* Other infos that people should be aware of, such as: * Other infos that people should be aware of, such as:
* The ".env" config-files are stored under "/opt/yunohost/$app/live/" * The ".env" config-files are stored under "/opt/yunohost/$app/live/"

View file

@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
**Version incluse :** 2021.07.24~ynh3 **Version incluse :** 2021.08.30~ynh1
**Démo :** https://standardnotes.org/demo **Démo :** https://standardnotes.org/demo
@ -21,9 +21,10 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
* Any known limitations, constrains or stuff not working, such as (but not limited to): * Any known limitations, constrains or stuff not working, such as (but not limited to):
* No single-sign on or LDAP integration * No single-sign on or LDAP integration
* The app requires at least 450MB of RAM to work properly. * Ram requirements (Swap memory will be created during install):
* The app requires at least 650MB of RAM to start. * The app requires at least 800MB of RAM to work properly.
* The app requires around 1800MB of disk. * The app requires at least 1000MB of RAM to start.
* The app requires at least 1500MB of RAM to install.
* Other infos that people should be aware of, such as: * Other infos that people should be aware of, such as:
* The ".env" config-files are stored under "/opt/yunohost/$app/live/" * The ".env" config-files are stored under "/opt/yunohost/$app/live/"

View file

@ -15,18 +15,10 @@
setup_private=0 setup_private=0
setup_public=1 setup_public=1
upgrade=1 upgrade=1
# 2021.07.24~yhn3
upgrade=1 from_commit=426dd68db71fda8aa61269928bd991c0f17feb3f
# 3.22.8~yhn2 # 3.22.8~yhn2
upgrade=1 from_commit=b0c7e9e6f16d286ec74fa3c1b9cdf8492f4dcb9b upgrade=1 from_commit=b0c7e9e6f16d286ec74fa3c1b9cdf8492f4dcb9b
# 3.22.8~yhn1
#upgrade=1 from_commit=c9ea83e8102affd5ca74a6d438920fa40af4a63e
# 3.20.5~ynh2
#upgrade=1 from_commit=e8db15c97db16f68d6453970a9dff74d5136017b
# 3.13.6~ynh4
#upgrade=1 from_commit=bdb0c5049c8eacbef68059d2821353d0e0345290
# 3.13.6~ynh2
#upgrade=1 from_commit=e755357f8306805084317c81e85807ed87fdbd47
# 3.13.6~ynh1
#upgrade=1 from_commit=7474baadc1705ffe5981a52bdced16bdd1edf979
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
port_already_use=0 port_already_use=0

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/standardnotes/api-gateway/archive/1.20.5.tar.gz SOURCE_URL=https://github.com/standardnotes/api-gateway/archive/1.24.0.tar.gz
SOURCE_SUM=758F4ADC30CC16BA19BDDE50151F41AF868E7931886E3DBB42B6F4CBE86B7F7B SOURCE_SUM=97EF89B8951448BB7B34D0B9A30DB242E23808EF1FFC5B154CC1C823965A8B39
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/standardnotes/auth/archive/1.13.2.tar.gz SOURCE_URL=https://github.com/standardnotes/auth/archive/1.17.4.tar.gz
SOURCE_SUM=ABFC20349D04A68B86226B6D479D2085D4224138CD2CA6E78A9A81F3D00A51B5 SOURCE_SUM=a9d8a8db89c16b2f251d85135a70c2eee9d9b7c228be8a0322a9dd68acbce8b4
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/standardnotes/syncing-server-js/archive/1.36.1.tar.gz SOURCE_URL=https://github.com/standardnotes/syncing-server-js/archive/1.38.9.tar.gz
SOURCE_SUM=5FC8B36A6D8C63E2FAD6991C60CDDF227FCE71E70D4EB75F19109FACD4027951 SOURCE_SUM=80f3d3386457328ce2ed51ba0f41f859f9ba3fe65cf0ac0bb36d6116f16872c6
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -2,6 +2,7 @@ __YNH_NODE_LOAD_PATH__
LOG_LEVEL="info" LOG_LEVEL="info"
NODE_ENV="production" NODE_ENV="production"
VERSION="production"
PORT="__PORT_API_GATEWAY__" PORT="__PORT_API_GATEWAY__"

View file

@ -2,6 +2,7 @@ __YNH_NODE_LOAD_PATH__
LOG_LEVEL="info" LOG_LEVEL="info"
NODE_ENV="production" NODE_ENV="production"
VERSION="production"
JWT_SECRET=__JWT_SECRET__ JWT_SECRET=__JWT_SECRET__
LEGACY_JWT_SECRET=__LEGACY_JWT_SECRET__ LEGACY_JWT_SECRET=__LEGACY_JWT_SECRET__
@ -57,3 +58,6 @@ NEW_RELIC_NO_CONFIG_FILE=true
NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=false NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=false
NEW_RELIC_LOG_ENABLED=false NEW_RELIC_LOG_ENABLED=false
NEW_RELIC_LOG_LEVEL=info NEW_RELIC_LOG_LEVEL=info
# (Optional) Extensions Server
EXTENSION_SERVER_URL=

View file

@ -2,6 +2,7 @@ __YNH_NODE_LOAD_PATH__
LOG_LEVEL="info" LOG_LEVEL="info"
NODE_ENV="production" NODE_ENV="production"
VERSION="production"
JWT_SECRET=__JWT_SECRET__ JWT_SECRET=__JWT_SECRET__
LEGACY_JWT_SECRET=__LEGACY_JWT_SECRET__ LEGACY_JWT_SECRET=__LEGACY_JWT_SECRET__
@ -57,3 +58,6 @@ NEW_RELIC_NO_CONFIG_FILE=true
NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=false NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=false
NEW_RELIC_LOG_ENABLED=false NEW_RELIC_LOG_ENABLED=false
NEW_RELIC_LOG_LEVEL=info NEW_RELIC_LOG_LEVEL=info
# (Optional) Extensions Server
EXTENSION_SERVER_URL=

View file

@ -2,6 +2,7 @@ __YNH_NODE_LOAD_PATH__
LOG_LEVEL="info" LOG_LEVEL="info"
NODE_ENV="production" NODE_ENV="production"
VERSION="production"
AUTH_JWT_SECRET=__AUTH_JWT_SECRET__ AUTH_JWT_SECRET=__AUTH_JWT_SECRET__

View file

@ -2,6 +2,7 @@ __YNH_NODE_LOAD_PATH__
LOG_LEVEL="info" LOG_LEVEL="info"
NODE_ENV="production" NODE_ENV="production"
VERSION="production"
AUTH_JWT_SECRET=__AUTH_JWT_SECRET__ AUTH_JWT_SECRET=__AUTH_JWT_SECRET__

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/standardnotes/bold-editor/archive/1.2.1.zip SOURCE_URL=https://github.com/standardnotes/bold-editor/archive/1.2.2.zip
SOURCE_SUM=7bae5d62d0d49fe199f2a204317e23906e138072db4a8c2569a2479a42d2c357 SOURCE_SUM=2831f0fd4abed6562b860e558968388a398f691602a82795b10a13e897c3af2e
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/standardnotes/mfa-link/archive/1.2.4.zip SOURCE_URL=https://github.com/standardnotes/mfa-link/archive/1.2.5.zip
SOURCE_SUM=d384b8927eafc009022c15d9488e67f0e11672c7b5c90f2318b4cb15b0c81c6a SOURCE_SUM=f5f5221fa3cf53bf5ee94e60a5adb7a455d1ee46fabe8b0ef13e085f4098cbc8
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -1,8 +1,9 @@
* Any known limitations, constrains or stuff not working, such as (but not limited to): * Any known limitations, constrains or stuff not working, such as (but not limited to):
* No single-sign on or LDAP integration * No single-sign on or LDAP integration
* The app requires at least 450MB of RAM to work properly. * Ram requirements (Swap memory will be created during install):
* The app requires at least 650MB of RAM to start. * The app requires at least 800MB of RAM to work properly.
* The app requires around 1800MB of disk. * The app requires at least 1000MB of RAM to start.
* The app requires at least 1500MB of RAM to install.
* Other infos that people should be aware of, such as: * Other infos that people should be aware of, such as:
* The ".env" config-files are stored under "/opt/yunohost/$app/live/" * The ".env" config-files are stored under "/opt/yunohost/$app/live/"

View file

@ -5,7 +5,7 @@
"description": { "description": {
"en": "The Standard Notes syncing server. An end-to-end encrypted note-taking app." "en": "The Standard Notes syncing server. An end-to-end encrypted note-taking app."
}, },
"version": "2021.07.24~ynh3", "version": "2021.08.30~ynh1",
"url": "https://github.com/standardnotes/standalone", "url": "https://github.com/standardnotes/standalone",
"upstream": { "upstream": {
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",

View file

@ -6,10 +6,12 @@
RUBY_VERSION="2.7.3" RUBY_VERSION="2.7.3"
NODEJS_VERSION="15.11.0" NODEJS_VERSION="15.11.0"
syncing_server_js_version="1.36.1" syncing_server_js_version="1.38.9"
auth_version="1.13.2" auth_version="1.17.4"
api_gateway_version="1.20.5" api_gateway_version="1.24.0"
extensions_version="2021.07.06" extensions_version="2021.08.27"
swap_needed=1536
# dependencies used by the app # dependencies used by the app
pkg_dependencies="" pkg_dependencies=""

View file

@ -7,6 +7,7 @@
#================================================= #=================================================
source _common.sh source _common.sh
source ynh_add_swap
source ynh_install_ruby__2 source ynh_install_ruby__2
source ynh_redis source ynh_redis
source ynh_send_readme_to_admin__2 source ynh_send_readme_to_admin__2
@ -162,6 +163,13 @@ ynh_add_nginx_config
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
#=================================================
# ADD SWAP
#=================================================
ynh_script_progression --message="Adding swap..."
ynh_add_swap --size=$swap_needed
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================

View file

@ -7,6 +7,7 @@
#================================================= #=================================================
source _common.sh source _common.sh
source ynh_add_swap
source ynh_install_ruby__2 source ynh_install_ruby__2
source ynh_redis source ynh_redis
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -135,6 +136,12 @@ ynh_remove_fail2ban_config
#================================================= #=================================================
# SPECIFIC REMOVE # SPECIFIC REMOVE
#================================================= #=================================================
#=================================================
# REMOVE SWAP
#=================================================
ynh_script_progression --message="Removing swap..."
ynh_del_swap
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION

View file

@ -8,6 +8,7 @@
#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts #Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source ../settings/scripts/ynh_add_swap
source ../settings/scripts/ynh_install_ruby__2 source ../settings/scripts/ynh_install_ruby__2
source ../settings/scripts/ynh_redis source ../settings/scripts/ynh_redis
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -115,6 +116,14 @@ chown -R $app: "/var/log/$app"
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
#=================================================
#=================================================
# ADD SWAP
#=================================================
ynh_script_progression --message="Adding swap..."
ynh_add_swap --size=$swap_needed
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================

View file

@ -7,6 +7,7 @@
#================================================= #=================================================
source _common.sh source _common.sh
source ynh_add_swap
source ynh_install_ruby__2 source ynh_install_ruby__2
source ynh_redis source ynh_redis
source ynh_send_readme_to_admin__2 source ynh_send_readme_to_admin__2
@ -381,6 +382,13 @@ ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ st
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#================================================= #=================================================
#=================================================
# ADD SWAP
#=================================================
ynh_script_progression --message="Adding swap..."
ynh_add_swap --size=$swap_needed
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================

94
scripts/ynh_add_swap Normal file
View file

@ -0,0 +1,94 @@
#!/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
}

View file

@ -137,12 +137,12 @@
"area": "editor-editor", "area": "editor-editor",
"content_type": "SN|Component", "content_type": "SN|Component",
"description": "A simple and peaceful rich editor that helps you write and think clearly. Features FileSafe integration, so you can embed your images, videos, and audio recordings directly inline.", "description": "A simple and peaceful rich editor that helps you write and think clearly. Features FileSafe integration, so you can embed your images, videos, and audio recordings directly inline.",
"download_url": "https://github.com/standardnotes/bold-editor/archive/1.2.1.zip", "download_url": "https://github.com/standardnotes/bold-editor/archive/1.2.2.zip",
"identifier": "org.standardnotes.bold-editor", "identifier": "org.standardnotes.bold-editor",
"latest_url": "https://__DOMAIN__PATH__/extensions/src/bold-editor.json", "latest_url": "https://__DOMAIN__PATH__/extensions/src/bold-editor.json",
"name": "Bold Editor", "name": "Bold Editor",
"url": "https://__DOMAIN__PATH__/extensions/src/bold-editor/dist/index.html", "url": "https://__DOMAIN__PATH__/extensions/src/bold-editor/dist/index.html",
"version": "1.2.1" "version": "1.2.2"
}, },
{ {
"area": "editor-editor", "area": "editor-editor",
@ -280,12 +280,12 @@
"area": "modal", "area": "modal",
"content_type": "SN|Component", "content_type": "SN|Component",
"description": "Set up 2FA to enable an extra layer of security on your private notes account.", "description": "Set up 2FA to enable an extra layer of security on your private notes account.",
"download_url": "https://github.com/standardnotes/mfa-link/archive/1.2.4.zip", "download_url": "https://github.com/standardnotes/mfa-link/archive/1.2.5.zip",
"identifier": "org.stndardnotes.mfa-link", "identifier": "org.stndardnotes.mfa-link",
"latest_url": "https://__DOMAIN__PATH__/extensions/src/mfa-link.json", "latest_url": "https://__DOMAIN__PATH__/extensions/src/mfa-link.json",
"name": "MFA-Link", "name": "MFA-Link",
"url": "https://__DOMAIN__PATH__/extensions/src/mfa-link/dist/index.html", "url": "https://__DOMAIN__PATH__/extensions/src/mfa-link/dist/index.html",
"version": "1.2.4" "version": "1.2.5"
}, },
{ {
"area": "note-tags", "area": "note-tags",

View file

@ -3,9 +3,9 @@
"name": "Bold Editor", "name": "Bold Editor",
"content_type": "SN|Component", "content_type": "SN|Component",
"area": "editor-editor", "area": "editor-editor",
"version": "1.2.1", "version": "1.2.2",
"description": "A simple and peaceful rich editor that helps you write and think clearly. Features FileSafe integration, so you can embed your images, videos, and audio recordings directly inline.", "description": "A simple and peaceful rich editor that helps you write and think clearly. Features FileSafe integration, so you can embed your images, videos, and audio recordings directly inline.",
"url": "https://__DOMAIN__PATH__/extensions/src/bold-editor/dist/index.html", "url": "https://__DOMAIN__PATH__/extensions/src/bold-editor/dist/index.html",
"download_url": "https://github.com/standardnotes/bold-editor/archive/1.2.1.zip", "download_url": "https://github.com/standardnotes/bold-editor/archive/1.2.2.zip",
"latest_url": "https://__DOMAIN__PATH__/extensions/src/bold-editor.json" "latest_url": "https://__DOMAIN__PATH__/extensions/src/bold-editor.json"
} }

View file

@ -3,9 +3,9 @@
"name": "MFA-Link", "name": "MFA-Link",
"content_type": "SN|Component", "content_type": "SN|Component",
"area": "editor-stack", "area": "editor-stack",
"version": "1.2.4", "version": "1.2.5",
"description": "Set up 2FA to enable an extra layer of security on your private notes account.", "description": "Set up 2FA to enable an extra layer of security on your private notes account.",
"url": "https://__DOMAIN__PATH__/extensions/src/mfa-link/dist/index.html", "url": "https://__DOMAIN__PATH__/extensions/src/mfa-link/dist/index.html",
"download_url": "https://github.com/sn-extensions/mfa-link/archive/1.2.4.zip", "download_url": "https://github.com/sn-extensions/mfa-link/archive/1.2.5.zip",
"latest_url": "https://__DOMAIN__PATH__/extensions/src/mfa-link.json" "latest_url": "https://__DOMAIN__PATH__/extensions/src/mfa-link.json"
} }