mirror of
https://github.com/YunoHost-Apps/redirect_ynh.git
synced 2024-09-03 20:16:10 +02:00
Zbmlgrerg
This commit is contained in:
parent
3bf42a51f3
commit
9f05482862
6 changed files with 16 additions and 10 deletions
|
@ -26,7 +26,7 @@ In technical terms: this app only adds a NGINX configuration snippet with either
|
|||
**Shipped version:** 2.0~ynh1
|
||||
## Documentation and resources
|
||||
|
||||
* Official app website: <https://github.com/YunoHost-Apps/redirect_ynh>
|
||||
* Official app website: <https://en.wikipedia.org/wiki/Reverse_proxy>
|
||||
* YunoHost Store: <https://apps.yunohost.org/app/redirect>
|
||||
* Report a bug: <https://github.com/YunoHost-Apps/redirect_ynh/issues>
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ En terme technique: cette app se contente de rajouter le morceau de configuratio
|
|||
**Version incluse :** 2.0~ynh1
|
||||
## Documentations et ressources
|
||||
|
||||
* Site officiel de l’app : <https://github.com/YunoHost-Apps/redirect_ynh>
|
||||
* Site officiel de l’app : <https://en.wikipedia.org/wiki/Reverse_proxy>
|
||||
* YunoHost Store: <https://apps.yunohost.org/app/redirect>
|
||||
* Signaler un bug : <https://github.com/YunoHost-Apps/redirect_ynh/issues>
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
location __PATH__/ {
|
||||
location __PATH__ {
|
||||
return 302 __TARGET__$request_uri;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ maintainers = []
|
|||
|
||||
[upstream]
|
||||
license = "AGPL-3.0-or-later"
|
||||
website = "https://github.com/YunoHost-Apps/redirect_ynh"
|
||||
website = "https://en.wikipedia.org/wiki/Reverse_proxy"
|
||||
|
||||
[integration]
|
||||
yunohost = ">= 11.2"
|
||||
|
@ -37,6 +37,7 @@ ram.runtime = "50M"
|
|||
type = "select"
|
||||
choices.redirect = "Explicit redirection (HTTP 302). Redirect people to another URL."
|
||||
choices.reverseproxy = "Reverse-proxy (nginx proxy_pass). Expose an app, typically that you manually installed (with or without Docker) locally or an another machine."
|
||||
default = "redirect"
|
||||
|
||||
[install.target]
|
||||
ask.en = "Target"
|
||||
|
@ -45,6 +46,7 @@ ram.runtime = "50M"
|
|||
example = "http://127.0.0.1:1312/"
|
||||
|
||||
[install.init_main_permission]
|
||||
type = "group"
|
||||
default = "visitors"
|
||||
|
||||
[resources]
|
||||
|
|
|
@ -11,8 +11,8 @@ source /usr/share/yunohost/helpers
|
|||
# Avoid uncrypted remote destination with reverse proxy mode
|
||||
# Indeed the SSO send the password in all requests in HTTP headers
|
||||
url_regex='^(http://(127\.[0-9]+\.[0-9]+\.[0-9]+|localhost)|https://.*)(:[0-9]+)?(/.*)?$'
|
||||
[[ "$redirect_type" = "reverseproxy" ]] && [[ ! $redirect_path =~ $url_regex ]] && ynh_die \
|
||||
"For secure reason, you can't use an unencrypted http remote destination coupled with ssowat for your reverse proxy: $redirect_path" 1
|
||||
[[ "$redirect_type" = "reverseproxy" ]] && [[ ! "$target" =~ $url_regex ]] && ynh_die \
|
||||
"For secure reason, you can't use an unencrypted http remote destination coupled with ssowat for your reverse proxy: $target" 1
|
||||
|
||||
#=================================================
|
||||
# CONFIGURE NGINX
|
||||
|
|
12
tests.toml
12
tests.toml
|
@ -3,18 +3,22 @@ test_format = 1.0
|
|||
[default]
|
||||
|
||||
args.redirect_type = "redirect"
|
||||
args.target = "https://fr.wikipedia.org"
|
||||
args.target = "http://127.0.0.1"
|
||||
|
||||
test_upgrade_from.09cf1c6b.name = "v1 era"
|
||||
test_upgrade_from.09cf1c6b.args.domain = "domain.tld"
|
||||
test_upgrade_from.09cf1c6b.args.redirect_type = "visible_302"
|
||||
test_upgrade_from.09cf1c6b.args.redirect_path = "https://fr.wikipedia.org"
|
||||
test_upgrade_from.09cf1c6b.args.redirect_path = "http://127.0.0.1"
|
||||
|
||||
|
||||
[reverseproxy]
|
||||
|
||||
args.redirect_type = "reverseproxy"
|
||||
args.target = "http://127.0.0.1:80"
|
||||
args.target = "http://127.0.0.1"
|
||||
|
||||
exclude = ["install.private", "install.multi", "backup_restore"]
|
||||
|
||||
test_upgrade_from.09cf1c6b.name = "v1 era"
|
||||
test_upgrade_from.09cf1c6b.args.domain = "domain.tld"
|
||||
test_upgrade_from.09cf1c6b.args.redirect_type = "proxy_public"
|
||||
test_upgrade_from.09cf1c6b.args.redirect_path = "http://127.0.0.1:80"
|
||||
test_upgrade_from.09cf1c6b.args.redirect_path = "http://127.0.0.1"
|
||||
|
|
Loading…
Add table
Reference in a new issue