mirror of
https://github.com/YunoHost-Apps/reverseproxy_ynh.git
synced 2024-09-03 20:16:23 +02:00
v2
This commit is contained in:
parent
fc5f7521f2
commit
860ca94202
12 changed files with 19 additions and 219 deletions
|
@ -1,20 +0,0 @@
|
|||
;; Test complet
|
||||
; Manifest
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
proxy_path="http://127.0.0.1:6787"
|
||||
assets_path="/usr/share/yunohost/admin"
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=1
|
||||
setup_root=1
|
||||
setup_nourl=0
|
||||
setup_private=1
|
||||
setup_public=1
|
||||
upgrade=1
|
||||
backup_restore=1
|
||||
multi_instance=1
|
||||
change_url=1
|
||||
;;; Options
|
||||
Email=
|
||||
Notification=none
|
|
@ -1,63 +0,0 @@
|
|||
{
|
||||
"name": "Reverse Proxy",
|
||||
"id": "reverseproxy",
|
||||
"packaging_format": 1,
|
||||
"description": {
|
||||
"en": "Create a reverse proxy to a socket/port, optionally serve static files from folder",
|
||||
"fr": "Créer un reverse proxy vers un socket/port, optionnellement servir des fichiers statiques depuis un dossier"
|
||||
},
|
||||
"version": "0.2~ynh1",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"url": "https://en.wikipedia.org/wiki/Reverse_proxy",
|
||||
"upstream": {
|
||||
"website": "https://en.wikipedia.org/wiki/Reverse_proxy"
|
||||
},
|
||||
"maintainer": {
|
||||
"name": "selfhoster1312",
|
||||
"email": "selfhoster1312@kl.netlib.re"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 11.2"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
"nginx"
|
||||
],
|
||||
"arguments": {
|
||||
"install" : [
|
||||
{
|
||||
"name": "domain",
|
||||
"type": "domain"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"type": "path",
|
||||
"example": "/proxy"
|
||||
},
|
||||
{
|
||||
"name": "proxy_path",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Redirect destination path (unix:/file for socket)",
|
||||
"fr": "Emplacement de destination (unix:/fichier pour socket)"
|
||||
},
|
||||
"example": "http://127.0.0.1:8080"
|
||||
},
|
||||
{
|
||||
"name": "is_public",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
{
|
||||
"name": "assets_path",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Static assets folder",
|
||||
"fr": "Dossier pour les fichiers statiques"
|
||||
},
|
||||
"optional": true,
|
||||
"example": "/opt/foo/www/"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -10,28 +10,27 @@ version = "0.2~ynh1"
|
|||
maintainers = ["selfhoster1312"]
|
||||
|
||||
[upstream]
|
||||
website = "https://en.wikipedia.org/wiki/Reverse_proxy"
|
||||
license = "AGPL-3.0-or-later"
|
||||
cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number)
|
||||
fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin.
|
||||
website = "https://en.wikipedia.org/wiki/Reverse_proxy"
|
||||
|
||||
[integration]
|
||||
yunohost = ">= 11.2"
|
||||
architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"]
|
||||
multi_instance = true
|
||||
ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials.
|
||||
sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal.
|
||||
disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ...
|
||||
ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...
|
||||
ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...
|
||||
|
||||
ldap = "not_relevant"
|
||||
|
||||
sso = "not_relevant"
|
||||
|
||||
disk = "50M"
|
||||
ram.build = "50M"
|
||||
ram.runtime = "50M"
|
||||
|
||||
[install]
|
||||
[install.domain]
|
||||
# this is a generic question - ask strings are automatically handled by Yunohost's core
|
||||
type = "domain"
|
||||
|
||||
[install.path]
|
||||
# this is a generic question - ask strings are automatically handled by Yunohost's core
|
||||
type = "path"
|
||||
|
||||
[install.proxy_path]
|
||||
|
|
|
@ -9,28 +9,12 @@
|
|||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
# Exit if an error occurs during the execution of the script
|
||||
#REMOVEME? ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
#REMOVEME? ynh_print_info --message="Loading installation settings..."
|
||||
|
||||
# Retrieve arguments
|
||||
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
|
||||
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
# Copy the conf files
|
||||
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
||||
ynh_backup --src_path="/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
|
|
|
@ -8,26 +8,6 @@
|
|||
|
||||
source /usr/share/yunohost/helpers
|
||||
source _common.sh
|
||||
|
||||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
# Exit if an error occurs during the execution of the script
|
||||
#REMOVEME? ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||
#=================================================
|
||||
|
||||
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
|
||||
#REMOVEME? old_domain=$YNH_APP_OLD_DOMAIN
|
||||
#REMOVEME? new_domain=$YNH_APP_NEW_DOMAIN
|
||||
#REMOVEME? old_path=$YNH_APP_OLD_PATH
|
||||
#REMOVEME? new_path=$YNH_APP_NEW_PATH
|
||||
|
||||
# Path availability is already checked for
|
||||
|
||||
#=================================================
|
||||
# REVERSEPROXY_YNH
|
||||
#=================================================
|
||||
|
|
|
@ -9,32 +9,10 @@
|
|||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
# Exit if an error occurs during the execution of the script
|
||||
#REMOVEME? ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||
#=================================================
|
||||
|
||||
# Retrieve arguments
|
||||
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
|
||||
#REMOVEME? domain=$YNH_APP_ARG_DOMAIN
|
||||
#REMOVEME? path=$YNH_APP_ARG_PATH
|
||||
#REMOVEME? proxy_path=$YNH_APP_ARG_PROXY_PATH
|
||||
#REMOVEME? assets_path=$YNH_APP_ARG_ASSETS_PATH
|
||||
#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||
|
||||
#=================================================
|
||||
# REVERSEPROXY_YNH
|
||||
#=================================================
|
||||
|
||||
# Check domain/path availability
|
||||
#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path
|
||||
|
||||
# Validate reverse proxy destination
|
||||
rp_validate_proxy_path
|
||||
|
||||
|
@ -44,20 +22,10 @@ rp_validate_assets_path
|
|||
# Special case for "/" path
|
||||
rp_handle_webroot
|
||||
|
||||
# Save extra settings
|
||||
#REMOVEME? ynh_app_setting_set --app=$app --key=proxy_path --value=$proxy_path
|
||||
#REMOVEME? ynh_app_setting_set --app=$app --key=assets_path --value=$assets_path
|
||||
|
||||
# Configure nginx
|
||||
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
|
||||
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
|
||||
ynh_add_nginx_config
|
||||
|
||||
# Make app public if necessary (yunohost setting boolean is 1 when true)
|
||||
#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=2
|
||||
#REMOVEME? if [ $is_public -eq 1 ]; then
|
||||
#REMOVEME? ynh_permission_update --permission="main" --add="visitors"
|
||||
fi
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
|
|
|
@ -9,15 +9,6 @@
|
|||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||
|
||||
# Retrieve arguments
|
||||
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
|
||||
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
|
||||
#=================================================
|
||||
# REVERSEPROXY_YNH
|
||||
#=================================================
|
||||
|
@ -25,10 +16,6 @@ source /usr/share/yunohost/helpers
|
|||
# Remove configuration files
|
||||
ynh_secure_remove /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
|
||||
# Reload nginx
|
||||
#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
|
@ -9,24 +9,6 @@
|
|||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
# Exit if an error occurs during the execution of the script
|
||||
#REMOVEME? ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
|
||||
# Retrieve arguments
|
||||
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
|
||||
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path)
|
||||
#REMOVEME? proxy_path=$(ynh_app_setting_get --app=$app --key=proxy_path)
|
||||
#REMOVEME? assets_path=$(ynh_app_setting_get --app=$app --key=assets_path)
|
||||
|
||||
#=================================================
|
||||
# REVERSEPROXY_YNH
|
||||
#=================================================
|
||||
|
|
|
@ -10,30 +10,6 @@
|
|||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
|
||||
# Retrieve arguments
|
||||
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
|
||||
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path)
|
||||
#REMOVEME? proxy_path=$(ynh_app_setting_get --app=$app --key=proxy_path)
|
||||
#REMOVEME? assets_path=$(ynh_app_setting_get --app=$app --key=assets_path)
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
|
||||
# Backup the current version of the app
|
||||
#REMOVEME? ynh_backup_before_upgrade
|
||||
#REMOVEME? ynh_clean_setup () {
|
||||
# restore it if the upgrade fails
|
||||
#REMOVEME? ynh_restore_upgradebackup
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
#REMOVEME? ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# REVERSEPROXY_YNH
|
||||
#=================================================
|
||||
|
@ -49,7 +25,7 @@ rp_handle_webroot
|
|||
|
||||
# Configure nginx
|
||||
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
|
||||
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
|
||||
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
|
|
7
tests.toml
Normal file
7
tests.toml
Normal file
|
@ -0,0 +1,7 @@
|
|||
test_format = 1.0
|
||||
|
||||
[default]
|
||||
|
||||
|
||||
args.proxy_path="http://127.0.0.1:6787"
|
||||
args.assets_path="/usr/share/yunohost/admin"
|
Loading…
Add table
Reference in a new issue