mirror of
https://github.com/YunoHost-Apps/petrolette_ynh.git
synced 2024-09-03 19:56:26 +02:00
Testing (#20)
* update to 1.6 * use dev environment to accept reverse proxy * add sed to allow subdomain Co-authored-by: Tobias Ollive <tobias@ollive.oiseauroch.fr> Co-authored-by: yunohost-bot <yunohost@yunohost.org>
This commit is contained in:
parent
0a1c3f314a
commit
8261c57c58
16 changed files with 251 additions and 58 deletions
26
README.md
26
README.md
|
@ -5,7 +5,7 @@ It shall NOT be edited by hand.
|
||||||
|
|
||||||
# Petrolette for YunoHost
|
# Petrolette for YunoHost
|
||||||
|
|
||||||
[![Integration level](https://dash.yunohost.org/integration/petrolette.svg)](https://dash.yunohost.org/appci/app/petrolette) ![](https://ci-apps.yunohost.org/ci/badges/petrolette.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/petrolette.maintain.svg)
|
[![Integration level](https://dash.yunohost.org/integration/petrolette.svg)](https://dash.yunohost.org/appci/app/petrolette) ![Working status](https://ci-apps.yunohost.org/ci/badges/petrolette.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/petrolette.maintain.svg)
|
||||||
[![Install Petrolette with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=petrolette)
|
[![Install Petrolette with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=petrolette)
|
||||||
|
|
||||||
*[Lire ce readme en français.](./README_fr.md)*
|
*[Lire ce readme en français.](./README_fr.md)*
|
||||||
|
@ -17,34 +17,40 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
|
||||||
|
|
||||||
The news reader that doesn't know you
|
The news reader that doesn't know you
|
||||||
|
|
||||||
**Shipped version:** 1.5.3~ynh1
|
**Shipped version:** 1.6.0~ynh1
|
||||||
|
|
||||||
**Demo:** https://petrolette.space
|
**Demo:** https://petrolette.space
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
![](./doc/screenshots/petrolette.png)
|
![Screenshot of Petrolette](./doc/screenshots/petrolette.webp)
|
||||||
|
|
||||||
## Disclaimers / important information
|
## Disclaimers / important information
|
||||||
|
|
||||||
- require a dedicated domain
|
|
||||||
|
|
||||||
- the application doesn't store anything locally. Restore/uprade operation is basically reinstalling the app.
|
- The application has 2 modes
|
||||||
|
- multi user : each user store is own config itself.
|
||||||
|
- mono user : configuration is store locally in the server. Each visitor see the same page.
|
||||||
|
/!\ For now, there is no any mechanism included for feed protection. Any visitor can modify the feed list.
|
||||||
|
|
||||||
|
- If you like this software, Please consider to [support the Pétrolette project by sending a donation](https://liberapay.com/yPhil/donate). Even the smallest amount will help a lot.
|
||||||
|
|
||||||
## Documentation and resources
|
## Documentation and resources
|
||||||
|
|
||||||
* Upstream app code repository: https://framagit.org/yphil/petrolette
|
* Upstream app code repository: <https://framagit.org/yphil/petrolette>
|
||||||
* YunoHost documentation for this app: https://yunohost.org/app_petrolette
|
* YunoHost documentation for this app: <https://yunohost.org/app_petrolette>
|
||||||
* Report a bug: https://github.com/YunoHost-Apps/petrolette_ynh/issues
|
* Report a bug: <https://github.com/YunoHost-Apps/petrolette_ynh/issues>
|
||||||
|
|
||||||
## Developer info
|
## Developer info
|
||||||
|
|
||||||
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/petrolette_ynh/tree/testing).
|
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/petrolette_ynh/tree/testing).
|
||||||
|
|
||||||
To try the testing branch, please proceed like that.
|
To try the testing branch, please proceed like that.
|
||||||
```
|
|
||||||
|
``` bash
|
||||||
sudo yunohost app install https://github.com/YunoHost-Apps/petrolette_ynh/tree/testing --debug
|
sudo yunohost app install https://github.com/YunoHost-Apps/petrolette_ynh/tree/testing --debug
|
||||||
or
|
or
|
||||||
sudo yunohost app upgrade petrolette -u https://github.com/YunoHost-Apps/petrolette_ynh/tree/testing --debug
|
sudo yunohost app upgrade petrolette -u https://github.com/YunoHost-Apps/petrolette_ynh/tree/testing --debug
|
||||||
```
|
```
|
||||||
|
|
||||||
**More info regarding app packaging:** https://yunohost.org/packaging_apps
|
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>
|
||||||
|
|
32
README_fr.md
32
README_fr.md
|
@ -1,10 +1,14 @@
|
||||||
|
<!--
|
||||||
|
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
|
||||||
|
It shall NOT be edited by hand.
|
||||||
|
-->
|
||||||
|
|
||||||
# Petrolette pour YunoHost
|
# Petrolette pour YunoHost
|
||||||
|
|
||||||
[![Niveau d'intégration](https://dash.yunohost.org/integration/petrolette.svg)](https://dash.yunohost.org/appci/app/petrolette) ![](https://ci-apps.yunohost.org/ci/badges/petrolette.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/petrolette.maintain.svg)
|
[![Niveau d'intégration](https://dash.yunohost.org/integration/petrolette.svg)](https://dash.yunohost.org/appci/app/petrolette) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/petrolette.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/petrolette.maintain.svg)
|
||||||
[![Installer Petrolette avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=petrolette)
|
[![Installer Petrolette avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=petrolette)
|
||||||
|
|
||||||
*[Read this readme in english.](./README.md)*
|
*[Read this readme in english.](./README.md)*
|
||||||
*[Lire ce readme en français.](./README_fr.md)*
|
|
||||||
|
|
||||||
> *Ce package vous permet d'installer Petrolette rapidement et simplement sur un serveur YunoHost.
|
> *Ce package vous permet d'installer Petrolette rapidement et simplement sur un serveur YunoHost.
|
||||||
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
|
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
|
||||||
|
@ -13,34 +17,40 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
|
||||||
|
|
||||||
La page d'actu qui ne sait rien de toi
|
La page d'actu qui ne sait rien de toi
|
||||||
|
|
||||||
**Version incluse :** 1.5.3~ynh1
|
**Version incluse :** 1.6.0~ynh1
|
||||||
|
|
||||||
**Démo :** https://petrolette.space
|
**Démo :** https://petrolette.space
|
||||||
|
|
||||||
## Captures d'écran
|
## Captures d'écran
|
||||||
|
|
||||||
![](./doc/screenshots/petrolette.png)
|
![Capture d'écran de Petrolette](./doc/screenshots/petrolette.webp)
|
||||||
|
|
||||||
## Avertissements / informations importantes
|
## Avertissements / informations importantes
|
||||||
|
|
||||||
- require a dedicated domain
|
|
||||||
|
|
||||||
- the application doesn't store anything locally. Restore/uprade operation is basically reinstalling the app.
|
- The application has 2 modes
|
||||||
|
- multi user : each user store is own config itself.
|
||||||
|
- mono user : configuration is store locally in the server. Each visitor see the same page.
|
||||||
|
/!\ For now, there is no any mechanism included for feed protection. Any visitor can modify the feed list.
|
||||||
|
|
||||||
|
- If you like this software, Please consider to [support the Pétrolette project by sending a donation](https://liberapay.com/yPhil/donate). Even the smallest amount will help a lot.
|
||||||
|
|
||||||
## Documentations et ressources
|
## Documentations et ressources
|
||||||
|
|
||||||
* Dépôt de code officiel de l'app : https://framagit.org/yphil/petrolette
|
* Dépôt de code officiel de l'app : <https://framagit.org/yphil/petrolette>
|
||||||
* Documentation YunoHost pour cette app : https://yunohost.org/app_petrolette
|
* Documentation YunoHost pour cette app : <https://yunohost.org/app_petrolette>
|
||||||
* Signaler un bug : https://github.com/YunoHost-Apps/petrolette_ynh/issues
|
* Signaler un bug : <https://github.com/YunoHost-Apps/petrolette_ynh/issues>
|
||||||
|
|
||||||
## Informations pour les développeurs
|
## Informations pour les développeurs
|
||||||
|
|
||||||
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/petrolette_ynh/tree/testing).
|
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/petrolette_ynh/tree/testing).
|
||||||
|
|
||||||
Pour essayer la branche testing, procédez comme suit.
|
Pour essayer la branche testing, procédez comme suit.
|
||||||
```
|
|
||||||
|
``` bash
|
||||||
sudo yunohost app install https://github.com/YunoHost-Apps/petrolette_ynh/tree/testing --debug
|
sudo yunohost app install https://github.com/YunoHost-Apps/petrolette_ynh/tree/testing --debug
|
||||||
ou
|
ou
|
||||||
sudo yunohost app upgrade petrolette -u https://github.com/YunoHost-Apps/petrolette_ynh/tree/testing --debug
|
sudo yunohost app upgrade petrolette -u https://github.com/YunoHost-Apps/petrolette_ynh/tree/testing --debug
|
||||||
```
|
```
|
||||||
|
|
||||||
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
|
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
is_public=1
|
is_public=1
|
||||||
; Checks
|
; Checks
|
||||||
pkg_linter=1
|
pkg_linter=1
|
||||||
setup_sub_dir=0
|
setup_sub_dir=1
|
||||||
setup_root=1
|
setup_root=1
|
||||||
setup_nourl=0
|
setup_nourl=0
|
||||||
setup_private=1
|
setup_private=1
|
||||||
|
@ -15,4 +15,4 @@
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
port_already_use=0
|
port_already_use=0
|
||||||
change_url=0
|
change_url=1
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://framagit.org/yphil/petrolette/-/archive/v1.5.6/petrolette-v1.5.6.tar.gz
|
SOURCE_URL=https://framagit.org/yphil/petrolette/-/archive/v1.6.0/petrolette-v1.6.0.tar.gz
|
||||||
SOURCE_SUM=f615a84aa5026ca18b79d3d14b2eaebd6e76dd047a325465d3d8957bc7bf5967
|
SOURCE_SUM=25cff32873fb643882a1b43681842a646d4e46a9802da2ab086ab29f770b7d7e
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=tar.gz
|
SOURCE_FORMAT=tar.gz
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
location / {
|
location __PATH__/ {
|
||||||
proxy_pass http://localhost:__PORT__/;
|
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_buffering off;
|
proxy_buffering off;
|
||||||
|
|
||||||
|
rewrite ^__PATH__$ __PATH__/ break;
|
||||||
|
proxy_pass http://localhost:__PORT__/;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
3
conf/petrolette.config.json
Normal file
3
conf/petrolette.config.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"instanceType" : "monoUser"
|
||||||
|
}
|
|
@ -5,33 +5,43 @@ After=network.target
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
Environment="__YNH_NODE_LOAD_PATH__"
|
Environment="__YNH_NODE_LOAD_PATH__"
|
||||||
|
Environment="NODE_ENV=development"
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
ExecStart=/bin/sh -c ' node http/server.js'
|
ExecStart=/bin/sh -c ' npm run unmanaged'
|
||||||
WorkingDirectory=__FINALPATH__/
|
WorkingDirectory=__FINALPATH__/
|
||||||
StandardOutput=syslog
|
|
||||||
StandardError=syslog
|
|
||||||
SyslogIdentifier=__APP__
|
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
; Some security directives.
|
# Sandboxing options to harden security
|
||||||
; Use private /tmp and /var/tmp folders inside a new file system namespace,
|
# Depending on specificities of your service/app, you may need to tweak these
|
||||||
; which are discarded after the process stops.
|
# .. but this should be a good baseline
|
||||||
PrivateTmp=true
|
# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
|
||||||
; Mount /usr, /boot, and /etc as read-only for processes invoked by this service.
|
NoNewPrivileges=yes
|
||||||
|
PrivateTmp=yes
|
||||||
|
PrivateDevices=yes
|
||||||
|
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
|
||||||
|
RestrictNamespaces=yes
|
||||||
|
RestrictRealtime=yes
|
||||||
|
DevicePolicy=closed
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
; Sets up a new /dev mount for the process and only adds API pseudo devices
|
ProtectControlGroups=yes
|
||||||
; like /dev/null, /dev/zero or /dev/random but not physical devices. Disabled
|
ProtectKernelModules=yes
|
||||||
; by default because it may not work on devices like the Raspberry Pi.
|
ProtectKernelTunables=yes
|
||||||
PrivateDevices=false
|
LockPersonality=yes
|
||||||
; Ensures that the service process and all its children can never gain new
|
SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap
|
||||||
; privileges through execve().
|
|
||||||
NoNewPrivileges=true
|
# Denying access to capabilities that should not be relevant for webapps
|
||||||
; This makes /home, /root, and /run/user inaccessible and empty for processes invoked
|
# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html
|
||||||
; by this unit. Make sure that you do not depend on data inside these folders.
|
CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD
|
||||||
ProtectHome=false
|
CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE
|
||||||
; Drops the sys admin capability from the daemon.
|
CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT
|
||||||
CapabilityBoundingSet=~CAP_SYS_ADMIN
|
CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK
|
||||||
|
CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM
|
||||||
|
CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG
|
||||||
|
CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE
|
||||||
|
CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW
|
||||||
|
CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG
|
||||||
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
- require a dedicated domain
|
|
||||||
|
|
||||||
- the application doesn't store anything locally. Restore/uprade operation is basically reinstalling the app.
|
- The application has 2 modes
|
||||||
|
- multi user : each user store is own config itself.
|
||||||
|
- mono user : configuration is store locally in the server. Each visitor see the same page.
|
||||||
|
/!\ For now, there is no any mechanism included for feed protection. Any visitor can modify the feed list.
|
||||||
|
|
||||||
|
- If you like this software, Please consider to [support the Pétrolette project by sending a donation](https://liberapay.com/yPhil/donate). Even the smallest amount will help a lot.
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 521 KiB |
BIN
doc/screenshots/petrolette.webp
Normal file
BIN
doc/screenshots/petrolette.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 78 KiB |
|
@ -6,7 +6,7 @@
|
||||||
"en": "The news reader that doesn't know you",
|
"en": "The news reader that doesn't know you",
|
||||||
"fr": "La page d'actu qui ne sait rien de toi"
|
"fr": "La page d'actu qui ne sait rien de toi"
|
||||||
},
|
},
|
||||||
"version": "1.5.3~ynh1",
|
"version": "1.6.0~ynh1",
|
||||||
"url": "https://framagit.org/yphil/petrolette",
|
"url": "https://framagit.org/yphil/petrolette",
|
||||||
"upstream": {
|
"upstream": {
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
|
@ -31,6 +31,25 @@
|
||||||
"name": "domain",
|
"name": "domain",
|
||||||
"type": "domain"
|
"type": "domain"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"type": "path",
|
||||||
|
"example": "/petrolette",
|
||||||
|
"default": "/petrolette"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mono_user",
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"ask": {
|
||||||
|
"fr" : "Cette instance est elle mono utilisateur ?",
|
||||||
|
"en" : "Is this instance mono user ?"
|
||||||
|
},
|
||||||
|
"help" : {
|
||||||
|
"fr" : "Cette instance ne proposera qu'une seule selection de flux, la même pour tous les visiteurs",
|
||||||
|
"en" : "This instance will have the same rss selection for any visitor visiting the page"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
# COMMON VARIABLES
|
# COMMON VARIABLES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
NODEJS_VERSION=15
|
NODEJS_VERSION=16
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
|
|
125
scripts/change_url
Normal file
125
scripts/change_url
Normal file
|
@ -0,0 +1,125 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# GENERIC STARTING
|
||||||
|
#=================================================
|
||||||
|
# IMPORT GENERIC HELPERS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
source _common.sh
|
||||||
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RETRIEVE ARGUMENTS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
old_domain=$YNH_APP_OLD_DOMAIN
|
||||||
|
old_path=$YNH_APP_OLD_PATH
|
||||||
|
|
||||||
|
new_domain=$YNH_APP_NEW_DOMAIN
|
||||||
|
new_path=$YNH_APP_NEW_PATH
|
||||||
|
|
||||||
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# LOAD SETTINGS
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||||
|
|
||||||
|
# Needed for helper "ynh_add_nginx_config"
|
||||||
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1
|
||||||
|
|
||||||
|
# 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
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
change_domain=0
|
||||||
|
if [ "$old_domain" != "$new_domain" ]
|
||||||
|
then
|
||||||
|
change_domain=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
change_path=0
|
||||||
|
if [ "$old_path" != "$new_path" ]
|
||||||
|
then
|
||||||
|
change_path=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# STANDARD MODIFICATIONS
|
||||||
|
#=================================================
|
||||||
|
# STOP SYSTEMD SERVICE
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||||
|
|
||||||
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# MODIFY URL IN NGINX CONF
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
||||||
|
|
||||||
|
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
||||||
|
|
||||||
|
# Change the path in the NGINX config file
|
||||||
|
if [ $change_path -eq 1 ]
|
||||||
|
then
|
||||||
|
# Make a backup of the original NGINX config file if modified
|
||||||
|
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
|
||||||
|
# Set global variables for NGINX helper
|
||||||
|
domain="$old_domain"
|
||||||
|
path_url="$new_path"
|
||||||
|
# Create a dedicated NGINX config
|
||||||
|
ynh_add_nginx_config
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Change the domain for NGINX
|
||||||
|
if [ $change_domain -eq 1 ]
|
||||||
|
then
|
||||||
|
# Delete file checksum for the old conf file location
|
||||||
|
ynh_delete_file_checksum --file="$nginx_conf_path"
|
||||||
|
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
|
||||||
|
# Store file checksum for the new config file location
|
||||||
|
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# GENERIC FINALISATION
|
||||||
|
#=================================================
|
||||||
|
# START SYSTEMD SERVICE
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RELOAD NGINX
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||||
|
|
||||||
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_script_progression --message="Change of URL completed for $app" --last
|
|
@ -24,8 +24,9 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url="/"
|
path_url=$YNH_APP_ARG_PATH
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
mono_user=$YNH_APP_ARG_MONO_USER
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -47,6 +48,7 @@ ynh_script_progression --message="Storing installation settings..."
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
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=path --value=$path_url
|
||||||
|
ynh_app_setting_set --app=$app --key=mono_user --value=$mono_user
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
|
@ -106,10 +108,17 @@ pushd $final_path
|
||||||
sed -i "/HTTP_PORT/s/[0-9]*[0-9]/$port/" package.json
|
sed -i "/HTTP_PORT/s/[0-9]*[0-9]/$port/" package.json
|
||||||
sed -i "/HTTPS_PORT/s/[0-9]*[0-9]/$https_port/" package.json
|
sed -i "/HTTPS_PORT/s/[0-9]*[0-9]/$https_port/" package.json
|
||||||
# use custom home value to avoid bower storing values in root and have right errors
|
# use custom home value to avoid bower storing values in root and have right errors
|
||||||
|
if [ $mono_user -eq 1 ] ; then
|
||||||
|
ynh_add_config --template="petrolette.config.json" --destination="petrolette.config.json"
|
||||||
|
fi
|
||||||
|
if [ "$path_url" != "/" ] ; then
|
||||||
|
sed -i "s|\$.get(\"/feed\", {|\$.get(\"feed\", {|" public/js/PTL.feed.js
|
||||||
|
fi
|
||||||
[[ -v HOME ]] && TMP_HOME=$HOME
|
[[ -v HOME ]] && TMP_HOME=$HOME
|
||||||
HOME=$(pwd)
|
HOME=$(pwd)
|
||||||
|
export NODE_ENV=production
|
||||||
ynh_use_nodejs
|
ynh_use_nodejs
|
||||||
ynh_npm install
|
ynh_npm install --ignore-scripts
|
||||||
[[ -v TMP_HOME ]] && HOME=$TMP_HOME || unset HOME
|
[[ -v TMP_HOME ]] && HOME=$TMP_HOME || unset HOME
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
@ -140,7 +149,7 @@ yunohost service add $app --description="The news reader that doesn't know you"
|
||||||
ynh_script_progression --message="Starting a systemd service..."
|
ynh_script_progression --message="Starting a systemd service..."
|
||||||
|
|
||||||
# Start a systemd service
|
# Start a systemd service
|
||||||
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="(v1.5.6)"
|
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Pétrolette HTTP Server running on port"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
|
|
|
@ -98,7 +98,7 @@ yunohost service add $app --description="The news reader that doesn't know you"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Directory created"
|
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Pétrolette HTTP Server running on port"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
|
@ -99,11 +99,14 @@ pushd $final_path
|
||||||
# set port in configuration file
|
# set port in configuration file
|
||||||
sed -i "/HTTP_PORT/s/[0-9]*[0-9]/$port/" package.json
|
sed -i "/HTTP_PORT/s/[0-9]*[0-9]/$port/" package.json
|
||||||
sed -i "/HTTPS_PORT/s/[0-9]*[0-9]/$https_port/" package.json
|
sed -i "/HTTPS_PORT/s/[0-9]*[0-9]/$https_port/" package.json
|
||||||
|
if [ "$path_url" != "/" ] ; then
|
||||||
|
sed -i "s|\$.get(\"/feed\", {|\$.get(\"feed\", {|" public/js/PTL.feed.js
|
||||||
|
fi
|
||||||
|
|
||||||
[[ -v HOME ]] && TMP_HOME=$HOME
|
[[ -v HOME ]] && TMP_HOME=$HOME
|
||||||
HOME=$(pwd)
|
HOME=$(pwd)
|
||||||
ynh_use_nodejs
|
ynh_use_nodejs
|
||||||
ynh_npm install
|
ynh_npm update
|
||||||
[[ -v TMP_HOME ]] && HOME=$TMP_HOME || unset HOME
|
[[ -v TMP_HOME ]] && HOME=$TMP_HOME || unset HOME
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
@ -133,7 +136,8 @@ yunohost service add $app --description="The news reader that doesn't know you"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="(v1.5.6)"
|
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Pétrolette HTTP Server running on port"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
|
Loading…
Reference in a new issue