1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cryptpad_ynh.git synced 2024-09-03 18:26:14 +02:00

Merge pull request #74 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2021-03-31 12:19:58 +02:00 committed by GitHub
commit 6be019cba9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 49 additions and 76 deletions

View file

@ -11,7 +11,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
## Overview
CryptPad is a collaborative encrypted document editor in real time. It is a privacy-friendly alternative to popular office tools and cloud services. All content stored in CryptPad is encrypted before being sent, which means that no one can access your data unless you give them the keys. You can share access to a document simply by sharing the link.
**Shipped version:** 4.2.1
**Shipped version:** 4.3.0
## Screenshots

View file

@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install
## Vue d'ensemble
CryptPad est un éditeur de documents chiffrés collaboratifs en temps réel. C'est une alternative respectant la vie privée aux outils office et aux services cloud populaires. Tout le contenu stocké dans CryptPad est chiffré avant d'être envoyé, ce qui signifie que personne ne peut accéder à vos données à moins que vous ne leur donniez les clés. Vous pouvez partager l'accès à un document simplement en partageant le lien.
**Version incluse :** 4.2.1
**Version incluse :** 4.3.0
## Captures d'écran

View file

@ -15,7 +15,6 @@
upgrade=1 from_commit=ddbb3b36b8bcd00e573456bd9ad07b1aa5e41cb1
backup_restore=1
multi_instance=0
incorrect_path=0
port_already_use=1
change_url=1
;;; Options

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://github.com/xwiki-labs/cryptpad/archive/4.2.1.tar.gz
SOURCE_SUM=0e769b0184741907bf5cdd0f5bb0488d43589435f2f102e53d7d64e666978a65
SOURCE_URL=https://github.com/xwiki-labs/cryptpad/archive/4.3.0.tar.gz
SOURCE_SUM=aefa5853981b11853aad60439071fa9e3b5e5fd0642cb48adf7cd1e8133dc8f5
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=cryptpad-4.2.1.tar.gz
SOURCE_FILENAME=cryptpad-4.3.0.tar.gz

View file

@ -142,7 +142,7 @@ module.exports = {
/* CryptPad will display a point of contact for your instance on its contact page
* (/contact.html) if you provide it below.
*/
adminEmail: '__ADMIN_MAIL__',
adminEmail: '__EMAIL__',
/*
* By default, CryptPad contacts one of our servers once a day.

View file

@ -1,8 +1,10 @@
location ^~ / {
# Force usage of https
if ($scheme = http) {
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
proxy_pass http://127.0.0.1:__PORT__;
proxy_redirect off;
proxy_set_header Host $host;

View file

@ -12,5 +12,11 @@ Environment=NODE_ENV=production
ExecStart=__YNH_NPM__ start
Restart=always
PrivateDevices=true
ProtectControlGroups=true
ProtectHome=true
ProtectKernelTunables=true
ProtectSystem=full
[Install]
WantedBy=multi-user.target

View file

@ -6,7 +6,7 @@
"en": "Zero Knowledge realtime collaborative editor",
"fr": "Éditeur chiffré collaboratif en temps réel."
},
"version": "4.2.1~ynh2",
"version": "4.3.0~ynh1",
"url": "https://cryptpad.fr/",
"license": "AGPL-3.0-only",
"maintainer": {
@ -26,10 +26,6 @@
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain name for CryptPad",
"fr": "Choisissez un nom de domaine pour CryptPad"
},
"help": {
"en": "CryptPad needs to be installed in a dedicated domain or sub-domain.",
"fr": "CryptPad doit être installé dans un domaine ou sous-domaine dédié."
@ -39,19 +35,11 @@
{
"name": "admin",
"type": "user",
"ask": {
"en": "Choose an admin user",
"fr": "Choisissez ladministrateur"
},
"example": "johndoe"
},
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Is it a public site?",
"fr": "Est-ce un site publique ?"
},
"help": {
"en": "If enabled, CryptPad 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, CryptPad sera accessible aux personnes nayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."

View file

@ -27,6 +27,7 @@ domain=$YNH_APP_ARG_DOMAIN
is_public=$YNH_APP_ARG_IS_PUBLIC
path_url="/"
admin=$YNH_APP_ARG_ADMIN
email=$(ynh_user_get_info --username=$admin --key=mail)
app=$YNH_APP_INSTANCE_NAME
@ -49,8 +50,6 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path_url --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
email=$(ynh_user_get_info --username=$admin --key=mail)
#=================================================
# STANDARD MODIFICATIONS
#=================================================
@ -80,7 +79,7 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
ynh_script_progression --message="Configuring system user..." --weight=1
# Create a system user
ynh_system_user_create --username=$app
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -104,8 +103,8 @@ ynh_add_nginx_config
#=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=1
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"
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"
ynh_add_systemd_config
@ -113,15 +112,7 @@ ynh_add_systemd_config
# CONFIGURE CONFIG.JS
#=================================================
# Copy default configuration file
mv "../conf/config.js" "$final_path/config/config.js"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/config.js"
ynh_replace_string --match_string="__PORTI__" --replace_string="$porti" --target_file="$final_path/config/config.js"
ynh_replace_string --match_string="__ADMIN_MAIL__" --replace_string="$email" --target_file="$final_path/config/config.js"
# Store file checksum to detected user modifications on upgrade
ynh_store_file_checksum "$final_path/config/config.js"
ynh_add_config --template="../conf/config.js" --destination="$final_path/config/config.js"
#=================================================
# INSTALL CRYPTPAD
@ -140,7 +131,9 @@ popd || ynh_die
#=================================================
ynh_script_progression --message="Securing files and directories..." --weight=1
chown -R $app: $final_path
chown -R $app:$app $final_path
chmod -R o-rwx $final_path
chmod 600 "$final_path/config/config.js"
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
@ -155,7 +148,7 @@ yunohost service add $app --description="Zero Knowledge realtime collaborative e
ynh_script_progression --message="Starting a systemd service..." --weight=2
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="server available"
ynh_systemd_action --service_name=$app --action=start --log_path="systemd" --line_match="server available"
#=================================================
# SETUP SSOWAT

View file

@ -49,6 +49,14 @@ test ! -d $final_path \
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RECREATE THE DEDICATED 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"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
@ -56,20 +64,14 @@ ynh_script_progression --message="Restoring CryptPad main directory..." --weight
ynh_restore_file --origin_path="$final_path"
#=================================================
# RECREATE THE DEDICATED 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
#=================================================
# RESTORE USER RIGHTS
#=================================================
# Restore permissions on app files
chown -R $app: $final_path
chmod -R o-rwx $final_path
chmod 600 "$final_path/config/config.js"
#=================================================
# REINSTALL DEPENDENCIES

View file

@ -35,15 +35,6 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=2
# 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 final_path doesn't exist, create it
if [ -z "$final_path" ]; then
final_path=/var/www/$app
@ -80,6 +71,14 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log"
#=================================================
# 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 --home_dir="$final_path"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -108,29 +107,11 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=6
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
# 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
#=================================================
# CONFIGURE CONFIG.JS
#=================================================
ynh_backup_if_checksum_is_different "$final_path/config/config.js"
# Copy default configuration file
mv "../conf/config.js" "$final_path/config/config.js"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config/config.js"
ynh_replace_string --match_string="__PORTI__" --replace_string="$porti" --target_file="$final_path/config/config.js"
ynh_replace_string --match_string="__ADMIN_MAIL__" --replace_string="$email" --target_file="$final_path/config/config.js"
# Store file checksum to detected user modifications on upgrade
ynh_store_file_checksum "$final_path/config/config.js"
ynh_add_config --template="../conf/config.js" --destination="$final_path/config/config.js"
#=================================================
# INSTALL CRYPTPAD
@ -146,8 +127,8 @@ popd || ynh_die
#=================================================
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
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"
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
@ -159,6 +140,8 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
# Set permissions on app files
chown -R $app: $final_path
chmod -R o-rwx $final_path
chmod 600 "$final_path/config/config.js"
#=================================================
# INTEGRATE SERVICE IN YUNOHOST