[11:31:19]
<tituspijean> Progress report:
[11:31:21]
<tituspijean> https://aria.im/_matrix/media/v1/download/pijean.ovh/544406f224e1f4e42ff6e430f4db8e7274709362268d0aff224af86879f81286
[11:31:40]
<tituspijean> I think I achieved dynamic config panels
[11:32:25]
<tituspijean> https://aria.im/_matrix/media/v1/download/pijean.ovh/823aaab3e7c25846b2de8e201d699756ec67c6f70e5f448b495beed88cff327d
[11:33:51]
<Aleks> owo
[11:34:19]
<tituspijean> it's "simply" a matter of rewriting config_panel.toml
[11:34:22]
<Aleks> much toast
[11:34:34]
<Aleks> > <@titus:pijean.ovh> it's "simply" a matter of rewriting config_panel.toml
u
[11:34:35]
<Aleks> wat
[11:34:43]
<Aleks> u wot m8
[11:34:55]
<tituspijean> I knew you'd react like that :p
[11:35:06]
<Aleks> dont tell me you did what you think you did
[11:35:18]
<Aleks> burn the witch !
[11:35:21]
<tituspijean> I'll upload the code. The wireguard services are not getting enabled, but it's a good proof of concept
[11:35:35]
<tituspijean> > <@Alekswag:matrix.org> dont tell me you did what you think you did
oh yeah
[11:37:30]
<Aleks> internallyscreaming.gif
[11:40:36]
<tituspijean> https://github.com/tituspijean/wireguard_client_ynh
[11:41:02]
<tituspijean> removal is not quite clean regarding services though
[11:45:05]
<Aleks> https://github.com/tituspijean/wireguard_client_ynh/blob/master/scripts/config#L112 mer il et fou
[11:45:21]
<tituspijean> M'EN FOUT CA MARCHE
[11:45:25]
<tituspijean> 😇
[11:50:50]
<tituspijean> Aleks: should I really *not* be doing that? Do we envision some evolution of the config panels that would break that?
[11:51:38]
<Aleks> no idk this sounds okay but still very hackish magic xD
[11:52:38]
<tituspijean> it is haha. But the code is actually much cleaner and flexible than having X interfaces ready to go and hide them if we switch a button :)
[11:53:24]
<Aleks> sounds very like "yo dawg i hear you like config panels so i added `bind = "/etc/yunohost/apps/$app/config_panel.toml"` so you can edit your config panel from the config panel"
[11:53:38]
<tituspijean> do give me ideas xD
[11:53:41]
<tituspijean> *don't
[11:55:00]
<Aleks> tituspijean: did you think about the upgrade tho ? The upgrade will overwrite the config panel file
[11:55:55]
<Aleks> and the copy happens ... after the upgrade script is ran D:
[11:58:20]
<tituspijean> oh no :/
motus.wav
[11:58:38]
<tituspijean> (╯°□°)╯︵ ┻━┻
[11:58:51]
<tituspijean> No upgrades. Simple. :p
[12:02:42]
<Aleks> i guess you can do a super ugly trick like a `cp config_panel.toml{,bkp}` and then the other way around like 1~2 minutes later with `at` :P
[12:03:55]
<Aleks> ah wait
[12:04:12]
<Aleks> in fact the code is : https://github.com/YunoHost/yunohost/blob/dev/src/app.py#L671
[12:05:16]
<Aleks> so if you copy `/etc/yunohost/apps/$app/config_panel.toml` to overwrite the `config_panel.toml` from the working dir inside the upgrade script, it will get copied the other way around when that code is ran
[12:05:20]
<Aleks> (if that makes sense)
[12:09:07]
<tituspijean> I'll need to test that, but I think I'm getting the gist of it :)
[16:59:53]
<tituspijean> Aleks: is `$YNH_CWD` the current working directory of the running script?
[17:00:20]
<tituspijean> as in, if I'm upgrading, am I in the tempdir/scripts dir 'coz I'm running upgrade script?
[17:00:21]
<Aleks> eeeh i dunno, i think that var is useless, i think you're looking for $YNH_APP_BASE
[17:00:24]
<Aleks> something like this
[17:01:03]
<Aleks> (if you grep the helpers you'll find example of usage of that var)
[17:02:08]
<tituspijean> yup, `YNH_APP_BASEDIR`
[17:02:29]
<tituspijean> So in the context of an app upgrade being run, that's the tempdir where the new code is copied, correct?
[17:02:35]
<Aleks> it's the ephemeral directory where all the app script and conf are located during the script execution
[17:02:42]
<Aleks> yep
[17:03:09]
<tituspijean> alright thanks. and there's no variable for `/etc/yunohost/apps/$app/` ?
[17:03:11]
<Aleks> eeeh not really
[17:03:21]
<tituspijean> alright :)
[17:52:03]
<tituspijean> WireGuard Client call for testers: https://forum.yunohost.org/t/wireguard-client-call-for-testers/21069 🚀
[18:02:22]
<balaa> Love WireGuard
[19:21:34]
<ابوطه عبدالعظيم> رمز
[19:25:27]
<tituspijean> hunter2