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 #216 from YunoHost-Apps/cleaning

cleaning
This commit is contained in:
eric_G 2024-05-24 10:48:52 +02:00 committed by GitHub
commit 4075742998
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 24 additions and 47 deletions

View file

@ -3,7 +3,7 @@ We have added the mandatory sandbox domain for you but you still need to configu
Once CryptPad is installed, create an account via the Register button on the home page. To make this account an instance administrator: Once CryptPad is installed, create an account via the Register button on the home page. To make this account an instance administrator:
1. Copy the public key found in User Menu (avatar at the top right) > Settings > Account > Public Signing Key 1. Copy the public key found in User Menu (avatar at the top right) > Settings > Account > Public Signing Key
2. Paste this key in `/var/www/cryptpad/config/config.js` in the following array (uncomment and replace the placeholder): 2. Paste this key in `__INSTALL_DIR__/config/config.js` in the following array (uncomment and replace the placeholder):
``` ```
adminKeys: [ adminKeys: [
"[cryptpad-user1@my.awesome.website/YZgXQxKR0Rcb6r6CmxHPdAGLVludrAF2lEnkbx1vVOo=]", "[cryptpad-user1@my.awesome.website/YZgXQxKR0Rcb6r6CmxHPdAGLVludrAF2lEnkbx1vVOo=]",

View file

@ -5,7 +5,7 @@ Nous avons ajouté le domaine obligatoire sandbox pour vous mais vous devez enco
Une fois CryptPad installé, créez un compte via le bouton S'inscrire sur la page d'accueil. Pour faire de ce compte un administrateur d'instance : Une fois CryptPad installé, créez un compte via le bouton S'inscrire sur la page d'accueil. Pour faire de ce compte un administrateur d'instance :
1. Copiez la clé publique trouvée dans le menu utilisateur (avatar en haut à droite) > Paramètres > Compte > Clé de signature publique 1. Copiez la clé publique trouvée dans le menu utilisateur (avatar en haut à droite) > Paramètres > Compte > Clé de signature publique
2. Collez cette clé dans `/var/www/cryptpad/config/config.js` dans le tableau suivant (décommentez et remplacez l'espace réservé) : 2. Collez cette clé dans `__INSTALL_DIR__/config/config.js` dans le tableau suivant (décommentez et remplacez l'espace réservé) :
``` ```
adminKeys: [ adminKeys: [
"[cryptpad-user1@my.awesome.website/YZgXQxKR0Rcb6r6CmxHPdAGLVludrAF2lEnkbx1vVOo=]", "[cryptpad-user1@my.awesome.website/YZgXQxKR0Rcb6r6CmxHPdAGLVludrAF2lEnkbx1vVOo=]",

View file

@ -7,7 +7,7 @@ Once CryptPad is installed, create an account via the Sign Up button on the home
To make this account an instance administrator: To make this account an instance administrator:
1. Copy the public key found in User Menu (avatar at the top right) > Settings > Account > Public Signing Key 1. Copy the public key found in User Menu (avatar at the top right) > Settings > Account > Public Signing Key
2. Paste this key in `/var/www/cryptpad/config/config.js` in the following array (uncomment and replace the placeholder): 2. Paste this key in `__INSTALL_DIR__/config/config.js` in the following array (uncomment and replace the placeholder):
``` ```
adminKeys: [ adminKeys: [

View file

@ -3,7 +3,7 @@ If not already done, then you can please open CryptPad domain: https://__DOMAIN_
Create an account via the Register button on the home page. To make this account an instance administrator: Create an account via the Register button on the home page. To make this account an instance administrator:
1. Copy the public key found in User Menu (avatar at the top right) > Settings > Account > Public Signing Key 1. Copy the public key found in User Menu (avatar at the top right) > Settings > Account > Public Signing Key
2. Paste this key in /var/www/cryptpad/config/config.js in the following array (uncomment and replace the placeholder): 2. Paste this key in __INSTALL_DIR__/config/config.js in the following array (uncomment and replace the placeholder):
adminKeys: [ adminKeys: [
"[cryptpad-user1@my.awesome.website/YZgXQxKR0Rcb6r6CmxHPdAGLVludrAF2lEnkbx1vVOo=]", "[cryptpad-user1@my.awesome.website/YZgXQxKR0Rcb6r6CmxHPdAGLVludrAF2lEnkbx1vVOo=]",
], ],

View file

@ -19,11 +19,14 @@ cpe = "cpe:2.3:a:xwiki:cryptpad"
fund = "https://opencollective.com/cryptpad/contribute?language=fr" fund = "https://opencollective.com/cryptpad/contribute?language=fr"
[integration] [integration]
yunohost = ">= 11.1.21" yunohost = ">= 11.2"
architectures = "all" architectures = "all"
multi_instance = false multi_instance = false
ldap = false ldap = false
sso = false sso = false
disk = "50M" disk = "50M"
ram.build = "350M" ram.build = "350M"
ram.runtime = "50M" ram.runtime = "50M"

View file

@ -22,17 +22,11 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$install_dir" ynh_backup --src_path="$install_dir"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" 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" ynh_backup --src_path="/etc/systemd/system/$app.service"
#================================================= #=================================================

View file

@ -34,7 +34,7 @@ fi
ynh_app_setting_set --app=$app --key=sandboxdomain --value=$sandboxdomain ynh_app_setting_set --app=$app --key=sandboxdomain --value=$sandboxdomain
ynh_script_progression --message="Setting up sandobx domain : $sandboxdomain" --weight=1 ynh_script_progression --message="Setting up sandobx domain: $sandboxdomain" --weight=1
# We don't test that in CI # We don't test that in CI
if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
@ -68,7 +68,6 @@ ynh_script_progression --message="Adding system configurations related to $app..
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
env_path="$PATH"
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_add_systemd_config ynh_add_systemd_config
@ -77,9 +76,9 @@ yunohost service add $app --description="Zero Knowledge realtime collaborative e
#================================================= #=================================================
# ADD A CONFIGURATION # ADD A CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Adding a configuration file..." ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_add_config --template="../conf/config.js" --destination="$install_dir/config/config.js" ynh_add_config --template="config.js" --destination="$install_dir/config/config.js"
chmod 600 "$install_dir/config/config.js" chmod 600 "$install_dir/config/config.js"
chown $app "$install_dir/config/config.js" chown $app "$install_dir/config/config.js"

View file

@ -29,11 +29,6 @@ ynh_remove_systemd_config
# Remove the dedicated NGINX config # Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=3
ynh_remove_nodejs ynh_remove_nodejs
#================================================= #=================================================

View file

@ -17,10 +17,11 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
email=$(ynh_user_get_info --username=$admin --key=mail) email=$(ynh_user_get_info --username=$admin --key=mail)
#================================================= #=================================================
# CHECK VERSION # UPGRADE DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=6
upgrade_type=$(ynh_check_app_version_changed) ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
@ -34,17 +35,13 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..." --weight=1
if [ "$upgrade_type" == "UPGRADE_APP" ] # Download, check integrity, uncompress and patch the source from app.src
then ynh_setup_source --dest_dir="$install_dir" #--keep="config/config.js"
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src chmod -R o-rwx "$install_dir"
ynh_setup_source --dest_dir="$install_dir" #--keep="config/config.js" chown -R $app:$app "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:$app "$install_dir"
fi
#================================================= #=================================================
# APPLY FOLDER GROUP RIGHTS FOR WWW-DATA # APPLY FOLDER GROUP RIGHTS FOR WWW-DATA
@ -88,13 +85,10 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
env_path="$PATH" # Create a dedicated systemd config
#================================================= ynh_add_systemd_config
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=6
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version yunohost service add $app --description="Zero Knowledge realtime collaborative editor" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# INSTALL CRYPTPAD # INSTALL CRYPTPAD
@ -109,20 +103,12 @@ pushd "$install_dir"
ynh_exec_warn_less npm run build ynh_exec_warn_less npm run build
popd popd
#=================================================
# CREATE SYSTEMD SERVICE
#=================================================
# Create a dedicated systemd config
ynh_add_systemd_config
yunohost service add $app --description="Zero Knowledge realtime collaborative editor" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# ADD UPGRADED CONFIG WITH SANDBOX # ADD UPGRADED CONFIG WITH SANDBOX
#================================================= #=================================================
ynh_script_progression --message="Updating a configuration file..." --weight=1 ynh_script_progression --message="Updating a configuration file..." --weight=1
ynh_add_config --template="../conf/config.js" --destination="$install_dir/config/config.js" ynh_add_config --template="config.js" --destination="$install_dir/config/config.js"
chmod 600 "$install_dir/config/config.js" chmod 600 "$install_dir/config/config.js"
chown $app "$install_dir/config/config.js" chown $app "$install_dir/config/config.js"