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

Merge pull request #50 from YunoHost-Apps/testing

Testing
This commit is contained in:
Alexandre Aubin 2020-11-26 18:47:46 +01:00 committed by GitHub
commit b606544077
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 21 additions and 42 deletions

View file

@ -1,4 +1,4 @@
# Lstu app for YunoHost
# Lstu for YunoHost
[![Integration level](https://dash.yunohost.org/integration/lstu.svg)](https://dash.yunohost.org/appci/app/lstu) ![](https://ci-apps.yunohost.org/ci/badges/lstu.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/lstu.maintain.svg)
[![Install Lstu with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=lstu)
@ -31,27 +31,23 @@ How to configure this app: a plain file at `/var/www/lstu/lstu.conf` with SSH.
#### Multi-user support
Are LDAP and HTTP auth supported? **Yes**
Can the app be used by multiple users? **Yes**
* Are LDAP and HTTP auth supported? **Yes**
* Can the app be used by multiple users? **Yes**
#### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/lstu%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/lstu/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/lstu%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/lstu/)
**More info on the documentation page:**
https://yunohost.org/packaging_apps
## Links
* Report a bug: https://github.com/YunoHost-Apps/lstu_ynh/issues
* Upstream app repository: Link to the official repository of the upstream app.
* Upstream app repository: https://framagit.org/fiat-tux/hat-softwares/lstu
* YunoHost website: https://yunohost.org/
---
Developer info
----------------
## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/lstu_ynh/tree/testing).

View file

@ -3,10 +3,10 @@ Description=Shortened URLs service job queue
Documentation=https://framagit.org/luc/lstu
[Service]
Type=simple
Type=forking
User=www-data
WorkingDirectory=__FINALPATH__
ExecStart=/usr/local/bin/carton exec script/application minion worker
ExecStart=/usr/bin/carton exec script/application minion worker
[Install]
WantedBy=multi-user.target

View file

@ -5,16 +5,15 @@ Requires=network.target
After=network.target
[Service]
Type=simple
Type=forking
User=www-data
RemainAfterExit=yes
Restart=always
RestartSec=10
WorkingDirectory=__FINALPATH__
PIDFile=__FINALPATH__/script/hypnotoad.pid
ExecStart=/usr/local/bin/carton exec hypnotoad script/lstu
ExecStop=/usr/local/bin/carton exec hypnotoad -s script/lstu
ExecReload=/usr/local/bin/carton exec hypnotoad script/lstu
ExecStart=/usr/bin/carton exec hypnotoad script/lstu
ExecStop=/usr/bin/carton exec hypnotoad -s script/lstu
ExecReload=/usr/bin/carton exec hypnotoad script/lstu
[Install]
WantedBy=multi-user.target

View file

@ -14,7 +14,7 @@
"email": "abld@abld.info"
},
"requirements": {
"yunohost": ">= 3.5"
"yunohost": ">= 4.0"
},
"multi_instance": true,
"services": [

View file

@ -5,7 +5,7 @@
#=================================================
# dependencies used by the app
pkg_dependencies="build-essential libssl-dev zlib1g-dev libpng-dev libpq-dev memcached postgresql cpanminus"
pkg_dependencies="build-essential libssl-dev zlib1g-dev libpng-dev libpq-dev memcached postgresql carton"
#=================================================
# PERSONAL HELPERS

View file

@ -61,19 +61,12 @@ ynh_app_setting_set --app=$app --key=hashed_password --value=$hashed_password
#=================================================
# FIND AND OPEN A PORT
#=================================================
ynh_script_progression --message="Configuring firewall..."
ynh_script_progression --message="Finding an available port..."
# Find an available port
port=$(ynh_find_port --port=8095)
ynh_app_setting_set --app=$app --key=port --value=$port
# Optional: Expose this port publicly
# (N.B. : you only need to do this if the app actually needs to expose the port publicly.
# If you do this and the app doesn't actually need you are CREATING SECURITY HOLES IN THE SERVER !)
# Open the port
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
#=================================================
# INSTALL DEPENDENCIES
#=================================================
@ -81,9 +74,6 @@ ynh_script_progression --message="Installing dependencies..."
ynh_install_app_dependencies $pkg_dependencies
# Install Carton
echo yes | cpanm Carton
#=================================================
# CREATE A POSTGRESQL DATABASE
#=================================================

View file

@ -83,16 +83,6 @@ ynh_script_progression --message="Removing logrotate configuration..."
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# CLOSE A PORT
#=================================================
if yunohost firewall list | grep -q "\- $port$"
then
ynh_script_progression --message="Closing port $port..."
ynh_exec_warn_less yunohost firewall disallow TCP $port
fi
#=================================================
# SPECIFIC REMOVE
#=================================================

View file

@ -86,9 +86,6 @@ ynh_script_progression --message="Reinstalling dependencies..."
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
# Install Carton
echo yes | cpanm Carton
#=================================================
# RESTORE THE POSTGRESQL DATABASE
#=================================================

View file

@ -90,6 +90,13 @@ if [ -z "$hashed_password" ]; then
ynh_app_setting_set --app=$app --key=hashed_password --value=$hashed_password
fi
# In previous versions, the port was mistakenly exposed to the outside world >_>
if yunohost firewall list | grep -q "\- $port$"
then
ynh_script_progression --message="Closing port $port..."
ynh_exec_warn_less yunohost firewall disallow TCP $port
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================