Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
WIP of syn2mas tool
Browse files Browse the repository at this point in the history
  • Loading branch information
hughns committed Aug 11, 2023
1 parent 1768520 commit e79be6c
Show file tree
Hide file tree
Showing 33 changed files with 6,937 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,8 @@ updates:
graphql-codegen:
patterns:
- "@graphql-codegen/*"

- package-ecosystem: "npm"
directory: "/tools/syn2mas/"
schedule:
interval: "weekly"
4 changes: 4 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ name: Build
on:
push:
branches: [ main ]
paths-ignore:
- 'tools/**'
pull_request:
branches: [ main ]
paths-ignore:
- 'tools/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ name: CI
on:
push:
branches: [ main ]
paths-ignore:
- 'tools/**'
pull_request:
branches: [ main ]
paths-ignore:
- 'tools/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ name: Coverage
on:
push:
branches: [ main ]
paths-ignore:
- 'tools/**'
pull_request:
branches: [ main ]
paths-ignore:
- 'tools/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ name: Build and deploy the documentation
on:
push:
branches: [ main ]
paths-ignore:
- 'tools/**'
pull_request:
branches: [ main ]
paths-ignore:
- 'tools/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/tools.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI for tools

on:
push:
paths:
- 'tools/**'
pull_request:
paths:
- 'tools/**'

concurrency:
group: tools-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
syn2mas-lint:
name: Check syn2mas style
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Checkout the code
uses: actions/checkout@v3.5.3

- name: Install Node
uses: actions/setup-node@v3.7.0
with:
node-version-file: ./tools/syn2mas/.nvmrc

- name: Install Node dependencies
working-directory: ./tools/syn2mas
run: npm ci

- name: Lint
working-directory: ./tools/syn2mas
run: npm run lint

tests-done:
name: Tests done
if: ${{ always() }}
needs:
- syn2mas-lint
runs-on: ubuntu-latest

steps:
- uses: matrix-org/done-action@v2
with:
needs: ${{ toJSON(needs) }}
22 changes: 22 additions & 0 deletions tools/syn2mas/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
plugins: [
'matrix-org',
],
extends: [
'plugin:matrix-org/typescript',
],
env: {
browser: false,
node: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: "./tsconfig.json",
},
rules: {
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-misused-promises': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/await-thenable': 'error',
},
};
2 changes: 2 additions & 0 deletions tools/syn2mas/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
1 change: 1 addition & 0 deletions tools/syn2mas/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
16 changes: 16 additions & 0 deletions tools/syn2mas/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# syn2mas - Synapse to Matrix Authentication Service

Tool to help with the migration of a Matrix Synapse installation to the Matrix Authentication Service.

The tool has two modes of operation:

- Advisor mode: Analyses the Synapse configuration and reports on any issues that would prevent a successful migration.
- Migration mode: Performs the migration of the Synapse database into the Matrix Authentication Service database.

## Usage

Pre-migration advisor:

```sh
npm run dev -- advisor --synapseConfigFile homeserver.yaml
```
Loading

0 comments on commit e79be6c

Please sign in to comment.