Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General settings in config.ini.php gets overwritten #9

Open
Kiina opened this issue Jun 11, 2015 · 32 comments
Open

General settings in config.ini.php gets overwritten #9

Kiina opened this issue Jun 11, 2015 · 32 comments
Assignees
Labels

Comments

@Kiina
Copy link
Contributor

Kiina commented Jun 11, 2015

I started the container with minimal config and got the trusted host warning.
I looked into the piwik/config/config.ini.php and it looked like this.
Seems like the enable_trusted_host_check=0 option gets overwritten or something.

[database]
host = "mysql"
username = "root"
password = "example"
dbname = "piwik"
tables_prefix = "piwik_"
charset = "utf8"

[General]
salt = "the random salt"
trusted_hosts[] = "localhost"

[PluginsInstalled]
Long list of all the plugins
@MarvAmBass
Copy link
Owner

can you give me the line you used to start the container (without passwords and personal data)

@Kiina
Copy link
Contributor Author

Kiina commented Jun 11, 2015

Here is my docker-compose file. The VIRTUAL_HOST is just for the ngnix reverse proxy docker that i use

piwik:
  image: marvambass/piwik
  links:
    - db:mysql
  restart: always
  environment:
    - PIWIK_MYSQL_USER=
    - PIWIK_MYSQL_PASSWORD=
    - VIRTUAL_HOST=
db:
  image: mariadb
  restart: always
  volumes:
    - /srv/database:/data
  environment:
    MYSQL_ROOT_PASSWORD:

@MarvAmBass
Copy link
Owner

hey there, it seems like I found and fixes this bug. I was erasing to much lines inside the config with sed. Now I only erase the right lines ;)

The new container should currently be build on the docker systems, you can check with the new container in about 15-30 Minutes (don't forget docker pull marvambass/piwik)

hope i could help

Marvin

@MarvAmBass MarvAmBass self-assigned this Jun 11, 2015
@MarvAmBass MarvAmBass added the bug label Jun 11, 2015
@MarvAmBass
Copy link
Owner

could you notify me or close this if it works now?

@Kiina
Copy link
Contributor Author

Kiina commented Jun 11, 2015

pulled the lastest container, issue still seems the same

@MarvAmBass
Copy link
Owner

seems like the latest commit didn't trigger a new build on docker - so the version is still buggy

started the build manually - takes some time

@MarvAmBass
Copy link
Owner

so now the latest build is finished - as far as I've testet it, it should definetly work now.

@Kiina
Copy link
Contributor Author

Kiina commented Jun 15, 2015

couldn't test it earlier, but it seems i still have the same issue. even after removing and repulling the complete image

@MarvAmBass
Copy link
Owner

hey kiina thx for testing again, could you please check if the

 enable_trusted_host_check=0 

is inside of the piwik conf

@Kiina
Copy link
Contributor Author

Kiina commented Jun 15, 2015

nope, the config file is still like above

@MarvAmBass
Copy link
Owner

could you send me the logoutput?

@Kiina
Copy link
Contributor Author

Kiina commented Jun 15, 2015

Here you go

@MarvAmBass
Copy link
Owner

thanks, looks pretty normal to me. it would be interesting to find this well hidden bug

@Kiina
Copy link
Contributor Author

Kiina commented Jun 16, 2015

have you tried with a clean database? the problem seems only to exist with a clean db.

i tried:

docker rm piwik_piwik_1
docker rm piwik_db_1
docker run -d -e MYSQL_ROOT_PASSWORD=example --name piwik_db_1 mariadb
docker run -d -e PIWIK_MYSQL_USER=root -e PIWIK_MYSQL_PASSWORD=example -e PIWIK_MYSQL_PREFIX=piwik_ -e VIRTUAL_HOST=test.com --link piwik_db_1:mysql --name piwik_piwik_1 marvambass/piwik

which provides the error. but if i remove the piwik docker after setup and deploy it again:

docker rm piwik_piwik_1
docker rm piwik_db_1
docker run -d -e MYSQL_ROOT_PASSWORD=example --name piwik_db_1 mariadb
docker run -d -e PIWIK_MYSQL_USER=root -e PIWIK_MYSQL_PASSWORD=example -e PIWIK_MYSQL_PREFIX=piwik_ -e VIRTUAL_HOST=test.com--link piwik_db_1:mysql --name piwik_piwik_1 marvambass/piwik

wait

docker stop piwik_piwik_1
docker rm piwik_piwik_1
docker run -d -e PIWIK_MYSQL_USER=root -e PIWIK_MYSQL_PASSWORD=example -e PIWIK_MYSQL_PREFIX=piwik_ -e VIRTUAL_HOST=test.com--link piwik_db_1:mysql --name piwik_piwik_1 marvambass/piwik

it works for some reason.

edit:

guess this is related. seems like you add all the headers and then delete the file

@MarvAmBass
Copy link
Owner

hey there,

well your log looks pretty fine to me.

I always use a completely new environment to test. But I use my marvambass/mysql container.

thanks for figuring the line out, I just tought about this. I use the mysql client binary to connect to the database. but I've just got an idea to fix this easily

@MarvAmBass MarvAmBass reopened this Jun 16, 2015
@MarvAmBass
Copy link
Owner

actually removing the config in the first place doesn't make sense to me 😄
I need to figure out why I did this there

@Kiina
Copy link
Contributor Author

Kiina commented Jun 22, 2015

/Edit: okay it doesn't work with removing it. It adds the HTTP_X_FORWARDED but doesn't give you a username and password for piwik at initialization.

And even if you set a password via env you get the error:

Fehler: Sicherheitschecks fehlgeschlagen. Bitte laden Sie das Formular erneut und prüfen Sie, ob Ihr Browser Cookies zulässt. Wenn Sie einen Proxy Server verwenden, müssen Sie Piwik so einrichten, dass es Proxy Header akzeptiert.

@MarvAmBass
Copy link
Owner

yeah i thought so, you would need something like a generator script for the config.

the best thing would be to restart the container (destroy and start again) after the initialisation of your container.

or maybe i find time to add such a generator - but this could happen in the next 24 months, I ve serveral other things to do at the moment

@JoshFerge
Copy link

I am also still getting this error

@prehensile
Copy link

I'm getting this error too. Completely fresh setup.

Log output & generated config.ini.php here.

Going to have a look, try to solve this myself. Will report back.

@MarvAmBass
Copy link
Owner

yeah it's still not fixed. you can take a look at #13 to get a bit more details

@michelcve
Copy link

Any progress on this one? I would love to get "enable_trusted_host_check=0" to make it into the configuration ;-).

@MarvAmBass
Copy link
Owner

@michelcve
but isn't it already in my default config?

https://github.com/MarvAmBass/docker-piwik/blob/master/config.ini.php#L2

@michelcve
Copy link

@MarvAmBass no, as you mentioned in the issue here, your config is basically never used as it's replaced by the piwik installer.

@MarvAmBass
Copy link
Owner

🙈 sorry you're right. unfortunately I wasn't able to look into this further but if you fix this I'm happy to merge a bugfix

thx

@michelcve
Copy link

In version 3.3.0 at least (probably also in 3.2.0, I did not check extensively, thought the console tool is available), it's simply a matter of running the following console command:

/piwik/console config:set 'General.enable_trusted_host_check=0'

I'd suggest in your DB setup part, at the end (after the sleep 5). Perhaps make it optional with environment variables...

Could you give that a shot?

@MarvAmBass
Copy link
Owner

thanks for figuring this out - I might be able to have a look at this - maybe with the console utility everything else gets better as well

@michelcve
Copy link

I've made a PR for this #39

@MarvAmBass
Copy link
Owner

thanks for adding - it's merged already! 👍

@michelcve
Copy link

Great thanks! Any idea how fast this will hit the docker hub?

@MarvAmBass
Copy link
Owner

current latest image is already pushed.

the tagged version is also already pushed now

https://hub.docker.com/r/marvambass/piwik/builds/

@michelcve
Copy link

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants