diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..32ac534 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,18 @@ +variables: + CONTAINER_NAME: thallian/matrix-synapse + +build: + stage: build + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + script: + - mkdir -p /kaniko/.docker + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(printf "%s:%s" "$CI_REGISTRY_USER" "$CI_REGISTRY_PASSWORD" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json + - >- + /kaniko/executor + --context "$CI_PROJECT_DIR" + --dockerfile "$CI_PROJECT_DIR/Dockerfile" + --destination "$CONTAINER_NAME:$CI_COMMIT_SHA" + --destination "$CONTAINER_NAME:$CI_COMMIT_REF_NAME" + --destination "$CONTAINER_NAME:latest" diff --git a/Containerfile b/Containerfile deleted file mode 100644 index 755d847..0000000 --- a/Containerfile +++ /dev/null @@ -1,50 +0,0 @@ -FROM docker.io/alpine:3.21 AS builder - -RUN apk add --no-cache \ - alpine-sdk \ - python3-dev \ - py3-pip \ - py3-wheel \ - libffi-dev \ - openssl-dev \ - zlib-dev \ - jpeg-dev \ - rust \ - cargo \ - poetry \ - git - -ENV VERSION=v1.132.0 -RUN git clone https://github.com/element-hq/synapse.git -WORKDIR /synapse -RUN git checkout $VERSION - -RUN poetry export -o /synapse/requirements.txt -RUN pip3 install --target="/install" -r /synapse/requirements.txt -RUN pip3 install --target="/install" --no-deps --no-warn-script-location /synapse[all]; - - -FROM docker.io/thallian/confd-env:3.21-3.2.0.2 - -RUN addgroup -g 2222 matrix-synapse -RUN adduser -h /var/lib/matrix-synapse -u 2222 -D -G matrix-synapse matrix-synapse - -RUN apk add --no-cache \ - python3 \ - py3-psycopg2 \ - py3-authlib \ - py3-asn1 \ - libffi \ - openssl \ - zlib \ - jpeg - -ENV PYTHONPATH=$PYTHONPATH:/py-pkgs -COPY --from=builder /install /py-pkgs - -ADD /rootfs / - -RUN chown -R matrix-synapse:matrix-synapse /var/lib/matrix-synapse -ENV HOME /var/lib/matrix-synapse - -VOLUME /var/lib/matrix-synapse/media_store/ /var/lib/matrix-synapse/signing/ /etc/ssl/matrix-synapse/ /var/lib/matrix-synapse/registrations/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f5dce69 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +FROM docker.io/alpine:3.16 AS builder + +ENV VERSION=v1.65.0 + +RUN apk add --no-cache \ + alpine-sdk \ + python3-dev \ + py3-pip \ + py3-wheel \ + libffi-dev \ + openssl-dev \ + zlib-dev \ + jpeg-dev \ + rust + +RUN pip3 install --target="/install" matrix-synapse==$VERSION + +FROM docker.io/thallian/confd-env:3.16 + +RUN addgroup -g 2222 matrix-synapse +RUN adduser -h /var/lib/matrix-synapse -u 2222 -D -G matrix-synapse matrix-synapse + +RUN apk add --no-cache \ + python3 \ + py3-psycopg2 \ + py3-authlib \ + libffi \ + openssl \ + zlib \ + jpeg + +ENV PYTHONPATH=$PYTHONPATH:/py-pkgs +COPY --from=builder /install /py-pkgs + +ADD /rootfs / + +RUN chown -R matrix-synapse:matrix-synapse /var/lib/matrix-synapse +ENV HOME /var/lib/matrix-synapse + +VOLUME /var/lib/matrix-synapse/media_store/ /var/lib/matrix-synapse/signing/ /etc/ssl/matrix-synapse/ /var/lib/matrix-synapse/registrations/ diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index a8bfde8..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1 +0,0 @@ -multiarch_container() diff --git a/rootfs/etc/confd/templates/server.yaml.tmpl b/rootfs/etc/confd/templates/server.yaml.tmpl index a40bb9f..263b6d1 100644 --- a/rootfs/etc/confd/templates/server.yaml.tmpl +++ b/rootfs/etc/confd/templates/server.yaml.tmpl @@ -301,14 +301,12 @@ listeners: tls: false type: http x_forwarded: true - bind_addresses: ['::'] + bind_addresses: ['0.0.0.0'] resources: - names: [client, federation] compress: false - - port: 9000 - type: metrics - bind_addresses: ['::'] + # example additional_resources: # #additional_resources: @@ -1141,7 +1139,7 @@ oembed: # Defaults to "https://www.recaptcha.net/recaptcha/api/siteverify". # #recaptcha_siteverify_api: "https://my.recaptcha.site" -enable_authenticated_media: true + ## TURN ## @@ -1434,7 +1432,7 @@ account_threepid_delegates: # Enable collection and rendering of performance metrics # -enable_metrics: true +enable_metrics: false # Enable sentry integration # NOTE: While attempts are made to ensure that the logs don't contain @@ -1517,7 +1515,7 @@ room_prejoin_state: app_service_config_files: {{if not (getenv "REGISTRATIONS")}}[]{{end}} {{- if (getenv "REGISTRATIONS")}} {{- range $registration := split (getenv "REGISTRATIONS") ";"}} - - registrations/{{ $registration -}} + - {{ $registration -}} {{end}} {{end}}