mirror of
https://github.com/YunoHost-Apps/wikijs_ynh.git
synced 2024-09-03 20:36:09 +02:00
commit
535a52be00
11 changed files with 57 additions and 43 deletions
|
@ -9,7 +9,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
|
||||||
## Overview
|
## Overview
|
||||||
An open source, modern and powerful wiki app built on Node.js, Git and Markdown for YunoHost.
|
An open source, modern and powerful wiki app built on Node.js, Git and Markdown for YunoHost.
|
||||||
|
|
||||||
**Shipped version:** 2.0.0-beta.303
|
**Shipped version:** 2.0.12
|
||||||
|
|
||||||
## Important points to read before installing
|
## Important points to read before installing
|
||||||
|
|
||||||
|
@ -43,7 +43,6 @@ The app can be used by multiple users
|
||||||
|
|
||||||
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/wikijs%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/wikijs/)
|
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/wikijs%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/wikijs/)
|
||||||
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/wikijs%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/wikijs/)
|
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/wikijs%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/wikijs/)
|
||||||
* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/wikijs%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/wikijs/)
|
|
||||||
|
|
||||||
## Limitations
|
## Limitations
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
setup_private=1
|
setup_private=1
|
||||||
setup_public=1
|
setup_public=1
|
||||||
upgrade=1
|
upgrade=1
|
||||||
upgrade=1 from_commit=ad5db1af11dfa2502ab0f214ec8e929e1eecbec8
|
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
# This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version.
|
# This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://github.com/Requarks/wiki/releases/download/2.0.0-beta.303/wiki-js.tar.gz
|
SOURCE_URL=https://github.com/Requarks/wiki/releases/download/2.0.12/wiki-js.tar.gz
|
||||||
SOURCE_SUM=efb50def29453680c1707383d8d0429a73ee34d190067b0705154ad9ff276877
|
SOURCE_SUM=67ad4b7b3d70085da277fb7beacbfd99f97715cd81d99ff5e6eef3c407c05bc3
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=tar.gz
|
SOURCE_FORMAT=tar.gz
|
||||||
SOURCE_IN_SUBDIR=false
|
SOURCE_IN_SUBDIR=false
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Wiki.js - CONFIGURATION #
|
# Wiki.js - CONFIGURATION #
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# Full documentation + examples:
|
# Full documentation + examples:
|
||||||
# https://docs-beta.requarks.io/install
|
# https://docs.requarks.io/install
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
# Port the server should listen to
|
# Port the server should listen to
|
||||||
|
@ -37,14 +37,6 @@ db:
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# Do not change unless you know what you are doing!
|
# Do not change unless you know what you are doing!
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
# Use X-Forwarded-For header
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
# Enable only if Wiki.js is behind a reverse-proxy (nginx, apache, etc)
|
|
||||||
# or a cloud proxying services like Cloudflare.
|
|
||||||
|
|
||||||
trustProxy: true
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
# SSL/TLS Settings
|
# SSL/TLS Settings
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
|
@ -113,3 +105,9 @@ uploads:
|
||||||
# download the offline files for sideloading.
|
# download the offline files for sideloading.
|
||||||
|
|
||||||
offline: false
|
offline: false
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------
|
||||||
|
# Data Path
|
||||||
|
# ---------------------------------------------------------------------
|
||||||
|
# Writeable data path for Wiki.js, mainly for cache and user uploads.
|
||||||
|
dataPath: ./data
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"en": "An open source, modern and powerful wiki app built on Node.js, Git and Markdown.",
|
"en": "An open source, modern and powerful wiki app built on Node.js, Git and Markdown.",
|
||||||
"fr": "Un wiki moderne et open source propulsé Node.js, Git et Markdown."
|
"fr": "Un wiki moderne et open source propulsé Node.js, Git et Markdown."
|
||||||
},
|
},
|
||||||
"version": "2.0.0-beta.303~ynh1",
|
"version": "2.0.12~ynh1",
|
||||||
"url": "https://wiki.js.org/",
|
"url": "https://wiki.js.org/",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
|
|
|
@ -38,7 +38,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Stopping a systemd service..."
|
ynh_print_info --message="Stopping a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="stop"
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped wikijs service"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE APP MAIN DIR
|
# BACKUP THE APP MAIN DIR
|
||||||
|
@ -70,6 +70,13 @@ ynh_print_info --message="Backing up systemd configuration..."
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/systemd/system/$app.service"
|
ynh_backup --src_path="/etc/systemd/system/$app.service"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# START SYSTEMD SERVICE
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info --message="Starting a systemd service..."
|
||||||
|
|
||||||
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server:"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -35,6 +35,23 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
#db_user=$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=db_pwd)
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info --message="Backing up the app before changing its url (may take a while)..."
|
||||||
|
|
||||||
|
# Backup the current version of the app
|
||||||
|
ynh_backup_before_upgrade
|
||||||
|
ynh_clean_setup () {
|
||||||
|
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
|
||||||
|
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
||||||
|
|
||||||
|
# restore it if the upgrade fails
|
||||||
|
ynh_restore_upgradebackup
|
||||||
|
}
|
||||||
|
# Exit if an error occurs during the execution of the script
|
||||||
|
ynh_abort_if_errors
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK WHICH PARTS SHOULD BE CHANGED
|
# CHECK WHICH PARTS SHOULD BE CHANGED
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -58,7 +75,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Stopping a systemd service..."
|
ynh_print_info --message="Stopping a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="stop"
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped wikijs service"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY URL IN NGINX CONF
|
# MODIFY URL IN NGINX CONF
|
||||||
|
@ -96,7 +113,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Starting a systemd service..."
|
ynh_print_info --message="Starting a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server:"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
|
|
@ -108,7 +108,7 @@ ynh_add_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Configuring system user ..."
|
ynh_print_info --message="Configuring system user..."
|
||||||
|
|
||||||
# Create a system user
|
# Create a system user
|
||||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
|
@ -138,16 +138,16 @@ ynh_add_systemd_config
|
||||||
config_file="$final_path/config.yml"
|
config_file="$final_path/config.yml"
|
||||||
cp -f ../conf/config.sample.yml $config_file
|
cp -f ../conf/config.sample.yml $config_file
|
||||||
|
|
||||||
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=$config_file
|
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_file"
|
||||||
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file=$config_file
|
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config_file"
|
||||||
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file=$config_file
|
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config_file"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE THE CONFIG FILE CHECKSUM
|
# STORE THE CONFIG FILE CHECKSUM
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Calculate and store the config file checksum into the app settings
|
# Calculate and store the config file checksum into the app settings
|
||||||
ynh_store_file_checksum --file=$config_file
|
ynh_store_file_checksum --file="$config_file"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
@ -159,19 +159,17 @@ ynh_store_file_checksum --file=$config_file
|
||||||
chown -R "$app":"$app" "$final_path"
|
chown -R "$app":"$app" "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# if using yunohost version 3.2 or more in the 'manifest.json', a description can be added
|
# if using yunohost version 3.2 or more in the 'manifest.json', a description can be added
|
||||||
yunohost service add $app --description "$app daemon for Wiki.js" -t systemd
|
yunohost service add $app --description "$app daemon for Wiki.js" --log_type systemd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action=start --line_match="Browse to http://localhost" --log_path=systemd
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server:"
|
||||||
|
|
||||||
sleep 30
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
|
|
|
@ -27,10 +27,10 @@ ldap_user=$(ynh_app_setting_get --app=$app --key=ldap_user)
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE SERVICE FROM ADMIN PANEL
|
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Remove a service from the admin panel, added by `yunohost service add`
|
# 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
|
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
||||||
then
|
then
|
||||||
ynh_print_info --message="Removing $app service..."
|
ynh_print_info --message="Removing $app service..."
|
||||||
|
|
|
@ -106,19 +106,17 @@ ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||||
systemctl enable $app.service
|
systemctl enable $app.service
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
yunohost service add $app --description "$app daemon for Wiki.js" -t systemd
|
yunohost service add $app --description "$app daemon for Wiki.js" --log_type systemd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Starting a systemd service..."
|
ynh_print_info --message="Starting a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action=start --log_path=systemd
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server:"
|
||||||
|
|
||||||
sleep 30
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE LDAP USER
|
# CREATE LDAP USER
|
||||||
|
|
|
@ -101,7 +101,7 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Stopping a systemd service..."
|
ynh_print_info --message="Stopping a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="stop"
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped wikijs service"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
@ -150,16 +150,16 @@ config_file="$final_path/config.yml"
|
||||||
ynh_backup_if_checksum_is_different --file=$config_file
|
ynh_backup_if_checksum_is_different --file=$config_file
|
||||||
cp -f ../conf/config.sample.yml $config_file
|
cp -f ../conf/config.sample.yml $config_file
|
||||||
|
|
||||||
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=$config_file
|
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_file"
|
||||||
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file=$config_file
|
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config_file"
|
||||||
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file=$config_file
|
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config_file"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE THE CONFIG FILE CHECKSUM
|
# STORE THE CONFIG FILE CHECKSUM
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Recalculate and store the checksum of the file for the next upgrade.
|
# Recalculate and store the checksum of the file for the next upgrade.
|
||||||
ynh_store_file_checksum --file=$config_file
|
ynh_store_file_checksum --file="$config_file"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
|
@ -196,9 +196,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Starting a systemd service..."
|
ynh_print_info --message="Starting a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server:"
|
||||||
|
|
||||||
sleep 30
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
|
Loading…
Reference in a new issue