Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reverse-proxy does not install on Yunohost 12 #55

Open
anubister opened this issue Apr 22, 2024 · 1 comment
Open

reverse-proxy does not install on Yunohost 12 #55

anubister opened this issue Apr 22, 2024 · 1 comment

Comments

@anubister
Copy link

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

@anubister
Copy link
Author

The problem seems to come from the new URL validation using pydantic : https://github.com/YunoHost/yunohost/blob/bookworm/src/utils/form.py#L1230C1-L1257C1 ; might be from upstream (Debian 12 is packaging 1.10.4-1 but there is now a v2 which brings deep change (rely on another lib to validate URLs).

In the meantime, I would like to propose to consider URL as a string, applying the previous simple regex validation. Without regex validation it does work, but when trying to apply the regex:

class URLOption(BaseStringOption):
    type: Literal[OptionType.url] = OptionType.string
    pattern = {
        "regexp": r"^https?://.*$",
        "error": "config_validate_url",  # i18n: config_validate_url
    }

I get the following error and not familiar with pydantic:
TypeError: The type of URLOption.pattern differs from the new default value; if you wish to change the type of this field, please use a type annotation
could anyone provide support?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant