Thursday, June 13, 2024
dev@conference.yunohost.org
June
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
             

[07:33:28] <Yunohost Git/Infra notifications> [issues] GoustiFruit [commented](https://github.com/YunoHost/issues/issues/2404#issuecomment-2164839340) on [issue #2404](https://github.com/YunoHost/issues/issues/2404) Edge case in port availability check: Would uninstalling/reinstalling AdGuard work ?
[07:38:13] <Salamandar> > <@Alekswag:matrix.org> anybody familiar with SQL understand why we would need both "ynh_foosql_connect_as" to run SQL stuff "as $db_user" AND "ynh_execute_as_root" to run SQL stuff "as root" ? x_x

AFAIK no we don't need both indeed
[07:38:43] <Salamandar> i mean i usually move every app to what the example_ynh does
[07:40:38] <Salamandar> but i think i prefer connect_as, it's more versatile and secure
[07:40:49] <Salamandar> Ah no
[07:40:53] <Salamandar> there is ONE reason we need to execute things as root
[07:40:55] <Salamandar> let me find that
[07:41:48] <Salamandar> maybe 2 reasons : does `ALTER DATABASE $db_name charset=utf8` require root permissions on mysql ?
[07:42:00] <Salamandar> phpmyadmin does `ynh_mysql_execute_as_root --sql="GRANT ALL PRIVILEGES ON *.* TO '$db_admin_user'@'localhost' IDENTIFIED BY '$db_admin_pwd' WITH GRANT OPTION; FLUSH PRIVILEGES;" --database=mysql`, that makes sense
[07:43:28] <Salamandar> hmm on the mysql side apart from phpmyadmin and the ALTER DATABASE, everything can be done as $app
[07:43:33] <Salamandar> but on the postgresql that's another story
[07:43:57] <Salamandar> (with different extensions)
[07:44:05] <Salamandar> a lot of apps call
`ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS hstore;" --database="$db_name"`
[07:45:16] <Salamandar> Some apps do weird things like adding $app to SUPERUSER, creating extensions then removing $app from SUPERUSER…
[07:45:17] <Salamandar> https://aria.im/_matrix/media/v1/download/matrix.org/ktEcGMkocqdjgxXTnROTUOuM
[07:46:23] <Salamandar> and then there is the upgrade process where you might want to migrate/copy/rename databases… you indeed need SQL root for that
[07:48:04] <Salamandar> > <@Alekswag:matrix.org> like, what's the drawback of always running them as root ?

i'd say "meh", you run the risk of calling things you shouldn't
[07:48:41] <Salamandar> it would be like having a setuid `rm` binary
[09:24:42] <Aleks (he/him/il/lui)> > <@Salamandar:matrix.org> sent an image.

uuuuh but what's the point of adding $db_user as SUPERUSER if running the CREATE EXTENSION as root anyway x_x
[09:25:34] <Aleks (he/him/il/lui)> feels like we could have an `extensions = [ ]` in the app resource
[09:27:21] <Aleks (he/him/il/lui)> anyway what i'm most infuriated about is that we have 3 helpers with 3 differents way of passing stuff, between `ynh_foosql_connect_as < stuff.sql`, `ynh_foosql_execute_as_root --sql="instructions"` and `ynh_foosql_execute_file_as_root --file="stuff.sql"` >_>
[09:30:07] <Salamandar> > <@Alekswag:matrix.org> uuuuh but what's the point of adding $db_user as SUPERUSER if running the CREATE EXTENSION as root anyway x_x

Yeah that doesnt make sense
[09:30:19] <Salamandar> > <@Alekswag:matrix.org> feels like we could have an `extensions = [ ]` in the app resource

Hmmm yeah that would be nice i guess
[09:34:52] <Aleks (he/him/il/lui)> `psql` tho, what about `lfiql` ?
[09:40:15] <Salamandar> > <@Alekswag:matrix.org> anyway what i'm most infuriated about is that we have 3 helpers with 3 differents way of passing stuff, between `ynh_foosql_connect_as < stuff.sql`, `ynh_foosql_execute_as_root --sql="instructions"` and `ynh_foosql_execute_file_as_root --file="stuff.sql"` >_>

Both use cases can be covered by stdin redirect with < for a file and <<< for commands in a string.
[09:40:21] <Salamandar> > <@Alekswag:matrix.org> `psql` tho, what about `lfiql` ?

What is that
[09:41:41] <Aleks (he/him/il/lui)> a bad joke 😬
[09:47:42] <Salamandar> Ah i got it now
[09:48:18] <Salamandar> No to lfiql because they hate javascript
[11:06:11] <Yunohost Git/Infra notifications> [yunohost] alexAubin pushed 2 commits to helpers-2.1 ([50a4d08add36...800f93d12e58](https://github.com/YunoHost/yunohost/compare/50a4d08add36...800f93d12e58))
[11:08:40] <Yunohost Git/Infra notifications> [yunohost] github-advanced-security[bot] [commented](https://github.com/YunoHost/yunohost/pull/1855#discussion_r1638025204) on pull request #1855 Helpers 2.1: ## Potentially uninitialized local variable

Local variable db_helper_name may be used before it is initialized.

[Sho...
[11:09:05] <Yunohost Git/Infra notifications> [yunohost] alexAubin edited [pull request #1855](https://github.com/YunoHost/yunohost/pull/1855): Helpers 2.1
[11:10:23] <Yunohost Git/Infra notifications> [yunohost] alexAubin edited [pull request #1855](https://github.com/YunoHost/yunohost/pull/1855): Helpers 2.1
[12:28:06] <Yunohost Git/Infra notifications> [yunohost] alexAubin pushed 3 commits to bookworm ([bb4f9cc1da55...e13e9bc378ad](https://github.com/YunoHost/yunohost/compare/bb4f9cc1da55...e13e9bc378ad))
[12:30:39] <Yunohost Git/Infra notifications> 🏗️ Starting build for yunohost/12.0.0+202406131230 for bookworm/unstable/all ...
[12:32:06] <Yunohost Git/Infra notifications> ✔️ Completed build for yunohost/12.0.0+202406131230 for bookworm/unstable/all.
[13:02:21] <Yunohost Git/Infra notifications> [yunohost] 🔴 Pipeline [#1331054748](https://gitlab.com/YunoHost/yunohost/-/pipelines/1331054748) failed on branch bookworm
[13:27:59] <Yunohost Git/Infra notifications> [issues] FranzMari [commented](https://github.com/YunoHost/issues/issues/2404#issuecomment-2165676792) on [issue #2404](https://github.com/YunoHost/issues/issues/2404) Edge case in port availability check: @GoustiFruit I think it should, but I didnt try.