Skip to content

Conversation

@andrasmaroy
Copy link
Contributor

As #819 seems abandoned to me, I implemented @kesselb's suggestion of putting these variables into a separate config file.

Should fix #792

@J0WI
Copy link
Contributor

J0WI commented Mar 31, 2020

I think we go for #1010 (comment)

@kesselb
Copy link
Contributor

kesselb commented Mar 31, 2020

I think we go for #1010 (comment)

Yeah. But we should do both ;) We need to merge the configuration after #1010 is merged and make sure to set the proper defaults.

andrasmaroy and others added 4 commits April 5, 2020 15:18
Signed-off-by: András Maróy <andras@maroy.hu>
Co-Authored-By: J0WI <J0WI@users.noreply.github.com>
Signed-off-by: András Maróy <andras@maroy.hu>
Co-Authored-By: J0WI <J0WI@users.noreply.github.com>
Signed-off-by: András Maróy <andras@maroy.hu>
Signed-off-by: András Maróy <andras@maroy.hu>
@andrasmaroy
Copy link
Contributor Author

I've set the defaults for these to empty strings (empty array obviously for trusted proxies), I figure that should remove these values when merging conflicts.

Please let me know if this should be done differently.

@kesselb
Copy link
Contributor

kesselb commented Apr 5, 2020

Please change the default value to null.

It's necessary because Nextcloud merges the configuration files together. That's only a problem if you previously set a value and want to unset it again. To unset it again we need a value that evaluates to false on isset. Otherwise Nextcloud will not use the internal defaults leading to unexpected behaviour.

https://github.com/nextcloud/server/blob/19ca921676240350abd694d8ca2d7b8c19fbd95a/lib/private/Config.php#L96-L100 is the code in question.

Signed-off-by: András Maróy <andras@maroy.hu>
@andrasmaroy
Copy link
Contributor Author

Done, thanks for pointing me in the right direction.

@J0WI J0WI requested a review from kesselb April 6, 2020 17:12
@kesselb
Copy link
Contributor

kesselb commented Apr 6, 2020

@J0WI mind to merge (or ping the other maintainers) #1010 first? It's easier to avoid conflicts then.

@kesselb
Copy link
Contributor

kesselb commented Apr 7, 2020

@andrasmaroy the other PR is merged now. Mind to rebase your PR? We picked a similar but different name for the configuration file. reverse_proxy.config.php vs reverse-proxy.config.php. I don't have a strong opinion on that. Pick the one you like the most ;)

@andrasmaroy
Copy link
Contributor Author

@andrasmaroy the other PR is merged now. Mind to rebase your PR? We picked a similar but different name for the configuration file. reverse_proxy.config.php vs reverse-proxy.config.php. I don't have a strong opinion on that. Pick the one you like the most ;)

Will do, I prefer merging instead of rebasing though if that's not against the conventions here.

Signed-off-by: András Maróy <andras@maroy.hu>
Signed-off-by: András Maróy <andras@maroy.hu>
Signed-off-by: András Maróy <andras@maroy.hu>
Signed-off-by: András Maróy <andras@maroy.hu>
@kesselb
Copy link
Contributor

kesselb commented Apr 11, 2020

Did a quick test:

  1. Patch master with https://patch-diff.githubusercontent.com/raw/nextcloud/docker/pull/1048.patch
  2. Pick a version (for example 18.0-apache)
  3. Build the image locally
  4. Run the image docker run -p 8080:80 --env OVERWRITEHOST=cloud.test --env OVERWRITEPROTOCOL=http -it $imageId
  5. Run the setup routine
  6. Ask occ for the configuration docker exec -u www-data $containerName /var/www/html/occ config:list system --private
        "overwritehost": "cloud.test",
        "overwriteprotocol": "http",

Copy link
Contributor

@kesselb kesselb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build fails. Mind to update your branch with the latest changes from master one last time?

Signed-off-by: András Maróy <andras@maroy.hu>
@kesselb
Copy link
Contributor

kesselb commented Apr 11, 2020

Nextcloud 19-beta has been added as image. You might run update.sh again to apply the changes to that image too.

Signed-off-by: András Maróy <andras@maroy.hu>
Copy link
Contributor

@kesselb kesselb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

Don't know what's wrong with the build.

@kesselb kesselb requested a review from tilosp April 11, 2020 16:48
@kesselb
Copy link
Contributor

kesselb commented Apr 12, 2020

Hold on :) We have some reports that #1010 is going to break existing setups because null is used as default if the env is not set.

@kesselb
Copy link
Contributor

kesselb commented Apr 12, 2020

Would you mind to update your pr another time and remove all the else null blocks?

@andrasmaroy
Copy link
Contributor Author

Would you mind to update your pr another time and remove all the else null blocks?

Sure although in this case maybe there should be a notice somewhere that omitting these environment variables won't remove the configuration values?

@kesselb
Copy link
Contributor

kesselb commented Apr 12, 2020

Sure although in this case maybe there should be a notice somewhere that omitting these environment variables won't remove the configuration values?

That make sense yes.

…ing deployments

Signed-off-by: András Maróy <andras@maroy.hu>
@crackers8199
Copy link

is this fixed in the 17.0.5 image? i can't get a clean install of 17.0.5 to work as far as the trusted proxies option goes...17.0.4 works, and i can then upgrade to 17.0.5 once it's set up. if i do a straight install of 17.0.5, trusted proxies never works.

@kesselb
Copy link
Contributor

kesselb commented Apr 12, 2020

This pull request is not merged so the answer is no. Just use the new trusted proxies environment variable with 17.0.5.

@crackers8199
Copy link

This pull request is not merged so the answer is no. Just use the new trusted proxies environment variable with 17.0.5.

i'm good now because i just started with 17.0.4 and then upgraded, and that worked...just was curious if this would eventually fix the issue with 17.0.5 clean install not working with reverse proxy. thanks!

@kesselb
Copy link
Contributor

kesselb commented Apr 12, 2020

It will fix the issue once merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSL Reverse Proxy support?

4 participants