Hey together!
I recently took over the administration of an old NC 18 installation, which i migrated to a new server and into a docker setup. After that i upgraded every major to the current stable. At first glance everything works as expected, but i have two strange things happening:
1: The admin overview states
Could not check for JavaScript support. Please check manually if your webserver serves `.mjs` files using the JavaScript MIME type.
i have read a lot of proposed fixes to this problem, but a lot do not apply here (since i don’t use nginx).
when i try to curl the esm-test from my app container, the following happens:
curl -I https://cloud.mydomain.de/apps/settings/js/esm-test.mjs
curl: (28) Failed to connect to cloud.mydomain.de port 443 after 129894 ms: Couldn't connect to server
Which i don’t really understand. curling any other online resource seems to work fine from here.
opening it from my Browser results in
/**
* This is a dummy file for testing webserver support of JavaScript modules.
*/
export default 'Hello'
If i install dnsutils into the app container and call
nslookup cloud.mydomain.de
it resolves the public ipv4 and ipv6 without any problems.
2: I get sporadic DNS errors in the protocoll, seems like this happens when specific cron tasks are ran.
one example:
{"reqId":"GjoN5HOEfJOzkwpTtxh3","level":3,"time":"2024-04-18T10:35:03+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"dns_get_record(): A temporary server error occurred. at /var/www/html/lib/private/Http/Client/DnsPinMiddleware.php#111","userAgent":"--","version":"28.0.4.1","data":{"app":"PHP"},"id":"6620faba80aa6"}
Also looked around what that could be, but did not really found any solution worth trying.
Maybe these two problems are linked together?
My setup looks like this:
docker-compose of my traefik reverse proxy:
services:
socket-proxy-traefik:
image: lscr.io/linuxserver/socket-proxy:latest
container_name: socket-proxy-traefik
environment:
- ALLOW_START=0
- ALLOW_STOP=0
- ALLOW_RESTARTS=0
- AUTH=0
- BUILD=0
- COMMIT=0
- CONFIGS=0
- CONTAINERS=1
- DISABLE_IPV6=0
- DISTRIBUTION=0
- EVENTS=1
- EXEC=0
- IMAGES=0
- INFO=0
- NETWORKS=0
- NODES=0
- PING=0
- POST=0
- PLUGINS=0
- SECRETS=0
- SERVICES=0
- SESSION=0
- SWARM=0
- SYSTEM=0
- TASKS=0
- VERSION=1
- VOLUMES=0
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: unless-stopped
read_only: true
tmpfs:
- /run
networks:
- sp-traefik
traefik:
image: traefik:latest
restart: unless-stopped
user: 4200:4200
volumes:
- /mnt/data/container_data/baseservices/traefik/acme:/acme:z
ports:
- 80:80/tcp
- 443:443/tcp
command:
- --providers.docker=true
- --providers.docker.endpoint=tcp://socket-proxy-traefik:2375
- --entryPoints.web.address=:80
- --entryPoints.web.http.redirections.entryPoint.to=websecure
- --entryPoints.web.http.redirections.entryPoint.scheme=https
- --entryPoints.websecure.address=:443
- --providers.docker.exposedByDefault=false
- --certificatesresolvers.le.acme.email=ssladmin@mydomain.de
- --certificatesresolvers.le.acme.storage=/acme/acme.json
- --certificatesresolvers.le.acme.tlschallenge=true
container_name: traefik
networks:
- gateway
- sp-traefik
networks:
gateway:
name: gateway
external: true
sp-traefik:
name: sp-traefik
external: true
the docker-compose of the cloud instance looks like this:
services:
db:
image: mariadb:latest
restart: always
volumes:
- /mnt/data/container_data/cloud/database:/var/lib/mysql
env_file:
- .env
networks:
- cloud
app:
image: nextcloud:stable
restart: always
expose:
- "80"
volumes:
- /mnt/data/container_data/cloud/www:/var/www/html
- /mnt/data/container_data/cloud/data:/Data/Cloud
- /etc/localtime:/etc/localtime:ro
env_file:
- .env
depends_on:
- db
- redis
labels:
- "traefik.enable=true"
- "traefik.docker.network=gateway"
- "traefik.http.routers.cl01.rule=Host(`cloud.mydomain.de`)"
- "traefik.http.routers.cl01.entrypoints=websecure"
- "traefik.http.routers.cl01.tls.certresolver=le"
- "traefik.http.services.cl01.loadbalancer.server.port=80"
- "traefik.http.routers.cl01.middlewares=nextcloud_redirectregex,nextcloud_headers"
- "traefik.http.middlewares.nextcloud_redirectregex.redirectregex.permanent=true"
- "traefik.http.middlewares.nextcloud_redirectregex.redirectregex.regex=https://(.*)/.well-known/(?:card|cal)dav"
- "traefik.http.middlewares.nextcloud_redirectregex.redirectregex.replacement=https://$${1}/remote.php/dav"
- "traefik.http.middlewares.nextcloud_headers.headers.customFrameOptionsValue=SAMEORIGIN"
- "traefik.http.middlewares.nextcloud_headers.headers.framedeny=true"
- "traefik.http.middlewares.nextcloud_headers.headers.sslredirect=true"
- "traefik.http.middlewares.nextcloud_headers.headers.STSIncludeSubdomains=true"
- "traefik.http.middlewares.nextcloud_headers.headers.STSPreload=true"
- "traefik.http.middlewares.nextcloud_headers.headers.STSSeconds=315360000"
- "traefik.http.middlewares.nextcloud_headers.headers.forceSTSHeader=true"
- "traefik.http.middlewares.nextcloud_headers.headers.sslProxyHeaders.X-Forwarded-Proto=https"
networks:
- gateway
- cloud
cron:
image: nextcloud:stable
restart: always
volumes:
- /mnt/data/container_data/cloud/www:/var/www/html
- /mnt/data/container_data/cloud/data:/Data/Cloud
- /etc/localtime:/etc/localtime:ro
env_file:
- .env
depends_on:
- db
- redis
entrypoint: /cron.sh
networks:
- cloud
redis:
image: redis:alpine
restart: always
env_file:
- .env
depends_on:
- db
networks:
- cloud
networks:
gateway:
name: gateway
external: true
cloud:
internal: true
the .env file for the instance looks like:
MYSQL_PASSWORD=REMOVEDUNSAFEINFORMATION
MYSQL_USER=nextcloud
MYSQL_DATABASE=nextcloud
MYSQL_HOST=db
MARIADB_RANDOM_ROOT_PASSWORD=true
NEXTCLOUD_ADMIN_USER=admin
NEXTCLOUD_ADMIN_PASSWORD=REMOVEDUNSAFEINFORMATION
NEXTCLOUD_TRUSTED_DOMAINS=cloud.mydomain.de
REDIS_HOST=redis
the config.php of the instance looks like:
<?php
$CONFIG = array (
'instanceid' => 'REMOVEDUNSAFEINFORMATION',
'passwordsalt' => 'REMOVEDUNSAFEINFORMATION',
'secret' => 'REMOVEDUNSAFEINFORMATION',
'trusted_domains' =>
array (
0 => 'cloud.mydomain.de',
1 => 'REMOVEDIPV4PUBLICIP',
2 => 'REMOVEDIPV6PUBLICIP',
),
'datadirectory' => '/Data/Cloud/',
'dbtype' => 'mysql',
'version' => '28.0.4.1',
'overwriteprotocol' => 'https',
'overwritehost' => 'cloud.mydomain.de',
'overwrite.cli.url' => 'https://cloud.mydomain.de',
'dbname' => 'nextcloud',
'dbhost' => 'db',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'nextcloud',
'dbpassword' => 'REMOVEDUNSAFEINFORMATION',
'installed' => true,
'maintenance' => false,
'loglevel' => 2,
'trusted_proxies' =>
array (
0 => '172.0.0.0/8',
),
'mysql.utf8mb4' => true,
'maintenance_window_start' => 1,
'filelocking.enabled' => true,
'memcache.local' => '\\OC\\Memcache\\APCu',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => 'redis',
'port' => 6379,
'timeout' => 0.0,
),
'default_phone_region' => 'DE',
);
Does someone notice anything wrong with my configuration here?
I’m thankful for any hints
Alex