Giter Club home page Giter Club logo

redirect_ynh's Introduction

Redirect for YunoHost

Integration level Working status Maintenance status

Install Redirect with YunoHost

Read this README is other languages.

This package allows you to install Redirect quickly and simply on a YunoHost server.
If you don't have YunoHost, please consult the guide to learn how to install it.

Overview

This application allows to integrate a custom tile in YunoHost's user portal.

There two typical use cases are covered:

  • basic, explicit redirection : this is a "virtual" app tile that just redirects to another url or external website using HTTP code 302
  • reverse-proxy : create an app tile to expose an app listening on a specific port, typically something that you manually installed (with or without Docker) locally or on another machine.

Shipped version: 2.0~ynh3

Documentation and resources

Developer info

Please send your pull request to the testing branch.

To try the testing branch, please proceed like that:

sudo yunohost app install https://github.com/YunoHost-Apps/redirect_ynh/tree/testing --debug
or
sudo yunohost app upgrade redirect -u https://github.com/YunoHost-Apps/redirect_ynh/tree/testing --debug

More info regarding app packaging: https://yunohost.org/packaging_apps

redirect_ynh's People

Contributors

alexaubin avatar arthurlutz avatar ericgaspar avatar jibec avatar jocelyndelalande avatar kay0u avatar kcchouette avatar m5oul avatar nicofrand avatar opi avatar scith avatar tituspijean avatar yunohost-bot avatar zamentur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redirect_ynh's Issues

Redirect configures host header second time

Hi,
FYI
The problem described and solved at https://forum.yunohost.org/t/redirect-app-configuration/26067

Describe the bug

Hardware: VPS bought online
YunoHost version: 11.2.3 (stable)
I have access to my server : Through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

If your request is related to an app, specify its name and version: app 1.0.2~ynh1

Description of my issue
I’ve a web application runs on Yunohost server. It uses port 3000 to serve.

redirect.conf 
location / {
  proxy_pass        http://127.0.0.1:3000;
  proxy_redirect    off;
  proxy_set_header  Host $host;
  proxy_set_header  X-Real-IP $remote_addr;
  proxy_set_header  X-Forwarded-Proto $scheme;
  proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header  X-Forwarded-Host $server_name;
  proxy_set_header  X-Forwarded-Port $server_port;
  
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "upgrade";

  # Include SSOWAT user panel.
  include conf.d/yunohost_panel.conf.inc;
  more_clear_input_headers 'Accept-Encoding';

When I try to connect my app\ browser says: Invalid Host header.
Let’s encrypt symbol shows as secure connection.

The problem is that you have caused the Host header to be included twice.

    proxy_set_header Host $host;
    include proxy_params;

Looking at the proxy_params file will show you that it was already set there. Setting it again causes the two values to be joined with a comma.

Inside that file you will find preset headers that will be used when you include that file. You do not need to repeat any of those lines in your own configuration.

ubuntu@vmtest-ubuntu2004:~$ cat /etc/nginx/proxy_params
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
You can remove your own additional proxy_set_header Host $host; from the configuration.

Trailing slash in location needed

We have a web application that when behind nginx, needs to have a trailing slash, so the default config :

location /demo {
  proxy_path  http://internal.example.org:8080/;
[snip]

Needs to be modified to

location /demo/ {
  proxy_path  http://internal.example.org:8080/;
[snip]

The "path" key in settings does include that trailing slash

settings: 
  domain: example.org
  id: redirect
  [snip]
  path: /demo/

What is the right way to do this ? In the template ? Somewhere in the configuration ?

"Redirect type" menu disappeared in Yunohost 11

Describe the bug

A clear and concise description of what the bug is.

Context

  • Hardware: Virtual Container on Proxmox
  • YunoHost version: 11.0.9.8
  • I have access to my server: Through SSH | through the webadmin

Steps to reproduce

  • Install from the web admin page

Expected behaviour

Redirect type menu appearing

Hi, the Redirect App doesn't show Redirect type options anymore on v11.
image

I tried both a fresh install and an existing install. Are there some instructions on what to be filled or the possibility to restore the menu?

Proxy https ---> http

Hello so i have two server :

1> Yunohost with sll certifiact valid.
2> a servur with web service inj http

so i want use nginx proxy from yunohost to access to my http serveur in http

what i want :

https://fgr.domaine.fr <----> http://fgr.domaine.fr

the user used the https link, and this is yunohost and nginx who work in http
but now not working because nginx just redirect the user, and how to do that please

[Maintenance ping] Is this app still maintained ?

Hello !

This is a friendly automatic notice from the Yunohost Apps team : our tool noticed that this app is listed in the community/official app lists - but this app appears to be inactive.

Hence, this issue was created automatically to check if this app is still actively maintained.

You are the current maintainer ? 👷‍♂️ 👷‍♀️

You still actively maintain this app ? 🎉

Please close this issue to signify that you still actively maintain this app. Nothing else, and thank you for your work ❤️ !

You don't intend to maintain this app anymore ? 😢

Either don't do anything, or add a comment to explicitly state that you do not intend / have time / ... to maintain this app (but thanks for your work so far ! 😘). After 15 days, if this issue is still opened, the app will be considered unmaintained.

You wish to become the new maintainer of this app ? 😄

You are welcome and free to comment in this thread that you wish to become the new maintainer, and/or to create the corresponding pull request to fix this issue ! (If you do not already have commit rights on this repo, we can then arrange things with the rest of the app team. 😉) Once this issue is closed, the app will then be flagged again as maintained !

reverse-proxy does not install on Yunohost 12

Unable to install in mode 'reverse-proxy' on Yunohost 12

It does not install due to "invalid URL" for target parameter (while this parameter is accepted on Yunohost 11).

Context

  • Hardware: Old laptop
  • YunoHost version: 12.0.0+202404200900
  • I have access to my server: Through SSH + through the webadmin + direct access via keyboard / screen
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: yes
    • If yes, please explain: testing new apps on Yunohost 12, however nginx conf was not modified manually.
  • Using, or trying to install package version/branch: current master (2.0~ynh3)

Steps to reproduce

  • If you performed a command from the CLI, the command itself is enough. For example:
    yunohost app install redirect -a "domain=bosh.domain.tld&path=/http-bind&target=http://localhost:5290/http-bind&redirect_type=reverseproxy" -l BOSH

I tried also:
yunohost app install redirect -a "domain=bosh.domain.tld&path=/http-bind&target=http://localhost:5290&redirect_type=reverseproxy" -l BOSH

  • If you used the webadmin, please perform the equivalent command from the CLI first.
    I also tried via webadmin, which fails with the following message :
    Pick a valid value for the argument 'target': URL host invalid

Expected behavior

As it does on Yunohost 11; goal is to redirect as recommended here : https://forum.yunohost.org/t/unable-to-set-up-bosh-conf-nginx/12995/2

Logs

When command is ran from CLI with --debug:

112  DEBUG   acquiring lock...
121  DEBUG   lock has been acquired
129  DEBUG   loading python module yunohost.app took 0.008s
129  DEBUG   processing action 'yunohost.app.install'
526  DEBUG   Checking default branch
5925 DEBUG   Downloading…
6522 DEBUG   Done
6558 DEBUG   initializing root ldap interface
6559 DEBUG   Checking requirements for redirect…
6565 DEBUG   Checking that required services are up and running...
7522 ERROR   URL host invalid
7522 ERROR   URL host invalid
7522 ERROR   URL host invalid
7522 ERROR   URL host invalid
7523 DEBUG   action executed in 7.393s
7523 DEBUG   lock has been released
7523 ERROR   URL host invalid

Reverse proxy to be completely transparent

I use this app for reverse proxy from firstdomain to secondomain on another local server with yunohost.
I'm unable to connect to:

  • seconddomain/yunohost/admin/
    -> it shows the correct url but only accept firstdomain password (and contents is from firstdomain)
  • seconddomain/app/admin
    -> it shows seconddomain/app/ (even if url is still seconddomain/app/admin)
    -> seconddomain/app/admin/pages is a 404

How to force it to send the complet request to the other server?

Allow redirecting HTTP/HTTPS app

I have an application like myapp.mydomain.com that I also want to host at the address myapp.com.

I tried doing this using the redirect but it always gets a 502 Bad Gateway error. It seems this is because the proxy is not expecting to be redirecting HTTP traffic? Is it possible to allow this application to work for this scenario?

Have an option to allow large uploads

For a site I need to add

  client_max_body_size 10G;

to the nginx options... how could this become an option ? or a generic mechanism to that an advanced user can add custom nginx rules or options ? Will the customized version of the config file be ovewritten at some point ?

Redirect adds / to the url

I want to redirect to my.app/de but the redirect app redirects to my.app/de/, which is a broken link

I'm on YH 4.3.6.3 (stable) and Redirect 1.0.1~ynh1

Add a $request_uri from the option

Hello,
I wonder if it's possible to add a $request_uri option from the gui, in this way when the redirect app is updated we don't have to manually change the files again.

What happen, at the moment, is that I'm not updating the redirect app because of this.

As described in this post https://forum.yunohost.org/t/problems-with-the-redirect-app-on-wordpress/16611/2

Open your redirect conf file. To redirect [domain.com](http://domain.com/) to [www.domain.com](http://www.domain.com/)

sudo nano /etc/nginx/domain.com.d/redirect*

It has to be

location / {
  return 301 https://domain.com$request_uri;
}

The result would be
redirect

Thank you!

Have an option to disable SSOWAT user panel

It would be nice to have an option to disable the SSOWAT resource fetcher :

  # Include SSOWAT user panel.
  include conf.d/yunohost_panel.conf.inc;

I don't quite get how this is actually supposed to work, unless the redirected host is serving yunohost too...

Handle migration from scith/redirect_ynh

The opi's redirect_ynh app has replaced the scith's one, but we need to handle update from one to another. The upgrade script should set a default value for redirect_type attribute, and proxy seems a good choice according to scith/redirect_ynh behavior. (sorry for this bad english, i'm exhausted)

All redirects are "private" after update

I just ran yunohost tools upgrade and now all 3 of my redirects aren't public anymore, one has to be logged in to get to them. They worked fine up to that point.

I also got a warning (per redirect) while upgrading:

Warning: [WARN] Too many arguments ! "/" will be ignored.

Any idea what went wrong and how to fix this?

// Edit:
After completely removing and reinstalling them, they seem to work again. Still no idea what went wrong.

After authentication application does not see me as authenticated (missing headers ?)

Describe the bug

Once OhMyForm or Mealie containers are deployed and behind the Redirect App, i can't authenticate (credentials validated by the app) but in the front looks like headers are not available and it remains on the login page

Context

  • Hardware: VPS bought online KVM Linux Debian
  • YunoHost version: 11.0.0
  • I have access to my server: Through SSH | through the webadmin | direct access via keyboard / screen | ...
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no

Steps to reproduce

Run the docker version of Mealie for example
Use Redirect as private proxy to access the container for the Yunohost portal
Try to connect

blocked by IP

Hello there,

so i m using redirect with my yunohost to use an second serveur at home, and give https with let's encrypte to the second serveur at home it's a NAS.

the problem my nas can access it on internet.

i want bloc access to my redirect apps by ip, only my local network can accessit.

how add this filter acess please

Need help for configuration

Hi,

First thank you for this useful application.

I run Yunohost on a Pi, broadcasting a wifi network. I have another Pi running Birdnet-Pi, connected to the Pi running Yunohost, https://birdnetpi.com/ and have a sub-domain for it. I installed Redirect in Yunohost, I selected "Proxy Invisible, for everybody":

2022-Sunday-August-16-39-00

It is working very well, however I can't access the Live audio function in Birdnet-Pi from my sub-domain. It asks for a password and username, but after having filled them in, I still can't access the Live audio.

Could it be related to the Redirect config? Do you think I have to open ports?

Thank you.

Can not redirect a second domain

Bonjour

Je viens d’installer un serveur Proxmox 5.2 sous debian 9 avec plusieurs VMs. Dans une des VMs j’ai installer un YunoHost 2.7.12 (sous Debian 8) qui fonctionne bien.

Au moins dans 2 VMs, je vais installer un site sous Joomla. Comme j’ai qu’une seule adresse IP publique, j’ai choisi l’appli redirect_ynh pour rediriger mes différents sites vers mes IPs locales.

La première redirection vers mondomaine.tld a bien fonctionné mais quand je souhaite le faire avec mon second domaine www.mondomaine.tld ça ne fonctionne pas.

YunoHost me dit qu’il a rencontré une erreur interne :

**YunoHost a rencontré une erreur interne : **
Vraiment navré.
Vous devriez chercher de l’aide sur le forum ou le salon pour résoudre le problème, ou rapporter le bogue sur l’outil de suivi.
Les informations suivantes peuvent être utile à l’interlocuteur vous aidant :
Action

POST /apps
** {“locale”:“fr”,“app”:“redirect”,“args”:“domain=www.mondomaine.tld&path=%2F&redirect_path=http%3A%2F%2F192.168.0.50%3A8080&is_public=1&redirect_type=proxy”,“label”:“Redirect”}**

Trace

Traceback (most recent call last):
** File “/usr/lib/python2.7/dist-packages/moulinette/interfaces/api.py”, line 406, in process**
** ret = self.actionsmap.process(arguments, timeout=30, route=_route)**
** File “/usr/lib/python2.7/dist-packages/moulinette/actionsmap.py”, line 498, in process**
** return func(arguments)
** File “/usr/lib/moulinette/yunohost/app.py”, line 690, in app_install**
** manifest, extracted_app_folder = _fetch_app_from_git(app)**
** File “/usr/lib/moulinette/yunohost/app.py”, line 1594, in _fetch_app_from_git**
** app_info[‘manifest’][‘lastUpdate’] = app_info[‘lastUpdate’]**
KeyError: 'lastUpdate’

Merci pour votre aide

Hello

I just installed a Proxmox 5.2 server under debian 9 with several VMs. In one of the VMs I install a YunoHost 2.7.12 (under Debian 8) that works well.

At least in 2 VMs, I will install a site under Joomla. As I have only one public IP address, I chose the redirect_ynh app to redirect my different sites to my local IPs.

The first redirection to mydomain.tld worked well but when I want to do it with my second domain www.mydomain.tld it does not work.

YunoHost tells me he has encountered an internal error:

** YunoHost has encountered an internal error: **
Really sorry.
You should look for help on the forum or the show to solve the problem, or report the bug on the tracking tool.
The following information may be useful to the person helping you:
Action
POST /apps
** {“locale”:“fr”,“app”:“redirect”,“args”:“domain=www.mondomaine.tld&path=%2F&redirect_path=http%3A%2F%2F192.168.0.50%3A8080&is_public=1&redirect_type=proxy”,“label”:“Redirect”}**

Trace

Traceback (most recent call last):
** File “/usr/lib/python2.7/dist-packages/moulinette/interfaces/api.py”, line 406, in process**
** ret = self.actionsmap.process(arguments, timeout=30, route=_route)**
** File “/usr/lib/python2.7/dist-packages/moulinette/actionsmap.py”, line 498, in process**
** return func(arguments)
** File “/usr/lib/moulinette/yunohost/app.py”, line 690, in app_install**
** manifest, extracted_app_folder = _fetch_app_from_git(app)**
** File “/usr/lib/moulinette/yunohost/app.py”, line 1594, in _fetch_app_from_git**
** app_info[‘manifest’][‘lastUpdate’] = app_info[‘lastUpdate’]**
KeyError: 'lastUpdate’

Thanks for your help

Container's IP required when proxying : add explanation text

Describe the bug

It's not a bug, it's a feature request: add one sentence, regarding containers IPs

While trying to get Portainer properly reverse proxyed, I spent quite a while figuring that since it's a docker container, the container IP or docker hostname was to be provided, and not the actual server IP.

A short extra sentence explaining this would be greatly appreciated by newcomers trying to get a docker container to accept one's login info.

Under the Target field:
This may be something like https://some.other.website/ (for explicit redirect) or http://127.0.0.1:1234/ for reverse-proxies. For a Docker container, provide it's IP instead of the server's IP

Context

  • Hardware: Old laptop
  • YunoHost version: 11.2.9.1
  • I have access to my server: Through SSH | through the webadmin | direct access via keyboard / screen | ...
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: yes
    • installed docker, then Portainer, following installation methods described in both their webpages
  • Using, or trying to install package version/branch:
  • If upgrading, current package version: can be found in the admin, or with yunohost app info $app_id

Steps to reproduce

Install docker : https://docs.docker.com/engine/install/debian/
Install Portainer : https://docs.portainer.io/start/install-ce/server/docker/linux
create a specific domain: portainer.local
create a redirect (using the server's IP and portainer port)

result: portainer landing page works, but the login isn't working.

Expected behavior

being able to log in with portainer credentials

Logs

no relevant log.
Though, loging in with the server IP in Nginx creates this error: Your session has expired

problem is solved when using the container IP as a proxy_pass and allowing visitors to access the redirection.

Thanks

add an option to open in new window

I suggest to add an html target=_blank option to open URLs in new window. This is useful in case of an external website added in the portal.

Blocking a Cross-Origin Request: The "Same Origin

Hello there,
i m using u apps to make a reverse proxy for a second serveur with apache without https.

on this serveur i have two apps :

and when i try to using one and other i have this error :

Blocking a Cross-Origin Request: The "Same Origin

do u know how pass this error code ?

i m using this program :

WWBN/AVideo-Encoder#44

thanks

Deprecated function in use Warning

It still works fine but may not do so in near future as the warning is generated when used:

WARNING - 'yunohost app checkurl' is deprecated and will be removed in the future
WARNING - Packagers /!\ : 'app checkurl' is deprecated ! Please use the helper 'ynh_webpath_register' instead 

Can someone knowledgeable update the code to align it with latest updated yunohost version please?

Redirect App in private proxy mode reveals the user's password in plain to the target application

Describe the bug

When you use the Redirect app to proxy to some remote application, that remote application gets to know the password of the currently logged-in user.

Context

  • Hardware: VPS bought online
  • YunoHost version: 11.1.15
  • I have access to my server: Through SSH
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no *
  • Using version: 1.0.2~ynh1

Steps to reproduce

  1. Install the application, redirecting it to for example the local port under http://127.0.0.1:8080, setting it as private proxy
  2. open netcat to see the traffic incoming to the application by running nc -l -p 8080 on the server
  3. visit the URL for the app created in step 1 and log in with your yunohost credentials
  4. Look at the nc output

Expected behavior

The output should not contain the user's SSO password

Actual behavior

The output include various pieces of information about the user, including their SSO password, unencrypted:

# nc -l -p 8081
GET / HTTP/1.1
Host: <redacted>
X-Real-IP: <redacted>
X-Forwarded-Proto: https
X-Forwarded-For: 
X-Forwarded-Host: <redacted>
X-Forwarded-Port: 443
Connection: upgrade
user-agent: <redacted>
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
accept-language: en
referer: <redacted>
dnt: 1
upgrade-insecure-requests: 1
sec-fetch-dest: document
sec-fetch-mode: navigate
sec-fetch-site: same-site
sec-fetch-user: ?1
cookie: SSOwAuthUser=kuba; SSOwAuthHash=<redacted>; SSOwAuthExpire=<redacted>
Authorization: Basic <redacted !!! here's the password in base64>
Remote-User: <redacted>
Email: <redacted !! user email>
Name: <redacted !! full user name>
Auth-User: <redacted !! username>

Can't redirect from `https://mydomain.tld/a_redirect_name` to `https://myotherdomain.tld/`

Describe the bug

Found breaking change: Can't redirect from https://mydomain.tld/a_redirect_name to https://myotherdomain.tld/ and this behavior worked before PR #27. Now the redirection is opening https://myotherdomain.tld/a_redirect_name

Context

  • Hardware: not relevant
  • YunoHost version: 4.3.6.2 (not relevant)
  • I have access to my server: Through SSH and through the webadmin
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no
  • Using, or trying to install package version/branch: master
  • If upgrading, current package version: no

Steps to reproduce

  • Install a redirect app from webadmin or from yunohost command with:
    • domain: mydomain.tld
    • path: /a_redirect_name
    • redirect_path: https://myotherdomain.tld/
    • redirect_type: public_302

Expected behavior

When opening https://mydomain.tld/a_redirect_name in a browser, the redirection should be done on redirect path https://myotherdomain.tld/ (like before PR #27)

Proposal

The behavior described in PR #27 (and so the solution) should be activated thanks a new options when the redirect app is installed or by adding choices in option redirect_type

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.