1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ztncui_ynh.git synced 2024-09-03 18:06:05 +02:00

Merge pull request #18 from YunoHost-Apps/testing

Testing
This commit is contained in:
tituspijean 2021-10-24 14:28:12 +02:00 committed by GitHub
commit c539fa6a2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 164 additions and 97 deletions

View file

@ -1,66 +1,54 @@
# ZeroTier network controller user interface 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/ztncui.svg)](https://dash.yunohost.org/appci/app/ztncui)
[![Install ztncui with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ztncui)
# Zerotier UI for YunoHost
[![Integration level](https://dash.yunohost.org/integration/ztncui.svg)](https://dash.yunohost.org/appci/app/ztncui) ![](https://ci-apps.yunohost.org/ci/badges/ztncui.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/ztncui.maintain.svg)
[![Install Zerotier UI with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ztncui)
*[Lire ce readme en français.](./README_fr.md)*
> *This package allow you to install ztncui quickly and simply on a YunoHost server.
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
> *This package allows you to install Zerotier UI 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
ztncui is a web user interface for a standalone ZeroTier network controller. It requires the ZeroTier app for YunoHost.
**Shipped version:** 0.5.8
ztncui is a web user interface for a standalone ZeroTier network controller.
It allows you to take control of your own ZeroTier network without relying on the publisher's cloud-based controller.
**Shipped version:** 20210310~ynh2
## Screenshots
![](https://key-networks.com/images/ztncui/07-networks-list.png)
![](./doc/screenshots/screenshot.jpg)
## Configuration
## Disclaimers / important information
No particular configuration is needed after initial installation.
## Documentation
* Official documentation: https://key-networks.com/ztncui/
* YunoHost documentation: If specific documentation is needed, feel free to contribute.
## YunoHost specific features
#### Multi-users support
* No LDAP and HTTP auth supported.
* Can the app be used by multiple users? Yes, you have to add them manually in `/opt/key-networks/ztncui/src/etc/passwd`, see ztncui documentation.
#### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/ztncui%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/ztncui/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/ztncui%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/ztncui/)
## Limitations
### Dependency
* [ZeroTier for YunoHost](https://github.com/YunoHost-Apps/zerotier_ynh) has to be installed beforehand.
## Additional information
### Multi-users support
* Other information you would add about this application
* LDAP and HTTP auth are not supported.
* Multiple users can use the app, you have to add them manually in `/opt/key-networks/ztncui/src/etc/passwd`, see ztncui's documentation.
**More information on the documentation page:**
https://yunohost.org/packaging_apps
## Documentation and resources
## Links
* Official app website: https://key-networks.com/ztncui/
* Upstream app code repository: https://github.com/key-networks/ztncui
* YunoHost documentation for this app: https://yunohost.org/app_ztncui
* Report a bug: https://github.com/YunoHost-Apps/ztncui_ynh/issues
* Report a bug: https://github.com/YunoHost-Apps/ztncui_ynh/issues
* App website: https://key-networks.com/ztncui/
* Upstream app repository: https://github.com/key-networks/ztncui
* YunoHost website: https://yunohost.org/
## Developer info
---
## Developers info
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/ztncui_ynh/tree/testing).
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/ztncui_ynh/tree/testing).
To try the testing branch, please proceed like that.
```
@ -68,3 +56,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/ztncui_ynh/tree/testi
or
sudo yunohost app upgrade ztncui -u https://github.com/YunoHost-Apps/ztncui_ynh/tree/testing --debug
```
**More info regarding app packaging:** https://yunohost.org/packaging_apps

56
README_fr.md Normal file
View file

@ -0,0 +1,56 @@
# Zerotier UI pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/ztncui.svg)](https://dash.yunohost.org/appci/app/ztncui) ![](https://ci-apps.yunohost.org/ci/badges/ztncui.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/ztncui.maintain.svg)
[![Installer Zerotier UI avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ztncui)
*[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer Zerotier UI 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
ztncui is a web user interface for a standalone ZeroTier network controller.
It allows you to take control of your own ZeroTier network without relying on the publisher's cloud-based controller.
**Version incluse :** 20210310~ynh2
## Captures d'écran
![](./doc/screenshots/screenshot.jpg)
## Avertissements / informations importantes
### Dependency
* [ZeroTier for YunoHost](https://github.com/YunoHost-Apps/zerotier_ynh) has to be installed beforehand.
### Multi-users support
* LDAP and HTTP auth are not supported.
* Multiple users can use the app, you have to add them manually in `/opt/key-networks/ztncui/src/etc/passwd`, see ztncui's documentation.
## Documentations et ressources
* Site officiel de l'app : https://key-networks.com/ztncui/
* Dépôt de code officiel de l'app : https://github.com/key-networks/ztncui
* Documentation YunoHost pour cette app : https://yunohost.org/app_ztncui
* Signaler un bug : https://github.com/YunoHost-Apps/ztncui_ynh/issues
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/ztncui_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
```
sudo yunohost app install https://github.com/YunoHost-Apps/ztncui_ynh/tree/testing --debug
ou
sudo yunohost app upgrade ztncui -u https://github.com/YunoHost-Apps/ztncui_ynh/tree/testing --debug
```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps

View file

@ -1,19 +1,15 @@
# See here for more information
# https://github.com/YunoHost/package_check#syntax-check_process-file
# Move this file from check_process.default to check_process when you have filled it.
;; Test complet
; Manifest
domain="domain.tld" (DOMAIN)
path="/" (PATH)
admin="john" (USER)
language="fr"
is_public=1 (PUBLIC|public=1|private=0)
password="pass"
port="666" (PORT)
; pre-install
sudo yunohost app install https://github.com/tituspijean/zerotier_ynh --force
; Manifest
domain="domain.tld"
path="/"
admin="john"
is_public=1
password="pass"
; Checks
pkg_linter=1
setup_sub_dir=0
@ -27,12 +23,6 @@
multi_instance=0
port_already_use=0
change_url=1
;;; Levels
# If the level 5 (Package linter) is forced to 1. Please add justifications here.
Level 5=auto
;;; Options
Email=
Notification=none
;;; Upgrade options
; commit=CommitHash
name=Name and date of the commit.

View file

@ -4,11 +4,41 @@ After=network.target
[Service]
Type=simple
User=ztncui
Group=ztncui
User=__APP__
Group=__APP__
Environment="__YNH_NODE_LOAD_PATH__"
WorkingDirectory=__FINALPATH__/src/
ExecStart=__YNH_NPM__ start
StandardOutput=append:/var/log/__APP__/__APP__.log
StandardError=inherit
# Sandboxing options to harden security
# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
RestrictNamespaces=yes
RestrictRealtime=yes
DevicePolicy=closed
ProtectSystem=full
ProtectControlGroups=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
LockPersonality=yes
SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap
# Denying access to capabilities that should not be relevant for webapps
# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html
CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD
CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE
CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT
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]
WantedBy=multi-user.target

3
doc/DESCRIPTION.md Normal file
View file

@ -0,0 +1,3 @@
ztncui is a web user interface for a standalone ZeroTier network controller.
It allows you to take control of your own ZeroTier network without relying on the publisher's cloud-based controller.

8
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,8 @@
### Dependency
* [ZeroTier for YunoHost](https://github.com/YunoHost-Apps/zerotier_ynh) has to be installed beforehand.
### Multi-users support
* LDAP and HTTP auth are not supported.
* Multiple users can use the app, you have to add them manually in `/opt/key-networks/ztncui/src/etc/passwd`, see ztncui's documentation.

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

View file

@ -6,15 +6,20 @@
"en": "ZeroTier network controller user interface",
"fr": "Interface utilisateur pour le contrôleur de réseau ZeroTier"
},
"version": "20210310~ynh1",
"version": "20210310~ynh2",
"url": "https://key-networks.com/ztncui",
"upstream": {
"license": "GPL-3.0-only",
"website": "https://key-networks.com/ztncui/",
"code": "https://github.com/key-networks/ztncui"
},
"license": "GPL-3.0-only",
"maintainer": {
"name": "tituspijean",
"email": "tituspijean@outlook.com"
},
"requirements": {
"yunohost": ">= 4.1.2"
"yunohost": ">= 4.1.7"
},
"services": [],
"multi_instance": false,
@ -34,8 +39,7 @@
"help": {
"en": "Ztncui can only be installed at the root of a domain.",
"fr": "Ztncui ne peut être installée qu'à la racine d'un domaine."
},
"example": "zt.example.com"
}
},
{
"name": "is_public",
@ -48,8 +52,7 @@
},
{
"name": "admin",
"type": "user",
"example": "johndoe"
"type": "user"
},
{
"name": "password",
@ -57,8 +60,7 @@
"help": {
"en": "It will always be asked by Ztncui, in addition to your YunoHost credentials if set to private.",
"fr": "Il sera toujours demandé par Ztncui, en plus des identifiants YunoHost si l'app est privée."
},
"example": "Choose a password"
}
}
]
}

View file

@ -4,7 +4,7 @@
# COMMON VARIABLES
#=================================================
nodejs_version=12
nodejs_version=16
# dependencies used by the app
pkg_dependencies="g++"
@ -17,21 +17,6 @@ pkg_dependencies="g++"
# EXPERIMENTAL HELPERS
#=================================================
#!/bin/bash
# Execute a command as another user
# usage: exec_as USER COMMAND [ARG ...]
ynh_exec_as() {
local USER=$1
shift 1
if [[ $USER = $(whoami) ]]; then
eval "$@"
else
sudo -u "$USER" "$@"
fi
}
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================

View file

@ -110,10 +110,10 @@ ynh_script_progression --message="Performing Node app installation..." --weight=
chown -R $app: $final_path
pushd $final_path/src
ynh_exec_as $app $ynh_node_load_PATH $ynh_npm --loglevel=error install node-gyp
ynh_exec_as $app $ynh_node_load_PATH $ynh_npm --loglevel=error install
ynh_exec_as $app $ynh_node_load_PATH $ynh_npm --loglevel=error install argon2-cli
ynh_exec_as $app $ynh_node_load_PATH $ynh_npm --loglevel=error audit fix
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install node-gyp
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install argon2-cli
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm audit fix --force
popd
#=================================================
@ -171,7 +171,6 @@ chown -R $app: $final_path
#=================================================
ynh_script_progression --message="Configuring log rotation..." --weight=1
# Use logrotate to manage application logfile(s)
ynh_use_logrotate

View file

@ -37,8 +37,6 @@ nodejs_version=$(ynh_app_setting_get --app=$app --key=nodejs_version)
#=================================================
ynh_script_progression --message="Validating restoration parameters..." --weight=1
ynh_webpath_available --domain=$domain --path_url=$path_url \
|| ynh_die --message="Path not available: ${domain}${path_url}"
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
@ -110,6 +108,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap
#=================================================
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
mkdir -p "/var/log/$app"
#=================================================
# GENERIC FINALIZATION

View file

@ -114,7 +114,10 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=2
ynh_install_app_dependencies $pkg_dependencies
ynh_install_nodejs --nodejs_version=$nodejs_version
if [ $nodejs_version != $(ynh_app_setting_get --app=$app --key=nodejs_version) ]; then
ynh_remove_nodejs
ynh_install_nodejs --nodejs_version=$nodejs_version
fi
#=================================================
# CREATE DEDICATED USER
@ -133,11 +136,13 @@ ynh_script_progression --message="Performing Node app installation..." --weight=
chown -R $app: $final_path
ynh_use_nodejs
pushd $final_path/src
ynh_exec_as $app $ynh_node_load_PATH $ynh_npm --loglevel=error install node-gyp
ynh_exec_as $app $ynh_node_load_PATH $ynh_npm --loglevel=error install
ynh_exec_as $app $ynh_node_load_PATH $ynh_npm --loglevel=error install argon2-cli
ynh_exec_as $app $ynh_node_load_PATH $ynh_npm --loglevel=error audit fix
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH HOME=$final_path $ynh_npm install node-gyp
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH HOME=$final_path $ynh_npm install argon2-cli
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH HOME=$final_path $ynh_npm install
ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH HOME=$final_path $ynh_npm audit fix --force
popd
#=================================================