Yunohost package with wildcard domain?

I’m working on packaging go-ssb-room for yunohost,
and it requires a wild-card domain in its nginx config to fully work.

See go-ssb-room example nginx config here

For my yunohost package, instead of using ynh_add_nginx_config,
I tried writing /etc/nginx/conf.d/$domain.conf directly in my install script (here)

This gets the package working for me locally, however the yunohost CI runner complains;

24040 ERROR Packagers /!\ This app manually modified some system configuration files! This should not happen! If you need to do so, you should implement a proper conf_regen hook. Those configuration were affected:
    - /etc/nginx/conf.d/sub.domain.tld.conf

Is there a better way I can achieve what I need to do?

Or could someone explain how I write conf_regen hook or where I can find documentation on that?

Thank you (ps. I will be away for one week, so may not answer replies right away)

Uuuuuuh yeah your app is not really supposed to overwrite the global conf for this domain …

It’s suppose to only have locations blocks like here: wekan_ynh/nginx.conf at master · YunoHost-Apps/wekan_ynh · GitHub

and then just call ynh_add_nginx_conf in the install script (and also upgrade and restore) : wekan_ynh/install at master · YunoHost-Apps/wekan_ynh · GitHub

1 Like

@Aleks does this mean yunohost doesn’t support apps that require multiple subdomains or a wildcard subdomain like go-ssb-room?

it looks to me like the locations block you linked with ynh_add_nginx_config, would just be for a single domain,
or is there a way to specify a location for a wildcard?
server_name "~^(?<alias>\w+)\.domain\.tld$";

Yes, the classic use case is that app only need one domain (or one domain/subpath), i don’t know anything about ssb so I don’t know why it would need multiple domains, but that’s gonna be complex for many reasons, yes

2 Likes

I was able to find a solution on the go-ssb-room side of things, to avoid needing the wildcard domain. (see here).

thanks for the clarification!