Giter VIP home page Giter VIP logo

Comments (8)

Black-Gold avatar Black-Gold commented on August 9, 2024 2

worked nextcloud version 23.x helm charts,add setting values.yaml,Inspired by @js02sixty
example:If you want to access from the external network for 192.168.2.x,Add the following settings

nextcloud:
  configs:
    domains.config.php: |-
      <?php
      $CONFIG = array (
        'trusted_domains' =>
          array (
           0 => '192.168.2.*',
           1 => 'nextcloud.kube.home',
          )
      );

from helm.

luandro avatar luandro commented on August 9, 2024 1

+1, everytime I install I get a message telling me to edit trusted_domains on config.php, that's really terrible UX.

from helm.

js02sixty avatar js02sixty commented on August 9, 2024

this worked for me. Under configs: , you can add as many <whatever>.config.php entries.

nextcloud:
    configs:
      proxies.config.php: |-
        <?php
        $CONFIG = array (
          'trusted_proxies' => ['10.43.0.0/16']
        );

from helm.

asoltesz avatar asoltesz commented on August 9, 2024

@js02sixty
Thanks, I will try this.

from helm.

Janl1 avatar Janl1 commented on August 9, 2024

this worked for me. Under configs: , you can add as many <whatever>.config.php entries.

nextcloud:
    configs:
      proxies.config.php: |-
        <?php
        $CONFIG = array (
          'trusted_proxies' => ['10.43.0.0/16']
        );

When i try to add the trusted proxies as you mentioned i get the following error:

Configuring Redis as session handler
Initializing nextcloud 19.0.5.2 ...
Initializing finished
New nextcloud instance
Installing with MySQL database
starting nextcloud installation
Cannot write into "config" directory!
This can usually be fixed by giving the webserver write access to the config directory

Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it.
See https://docs.nextcloud.com/server/19/go.php?to=admin-config
setting trusted domains…
Cannot write into "config" directory!
This can usually be fixed by giving the webserver write access to the config directory

Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it.
See https://docs.nextcloud.com/server/19/go.php?to=admin-config
[09-Dec-2020 11:36:08] NOTICE: fpm is running, pid 1
[09-Dec-2020 11:36:08] NOTICE: ready to handle connections
127.0.0.1 -  09/Dec/2020:11:36:15 +0000 "GET /cron.php" 200
127.0.0.1 -  09/Dec/2020:11:40:04 +0000 "GET /cron.php" 200

from helm.

brandtkeller avatar brandtkeller commented on August 9, 2024

Should this file not be a config that would get templated anytime nextcloud.host is provided a value?

This would likely resolve some issues that the probes are hitting as well.

from helm.

jessebot avatar jessebot commented on August 9, 2024

Should this file not be a config that would get templated anytime nextcloud.host is provided a value?

I think that's what this is for in our _helpers.tpl:

- name: NEXTCLOUD_TRUSTED_DOMAINS
value: {{ .Values.nextcloud.host }}

According to the nextcloud/docker README that env variable is used for running an occ command directly:

if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
    echo "Setting trusted domains…"
    NC_TRUSTED_DOMAIN_IDX=1
    for DOMAIN in $NEXTCLOUD_TRUSTED_DOMAINS ; do
        DOMAIN=$(echo "$DOMAIN" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
        run_as "php /var/www/html/occ config:system:set trusted_domains $NC_TRUSTED_DOMAIN_IDX --value=$DOMAIN"
        NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
    done
fi

It looks like the most recent change to that block was this: https://github.com/nextcloud/docker/pull/1868/files

If it's still not working though, I think testing at a docker level would be the next step. If anyone has time, could you please test if this works in the docker container by specifying the NEXTCLOUD_TRUSTED_DOMAINS env var at time of building or running? If it does not, it should be handled at the docker repo, as setting the env var should be enough from the helm side of things. I can try to get to it, but I have a bit of a backlog right now, so it may be a while :( Others in the community are welcome to test and submit needed PRs though, and I'm happy to review them :)

I don't use trusted_domains, but instead use trusted_proxies (in part due to my using nginx, I believe) which we currently don't handle in the helm chart, and I may submit a PR for that, as it does appear to be handled by the docker container according to this, so I will do my due diligence of testing that part, as it is part of my normal lab setup and easier to tackle sooner rather than later.

from helm.

gthieleb avatar gthieleb commented on August 9, 2024

Hope that this does not break topic but can someone tell me which one has precedence the docker environment vars or the persisted config in the nextcloud container?

Looking here it seems the env var recreates the redis config on start. but here it seems the env var is only used once installation time.

I would like to migrate my configuration to using envvars only but don't know where to start.

from helm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.