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

cleaning up

This commit is contained in:
ericgaspar 2021-04-22 23:52:56 +02:00
parent 469fb267eb
commit 5345427e47
No known key found for this signature in database
GPG key ID: 574F281483054D44
5 changed files with 16 additions and 41 deletions

View file

@ -36,8 +36,8 @@ How to configure this app: a plain file at `/var/www/lstu/lstu.conf` with SSH.
#### 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/)
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/lstu.svg)](https://ci-apps.yunohost.org/ci/apps/lstu/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/lstu.svg)](https://ci-apps-arm.yunohost.org/ci/apps/lstu/)
## Links
@ -57,9 +57,3 @@ sudo yunohost app install https://github.com/YunoHost-Apps/lstu_ynh/tree/testing
or
sudo yunohost app upgrade lstu -u https://github.com/YunoHost-Apps/lstu_ynh/tree/testing --debug
```
## Todo
- [ ] Allow to choose the database (sqlite or PostgreSQL)
- [ ] Allow to choose to use Minion
- [ ] Add CI stuff

View file

@ -14,7 +14,7 @@
"email": "abld@abld.info"
},
"requirements": {
"yunohost": ">= 4.0"
"yunohost": ">= 4.1.7"
},
"multi_instance": true,
"services": [
@ -25,29 +25,17 @@
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain for Lstu",
"fr": "Choisissez un domaine pour Lstu"
},
"example": "domain.org"
},
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for Lstu",
"fr": "Choisissez un chemin pour Lstu"
},
"example": "/lstu",
"default": "/lstu"
},
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"default": false
},
{
@ -66,10 +54,6 @@
{
"name": "password",
"type": "password",
"ask": {
"en": "Choose a password",
"fr": "Choisissez un mot de passe"
}
}
]
}

View file

@ -13,6 +13,4 @@
## Package_check results
---
*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results*
[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/lstu_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/lstu_ynh%20PR-NUM-%20(USERNAME)/)
* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"*

View file

@ -85,7 +85,6 @@ db_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) # Password created in ynh_psql_setup_db function
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -193,9 +192,10 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring SSOwat..."
ynh_script_progression --message="Configuring permissions..."
ynh_permission_update --permission="main" --add="visitors"
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
if [ $is_public -eq 0 ]
then
# If the app is private, only the shortened URLs are publics.

View file

@ -40,15 +40,6 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
# Fix is_public as a boolean value
if [ "$is_public" = "Yes" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=1
is_public=1
elif [ "$is_public" = "No" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=0
is_public=0
fi
# If final_path doesn't exist, create it
if [ -z "$final_path" ]; then
final_path=/var/www/$app
@ -97,6 +88,13 @@ then
ynh_exec_warn_less yunohost firewall disallow TCP $port
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -232,7 +230,8 @@ yunohost service add $app --log="/var/log/$app.log" --log="/var/www/$app/log/pro
#=================================================
ynh_script_progression --message="Upgrading SSOwat configuration..."
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
ynh_permission_update --permission="main" --add="visitors"
if [ $is_public -eq 0 ]
then
# If the app is private, only the shortened URLs are publics.