Password set, but instance still public.

by mdione, Tuesday, August 27, 2019, 20:49 (1795 days ago)

I migrated a selfoss installation from one server to another. In fact, I made a new installation and migrated db and config.

The old installation I don't know what version is, but it's not using composer or npm. That instance has user/password prompt OK.

The new one is v2.18, I ran composer and npm and all installed OK. The config is the same, but the instance is public (no user/pass prompt). Here's the relevant config section:

username=xxxxxxxxx
password=f143b54f4532ed3fc1e16e3763303a7e8e33a826d6858822fdd469af296972e11268cf343bc567....
salt=lkjl1289
public=0

I hid the user, cut the hash. I also tried with public=, but still same thing. Any ideas?

Password set, but instance still public.

by mdione, Tuesday, August 27, 2019, 23:05 (1795 days ago) @ mdione

I also raised the logging to DEBUG. No new info at all.

Password set, but instance still public.

by jtojnar, Wednesday, August 28, 2019, 00:08 (1795 days ago) @ mdione

The configuration looks correct.

  • What do you see instead of login form?
  • Do you see a regular logged-in selfoss view?
  • Is there a logout button in the sidebar?
  • Could you try applying the following change to the source code and sharing what the website prints?


--- a/controllers/Index.php
+++ b/controllers/Index.php
@@ -17,6 +17,10 @@ class Index extends BaseController {
      * @return void
      */
     public function home() {
+        var_dump(\F3::get('public'));
+        var_dump(\F3::get('auth')->enabled());
+        exit;
+
         // parse params
         $options = [];
         if (\F3::get('homepage') != '') {

Password set, but instance still public.

by mdione, Wednesday, August 28, 2019, 09:37 (1795 days ago) @ jtojnar

I see a regular logged-in selfoss view, and no logout button. I'll try to apply the patch later.

Password set, but instance still public.

by mdione, Wednesday, August 28, 2019, 11:13 (1795 days ago) @ jtojnar

It doesn't look good:

string(0) "" bool(false)

it's like there's no configuration? At least it's honoring the db settings (sqlite, local file).

Password set, but instance still public.

by jtojnar, Wednesday, August 28, 2019, 14:27 (1795 days ago) @ mdione

The authenticated check is done here:

https://github.com/SSilence/selfoss/blob/9a1b107fd3d05dfa7f4cfb74d52293d0fef4aff7/helpers/Authentication.php#L66

Could you try dumping some more info?


--- a/controllers/Index.php
+++ b/controllers/Index.php
@@ -17,6 +17,13 @@ class Index extends BaseController {
      * @return void
      */
     public function home() {
+        var_dump(\F3::get('public'));
+        var_dump(\F3::get('auth')->enabled());
+        var_dump(\F3::get('username'));
+        var_dump(\F3::get('password'));
+        var_dump(file_exists(__DIR__ . '/../config.ini'));
+        exit;
+
         // parse params
         $options = [];
         if (\F3::get('homepage') != '') {

Password set, but instance still public.

by mdione, Wednesday, August 28, 2019, 17:19 (1795 days ago) @ jtojnar

string(0) "" bool(false) string(0) "" string(0) "" bool(true)

empty empty true?

Password set, but instance still public.

by jtojnar, Thursday, August 29, 2019, 00:27 (1794 days ago) @ mdione

Hmm, is the config.ini file readable by the user your web server/PHP-FPM runs under?

Password set, but instance still public.

by mdione, Thursday, August 29, 2019, 04:49 (1794 days ago) @ jtojnar

haah! no :( maybe selfoss should log a warning about config.ini being present but not readable? Thanks for helping, it works now :)

RSS Feed of thread
powered by my little forum