Thanks for the interest – here’s a more detailed writeup of the problem and how we tracked it down.
The problem occurs when you want to install a second instance of Streams:
Setup
Symptom
On the new instance, it was impossible to create the initial account. Every registration attempt on /register was rejected with:
The first account must be registered using the admin email which was supplied during setup.
This happened even when entering exactly the admin email chosen during install (typed by hand, lowercase, no autofill). Login obviously failed too, since no account existed yet – the login page just reloaded silently.
What we ruled out first
-
Wrong email / typos / case sensitivity (the check uses a strict === comparison, so we were careful)
-
register_policy – we set it to open (util/config system register_policy 1), no change
-
Captcha/ToS/incomplete form – the “phrase” check runs before the admin-email check in the code and has its own error message, so a failing captcha was not the cause
-
Hidden characters in the stored email – verified with SELECT HEX(v) ..., the value was clean
-
fail2ban lockout, stale sessions (tested in fresh private windows)
Root cause
The rejection message comes from src/Module/Register.php (~line 98). When account_total() === 0, it calls Account::check_admin($_POST), which does:
php
$admin_email = trim(get_config('system', 'admin_email', ''));
if (strlen($admin_email) && $admin_email === trim($arr['email'])) {
return true;
}
return false;
The installer writes the admin email to .htconfig.php only:
php
App::$config['system']['admin_email'] = 'admin@example.org';
…but no corresponding row exists in the config DB table:
sudo mysql streams__2 -e "SELECT v FROM config WHERE cat='system' AND k='admin_email';"
(empty result)
So at registration time get_config() returns an empty string, strlen() is 0, and check_admin() returns false for any submitted email. Registering the initial account through the web form is therefore impossible on a fresh install.
(Confusingly, util/config system admin_email displays the correct address, because it reads the merged file+DB configuration – which sent us down the wrong track for a while.)
Fix / workaround
Writing the value explicitly into the DB config solved the issue:
sudo -u streams__2 php util/config system admin_email admin@example.org
After that, registration with the admin email succeeded, the account got admin rights as expected, and everything works normally (channel created, admin panel accessible, federation OK). We closed registration again afterwards (register_policy 0).
Additional observations
-
The same DB row is also missing on the older instance – yet its initial account was created without problems back under the earlier package version. So either the older code read/merged admin_email from .htconfig.php at registration time and the current code doesn’t, or something else changed. Existing accounts and login are unaffected on both instances.
-
This implies any fresh install of the current version (or any state where the account table is empty, e.g. after restoring to a clean state) hits this wall.
-
Possible fixes could be: the package writing admin_email into the DB config during install, or the core falling back to the file config in check_admin().
Not sure whether this belongs in the package or upstream ( streams/streams: Decentralised personal communication system. - Codeberg.org ) – happy to report it there too if that’s the right place.