1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wikijs_ynh.git synced 2024-09-03 20:36:09 +02:00

Merge pull request #29 from YunoHost-Apps/testing

Testing
This commit is contained in:
yalh76 2019-02-24 23:43:57 +01:00 committed by GitHub
commit 08f04a52f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 68 additions and 102 deletions

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://github.com/Requarks/wiki/archive/2.0.0-beta.42.tar.gz
SOURCE_SUM=cd1669229f87630498dcbad4e2b652bcd9ce9c88a0fe0c19b55b15f98d44d6e7
SOURCE_URL=https://github.com/Requarks/wiki/releases/download/2.0.0-beta.42/wiki-js.tar.gz
SOURCE_SUM=e53edc10b7a187b8418acbc069de7560b580540fab51a37e902010152fad2a6d
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_IN_SUBDIR=false
SOURCE_FILENAME=

View file

@ -10,13 +10,6 @@
port: __PORT__
# ---------------------------------------------------------------------
# IP address the server should listen to
# ---------------------------------------------------------------------
# Do not change unless you know what you are doing!
bindIP: 0.0.0.0
# ---------------------------------------------------------------------
# Database
# ---------------------------------------------------------------------
@ -38,16 +31,47 @@ db:
# SQLite only:
storage: path/to/database.sqlite
# ---------------------------------------------------------------------
# Redis
# ---------------------------------------------------------------------
# Redis 3.2 or later required
#######################################################################
# ADVANCED OPTIONS #
#######################################################################
# Do not change unless you know what you are doing!
redis:
host: localhost
port: 6379
db: 0
password: null
# ---------------------------------------------------------------------
# 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: false
# ---------------------------------------------------------------------
# SSL/TLS Settings
# ---------------------------------------------------------------------
# Consider using a reverse proxy (e.g. nginx) if you require more
# advanced options than those provided below.
ssl:
enabled: false
# Certificate format, either 'pem' or 'pfx':
format: pem
# Using PEM format:
key: path/to/key.pem
cert: path/to/cert.pem
# Using PFX format:
pfx: path/to/cert.pfx
# Passphrase when using encrypted PEM / PFX keys (default: null):
passphrase: null
# Diffie Hellman parameters, with key length being greater or equal
# to 1024 bits (default: null):
dhparam: null
# ---------------------------------------------------------------------
# IP address the server should listen to
# ---------------------------------------------------------------------
# Leave 0.0.0.0 for all interfaces
bindIP: 0.0.0.0
# ---------------------------------------------------------------------
# Log Level

View file

@ -6,8 +6,11 @@ After=network.target
Type=simple
User=__APP__
Group=__APP__
WorkingDirectory=__FINALPATH__/
ExecStart=/bin/sh -c '__NODEJS_PATH__/node __FINALPATH__/server >> /var/log/__APP__/__APP__.log 2>&1'
WorkingDirectory=__FINALPATH__
ExecStart=__NODEJS_PATH__/node __FINALPATH__/server
Restart=always
Environment=PATH=/usr/bin:/usr/local/bin:__NODEJS_PATH__
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target

View file

@ -6,7 +6,7 @@
"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."
},
"version": "2.0.0-beta.42~ynh1",
"version": "2.0.0-beta.42~ynh2",
"url": "https://wiki.js.org/",
"license": "AGPL-3.0-or-later",
"maintainer": {

View file

@ -69,7 +69,7 @@ ynh_psql_dump_db "$db_name" > db.sql
#=================================================
ynh_print_info "Backing up logrotate configuration..."
ynh_backup "/etc/logrotate.d/$app"
#ynh_backup "/etc/logrotate.d/$app"
#=================================================
# BACKUP SYSTEMD

View file

@ -89,13 +89,6 @@ port=$(ynh_find_port 8095)
#ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
ynh_app_setting_set $app port $port
#=================================================
# INSTALL YARN 1.13.0
#=================================================
ynh_print_info "Installing yarn 1.13.0..."
sudo apt install -y ../sources/yarn_1.13.0_all.deb
#=================================================
# INSTALL DEPENDENCIES
#=================================================
@ -108,9 +101,9 @@ ynh_print_info "Installing dependencies..."
### - As well as the section "REINSTALL DEPENDENCIES" in the restore script
### - And the section "UPGRADE DEPENDENCIES" in the upgrade script
ynh_install_nodejs 10
ynh_install_app_dependencies redis-server postgresql postgresql-contrib build-essential
ynh_install_nodejs 10
ynh_install_app_dependencies postgresql postgresql-contrib
#=================================================
# CREATE A POSTGRESQL DATABASE
@ -186,27 +179,9 @@ ynh_print_info "Configuring php-fpm ..."
#=================================================
# SPECIFIC SETUP
#=================================================
# CREATE LOG FOLDER
# ...
#=================================================
mkdir -p "/var/log/$app"
chown -R "$app":"$app" "/var/log/$app"
#=================================================
# MAKE SETUP
#=================================================
chown -R "$app":"$app" "$final_path"
pushd $final_path
ynh_use_nodejs
sudo -u $app env PATH=$PATH yarn cache clean
sudo -u $app env PATH=$PATH yarn --frozen-lockfile --non-interactive
sudo -u $app env PATH=$PATH yarn build
ynh_secure_remove $final_path/node_modules
sudo -u $app env PATH=$PATH yarn --production --frozen-lockfile --non-interactive
popd
#=================================================
# SETUP SYSTEMD
#=================================================
@ -267,7 +242,6 @@ cp -f ../conf/config.sample.yml "$final_path/config.yml"
### `ynh_replace_string` is used to replace a string in a file.
### (It's compatible with sed regular expressions syntax)
#ynh_replace_string "match_string" "replace_string" "$final_path/config.yml"
ynh_replace_string "__PORT__" "$port" "$final_path/config.yml"
ynh_replace_string "__DB_PWD__" "$db_pwd" "$final_path/config.yml"
ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/config.yml"
@ -310,7 +284,7 @@ ynh_print_info "Configuring log rotation ..."
### - And the section "SETUP LOGROTATE" in the upgrade script
# Use logrotate to manage application logfile(s)
ynh_use_logrotate
#ynh_use_logrotate
#=================================================
# ADVERTISE SERVICE IN ADMIN PANEL
@ -326,7 +300,7 @@ ynh_use_logrotate
#yunohost service add $app --log "/var/log/$app/$app.log"
# 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" --log "/var/log/$app/$app.log"
yunohost service add $app --description "$app daemon for Wiki.js" -t systemd
#=================================================
# SETUP SSOWAT
@ -351,7 +325,7 @@ systemctl reload nginx
# START SERVICE
#=================================================
ynh_systemd_action --action=start --service_name=$app --line_match="Browse to http://localhost"
ynh_systemd_action --action=start --service_name=$app --line_match="Browse to http://localhost" --log_path=systemd
#=================================================
# END OF SCRIPT

View file

@ -50,7 +50,6 @@ ynh_print_info "Removing the PostgreSQL database"
# Remove a database if it exists, along with the associated user
ynh_psql_remove_db "$db_name" "$db_name"
ynh_psql_drop_user "$db_name"
#=================================================
# REMOVE DEPENDENCIES
@ -62,13 +61,6 @@ ynh_remove_app_dependencies
ynh_use_nodejs
ynh_remove_nodejs
#=================================================
# REMOVE YARN 1.13.0
#=================================================
ynh_print_info "Removing yarn 1.13.0..."
sudo apt remove -y yarn
#=================================================
# REMOVE APP MAIN DIR
#=================================================
@ -99,7 +91,7 @@ ynh_print_info "Removing php-fpm configuration"
ynh_print_info "Removing logrotate configuration"
# Remove the app-specific logrotate config
ynh_remove_logrotate
#ynh_remove_logrotate
#=================================================
# CLOSE A PORT
@ -124,7 +116,7 @@ fi
ynh_secure_remove "/etc/$app/"
# Remove the log files
ynh_secure_remove "/var/log/$app/"
#ynh_secure_remove "/var/log/$app/"
#=================================================
# GENERIC FINALIZATION

View file

@ -91,7 +91,7 @@ ynh_print_info "Reinstalling dependencies..."
ynh_install_nodejs 10
ynh_install_app_dependencies redis-server postgresql postgresql-contrib build-essential
ynh_install_app_dependencies postgresql postgresql-contrib
#=================================================
# RESTORE THE POSTGRESQL DATABASE
@ -115,7 +115,7 @@ systemctl daemon-reload
# ADVERTISE SERVICE IN ADMIN PANEL
#=================================================
yunohost service add $app --description "$app daemon for Wiki.js" --log "/var/log/$app/$app.log"
yunohost service add $app --description "$app daemon for Wiki.js" -t systemd
#=================================================
# RESTORE THE CRON FILE
@ -127,7 +127,7 @@ yunohost service add $app --description "$app daemon for Wiki.js" --log "/var/lo
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_restore_file "/etc/logrotate.d/$app"
#ynh_restore_file "/etc/logrotate.d/$app"
#=================================================
# GENERIC FINALIZATION
@ -139,18 +139,11 @@ ynh_print_info "Reloading nginx web server and php-fpm..."
#systemctl reload php7.0-fpm
systemctl reload nginx
#=================================================
# CREATE LOG FOLDER
#=================================================
mkdir -p "/var/log/$app"
chown -R "$app":"$app" "/var/log/$app"
#=================================================
# START SERVICE
#=================================================
ynh_systemd_action --action=start --service_name=$app --line_match="Redis connection:"
ynh_systemd_action --action=start --service_name=$app --log_path=systemd
#=================================================
# END OF SCRIPT

View file

@ -56,6 +56,9 @@ fi
# Remove yarn repository
ynh_secure_remove "/etc/apt/sources.list.d/yarn.list"
# Remove old log file
ynh_secure_remove "/var/log/$app/"
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -102,13 +105,6 @@ ynh_print_info "Upgrading nginx web server configuration..."
# Create a dedicated nginx config
ynh_add_nginx_config
#=================================================
# INSTALL YARN 1.13.0
#=================================================
ynh_print_info "Installing yarn 1.13.0..."
sudo apt install -y ../sources/yarn_1.13.0_all.deb
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
@ -116,7 +112,7 @@ ynh_print_info "Upgrading dependencies..."
ynh_install_nodejs 10
ynh_install_app_dependencies redis-server postgresql postgresql-contrib build-essential
ynh_install_app_dependencies postgresql postgresql-contrib
#=================================================
# CREATE DEDICATED USER
@ -134,21 +130,6 @@ ynh_print_info "Upgrading php-fpm configuration..."
# Create a dedicated php-fpm config
#ynh_add_fpm_config
#=================================================
# MAKE SETUP
#=================================================
chown -R "$app":"$app" "$final_path"
pushd $final_path
ynh_use_nodejs
sudo -u $app env PATH=$PATH yarn cache clean
sudo -u $app env PATH=$PATH yarn --frozen-lockfile --non-interactive
sudo -u $app env PATH=$PATH yarn build
ynh_secure_remove $final_path/node_modules
sudo -u $app env PATH=$PATH yarn --production --frozen-lockfile --non-interactive
popd
#=================================================
# MODIFY A CONFIG FILE
#=================================================
@ -158,7 +139,6 @@ cp -f ../conf/config.sample.yml "$final_path/config.yml"
### `ynh_replace_string` is used to replace a string in a file.
### (It's compatible with sed regular expressions syntax)
#ynh_replace_string "match_string" "replace_string" "$final_path/config.yml"
ynh_replace_string "__PORT__" "$port" "$final_path/config.yml"
ynh_replace_string "__DB_PWD__" "$db_pwd" "$final_path/config.yml"
ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/config.yml"
@ -175,7 +155,7 @@ ynh_store_file_checksum "$final_path/config.yml"
ynh_print_info "Upgrading logrotate configuration..."
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
#ynh_use_logrotate --non-append
#=================================================
# SETUP SYSTEMD
@ -218,7 +198,7 @@ systemctl reload nginx
# START SERVICE
#=================================================
ynh_systemd_action --action=start --service_name=$app --line_match="Redis connection:"
ynh_systemd_action --action=start --service_name=$app --log_path=systemd
#=================================================
# END OF SCRIPT

Binary file not shown.