From e80870356e6e3087f5a2c7db2462c4ab387bd084 Mon Sep 17 00:00:00 2001 From: Sheogorath <sheogorath@shivering-isles.com> Date: Sun, 18 Sep 2022 14:30:42 +0200 Subject: [PATCH] feat(synadm): Add synadm command image to administrate synapse This patch adds a new container image for synadm, which should help to administrate synapse using a CLI. --- docs/src/SUMMARY.md | 1 + docs/src/images/synadm.md | 1 + images/.utils/gitlab-ci.yaml | 1 + images/synadm/.release | 1 + images/synadm/Dockerfile | 10 ++++++++++ images/synadm/Makefile | 13 +++++++++++++ images/synadm/README.md | 19 +++++++++++++++++++ images/synadm/synadm | 12 ++++++++++++ 8 files changed, 58 insertions(+) create mode 120000 docs/src/images/synadm.md create mode 100644 images/synadm/.release create mode 100644 images/synadm/Dockerfile create mode 100644 images/synadm/Makefile create mode 100644 images/synadm/README.md create mode 100755 images/synadm/synadm diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index d2763a917..8ca74d20e 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -36,6 +36,7 @@ - [Dovecot](images/dovecot.md) - [Koolbox](images/koolbox.md) - [Postfix](images/postfix.md) + - [synadm](images/synadm.md) --- diff --git a/docs/src/images/synadm.md b/docs/src/images/synadm.md new file mode 120000 index 000000000..442d54c87 --- /dev/null +++ b/docs/src/images/synadm.md @@ -0,0 +1 @@ +../../../images/synadm/README.md \ No newline at end of file diff --git a/images/.utils/gitlab-ci.yaml b/images/.utils/gitlab-ci.yaml index 1711d6691..970f793c0 100644 --- a/images/.utils/gitlab-ci.yaml +++ b/images/.utils/gitlab-ci.yaml @@ -5,6 +5,7 @@ - dovecot - postfix - koolbox + - synadm container-build: diff --git a/images/synadm/.release b/images/synadm/.release new file mode 100644 index 000000000..85f180f38 --- /dev/null +++ b/images/synadm/.release @@ -0,0 +1 @@ +release=0.1.0 diff --git a/images/synadm/Dockerfile b/images/synadm/Dockerfile new file mode 100644 index 000000000..29d6bcda3 --- /dev/null +++ b/images/synadm/Dockerfile @@ -0,0 +1,10 @@ +FROM docker.io/library/python:3 + +RUN true \ + && pip3 install synadm \ + && mkdir -p /workspace \ + && true + + +WORKDIR /workspace +ENTRYPOINT ["/usr/local/bin/synadm"] diff --git a/images/synadm/Makefile b/images/synadm/Makefile new file mode 100644 index 000000000..9020ce9a5 --- /dev/null +++ b/images/synadm/Makefile @@ -0,0 +1,13 @@ +.DEFAULT_GOAL := help + +include ../.utils/container-build.mk +include ../../utils/help.mk + +.PHONY: preflight +preflight: + # Check for required tools + command -v podman > /dev/null + +.PHONY: install +install: preflight build ## Install koolbox, the Kubernetes Toolbox for SI-Infrastructure + install -m 755 ./synadm ~/bin/synadm diff --git a/images/synadm/README.md b/images/synadm/README.md new file mode 100644 index 000000000..9dd1697bc --- /dev/null +++ b/images/synadm/README.md @@ -0,0 +1,19 @@ +Synadm +=== + +Simple container providing the [synadm](https://github.com/JOJ0/synadm) CLI with nicely isolated from the system. + +Requirements +--- + +Have podman installed. And in best case running [Fedora Workstation](https://getfedora.org/en/workstation/) or [Silverblue](https://silverblue.fedoraproject.org/). + +Installation +--- + +In order to install it, you just build the container yourself and get a neat little shell script installed in `~/bin/` + +``` +make install REGISTRY_HOST=quay.io USERNAME=shivering-isles +synadm --help +``` diff --git a/images/synadm/synadm b/images/synadm/synadm new file mode 100755 index 000000000..3655871d9 --- /dev/null +++ b/images/synadm/synadm @@ -0,0 +1,12 @@ +#!/bin/bash + +set -x + +XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-${HOME}/.config}" + +SYNADM_CONFIG_HOME="${XDG_CONFIG_HOME}/synadm" + +mkdir -p "$SYNADM_CONFIG_HOME" +touch "$SYNADM_CONFIG_HOME/synadm.yaml" + +podman run -it --rm -v "${SYNADM_CONFIG_HOME}:/root/.config/:z" quay.io/shivering-isles/synadm:latest $@ -- GitLab