From 49d67f9130882b45677f9516a52818606012275a Mon Sep 17 00:00:00 2001 From: Aine Date: Sat, 31 Aug 2024 14:47:33 +0300 Subject: [PATCH] update CI and readme --- .github/FUNDING.yml | 1 + .github/dependabot.yml | 20 --------- .github/workflows/build-test.yml | 23 ---------- .github/workflows/docker-release.yml | 63 ---------------------------- .github/workflows/edge_ghpage.yml | 29 ------------- .github/workflows/github-release.yml | 30 ------------- .github/workflows/workflow.yml | 42 +++++++++++++++++++ README.md | 12 ++++++ 8 files changed, 55 insertions(+), 165 deletions(-) create mode 100644 .github/FUNDING.yml delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/build-test.yml delete mode 100644 .github/workflows/docker-release.yml delete mode 100644 .github/workflows/edge_ghpage.yml delete mode 100644 .github/workflows/github-release.yml create mode 100644 .github/workflows/workflow.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..bce7bfb --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +liberapay: etkecc diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index c179434..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,20 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "weekly" - ignore: - # Major updates for react-admin have breaking changes - - dependency-name: "react-admin" - update-types: ["version-update:semver-major"] - - - package-ecosystem: "docker" - directory: "/" - schedule: - interval: "weekly" - - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml deleted file mode 100644 index 378a872..0000000 --- a/.github/workflows/build-test.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: build-test - -on: - push: - branches: ["master"] - pull_request: - -jobs: - check: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: "18" - - name: Install dependencies - run: yarn --immutable - - name: Run checks - run: yarn lint - - name: Run tests - run: yarn test diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml deleted file mode 100644 index 44c2658..0000000 --- a/.github/workflows/docker-release.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Create docker image(s) and push to docker hub and ghcr.io -# see https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-docker-hub-and-github-packages - -on: - push: - # Sequence of patterns matched against refs/heads - # prettier-ignore - branches: - # Push events on master branch - - master - # Sequence of patterns matched against refs/tags - tags: - - '[0-9]+\.[0-9]+\.[0-9]+' # Push events to 0.X.X tag - -jobs: - docker: - name: Push Docker image to multiple registries - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Login to GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: | - awesometechnologies/synapse-admin - ghcr.io/${{ github.repository }} - - - name: Build and Push Tag - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/edge_ghpage.yml b/.github/workflows/edge_ghpage.yml deleted file mode 100644 index a66d675..0000000 --- a/.github/workflows/edge_ghpage.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Build and Deploy Edge version to GH Pages -on: - workflow_dispatch: - push: - branches: - - main - - master -jobs: - build-and-deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v4 - with: - fetch-depth: 100 - fetch-tags: true - - uses: actions/setup-node@v4 - with: - node-version: "20" - - name: Install and Build 🔧 - run: | - yarn install --immutable - yarn build --base=/synapse-admin - - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@v4.6.3 - with: - branch: gh-pages - folder: dist diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml deleted file mode 100644 index becd1bf..0000000 --- a/.github/workflows/github-release.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Create release tarball and attach to tag - -on: - push: - tags: - - "*" - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: write - packages: write - - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: "20" - - run: yarn install --immutable - - run: yarn build - - run: | - version=`git describe --dirty --tags || echo unknown` - cp -r dist synapse-admin-$version - tar chvzf dist/synapse-admin-$version.tar.gz synapse-admin-$version - - uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 - with: - files: dist/*.tar.gz - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..fcaee40 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,42 @@ +name: +on: + push: + branches: [ "main" ] +env: + upstream_version: v0.10.3 + etke_version: etke1 +permissions: + checks: write + contents: write + packages: write + pull-requests: read +jobs: + build-publish: + name: Build and Publish + runs-on: self-hosted + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to ghcr.io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository }} + registry.etke.cc/${{ github.repository }} + tags: | + type=raw,value=latest,enable=${{ github.ref_name == 'main' }} + type=raw,value=${{ env.upstream_version }}-${{ env.etke_version }},enable=${{ github.ref_name == 'main' }} + - name: Build and push + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/README.md b/README.md index b4f20db..5706a2a 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,18 @@ This project is built using [react-admin](https://marmelab.com/react-admin/). +## Fork differences + +With [Awesome-Technologies/synapse-admin](https://github.com/Awesome-Technologies/synapse-admin) as the upstream, this +fork is intended to be a more feature-rich version of the original project. The main goal is to provide a more +user-friendly interface for managing Synapse homeservers. + +The following changes are already implemented: + +* [Prevent admins from deleting themselves](https://github.com/etkecc/synapse-admin/pull/1) + +_the list will be updated as new changes are added_ + ## Usage ### Supported Synapse