Trusted domain allowing me to log in with ip

i have installed the docker version

    • 00b01889f388 owncloud/server:10.4 “/usr/bin/entrypoint…” 6 days ago Up 2 hours (healthy) 0.0.0.0:8080->8080/tcp oc_owncloud_1
    • 5e60f594879f webhippie/mariadb:latest “/usr/bin/entrypoint…” 6 days ago Up 22 hours (healthy) 3306/tcp oc_db_1
    • 7f14ca16b142 webhippie/redis:latest “/usr/bin/entrypoint…” 6 days ago Up 22 hours (healthy) 6379/tcp oc_redis_1

ins trusted domain i have following

‘trusted_domains’ =>
array (
0 => ‘localhost’,
1 => ‘orman.mooo.com’,
),

but for some reason i can still log in with ip, i would expect not able and get non trusted domain error

TIA

Hey,

the setting is called “trusted_domains” and i don’t think that a IP can be called a domain. If this is a wrong assumption from my side maybe the ownCloud docker container is adding some additional configuration to allow access via the own IP?

I am pretty sure that I have seen that the docker configuration overwrites the config.php values with values from the environment. It is quite possible that the docker container adds its own IP address to the trusted_domains array. However I’m not sure how it would be able to get the host IP address from inside the container.
I’ve had a quick look through some container layers:


But unfortunately I was unable to find the code in question.

You can definitely set an IP in the trusted_domains array.

3 Likes

thanks for the hint i found this

overwrite.config.php

should i delete this file
among other things i found
‘trusted_domains’ => [
0 => $domain
],

that was it , i commented trusted_domains in that file and now it works , not able to log with public ip

thanks a lot

  • You are accessing the server from an untrusted domain.
    Please contact your administrator. If you are an administrator of this instance, configure the “trusted_domains” setting in config/config.php. An example configuration is provided in config/config.sample.php or at the documentation.
1 Like

I am pretty sure that if you’d delete this file your container stopped working.

Just set your environment correctly and it should work.
Be aware that changing files directly in a container might not be a permanent solution (not sure what exactly you did)…

1 Like

i commented
// ‘trusted_domains’ => [
// 0 => $domain
// ],

in
overwrite.config.php

I would recommend you test that your config change persists a docker container restart.

2 Likes

you were right my solution did not survice image upgrade

v9LqrZophLPIE8EkkBRk","level":0,"time":"2020-04-17T08:28:53+00:00","remoteAddr":"","user":"--","app":"core","method":"--","url":"--","message":"starting upgrade from 10.4.0.4 to 10.4.1.3"}

need to figure a solution

If you look at the available environment variables in the owncloud base docker image you can find the variable OWNCLOUD_DOMAIN, I think that’s the one you need to set in either your docker-compose.yml or .env file.

3 Likes

i hope commenting it works

/etc/environment:#OWNCLOUD_DOMAIN=localhost

I feel like you are trying to troll me. I keep telling you were to edit it, and you find new places inside the container that is not persistent :smiley:

1 Like

Sorry I thought you mean evriroment. Remember I am one of those idiots sorry

I went to where image was What you mean by docker base image

1 Like

understand now thank you

im using this image i think i understand now

ill change it here

version: '2.1'

volumes:
  files:
    driver: local
  mysql:
    driver: local
  backup:
    driver: local
  redis:
    driver: local

services:
  owncloud:
    image: owncloud/server:${OWNCLOUD_VERSION}
    restart: always
    ports:
      - ${HTTP_PORT}:8080
    depends_on:
      - db
      - redis
    environment:
      - OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN}

https://hub.docker.com/r/owncloud/server/

or here .env
OWNCLOUD_VERSION=10.4
OWNCLOUD_DOMAIN=localhost
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin
HTTP_PORT=8080

1 Like

So what was final change you made to solve this error?

You just necroposted to a 4 year old topic. You may want to start a new topic.

1 Like