1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ulogger_ynh.git synced 2024-10-01 13:34:45 +02:00

Merge pull request #17 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2022-07-16 07:52:21 +02:00 committed by GitHub
commit 4755ef9544
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 190 additions and 111 deletions

View file

@ -1,67 +1,61 @@
# μlogger for YunoHost
<!--
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.
-->
[![Integration level](https://dash.yunohost.org/integration/ulogger.svg)](https://dash.yunohost.org/appci/app/ulogger) ![](https://ci-apps.yunohost.org/ci/badges/ulogger.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/ulogger.maintain.svg)
[![Install μlogger with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ulogger)
# ulogger for YunoHost
> *This package allows you to install μlogger quickly and simply on a YunoHost server.
[![Integration level](https://dash.yunohost.org/integration/ulogger.svg)](https://dash.yunohost.org/appci/app/ulogger) ![Working status](https://ci-apps.yunohost.org/ci/badges/ulogger.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/ulogger.maintain.svg)
[![Install ulogger with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ulogger)
*[Lire ce readme en français.](./README_fr.md)*
> *This package allows you to install ulogger 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.*
## Overview
This is a web application for real-time collection of geolocation data, tracks viewing and management. Together with a dedicated [μlogger mobile client](https://github.com/bfabiszewski/ulogger-android) it may be used as a complete self hosted serverclient solution for logging and monitoring users' geolocation.
**Version:** 1.0
**μlogger** is a web application for real-time collection of geolocation data, tracks viewing and management.
Together with a dedicated [μlogger mobile client](https://github.com/bfabiszewski/ulogger-android
) it may be used as a complete self hosted serverclient solution for logging and monitoring users' geolocation.
**Shipped version:** 1.1~ynh1
## Screenshots
![](screenshot.png)
![Screenshot of ulogger](./doc/screenshots/screenshot.png)
## Demo
* [Official demo](http://ulogger.fabiszewski.net/) (login: demo, password: demo)
## Disclaimers / important information
## Configuration
How to configure this app: From an admin panel, a plain file with SSH, or any other way.
### Login
**Name:** The user selected during installation
## Documentation
**Password:** Will be emailed to you immediately after installation
* Official documentation: Link to the official documentation of this app
* YunoHost documentation: If specific documentation is needed, feel free to contribute.
### How to configure this app:
From an admin panel, or a plain file with SSH.
## YunoHost specific features
## Documentation and resources
#### Multi-user support
* Are LDAP and HTTP auth supported? **No**
* Can the app be used by multiple users? **Yes**
#### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/ulogger%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/ulogger/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/ulogger%20%28Community%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/ulogger/)
## Limitations
* Any known limitations.
## Additional information
* Other info you would like to add about this app.
## Links
* Report a bug: https://github.com/YunoHost-Apps/ulogger_ynh/issues
* Upstream app repository: https://github.com/bfabiszewski/ulogger-server
* YunoHost website: https://yunohost.org/
---
* Official app website: <https://github.com/bfabiszewski/ulogger-server>
* Upstream app code repository: <https://github.com/bfabiszewski/ulogger-server>
* YunoHost documentation for this app: <https://yunohost.org/app_ulogger>
* Report a bug: <https://github.com/YunoHost-Apps/ulogger_ynh/issues>
## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/ulogger_ynh/tree/testing).
To try the testing branch, please proceed like that.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/ulogger_ynh/tree/testing --debug
or
sudo yunohost app upgrade ulogger -u https://github.com/YunoHost-Apps/ulogger_ynh/tree/testing --debug
```
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>

61
README_fr.md Normal file
View file

@ -0,0 +1,61 @@
<!--
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.
-->
# ulogger pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/ulogger.svg)](https://dash.yunohost.org/appci/app/ulogger) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/ulogger.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/ulogger.maintain.svg)
[![Installer ulogger avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ulogger)
*[Read this readme in english.](./README.md)*
> *Ce package vous permet d'installer ulogger 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.*
## Vue d'ensemble
**μlogger** is a web application for real-time collection of geolocation data, tracks viewing and management.
Together with a dedicated [μlogger mobile client](https://github.com/bfabiszewski/ulogger-android
) it may be used as a complete self hosted serverclient solution for logging and monitoring users' geolocation.
**Version incluse :** 1.1~ynh1
## Captures d'écran
![Capture d'écran de ulogger](./doc/screenshots/screenshot.png)
## Avertissements / informations importantes
## Configuration
### Login
**Name:** The user selected during installation
**Password:** Will be emailed to you immediately after installation
### How to configure this app:
From an admin panel, or a plain file with SSH.
## Documentations et ressources
* Site officiel de l'app : <https://github.com/bfabiszewski/ulogger-server>
* Dépôt de code officiel de l'app : <https://github.com/bfabiszewski/ulogger-server>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_ulogger>
* Signaler un bug : <https://github.com/YunoHost-Apps/ulogger_ynh/issues>
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/ulogger_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/ulogger_ynh/tree/testing --debug
ou
sudo yunohost app upgrade ulogger -u https://github.com/YunoHost-Apps/ulogger_ynh/tree/testing --debug
```
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/bfabiszewski/ulogger-server/archive/v1.0.zip
SOURCE_SUM=aac2f69f64477b3a1c4265d19603fa32d9ba385f3e00358c0a4f08e7dcbb2020
SOURCE_URL=https://github.com/bfabiszewski/ulogger-server/archive/v1.1.zip
SOURCE_SUM=558B83214EF8DD04DEBF826D5330367D478EBD360A6DFD3C8328CDED07C0E1A9
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true

View file

@ -27,7 +27,7 @@
// mysql:unix_socket=/tmp/mysql.sock;dbname=ulogger;charset=utf8
// pgsql:host=localhost;port=5432;dbname=ulogger
// sqlite:/tmp/ulogger.db
$dbdsn = "mysql:host=localhost;port=3307;dbname=__DB_USER__;charset=utf8";
$dbdsn = "mysql:host=localhost;port=3307;dbname=__DB_NAME__;charset=utf8";
// Database user name
$dbuser = "__DB_USER__";

View file

@ -4,10 +4,6 @@ location __PATH__/ {
# Path to source
alias __FINALPATH__/ ;
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
index index.html index.php;
# Common parameter to increase upload size limit in conjuction with dedicated php-fpm file

4
doc/DESCRIPTION.md Normal file
View file

@ -0,0 +1,4 @@
**μlogger** is a web application for real-time collection of geolocation data, tracks viewing and management.
Together with a dedicated [μlogger mobile client](https://github.com/bfabiszewski/ulogger-android
) it may be used as a complete self hosted serverclient solution for logging and monitoring users' geolocation.

9
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,9 @@
## Configuration
### Login
**Name:** The user selected during installation
**Password:** Will be emailed to you immediately after installation
### How to configure this app:
From an admin panel, or a plain file with SSH.

View file

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

View file

@ -3,18 +3,23 @@
"id": "ulogger",
"packaging_format": 1,
"description": {
"en": "Real-time collection of geolocation data, tracks viewing and management.",
"fr": "Géolocalisation en temps réel, gestion et affichage de traces."
"en": "Real-time collection of geolocation data, tracks viewing and management",
"fr": "Géolocalisation en temps réel, gestion et affichage de traces"
},
"version": "1.0~ynh1",
"version": "1.1~ynh1",
"url": "https://github.com/bfabiszewski/ulogger-server",
"upstream": {
"license": "AGPL-3.0-only",
"website": "https://github.com/bfabiszewski/ulogger-server",
"code": "https://github.com/bfabiszewski/ulogger-server"
},
"license": "AGPL-3.0-only",
"maintainer": {
"name": "Anmol Sharma",
"email": "anmol@datamol.org"
},
"requirements": {
"yunohost": ">= 4.1.7"
"yunohost": ">= 4.3.0"
},
"multi_instance": true,
"services": [
@ -26,8 +31,7 @@
"install" : [
{
"name": "domain",
"type": "domain",
"example": "example.com"
"type": "domain"
},
{
"name": "path",
@ -37,13 +41,16 @@
},
{
"name": "admin",
"type": "string",
"example": "johndoe"
"type": "user"
},
{
"name": "is_public",
"type": "boolean",
"default": true
"help": {
"en": "If enabled, ulogger will be accessible by people who do not have an account. This can be changed later via the webadmin.",
"fr": "Si cette case est cochée, ulogger sera accessible aux personnes nayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."
},
"default": true
},
{
"name": "language",

View file

@ -42,26 +42,26 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR
#=================================================
ynh_backup "$final_path"
ynh_backup --src_path="$final_path"
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================
ynh_backup "/etc/php/$phpversion/fpm/pool.d/$app.conf"
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#=================================================
# BACKUP THE MYSQL DATABASE
#=================================================
ynh_print_info --message="Backing up the MySQL database..."
ynh_mysql_dump_db "$db_name" > db.sql
ynh_mysql_dump_db --database="$db_name" > db.sql
#=================================================
# END OF SCRIPT

View file

@ -53,6 +53,14 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=language --value=$language
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..."
# Create a system user
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# CREATE A MYSQL DATABASE
#=================================================
@ -60,7 +68,6 @@ ynh_script_progression --message="Creating a MySQL database..."
db_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
@ -81,14 +88,6 @@ ynh_script_progression --message="Configuring NGINX web server..."
# Create a dedicated nginx config
ynh_add_nginx_config
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..."
# Create a system user
ynh_system_user_create $app
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
@ -113,6 +112,7 @@ cp "../conf/config.php" "$final_path/config.php"
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/config.php"
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/config.php"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config.php"
ynh_replace_string --match_string="\$enabled = false;" --replace_string="\$enabled = true;" --target_file="$final_path/scripts/setup.php"
@ -157,6 +157,10 @@ ynh_store_file_checksum "$final_path/config.php"
# Set permissions to app files
chown -R $app: $final_path
chmod 755 -R $final_path
chmod -R o-rwx $final_path
chown -R $app:www-data $final_path
#=================================================
# SETUP SSOWAT
#=================================================

View file

@ -39,18 +39,18 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
ynh_script_progression --message="Validating restoration parameters..."
ynh_webpath_available $domain $path_url \
|| ynh_die "Path not available: ${domain}${path_url}"
test ! -d $final_path \
|| ynh_die "There is already a directory: $final_path "
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
# RECREATE THE DEDICATED USER
#=================================================
ynh_script_progression --message="Recreating the dedicated system user..."
ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# RESTORE THE APP MAIN DIR
@ -59,13 +59,9 @@ ynh_script_progression --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$final_path"
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
ynh_script_progression --message="Recreating the dedicated system user..."
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app
chmod 755 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# RESTORE THE MYSQL DATABASE
@ -79,8 +75,16 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the PHP-FPM configuration..."
ynh_restore_file "/etc/php/$phpversion/fpm/pool.d/$app.conf"
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# GENERIC FINALIZATION

View file

@ -29,6 +29,20 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
@ -53,22 +67,16 @@ if ynh_legacy_permissions_exists; then
ynh_app_setting_delete --app=$app --key=is_public
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -96,22 +104,6 @@ then
ynh_secure_remove --file="$tmpdir"
fi
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated nginx config
ynh_add_nginx_config
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
ynh_system_user_create $app
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
@ -120,6 +112,14 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..."
# Create a dedicated php-fpm config
ynh_add_fpm_config
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated nginx config
ynh_add_nginx_config
#=================================================
# SPECIFIC UPGRADE
#=================================================