Skip to content

Commit a650026

Browse files
authored
Merge pull request #155 from chillymattster/oc_port_configurable
feat: port configuration
2 parents 79782cd + 50254df commit a650026

6 files changed

Lines changed: 25 additions & 19 deletions

File tree

.env.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ TRAEFIK_LOG_LEVEL=
7373
# If you want to run traefik non-privileged, use the following variable and the format [UID]:[GID] to set user and group of your choice.
7474
# Ensure that the user has access to docker.sock and traefik volumes defined in traefik/opencloud.yml
7575
#TRAEFIK_CONTAINER_UID_GID="1000:1000"
76-
76+
# Configure ports for HTTP and HTTPS when necessary, defaults are 80 and 443
77+
# Don't use ports in the range of 8000-9999 and 5232 as those ports are used internally and therefore might create conflicts.
78+
#TRAEFIK_PORT_HTTP=4080
79+
#TRAEFIK_PORT_HTTPS=4443
7780

7881
## OpenCloud Settings ##
7982
# The opencloud container image.

config/opencloud/csp.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ directives:
44
connect-src:
55
- '''self'''
66
- 'blob:'
7-
- 'https://${COMPANION_DOMAIN|companion.opencloud.test}/'
8-
- 'wss://${COMPANION_DOMAIN|companion.opencloud.test}/'
7+
- 'https://${COMPANION_DOMAIN|companion.opencloud.test}${TRAEFIK_PORT_HTTPS}/'
8+
- 'wss://${COMPANION_DOMAIN|companion.opencloud.test}${TRAEFIK_PORT_HTTPS}/'
99
- 'https://raw.githubusercontent.com/opencloud-eu/awesome-apps/'
10-
- 'https://${IDP_DOMAIN|keycloak.opencloud.test}/'
10+
- 'https://${IDP_DOMAIN|keycloak.opencloud.test}${TRAEFIK_PORT_HTTPS}/'
1111
- 'https://update.opencloud.eu/'
1212
default-src:
1313
- '''none'''
@@ -20,7 +20,7 @@ directives:
2020
- 'blob:'
2121
- 'https://embed.diagrams.net/'
2222
# In contrary to bash and docker the default is given after the | character
23-
- 'https://${COLLABORA_DOMAIN|collabora.opencloud.test}/'
23+
- 'https://${COLLABORA_DOMAIN|collabora.opencloud.test}${TRAEFIK_PORT_HTTPS}/'
2424
# This is needed for the external-sites web extension when embedding sites
2525
- 'https://docs.opencloud.eu'
2626
img-src:
@@ -30,7 +30,7 @@ directives:
3030
- 'https://raw.githubusercontent.com/opencloud-eu/awesome-apps/'
3131
- 'https://tile.openstreetmap.org/'
3232
# In contrary to bash and docker the default is given after the | character
33-
- 'https://${COLLABORA_DOMAIN|collabora.opencloud.test}/'
33+
- 'https://${COLLABORA_DOMAIN|collabora.opencloud.test}${TRAEFIK_PORT_HTTPS}/'
3434
manifest-src:
3535
- '''self'''
3636
media-src:
@@ -41,7 +41,7 @@ directives:
4141
script-src:
4242
- '''self'''
4343
- '''unsafe-inline'''
44-
- 'https://${IDP_DOMAIN|keycloak.opencloud.test}/'
44+
- 'https://${IDP_DOMAIN|keycloak.opencloud.test}${TRAEFIK_PORT_HTTPS}/'
4545
style-src:
4646
- '''self'''
4747
- '''unsafe-inline'''

config/traefik/docker-entrypoint-override.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ add_arg "--log.level=${TRAEFIK_LOG_LEVEL:-ERROR}"
1414
# enable dashboard
1515
add_arg "--api.dashboard=true"
1616
# define entrypoints
17-
add_arg "--entryPoints.http.address=:80"
17+
add_arg "--entryPoints.http.address=:${TRAEFIK_PORT_HTTP:-80}"
1818
add_arg "--entryPoints.http.http.redirections.entryPoint.to=https"
1919
add_arg "--entryPoints.http.http.redirections.entryPoint.scheme=https"
20-
add_arg "--entryPoints.https.address=:443"
20+
add_arg "--entryPoints.https.address=:${TRAEFIK_PORT_HTTPS:-443}"
2121
# change default timeouts for long-running requests
2222
# this is needed for webdav clients that do not support the TUS protocol
2323
add_arg "--entryPoints.https.transport.respondingTimeouts.readTimeout=12h"

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ services:
1616
environment:
1717
# enable services that are not started automatically
1818
OC_ADD_RUN_SERVICES: ${START_ADDITIONAL_SERVICES}
19-
OC_URL: https://${OC_DOMAIN:-cloud.opencloud.test}
19+
OC_URL: https://${OC_DOMAIN:-cloud.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
2020
OC_LOG_LEVEL: ${LOG_LEVEL:-info}
2121
OC_LOG_COLOR: "${LOG_PRETTY:-false}"
2222
OC_LOG_PRETTY: "${LOG_PRETTY:-false}"

traefik/opencloud.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ services:
2323
- "TRAEFIK_ACME_CASERVER=${TRAEFIK_ACME_CASERVER:-https://acme-v02.api.letsencrypt.org/directory}"
2424
- "TRAEFIK_LOG_LEVEL=${TRAEFIK_LOG_LEVEL:-ERROR}"
2525
- "TRAEFIK_ACCESS_LOG=${TRAEFIK_ACCESS_LOG:-false}"
26+
- "TRAEFIK_PORT_HTTP=${TRAEFIK_PORT_HTTP:-80}"
27+
- "TRAEFIK_PORT_HTTPS=${TRAEFIK_PORT_HTTPS:-443}"
2628
ports:
27-
- "80:80"
28-
- "443:443"
29+
- "${TRAEFIK_PORT_HTTP:-80}:${TRAEFIK_PORT_HTTP:-80}"
30+
- "${TRAEFIK_PORT_HTTPS:-443}:${TRAEFIK_PORT_HTTPS:-443}"
2931
volumes:
3032
- "${DOCKER_SOCKET_PATH:-/var/run/docker.sock}:/var/run/docker.sock:ro"
3133
- "./config/traefik/docker-entrypoint-override.sh:/opt/traefik/bin/docker-entrypoint-override.sh"

weboffice/collabora.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ services:
55
environment:
66
# this is needed for setting the correct CSP header
77
COLLABORA_DOMAIN: ${COLLABORA_DOMAIN:-collabora.opencloud.test}
8+
TRAEFIK_PORT_HTTPS: ${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
89
# expose nats and the reva gateway for the collaboration service
910
NATS_NATS_HOST: 0.0.0.0
1011
GATEWAY_GRPC_ADDR: 0.0.0.0:9142
@@ -30,15 +31,15 @@ services:
3031
COLLABORATION_HTTP_ADDR: 0.0.0.0:9300
3132
MICRO_REGISTRY: "nats-js-kv"
3233
MICRO_REGISTRY_ADDRESS: "opencloud:9233"
33-
COLLABORATION_WOPI_SRC: https://${WOPISERVER_DOMAIN:-wopiserver.opencloud.test}
34+
COLLABORATION_WOPI_SRC: https://${WOPISERVER_DOMAIN:-wopiserver.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
3435
COLLABORATION_APP_NAME: "CollaboraOnline"
3536
COLLABORATION_APP_PRODUCT: "Collabora"
36-
COLLABORATION_APP_ADDR: https://${COLLABORA_DOMAIN:-collabora.opencloud.test}
37-
COLLABORATION_APP_ICON: https://${COLLABORA_DOMAIN:-collabora.opencloud.test}/favicon.ico
37+
COLLABORATION_APP_ADDR: https://${COLLABORA_DOMAIN:-collabora.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
38+
COLLABORATION_APP_ICON: https://${COLLABORA_DOMAIN:-collabora.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}/favicon.ico
3839
COLLABORATION_APP_INSECURE: "${INSECURE:-true}"
3940
COLLABORATION_CS3API_DATAGATEWAY_INSECURE: "${INSECURE:-true}"
4041
COLLABORATION_LOG_LEVEL: ${LOG_LEVEL:-info}
41-
OC_URL: https://${OC_DOMAIN:-cloud.opencloud.test}
42+
OC_URL: https://${OC_DOMAIN:-cloud.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
4243
volumes:
4344
# configure the .env file to use own paths instead of docker internal volumes
4445
- ${OC_CONFIG_DIR:-opencloud-config}:/etc/opencloud
@@ -52,15 +53,15 @@ services:
5253
networks:
5354
opencloud-net:
5455
environment:
55-
aliasgroup1: https://${WOPISERVER_DOMAIN:-wopiserver.opencloud.test}:443
56+
aliasgroup1: https://${WOPISERVER_DOMAIN:-wopiserver.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-}
5657
DONT_GEN_SSL_CERT: "YES"
5758
extra_params: |
5859
--o:ssl.enable=${COLLABORA_SSL_ENABLE:-true} \
5960
--o:ssl.ssl_verification=${COLLABORA_SSL_VERIFICATION:-true} \
6061
--o:ssl.termination=true \
6162
--o:welcome.enable=false \
62-
--o:net.frame_ancestors=${OC_DOMAIN:-cloud.opencloud.test} \
63-
--o:net.lok_allow.host[14]=${OC_DOMAIN-cloud.opencloud.test} \
63+
--o:net.frame_ancestors=${OC_DOMAIN:-cloud.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-} \
64+
--o:net.lok_allow.host[14]=${OC_DOMAIN-cloud.opencloud.test}${TRAEFIK_PORT_HTTPS:+:}${TRAEFIK_PORT_HTTPS:-} \
6465
--o:home_mode.enable=${COLLABORA_HOME_MODE:-false}
6566
username: ${COLLABORA_ADMIN_USER:-admin}
6667
password: ${COLLABORA_ADMIN_PASSWORD:-admin}

0 commit comments

Comments
 (0)