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 #52 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2021-02-01 18:33:24 +01:00 committed by GitHub
commit 469fb267eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 40 additions and 34 deletions

BIN
LSTU_screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View file

@ -1,19 +1,19 @@
# Lstu 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) [![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) [![Install Lstu with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=lstu)
> *This package allows you to install Lstu quickly and simply on a YunoHost server. > *This package allows you to install Lstu quickly and simply on a YunoHost server.
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview ## Overview
Lstu means Let's Shorten That Url. Lstu means Let's Shorten That URL.
**Shipped version:** 0.22-0 **Shipped version:** 0.22-0
## Screenshots ## Screenshots
![](https://framalibre.org/sites/default/files/Screenshot_20161213_120016_1.png) ![](LSTU_screenshot.png)
## Demo ## Demo

View file

@ -8,14 +8,16 @@
0 0
], ],
"description": { "description": {
"en": "Change the public access of the app." "en": "Change the public access of the app.",
"fr": "Modifiez l'accès public de l'application."
}, },
"arguments": [ "arguments": [
{ {
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"ask": { "ask": {
"en": "Is it a public app ?" "en": "Is it a public app?",
"fr": "Est-ce une application publique ?"
}, },
"default": true "default": true
} }

View file

@ -17,13 +17,8 @@
upgrade=1 from_commit=2d33783907d6de4486ac9e954ebc4b4028e11de8 upgrade=1 from_commit=2d33783907d6de4486ac9e954ebc4b4028e11de8
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.
# incorrect_path=1
port_already_use=1 (8095) port_already_use=1 (8095)
change_url=1 change_url=1
;;; Levels
# If the level 5 (Package linter) is forced to 1. Please add justifications here.
Level 5=auto
;;; Upgrade options ;;; Upgrade options
; commit=2d33783907d6de4486ac9e954ebc4b4028e11de8 ; commit=2d33783907d6de4486ac9e954ebc4b4028e11de8
name=0.21-4~ynh4 name=0.21-4~ynh4

View file

@ -4,7 +4,9 @@ Documentation=https://framagit.org/luc/lstu
[Service] [Service]
Type=forking Type=forking
User=www-data User=__APP__
Restart=always
RestartSec=10
WorkingDirectory=__FINALPATH__ WorkingDirectory=__FINALPATH__
ExecStart=/usr/bin/carton exec script/application minion worker ExecStart=/usr/bin/carton exec script/application minion worker

View file

@ -6,7 +6,7 @@ After=network.target
[Service] [Service]
Type=forking Type=forking
User=www-data User=__APP__
Restart=always Restart=always
RestartSec=10 RestartSec=10
WorkingDirectory=__FINALPATH__ WorkingDirectory=__FINALPATH__

View file

@ -7,7 +7,7 @@ about: Create a report to help us debug, it would be nice to fill the template a
**How to post a meaningful bug report** **How to post a meaningful bug report**
1. *Read this whole template first.* 1. *Read this whole template first.*
2. *Determine if you are on the right place:* 2. *Determine if you are on the right place:*
- *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change url...), you are on the right place!* - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
- *Otherwise, the issue may be due to lstu itself. Refer to its documentation or repository for help.* - *Otherwise, the issue may be due to lstu itself. Refer to its documentation or repository for help.*
- *If you have a doubt, post here, we will figure it out together.* - *If you have a doubt, post here, we will figure it out together.*
3. *Delete the italic comments as you write over them below, and remove this guide.* 3. *Delete the italic comments as you write over them below, and remove this guide.*
@ -34,8 +34,8 @@ about: Create a report to help us debug, it would be nice to fill the template a
- *If you used the webadmin, please perform the equivalent command from the CLI first.* - *If you used the webadmin, please perform the equivalent command from the CLI first.*
- *If the error occurs in your browser, explain what you did:* - *If the error occurs in your browser, explain what you did:*
1. *Go to '...'* 1. *Go to '...'*
2. *Click on '....'* 2. *Click on '...'*
3. *Scroll down to '....'* 3. *Scroll down to '...'*
4. *See error* 4. *See error*
**Expected behavior** **Expected behavior**

View file

@ -6,7 +6,7 @@
"en": "URL Shortener", "en": "URL Shortener",
"fr": "Raccoursisseur d'URL" "fr": "Raccoursisseur d'URL"
}, },
"version": "0.22-0~ynh1", "version": "0.22-0~ynh2",
"url": "https://lstu.fr", "url": "https://lstu.fr",
"license": "WTFPL", "license": "WTFPL",
"maintainer": { "maintainer": {

View file

@ -42,7 +42,7 @@ hashed_password=$(ynh_app_setting_get --app=$app --key=hashed_password)
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..."
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
@ -84,7 +84,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================
ynh_script_progression --message="Updating nginx web server configuration..." ynh_script_progression --message="Updating NGINX web server configuration..."
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
@ -169,7 +169,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload

View file

@ -99,7 +99,7 @@ ynh_setup_source --dest_dir="$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring nginx web server..." ynh_script_progression --message="Configuring NGINX web server..."
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
@ -117,7 +117,7 @@ ynh_system_user_create --username=$app
#================================================= #=================================================
# CONFIGURE LSTU # CONFIGURE LSTU
#================================================= #=================================================
ynh_script_progression --message="Configuring lstu..." ynh_script_progression --message="Configuring Lstu..."
config="${final_path}/lstu.conf" config="${final_path}/lstu.conf"
cp ../conf/lstu.conf.template "$config" cp ../conf/lstu.conf.template "$config"
@ -143,7 +143,7 @@ ynh_store_file_checksum --file="$config"
#================================================= #=================================================
# INSTALL LSTU # INSTALL LSTU
#================================================= #=================================================
ynh_script_progression --message="Installing lstu..." ynh_script_progression --message="Installing Lstu..."
pushd $final_path pushd $final_path
carton install --deployment --without=sqlite --without=mysql carton install --deployment --without=sqlite --without=mysql
@ -165,7 +165,7 @@ ynh_add_systemd_config
ynh_script_progression --message="Securing files and directories..." ynh_script_progression --message="Securing files and directories..."
# Set permissions to app files # Set permissions to app files
chown -R www-data $final_path chown -R $app: $final_path
#================================================= #=================================================
# SETUP LOGROTATE # SETUP LOGROTATE
@ -180,7 +180,7 @@ ynh_use_logrotate
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --log "/var/log/$app.log" --log "/var/www/$app/log/production.log" yunohost service add $app --log="/var/log/$app.log" --log="/var/www/$app/log/production.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
@ -211,7 +211,7 @@ fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload

View file

@ -70,7 +70,7 @@ ynh_secure_remove --file="$final_path"
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Removing nginx web server configuration..." ynh_script_progression --message="Removing NGINX web server configuration..."
# Remove the dedicated nginx config # Remove the dedicated nginx config
ynh_remove_nginx_config ynh_remove_nginx_config

View file

@ -49,7 +49,7 @@ test ! -d $final_path \
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION # RESTORE THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Restoring the nginx configuration..." ynh_script_progression --message="Restoring the NGINX configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
@ -74,7 +74,7 @@ ynh_system_user_create --username=$app
ynh_script_progression --message="Restoring user rights..." ynh_script_progression --message="Restoring user rights..."
# Restore permissions on app files # Restore permissions on app files
chown -R www-data $final_path chown -R $app: $final_path
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
@ -101,14 +101,14 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name"
ynh_script_progression --message="Restoring the systemd configuration..." ynh_script_progression --message="Restoring the systemd configuration..."
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service systemctl enable $app.service --quiet
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --log "/var/log/$app.log" --log "/var/www/$app/log/production.log" yunohost service add $app --log="/var/log/$app.log" --log="/var/www/$app/log/production.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
@ -129,7 +129,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload

View file

@ -136,7 +136,7 @@ fi
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Upgrading nginx web server configuration..." ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
@ -218,7 +218,14 @@ ynh_add_systemd_config
ynh_script_progression --message="Securing files and directories..." ynh_script_progression --message="Securing files and directories..."
# Set permissions on app files # Set permissions on app files
chown -R www-data $final_path chown -R $app: $final_path
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $app --log="/var/log/$app.log" --log="/var/www/$app/log/production.log"
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
@ -248,7 +255,7 @@ ynh_systemd_action --service_name=$app --action=reload --line_match="Reloaded Sh
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload