1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/codimd_ynh.git synced 2024-09-03 18:16:32 +02:00
This commit is contained in:
ericgaspar 2021-05-08 11:06:29 +02:00
parent 4ad7fb53f2
commit a1f216e5e8
No known key found for this signature in database
GPG key ID: 574F281483054D44
5 changed files with 30 additions and 49 deletions

View file

@ -15,7 +15,7 @@ CodiMD is a real-time collaborative word processing web service. It uses Markdow
## Screenshots
![](https://demo.codimd.org/screenshot.png)
![](https://raw.githubusercontent.com/hackmdio/codimd/develop/public/screenshot.png)
## Demo
@ -23,11 +23,11 @@ CodiMD is a real-time collaborative word processing web service. It uses Markdow
## Configuration
You can configure CodiMD by editing this file `/var/www/codimd/config.json` using the [documentation](https://github.com/codimd/server/blob/master/docs/configuration.md)
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)
## Documentation
* Official documentation: https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-documentation
* Official documentation: https://hackmd.io/c/codimd-documentation
* YunoHost documentation: https://yunohost.org/en/app_codimd
## YunoHost specific features

View file

@ -17,7 +17,7 @@ CodiMD est un service web de traitement de texte collaboratif en temps réel. Il
## Captures d'écran
![](https://demo.codimd.org/screenshot.png)
![](https://raw.githubusercontent.com/hackmdio/codimd/develop/public/screenshot.png)
## Démo
@ -25,12 +25,12 @@ CodiMD est un service web de traitement de texte collaboratif en temps réel. Il
## Configuration
Vous pouvez configurer CodiMD en modifiant le fichier `/var/www/codimd/config.json` et en vous aidant de la [documentation](https://github.com/codimd/server/blob/master/docs/configuration.md)
Vous pouvez configurer CodiMD en modifiant le fichier `/var/www/codimd/config.json` et en vous aidant de la [documentation](https://hackmd.io/c/codimd-documentation/%2Fs%2Fcodimd-configuration)
## Documentation
* Documentation officielle : https://github.com/hedgedoc/hedgedoc/tree/master/docs
* Documentation YunoHost : https://yunohost.org/#/app_codimd_fr
* Documentation officielle : https://hackmd.io/c/codimd-documentation
* Documentation YunoHost : https://yunohost.org/fr/app_codimd
## Caractéristiques spécifiques YunoHost
@ -41,13 +41,13 @@ Vous pouvez configurer CodiMD en modifiant le fichier `/var/www/codimd/config.js
#### Architectures supportées
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/codimd%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/codimd/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/codimd%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/codimd/)
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/codimd.svg)](https://ci-apps.yunohost.org/ci/apps/codimd/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/codimd.svg)](https://ci-apps-arm.yunohost.org/ci/apps/codimd/)
## Liens
* Signaler un bug : https://github.com/YunoHost-Apps/codimd_ynh/issues
* Dépôt de l'application principale : https://github.com/hedgedoc/hedgedoc
* Dépôt de l'application principale : https://github.com/hackmdio/codimd
* Site web YunoHost : https://yunohost.org/
---

View file

@ -7,7 +7,7 @@
# dependencies used by the app
pkg_dependencies="postgresql apt-transport-https"
nodejs_version=14
nodejs_version=11
#=================================================
# PERSONAL HELPERS

View file

@ -45,8 +45,8 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
#=================================================
ynh_script_progression --message="Storing installation settings..." --weight=2
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=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
#=================================================
# STANDARD MODIFICATIONS
@ -64,7 +64,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=20
ynh_install_app_dependencies $pkg_dependencies
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
@ -72,6 +72,14 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# Install Yarn
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="Configuring system user..." --weight=2
# Create a system user
ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
# CREATE A POSTGRESQL DATABASE
#=================================================
@ -79,11 +87,8 @@ ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
db_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name
db_pwd=$(ynh_string_random --length=30)
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
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
@ -104,14 +109,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..." --weight=3
# Create a system user
ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
# SPECIFIC SETUP
#==============================================
@ -140,27 +137,10 @@ ynh_add_systemd_config
#=================================================
ynh_script_progression --message="Modifying a config file..."
cp ../conf/config.json.example "$final_path/config.json"
path=${path_url:1}
# Main config File
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config.json"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/config.json"
ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="$final_path/config.json"
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/config.json"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config.json"
ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="$final_path/config.json"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/config.json"
ynh_store_file_checksum --file="$final_path/config.json"
cp ../conf/.sequelizerc.example "$final_path/.sequelizerc"
# DB Config File
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/.sequelizerc"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/.sequelizerc"
ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="$final_path/.sequelizerc"
ynh_store_file_checksum --file="$final_path/.sequelizerc"
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json"
ynh_add_config --template="../conf/.sequelizerc.example" --destination="$final_path/.sequelizerc"
#=================================================
# GENERIC FINALIZATION
@ -171,6 +151,8 @@ ynh_script_progression --message="Securing files and directories..."
# Set permissions to app files
chown -R $app:$app $final_path
chmod o-rwx $final_path
chmod 600 $final_path/config.json
#=================================================
# INTEGRATE SERVICE IN YUNOHOST

View file

@ -20,10 +20,9 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$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
@ -109,7 +108,7 @@ ynh_add_nginx_config
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=18
ynh_install_app_dependencies $pkg_dependencies
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version