Default credentials do not work on docker container #70

Closed
opened 2019-12-16 18:31:33 +01:00 by jorgh6 · 6 comments
jorgh6 commented 2019-12-16 18:31:33 +01:00 (Migrated from github.com)

Describe the issue
When deploying the docker test container as per documentation. The default credentails as documented (admin password) do not seem to work.

To Reproduce
I started the docker container using:
docker run -v oauth_config:/etc/glewlwyd -p 4593:4593 --name oauth --detach babelouest/glewlwyd

Because my docker machine is on another server I edited the config files as follows:
config.json:
"GlewlwydUrl": "http://my.internal.dns.name:4593/",
"ProfileUrl": "http://my.internal.dns.name:4593/profile.html",
"AdminUrl": "http://my.internal.dns.name:4593/index.html",
"LoginUrl": "http://my.internal.dns.name:4593/login.html",
glewlwyd.conf:
external_url="http://my.internal.dns.name:4593"

Expected behavior
Successful login

Screenshots
The container puts out the following log:
Glewlwyd WARNING: Security - Authorization invalid for username admin at IP Address

System (please complete the following information):

  • OS/Environment [e.g. Debian Stretch, Ubuntu 19.04]
    Ubuntu 16.04
  • Browser used [e.g. Mozilla Firefox 69, Chrome 77, lynx 2.9]
    Chrome Version 78.0.3904.108
  • Glewlwyd Version [e.g. 2.0.0, 1.4.9]
    Current docker image
  • Source installation [e.g. Distribution package, GitHub package, build from source]
    Docker Hub
  • If applicable, what option did you use to build Glewlwyd
    N/A

Additional context
None

**Describe the issue** When deploying the docker test container as per documentation. The default credentails as documented (admin password) do not seem to work. **To Reproduce** I started the docker container using: docker run -v oauth_config:/etc/glewlwyd -p 4593:4593 --name oauth --detach babelouest/glewlwyd Because my docker machine is on another server I edited the config files as follows: config.json: "GlewlwydUrl": "http://my.internal.dns.name:4593/", "ProfileUrl": "http://my.internal.dns.name:4593/profile.html", "AdminUrl": "http://my.internal.dns.name:4593/index.html", "LoginUrl": "http://my.internal.dns.name:4593/login.html", glewlwyd.conf: external_url="http://my.internal.dns.name:4593" **Expected behavior** Successful login **Screenshots** The container puts out the following log: Glewlwyd WARNING: Security - Authorization invalid for username admin at IP Address **System (please complete the following information):** - OS/Environment [e.g. Debian Stretch, Ubuntu 19.04] Ubuntu 16.04 - Browser used [e.g. Mozilla Firefox 69, Chrome 77, lynx 2.9] Chrome Version 78.0.3904.108 - Glewlwyd Version [e.g. 2.0.0, 1.4.9] Current docker image - Source installation [e.g. Distribution package, GitHub package, build from source] Docker Hub - If applicable, what option did you use to build Glewlwyd N/A **Additional context** None
babelouest commented 2019-12-16 19:14:20 +01:00 (Migrated from github.com)

According to your log message, it's not a cookie problem but a real login error.

For some reason, the default login admin/password doesn't work. To have it working, you need a user backend instance configured but for some reason, your docker image doesn't have one.

Did you make other changes to the glewlwyd.conf file? especially in the database section?

I'll try to reproduce your error. Meanwhile, can you post the entire log output? There can be other useful messages.

According to your log message, it's not a cookie problem but a real login error. For some reason, the default login admin/password doesn't work. To have it working, you need a user backend instance configured but for some reason, your docker image doesn't have one. Did you make other changes to the `glewlwyd.conf` file? especially in the database section? I'll try to reproduce your error. Meanwhile, can you post the entire log output? There can be other useful messages.
jorgh6 commented 2019-12-16 19:24:21 +01:00 (Migrated from github.com)

I've not made any other changes to the file. I did however restart the container after updating the files,
glewlwyd.log

Attached you find the log file.

I've not made any other changes to the file. I did however restart the container after updating the files, [glewlwyd.log](https://github.com/babelouest/glewlwyd/files/3969586/glewlwyd.log) Attached you find the log file.
babelouest commented 2019-12-17 00:24:24 +01:00 (Migrated from github.com)

Hello @jorgh6 ,

I've tried to reproduce your issue but no luck so far. Although, the file glewlwyd.conf mentioned in the documentation as starting point was not correct, it pointed to a mariadb database by default, where the default docker image uses a sqlite3 database.

I would like you to retry with the last files from the docs/docker/config folder, where you modify only the file config.json with your external_url="http://my.internal.dns.name:4593" value.

Hello @jorgh6 , I've tried to reproduce your issue but no luck so far. Although, the file [glewlwyd.conf](https://github.com/babelouest/glewlwyd/blob/ef3fc6ee8a856b43fbd5d1c0aa45cfc49223562c/docs/docker/config/glewlwyd.conf) mentioned in the documentation as starting point was not correct, it pointed to a mariadb database by default, where the default docker image uses a sqlite3 database. I would like you to retry with the last files from the [docs/docker/config](https://github.com/babelouest/glewlwyd/tree/master/docs/docker/config) folder, where you modify only the file `config.json` with your `external_url="http://my.internal.dns.name:4593"` value.
jorgh6 commented 2019-12-17 08:19:27 +01:00 (Migrated from github.com)

Hello Babelouest,

That works. To be sure, up till now, I've not taken the config files from the github repo and made the changes. I've just edited the files that where already in the container when using the image from the docker hub. On these files, if I did not make the changes to the glewlwyd.conf it would not work, but these files (both of them) also reference the localhost, the files you referenced on github do not.

So, for now:
When using the docker hub image, making the change (only changing external_url to reflect my internal DNS name) in the config.json, does end in a working container. When also replacing localhost with my internal DNS name in the glewlwyd.conf, I can get to the interface, but am not able to log on.

When using the docs/docker/config files as a base, only changing the external_url to reflect my internal DNS name does result in a working container.

Kind regards,

Jorg

Hello Babelouest, That works. To be sure, up till now, I've not taken the config files from the github repo and made the changes. I've just edited the files that where already in the container when using the image from the docker hub. On these files, if I did not make the changes to the glewlwyd.conf it would not work, but these files (both of them) also reference the localhost, the files you referenced on github do not. So, for now: When using the docker hub image, making the change (only changing external_url to reflect my internal DNS name) in the config.json, does end in a working container. When also replacing localhost with my internal DNS name in the glewlwyd.conf, I can get to the interface, but am not able to log on. When using the docs/docker/config files as a base, only changing the external_url to reflect my internal DNS name does result in a working container. Kind regards, Jorg
jorgh6 commented 2019-12-17 08:52:36 +01:00 (Migrated from github.com)

Just made a diff, between the docker image default config and the github config files, the github config.json does not reference localhost:

~ < "GlewlwydUrl": "./",
~ < "ProfileUrl": "profile.html",
~ < "AdminUrl": "index.html",
~ < "LoginUrl": "login.html",
~ > "GlewlwydUrl": "http://localhost:4593/",
~ > "ProfileUrl": "http://localhost:4593/profile.html",
~ > "AdminUrl": "http://localhost:4593/index.html",
~ > "LoginUrl": "http://localhost:4593/login.html",
~ 52c52
~ < "label": "admin.picture",
~ > "label": "admin.user-picture",

furthermore I noticed the following diff in the glewlwyd.conf:

~ < # url prefix
~ < url_prefix="api"
~ > # api prefix
~ > api_prefix="api"

Just made a diff, between the docker image default config and the github config files, the github config.json does not reference localhost: ~ < "GlewlwydUrl": "./", ~ < "ProfileUrl": "profile.html", ~ < "AdminUrl": "index.html", ~ < "LoginUrl": "login.html", ~ > "GlewlwydUrl": "http://localhost:4593/", ~ > "ProfileUrl": "http://localhost:4593/profile.html", ~ > "AdminUrl": "http://localhost:4593/index.html", ~ > "LoginUrl": "http://localhost:4593/login.html", ~ 52c52 ~ < "label": "admin.picture", ~ > "label": "admin.user-picture", furthermore I noticed the following diff in the glewlwyd.conf: ~ < # url prefix ~ < url_prefix="api" ~ > # api prefix ~ > api_prefix="api"
babelouest commented 2019-12-17 14:39:01 +01:00 (Migrated from github.com)

Hi @jorgh6 ,

That works.

That's a relief!

According to your diff output, the problematic line is this one:
~ < url_prefix="api"
This old stuff still lies in the docs/docker/config/glewlwyd.conf file which is bad, it should be this instead.
api_prefix="api"
This is fixed in 8721876 , thanks!

Hi @jorgh6 , > That works. That's a relief! According to your diff output, the problematic line is this one: `~ < url_prefix="api"` This old stuff still lies in the [docs/docker/config/glewlwyd.conf](https://github.com/babelouest/glewlwyd/blob/master/docs/docker/config/glewlwyd.conf) file which is bad, it should be this instead. `api_prefix="api"` This is fixed in 8721876 , thanks!
This discussion has been locked. Commenting is limited to contributors.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
KittenSquad/glewlwyd#70
No description provided.