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

Access through untrusted domain #533

Open
arphillips06 opened this issue Feb 8, 2024 · 7 comments
Open

Access through untrusted domain #533

arphillips06 opened this issue Feb 8, 2024 · 7 comments

Comments

@arphillips06
Copy link

arphillips06 commented Feb 8, 2024

Describe your Issue

Get "Access through untrusted domain"

Logs and Errors

Accessing the webpage from either the internal network or externally results in the above error.

Describe your Environment

  • Kubernetes distribution: k3s

  • Helm Version (or App that manages helm): 3.14

  • Helm Chart Version: 4.6.2

  • values.yaml:

nextcloud:
  host: nextcloud.mydomainname.co.uk
  username: admin
  password: password
  persistence:
    enabled: true
    existingClaim: nextcloud-ssd
    accessMode: ReadWriteOnce
    size: 100Gi

  configs:
    trusted_domains.config.php: |-
      <?php
      $CONFIG = [
        'trusted_domains' => [
          0 => 'localhost',
          1 => 'nextcloud.mydomainname.co.uk',
          2 => '192.168.0.200',
          3 => 'nextcloud',
          4 => '192.168.0.1'
        ]
      ];
    proxy.config.php: |-
      <?php
      $CONFIG = array (
        'trusted_proxies' => array(
          0 => '127.0.0.1',
          1 => '10.0.0.0/8',
          2 => '192.168.0.1'
        ),
        'forwarded_for_headers' => array('HTTP_X_FORWARDED_FOR'),
      );

Additional context, if any

I'm using metalLB and I also am using NGINX-ingress that is deployed in this yml.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  namespace: nextcloud
  name: nextcloud-ingress
  annotations:
    cert-manager.io/cluster-issuer: my-ca-issuer
    nginx.ingress.kubernetes.io/enable-cors: "true"
    nginx.ingress.kubernetes.io/cors-allow-headers: "X-Forwarded-For"
spec:
  ingressClassName: nginx
  tls:
    - hosts:
        - nextcloud.mydomainname.co.uk
      secretName: nextcloud-prod-tls
  rules:
    - host: nextcloud.mydomainname.co.uk
      http:
        paths:
          - pathType: Prefix
            path: /
            backend:
              service:
                name: nextcloud
                port:
                  number: 8080

I checked in the pod by running the below, it seems that the config.php files aren't being made? Though I'm extremely new to Kube in general so could be missing something!

ubuntu@k3smaster:~/k3s/nextcloud $ kubectl exec -it -n nextcloud nextcloud-6d48dc68dd-n7j27 -- bash
root@nextcloud-6d48dc68dd-n7j27:/var/www/html# cd config/
root@nextcloud-6d48dc68dd-n7j27:/var/www/html/config# ls
CAN_INSTALL  apache-pretty-urls.config.php  apcu.config.php  apps.config.php  autoconfig.php  config.php  config.sample.php  redis.config.php  smtp.config.php
@provokateurin
Copy link
Member

@arphillips06
Copy link
Author

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#trusted-domains is what you are missing.

How would I apply it? I thought I had done it correctly in my values.yml file? About halfway down the config above.

@provokateurin
Copy link
Member

Ah you are right. Did you deploy again after making the config file changes? Other than that I don't see why the config files wouldn't be present,

@arphillips06
Copy link
Author

Yeah, I tried upgrading the helm install with the file (which I think should have done it) then uninstalled the deployment and chart. Same result both times.

@arphillips06 arphillips06 changed the title A descriptive title of the issue Access through untrusted domain Feb 9, 2024
@zhangdeshuai1999
Copy link

I'm just like you. How's your situation

@jessebot
Copy link
Collaborator

jessebot commented Jul 26, 2024

To be sure this is being set, can you, @arphillips06 or @zhangdeshuai1999, please log into your pod and check the output of:

php occ config:system:get trusted_domains

I'd also be interested to see if trusted_domains.config.php actually made it into the config dir? I don't see it in the original post with the output listed there 🤔

@jessebot
Copy link
Collaborator

Also, semi-related, but we recently added a new nextcloud.trustedDomains helm parameter in 5.4.0:
https://github.com/nextcloud/helm/releases/tag/nextcloud-5.4.0

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

No branches or pull requests

4 participants