Friday, September 22, 2023
support@conference.yunohost.org
September
Mon Tue Wed Thu Fri Sat Sun
        1
2
3
4
5
6
7
8
9
10
11
12
13 14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
             

[04:54:30] <@err404:matrix.org> Solrac: look at 'cron' and 'anacron' ?
[04:57:25] <Solrac> Sure 😲
[05:59:06] <ChriChri> > <@lsolrac:matrix.org> Hello. Is there a way to automate some service restarts once the server has interenet or on a timer?

Generally: yes. What is your use case?

anacron and cron can still be used, but there are also options to use systemd timers.

If you need to `restart` services regularly just to `restart` them it sounds like there is an issue with the service itself that should be taken care of...
[06:08:31] <Solrac> > <@chrichri:librem.one> Generally: yes. What is your use case?
>
> anacron and cron can still be used, but there are also options to use systemd timers.
>
> If you need to `restart` services regularly just to `restart` them it sounds like there is an issue with the service itself that should be taken care of...

Considering my unusual setup, my ynh server comples all of its services _before_ the internet is ready, and this results in Mautrix Bridges breaking, usually when internet goes down too. So I wanted to try and verify if I can do something like this;

```
OnConnected:
sudo yunohost service restart ....
....

OnDisconnect:
Wait and Retry?
```

[07:00:34] <ChriChri> How is your ynh connected to the internet? Doing pppoe itself?
[07:56:38] <Solrac> > <@chrichri:librem.one> How is your ynh connected to the internet? Doing pppoe itself?

Not exactly. My ISP's box just takes longer to boot (3-5min, out of the box, idk why). But My ISP Box is connected to my actual router, which boots up a lot quicker (1min) so the network is ready before the internet access
[07:59:13] <ChriChri> > <@lsolrac:matrix.org> Not exactly. My ISP's box just takes longer to boot (3-5min, out of the box, idk why). But My ISP Box is connected to my actual router, which boots up a lot quicker (1min) so the network is ready before the internet access

Short: I wouldn't restart by an interval, because it might bring other problems you're not foreseeing right now.
[07:59:43] <Solrac> I was considering something like a ping
[08:04:50] <ChriChri> Problem is that there are no included mechanisms I know of that would let you react to the change of state of your connection.
Yes, `ping` might be an option to check.

Another option would be to read the status of your software and react on the expected problems.

If the problem arrises then check the internet connection to make sure that your expected problem and the expected cause fit together. Then act.

Thinking about it, I'd say that the software of the service should handle this situation by itself. There is not such a thing like a permanent internet connection. All internet connections break sometimes and software created for services on the internet should handle this.

I'd say it's worth an issue discussing the problem at ynh and maybe if the version is quite actual at the softwares upstream repo.

I'd say we're talking about a temporary workaround.
[08:55:02] <John88888> https://chat.sum7.eu/upload/95331d4d6dd62003d91b4e8da812da056f59ce53/W1WoFbrTCQ01I0DL50ofH14T4dwLGcUXyvo8hbg8/load-image.jpeg
[09:48:44] <nicofrand> Hi! I am using YunoHost but still rely on an external mail provider (I trust yunohost, not myself). Does anyone know how to configure Roundcube to use this external account instead of the LDAP one?
[09:50:18] <nicofrand> (imap account)
[10:06:06] <orhtej2> > Hi! I am using YunoHost but still rely on an external mail provider (I trust yunohost, not myself). Does anyone know how to configure Roundcube to use this external account instead of the LDAP one?

Looks like this requires editing some files so not really supported with current ynh integration https://github.com/roundcube/roundcubemail/wiki/Configuration%3A-Multi-Domain-Setup (changes will be overwritten on update)
[10:06:38] <orhtej2> You can try snappymail,that one has proper configurable imap support built in
[10:07:14] <nicofrand> Maybe I'll try the local.inc.php then
[10:08:04] <nicofrand> > You can try snappymail,that one has proper configurable imap support built in

I currently use it but my IMAP server does not support thread/sort extensions (uh) and snappymail does not do it by itself and I really miss it
[10:08:45] <nicofrand> Nextcloud mail is fine in both regards but I really don't like the rounded UI
[10:31:05] <ChriChri> > I currently use it but my IMAP server does not support thread/sort extensions (uh) and snappymail does not do it by itself and I really miss it

You could also try `snappymail` which I like a lot. It offers this configuration inside its own admin interface and it works for my external imap (dovecot). I'm running it for two accounts: my ynh test email servers and my former still active self-hosted mailserver.
[10:32:06] <nicofrand> > <@chrichri:librem.one> You could also try `snappymail` which I like a lot. It offers this configuration inside its own admin interface and it works for my external imap (dovecot). I'm running it for two accounts: my ynh test email servers and my former still active self-hosted mailserver.

Yup but threads don't work with my mailserver
[12:12:54] <nicofrand> hm, looks like config/local.inc.php in roundcube is not considered at all
[12:28:04] <orhtej2> > hm, looks like config/local.inc.php in roundcube is not considered at all

As per docs

> These files have to be named like <hostname>.inc.php and are saved in Roundcube's config directory.
>
> Roundcube does not read them by default so you need to set the 'include_host_config' option to true in the main config file.
[12:28:43] <orhtej2> > As per docs
>
> > These files have to be named like <hostname>.inc.php and are saved in Roundcube's config directory.
> >
> > Roundcube does not read them by default so you need to set the 'include_host_config' option to true in the main config file.

Thanks fluffychat for mangling the quote x_x
[12:29:51] <nicofrand> uh. Roundcube documentation or roundcube_ynh doc?
[12:32:51] <orhtej2> https://github.com/roundcube/roundcubemail/wiki/Configuration%3A-Multi-Domain-Setup
[12:32:54] <orhtej2> Roundcube
[12:33:33] <nicofrand> ah yes for multidomain
[12:33:47] <nicofrand> I was just trying to override the imap setting eveyrwhere
[12:34:58] <nicofrand> The package clearly says to edit a local.inc.php and never edit config.inc.php as it will be rewritten on upgrade (which makes sense)
[12:35:15] <nicofrand> so even if multiple domain it is hard to set `include_host_config`
[12:36:49] <orhtej2> > I was just trying to override the imap setting eveyrwhere

https://github.com/roundcube/roundcubemail/blob/20447fa962cfc54ac3fe0616b1b5abc3258372e9/program/lib/Roundcube/rcube_config.php#L194
[12:37:13] <orhtej2> Can't say local.inc.php is listed here as special
[12:39:54] <nicofrand> nope but it is not listed in config/config.inc.php neither
[12:41:39] <nicofrand> `include_host_config` does not appear in it…
[12:41:51] <nicofrand> and its value is set to false in `defaults.inc.php`
[12:43:25] <orhtej2> > Looks like this requires editing some files so not really supported with current ynh integration https://github.com/roundcube/roundcubemail/wiki/Configuration%3A-Multi-Domain-Setup (changes will be overwritten on update)

That's what I was afraid of in the first place
[12:44:01] <orhtej2> We could have a placeholder file added and not touched by updates
[12:44:54] <orhtej2> But I'm not using roundcube rn so don't have the setup to develop that. consider creating issue to keep the discussion open
[12:47:02] <nicofrand> I'll see if editing config.inc.php to allow other hosts configuration works. If it does I'll suggest a modification
[12:51:53] <nicofrand> https://github.com/YunoHost-Apps/roundcube_ynh/blob/master/conf/config.inc.php#L21C22-L21C52 for me it is not the right domain
[21:25:51] <amu> Hello
[21:26:17] <amu> I have a Yunohost server with several services. And, in the same LAN, I also have a different server with another Internet service (the-non-ynh-server.org), which is an independend service, not related to my Yunhost apps or users. However, it is reachable through the Redirect app on my Yunhost server.
[21:27:08] <amu> The service of the-non-ynh-server is visible from the Internet and it should allow users to register. New users do receive their welcome email message, but when they click on the link to set a password, they get a weird error from my-non-ynh-server.org.
[21:28:26] <amu> I suspect the error is related to Yunohost's SSO. Please check the link below, especially when it says "X-Sso-Wat: You've just been SSOed"
[21:28:32] <Sean> What's the service? Doing similar except I have the non yunohost server relaying to yunohost.
[21:28:48] <amu> https://paste.yunohost.org/viquditico.vbs
[21:29:45] <orhtej2> > <amu> The service of the-non-ynh-server is visible from the Internet and it should allow users to register. New users do receive their welcome email message, but when they click on the link to set a password, they get a weird error from my-non-ynh-server.org.

what 'weird error' are you getting?
[21:30:57] <amu> I don't get accurate error information, it kind of says "Something went wrong".
[21:32:01] <amu> I guess the problem is this SSO thing
[21:33:18] <amu> I mean the service of the-non-ynh-server should has its own indiependent authentication, it should not go through Yunohost SSO. And maybe that is what iit is happening?
[21:33:55] <amu> In the forum I found things on the topic, but I don't know how to solve it, I am no HTTP expert : (
[21:35:23] <amu> https://forum.yunohost.org/search?q=%22X-Sso-Wat%3A%20You%27ve%20just%20been%20SSOed%22
[21:40:30] <orhtej2> 'something went wrong' is non-descriptive 500, does the app provide some form of log and/or ability to turn client-side errors on?
[21:40:38] <orhtej2> (showing full stack traces or smth)
[21:41:14] <orhtej2> sure SSO is a plausible guess but it's a guess nevertheless
[21:44:50] <orhtej2> theoretically you can tweak ssowat.conf as per https://forum.yunohost.org/t/disable-ssowat-for-custom-url/15491/2 and see if it helps
[21:46:43] <amu> Thank you
[21:47:05] <amu> That looks promising, but also intimidating for me
[21:47:42] <amu> Would you guide me on what I should edit exactly?
[21:52:53] <orhtej2> > <amu> Would you guide me on what I should edit exactly?

I must say I feel incompetent to give any guidance on that
[21:54:30] <amu> Ok. Thank you anyway for your help! You took me closer to a possible solution.
[21:55:19] <orhtej2> theoretically exactly as per post suggestion you should `sudo nano -w /etc/ssowat/conf.json.persistent` and just paste verbatim:

```
"permissions" : {
"arbitrary_permission_name" : { // can be anything
"auth_header" : false, // optional; what is the point anyway?
"public" : true, // required to skip the URIs being SSO'd
"show_tile" : false, // optional; to skip showing a tile on the user portal
"uris" : [ // required; the most important block
"domain.tld/redirect_path"
]
}
}
```
[21:55:35] <orhtej2> if this breaks just edit the file back to say `{}` and you're golden
[21:55:46] <orhtej2> or wait for someone more competent to chip in ;)
[21:56:50] <orhtej2> > theoretically exactly as per post suggestion you should `sudo nano -w /etc/ssowat/conf.json.persistent` and just paste verbatim:
>
> ```
> "permissions" : {
> "arbitrary_permission_name" : { // can be anything
> "auth_header" : false, // optional; what is the point anyway?
> "public" : true, // required to skip the URIs being SSO'd
> "show_tile" : false, // optional; to skip showing a tile on the user portal
> "uris" : [ // required; the most important block
> "domain.tld/redirect_path"
> ]
> }
> }
> ```

the line 7 here should match the `redirect_ynh` path that takes you to that other service
[21:59:20] <amu> Nice, thanks!
[21:59:55] <amu> But, where should I paste it? Just append it at the end of the file?
[22:02:11] <orhtej2> > <amu> But, where should I paste it? Just append it at the end of the file?

by default this file should have empty JSON contents of `{}`
[22:02:16] <orhtej2> at least that's on my end
[22:02:48] <orhtej2> conf.json.**persistent**, not bare conf.json
[22:03:00] <amu> ooh, yes, sorry, yes! That was my mistake : )
[22:03:25] <orhtej2> > <amu> ooh, yes, sorry, yes! That was my mistake : )

phew, that would be.... unfortunate :P
[22:03:53] <amu> : )
[22:04:31] <amu> Ok, I'm going to do some tests... I might come back in a while... cheers
[22:16:53] <orhtej2> you likely need to `sudo systemctl reload nginx` for the changes to take effect although I'm not sure
[22:17:10] <amu> thanks!
[22:27:11] <amu> Where should I exactly get "the `redirect_ynh` path that takes you to that other service"?
[22:29:15] <orhtej2> > <amu> Where should I exactly get "the `redirect_ynh` path that takes you to that other service"?

From redirect_ynh installation path
[22:31:38] <amu> I don't understand
[22:32:12] <amu> I installed this Redirect thing long ago
[22:32:21] <orhtej2> you installed app `redirect_ynh`, right?
[22:32:30] <amu> Yes
[22:32:43] <orhtej2> if you go to webadmin you can see `redirect_ynh` is installed on `domain.tld/some_path`
[22:32:54] <orhtej2> and that's exactly what you need to paste in that config
[22:32:55] <amu> Aaah, ok, I get it now
[22:33:01] <amu> Thanks!
[22:33:14] <amu> I thought it was more complicated : )
[22:50:30] <amu> Unfortunately it does not work : (
No change. When the new user receives the welcome email, it contains a link, when clicking that link, it takes them to the-non-ynh-server webpage where the password shoud be set, but it does not work and it shows a "Something weng wrong" banner.
[22:51:23] <amu> I tried reloading and restarting nginx service
[22:55:22] <amu> I am using two different dns domains for the same service (a temporary accident), I am not sure if everything is configured for both domains. How am I supposed to add a second domain according to the instructions you sent me? I know nothng about json...
[22:55:49] <amu> Should they go all into that line 7?
[22:56:15] <amu> Or should I add a different block for this second domain?
[23:00:06] <orhtej2> > <amu> Should they go all into that line 7?

it's a JSON array in form of

```
[
line1,
line2
]
```
[23:00:22] <orhtej2> > <amu> Unfortunately it does not work : (
> No change. When the new user receives the welcome email, it contains a link, when clicking that link, it takes them to the-non-ynh-server webpage where the password shoud be set, but it does not work and it shows a "Something weng wrong" banner.

again, try getting logs from target service
[23:00:32] <orhtej2> this is generic http.cat/500
[23:17:12] <amu> Cannot find anything relevant in the logs
[23:17:30] <amu> > this is generic http.cat/500
I don't understand
[23:48:31] <Mike> How to restart the nextcloud service installed with yunohost?
(I can't find it in the list of services)
[23:49:26] <Aleks (he/him/il/lui)> there's no nextcloud services, it's phpX.Y-fpm depending on which php version is used
[23:50:07] <Aleks (he/him/il/lui)> which is a "common" service used by all apps based on phpX.Y
[23:50:42] <Mike> So to restart nextcloud, I have to restart phpX.Y-fpm?
[23:50:48] <Aleks (he/him/il/lui)> yup
[23:51:04] <Aleks (he/him/il/lui)> X.Y being the php version, dunno which one that is currently for nextcloud
[23:52:41] <Mike> But restarting phpX.Y-fpm risks restarting many other applications, is there a more targeted way to target only nextcloud?
[23:53:30] <Aleks (he/him/il/lui)> ¯\_(ツ)_/¯ nope
[23:55:39] <Mike> There are 4 different phpX.Y-fpm versions installed by my yunohost instance, I will check the logs of the 4 versions to look for traces of nextcloud