1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nodebb_ynh.git synced 2024-09-03 19:46:29 +02:00

Merge pull request #21 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2021-09-23 08:48:43 +02:00 committed by GitHub
commit db07cc3654
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 26 additions and 31 deletions

View file

@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
NodeBB is built using the Node.js server-side Javascript platform, delivering unmatched performance. NodeBB is built using the Node.js server-side Javascript platform, delivering unmatched performance.
Building on this high performance platform means fast and dependable performance that will support even the biggest and most active community. Building on this high performance platform means fast and dependable performance that will support even the biggest and most active community.
**Shipped version:** 1.18.0~ynh1 **Shipped version:** 1.18.3~ynh1
**Demo:** https://try.nodebb.org **Demo:** https://try.nodebb.org

View file

@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
NodeBB is built using the Node.js server-side Javascript platform, delivering unmatched performance. NodeBB is built using the Node.js server-side Javascript platform, delivering unmatched performance.
Building on this high performance platform means fast and dependable performance that will support even the biggest and most active community. Building on this high performance platform means fast and dependable performance that will support even the biggest and most active community.
**Version incluse :** 1.18.0~ynh1 **Version incluse :** 1.18.3~ynh1
**Démo :** https://try.nodebb.org **Démo :** https://try.nodebb.org

View file

@ -5,7 +5,7 @@
admin="john" admin="john"
language="fr" language="fr"
is_public=1 is_public=1
password="password" password="password123456"
; Checks ; Checks
pkg_linter=1 pkg_linter=1
setup_sub_dir=1 setup_sub_dir=1

View file

@ -3,10 +3,7 @@
"secret": "__SECRET__", "secret": "__SECRET__",
"database": "postgres", "database": "postgres",
"port": "__PORT__", "port": "__PORT__",
"admin:username": "__ADMIN__", "bind_address": "127.0.0.1",
"admin:password": "__PASSWORD__",
"admin:password:confirm": "__PASSWORD__",
"admin:email": "admin@__DOMAIN__",
"postgres": { "postgres": {
"host": "localhost", "host": "localhost",
"port": "5432", "port": "5432",

View file

@ -6,7 +6,7 @@
"en": "Forum software built for the modern web", "en": "Forum software built for the modern web",
"fr": "Logiciel de forum conçu pour le Web moderne" "fr": "Logiciel de forum conçu pour le Web moderne"
}, },
"version": "1.18.0~ynh1", "version": "1.18.3~ynh1",
"url": "https://nodebb.org", "url": "https://nodebb.org",
"upstream": { "upstream": {
"license": "GPL-3.0", "license": "GPL-3.0",
@ -32,8 +32,7 @@
"install" : [ "install" : [
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain"
"example": "example.com"
}, },
{ {
"name": "path", "name": "path",
@ -43,8 +42,7 @@
}, },
{ {
"name": "admin", "name": "admin",
"type": "user", "type": "user"
"example": "johndoe"
}, },
{ {
"name": "is_public", "name": "is_public",
@ -53,8 +51,7 @@
}, },
{ {
"name": "password", "name": "password",
"type": "password", "type": "password"
"example": "Choose a password"
} }
] ]
} }

View file

@ -99,10 +99,10 @@ ynh_psql_setup_db --db_user=$db_name --db_name=$db_name
# Créer le dossier de log # Créer le dossier de log
mkdir -p /var/log/$app mkdir -p /var/log/$app
touch /var/log/$app/$app.log touch /var/log/$app/$app.log
install_log=/var/log/$app/installation.log #install_log=/var/log/$app/installation.log
touch $install_log #touch $install_log
chown $app -R /var/log/$app chown $app -R /var/log/$app
chown admin -R $install_log #chown admin -R $install_log
# Configuration de logrotate # Configuration de logrotate
ynh_use_logrotate ynh_use_logrotate
@ -123,25 +123,25 @@ chown -R $app:www-data "$final_path"
#================================================= #=================================================
# CONFIGURE NODEBB # CONFIGURE NODEBB
#================================================= #=================================================
ynh_script_progression --message="Configuring the $app..." --weight=2
ynh_add_config --template="../conf/config.json" --destination="$final_path/config.json"
setup="{ setup="{
\"url\": \"https://${domain}${path_url}\", \"admin:username\": \"$admin\",
\"admin:username\": \"${admin}\", \"admin:password\": \"$password\",
\"admin:password\": \"${password}\", \"admin:password:confirm\": \"$password\",
\"admin:password:confirm\": \"${password}\", \"admin:email\": \"admin@$domain\"
\"admin:email\": \"admin@${domain}\",
\"database\": \"postgres\",
\"postgres:host\": \"localhost\",
\"postgres:port\": \"5432\",
\"postgres:username\": \"$db_name\",
\"postgres:password\": \"$db_pwd\",
\"postgres:database\": \"$db_name\"
}" }"
pushd $final_path pushd $final_path
ynh_exec_as $app env $ynh_node_load_PATH $final_path/nodebb setup "${setup}" | tee -a $install_log ynh_use_nodejs
ynh_exec_as $app env $ynh_node_load_PATH $final_path/nodebb setup "${setup}" 2>/dev/null
popd popd
chmod 400 "$final_path/config.json"
chown $app:$app "$final_path/config.json"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================

View file

@ -84,13 +84,14 @@ then
ynh_script_progression --message="Upgrading source files..." --weight=1 ynh_script_progression --message="Upgrading source files..." --weight=1
pushd $final_path pushd $final_path
ynh_use_nodejs
# Shut down your forum # Shut down your forum
./nodebb stop ynh_exec_as $app env "$ynh_node_load_PATH" $final_path/nodebb stop
# Grab the latest and greatest code # Grab the latest and greatest code
git fetch # Grab the latest code from the NodeBB Repository git fetch # Grab the latest code from the NodeBB Repository
git reset --hard origin/$nodebb_version # Replace v1.12.x with the branch name! git reset --hard origin/$nodebb_version # Replace v1.12.x with the branch name!
# Run the NodeBB upgrade script # Run the NodeBB upgrade script
./nodebb upgrade ynh_exec_as $app $ynh_node_load_PATH $final_path/nodebb upgrade 2>/dev/null
popd popd
fi fi