1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/codimd_ynh.git synced 2024-09-03 18:16:32 +02:00
* cleaning (#77)

* Update upgrade

* 2.4.2 (#79)

* 2.4.2

* Auto-update README

Co-authored-by: yunohost-bot <yunohost@yunohost.org>

* [autopatch] Add Common Platform Enumeration id to `manifest.json` (#81)

* Testing (#80)

* cleaning (#77)

* Update upgrade

* 2.4.2 (#79)

* 2.4.2

* Auto-update README

Co-authored-by: yunohost-bot <yunohost@yunohost.org>

Co-authored-by: yunohost-bot <yunohost@yunohost.org>

* [autopatch] Add Common Platform Enumeration id to `manifest.json`

Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>
Co-authored-by: Yunohost-Bot <>

* set relative path for --keep opt

* Auto-update README

* Update install

* Auto-update README

* Upgrade auto-updater (#84)

* [autopatch] Upgrade auto-updater

* Auto-update README

---------

Co-authored-by: tituspijean <titus@pijean.ovh>

* Update manifest.json

* v2 (#85)

* v2

* v2

* Auto-update README

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>

* Update manifest.toml

* Auto-update README

* Update manifest.toml

* Update manifest.toml

* Update manifest.toml

* Auto-update README

* Update _common.sh

* cleaning

* Auto-update README

* Update _common.sh

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: YunoHost Bot <yunohost-bot@users.noreply.github.com>
Co-authored-by: tituspijean <titus@pijean.ovh>
This commit is contained in:
eric_G 2023-12-24 18:20:53 +01:00 committed by GitHub
parent e48d98cd49
commit 1c4461e674
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 32 additions and 83 deletions

View file

@ -20,7 +20,7 @@ CodiMD is the free software version of HackMD, developed and opened source by th
CodiMD is perfect for open communities, while HackMD emphasizes on permission and access controls for commercial use cases.
**Shipped version:** 2.4.2~ynh2
**Shipped version:** 2.4.2~ynh3
## Screenshots

View file

@ -20,7 +20,7 @@ CodiMD est la version logicielle libre de HackMD, développée et ouverte par l'
CodiMD est parfait pour les communautés ouvertes, tandis que HackMD met l'accent sur les autorisations et les contrôles d'accès pour les cas d'utilisation commerciale.
**Version incluse :** 2.4.2~ynh2
**Version incluse :** 2.4.2~ynh3
## Captures décran

View file

@ -1 +1 @@
You can configure CodiMD by editing this file `/var/www/codimd/config.json` using the [documentation](https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-configuration)
You can configure CodiMD by editing this file `__INSTALL_DIR__/config.json` using the [documentation](https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-configuration)

View file

@ -1 +1 @@
Vous pouvez configurer CodiMD en éditant ce fichier `/var/www/codimd/config.json` en utilisant la [documentation](https://hakmd.io/c/codimd-documentation/%2Fs%2Fcodimd-configuration)
Vous pouvez configurer CodiMD en éditant ce fichier `__INSTALL_DIR__/config.json` en utilisant la [documentation](https://hakmd.io/c/codimd-documentation/%2Fs%2Fcodimd-configuration)

View file

@ -5,7 +5,7 @@ name = "CodiMD"
description.en = "Collaborative editor to work on notes written in Markdown"
description.fr = "Éditeur collaboratif pour travailler sur des notes en Markdown"
version = "2.4.2~ynh2"
version = "2.4.2~ynh3"
maintainers = ["eric_G"]
@ -17,11 +17,14 @@ userdoc = "https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-documentation#
code = "https://github.com/hackmdio/codimd"
[integration]
yunohost = ">= 11.1.18"
yunohost = ">= 11.2"
architectures = ["amd64"]
multi_instance = false
ldap = true
sso = true
disk = "50M"
ram.build = "50M"
ram.runtime = "50M"
@ -29,7 +32,6 @@ ram.runtime = "50M"
[install]
[install.domain]
type = "domain"
full_domain = true
[install.init_main_permission]
help.en = "If enabled, CodiMD will be accessible by people who do not have an account. This can be changed later via the webadmin."
@ -53,7 +55,7 @@ ram.runtime = "50M"
main.url = "/"
[resources.apt]
packages = "postgresql libssl-dev"
packages = "postgresql, libssl-dev"
[resources.database]
type = "postgresql"

View file

@ -31,7 +31,7 @@ ynh_change_url_nginx_config
path=${path:1}
domain=new_domain
ynh_add_config --template="../conf/config.json.example" --destination="$install_dir/config.json"
ynh_add_config --template="config.json.example" --destination="$install_dir/config.json"
#=================================================
# GENERIC FINALISATION

View file

@ -22,7 +22,6 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=2
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir=$install_dir
chmod -R o-rwx "$install_dir"
@ -34,9 +33,23 @@ chmod +x $install_dir/app.js
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
# Create a dedicated NGINX config
ynh_add_nginx_config
ynh_add_systemd_config
yunohost service add $app --description="Collaborative Markdown notes" --log="/var/log/$app/$app.log"
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Modifying a config file..." --weight=1
ynh_add_config --template="config.json.example" --destination="$install_dir/config.json"
ynh_add_config --template=".sequelizerc.example" --destination="$install_dir/.sequelizerc"
chmod 600 $install_dir/config.json
chmod 600 $install_dir/.sequelizerc
#=================================================
# SPECIFIC SETUP
#=================================================
@ -50,32 +63,6 @@ pushd $install_dir
ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH $ynh_npm run build
popd
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Modifying a config file..." --weight=1
ynh_add_config --template="../conf/config.json.example" --destination="$install_dir/config.json"
ynh_add_config --template="../conf/.sequelizerc.example" --destination="$install_dir/.sequelizerc"
chmod 600 $install_dir/config.json
chmod 600 $install_dir/.sequelizerc
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=1
# Create a dedicated systemd config
ynh_add_systemd_config
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Collaborative Markdown notes" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================

View file

@ -14,36 +14,18 @@ source /usr/share/yunohost/helpers
#=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST
#=================================================
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
# 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..." --weight=1
yunohost service remove $app
fi
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
# Remove the dedicated systemd config
ynh_remove_systemd_config
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=5
# Remove the dedicated NGINX config
ynh_remove_nginx_config
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=1
# Remove metapackage and its dependencies
ynh_remove_nodejs
#=================================================

View file

@ -6,19 +6,9 @@
# IMPORT GENERIC HELPERS
#=================================================
# 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
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
@ -26,7 +16,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
@ -37,7 +26,6 @@ chown -R $app:www-data "$install_dir"
#=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=7
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
@ -45,37 +33,27 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
#=================================================
# RESTORE SYSTEMD
#=================================================
ynh_script_progression --message="Restoring the systemd configuration..." --weight=5
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --description="Collaborative Markdown notes" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="HTTP Server listening"
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
#=================================================