From a4c316a485de3b6f6c3c34de7dc0822581448cbb Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Wed, 16 Feb 2022 08:50:40 +0100 Subject: [PATCH] use new s6-rc layout [skip ci] --- .editorconfig | 9 -------- Dockerfile | 2 +- rootfs/{etc/cont-init.d => bin}/synapse-keys | 2 +- .../s6-rc.d/matrix-synapse/dependencies | 2 ++ .../s6-rc.d/matrix-synapse}/run | 2 +- .../s6-overlay/s6-rc.d/matrix-synapse/type | 1 + .../s6-rc.d/synapse-keys/dependencies | 1 + .../etc/s6-overlay/s6-rc.d/synapse-keys/type | 1 + rootfs/etc/s6-overlay/s6-rc.d/synapse-keys/up | 1 + .../s6-rc.d/user/contents.d/matrix-synapse | 0 .../nextcloud_oicd_mapping_provider.py | 22 ------------------- 11 files changed, 9 insertions(+), 34 deletions(-) delete mode 100644 .editorconfig rename rootfs/{etc/cont-init.d => bin}/synapse-keys (89%) mode change 100644 => 100755 create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/matrix-synapse/dependencies rename rootfs/etc/{services.d/synapse => s6-overlay/s6-rc.d/matrix-synapse}/run (80%) create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/matrix-synapse/type create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/synapse-keys/dependencies create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/synapse-keys/type create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/synapse-keys/up create mode 100644 rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/matrix-synapse delete mode 100644 rootfs/py-pkgs/nextcloud_oicd_mapping_provider.py diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index d741e40..0000000 --- a/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space -indent_size = 4 diff --git a/Dockerfile b/Dockerfile index a570d2b..c15ca00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.14 AS builder +FROM alpine:3.15 AS builder ENV VERSION=v1.52.0 diff --git a/rootfs/etc/cont-init.d/synapse-keys b/rootfs/bin/synapse-keys old mode 100644 new mode 100755 similarity index 89% rename from rootfs/etc/cont-init.d/synapse-keys rename to rootfs/bin/synapse-keys index 75d6291..e272c2d --- a/rootfs/etc/cont-init.d/synapse-keys +++ b/rootfs/bin/synapse-keys @@ -1,4 +1,4 @@ -#!/usr/bin/with-contenv sh +#!/bin/sh if [ ! -f /var/lib/matrix-synapse/signing/signing.key ]; then s6-setuidgid matrix-synapse python3 -B -m synapse.app.homeserver -c /var/lib/matrix-synapse/server.yaml --generate-config -H $SERVER_NAME --report-stats=no diff --git a/rootfs/etc/s6-overlay/s6-rc.d/matrix-synapse/dependencies b/rootfs/etc/s6-overlay/s6-rc.d/matrix-synapse/dependencies new file mode 100644 index 0000000..7710e42 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/matrix-synapse/dependencies @@ -0,0 +1,2 @@ +confd +synapse-keys diff --git a/rootfs/etc/services.d/synapse/run b/rootfs/etc/s6-overlay/s6-rc.d/matrix-synapse/run similarity index 80% rename from rootfs/etc/services.d/synapse/run rename to rootfs/etc/s6-overlay/s6-rc.d/matrix-synapse/run index 8988858..440b3f1 100644 --- a/rootfs/etc/services.d/synapse/run +++ b/rootfs/etc/s6-overlay/s6-rc.d/matrix-synapse/run @@ -1,4 +1,4 @@ -#!/usr/bin/with-contenv sh +#!/bin/sh cd /var/lib/matrix-synapse s6-setuidgid matrix-synapse python3 -B -m synapse.app.homeserver -c server.yaml diff --git a/rootfs/etc/s6-overlay/s6-rc.d/matrix-synapse/type b/rootfs/etc/s6-overlay/s6-rc.d/matrix-synapse/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/matrix-synapse/type @@ -0,0 +1 @@ +longrun diff --git a/rootfs/etc/s6-overlay/s6-rc.d/synapse-keys/dependencies b/rootfs/etc/s6-overlay/s6-rc.d/synapse-keys/dependencies new file mode 100644 index 0000000..7ba7514 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/synapse-keys/dependencies @@ -0,0 +1 @@ +confd diff --git a/rootfs/etc/s6-overlay/s6-rc.d/synapse-keys/type b/rootfs/etc/s6-overlay/s6-rc.d/synapse-keys/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/synapse-keys/type @@ -0,0 +1 @@ +oneshot diff --git a/rootfs/etc/s6-overlay/s6-rc.d/synapse-keys/up b/rootfs/etc/s6-overlay/s6-rc.d/synapse-keys/up new file mode 100644 index 0000000..6de521b --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/synapse-keys/up @@ -0,0 +1 @@ +synapse-keys diff --git a/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/matrix-synapse b/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/matrix-synapse new file mode 100644 index 0000000..e69de29 diff --git a/rootfs/py-pkgs/nextcloud_oicd_mapping_provider.py b/rootfs/py-pkgs/nextcloud_oicd_mapping_provider.py deleted file mode 100644 index 9fd2dc1..0000000 --- a/rootfs/py-pkgs/nextcloud_oicd_mapping_provider.py +++ /dev/null @@ -1,22 +0,0 @@ -from synapse.handlers.oidc import OidcMappingProvider - - -class NextcloudOidcMappingProvider(OidcMappingProvider): - def __init__(self, config): - self._config = config - - @staticmethod - def parse_config(config): - return {} - - def get_remote_user_id(self, userinfo): - return userinfo["ocs"]["data"]["id"] - - async def map_user_attributes(self, userinfo, token): - localpart = userinfo["ocs"]["data"]["id"] - display_name = userinfo["ocs"]["data"]["display-name"] - return {"localpart": localpart, "display_name": display_name} - - async def get_extra_attributes(self, userinfo, token): - extras = {} - return extras