diff --git a/.github/workflows/buildService.yml b/.github/workflows/buildService.yml index 154c675..0be2da9 100644 --- a/.github/workflows/buildService.yml +++ b/.github/workflows/buildService.yml @@ -3,11 +3,11 @@ name: Build Service on: workflow_dispatch: pull_request: - paths-ignore: ['*.md'] - branches: ['master', 'next'] + paths-ignore: ["*.md"] + branches: ["master", "next"] push: - paths-ignore: ['*.md'] - branches: ['master', 'next'] + paths-ignore: ["*.md"] + branches: ["master", "next"] jobs: BuildPackage: @@ -21,10 +21,10 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Get EmbassyOS Hash - run: echo "EMBASSYHASH=$(git ls-remote https://github.com/Start9Labs/embassy-os HEAD | awk '{ print $1}')" >> $GITHUB_ENV + - name: Get StartOS Hash + run: echo "STARTOSHASH=$(git ls-remote https://github.com/Start9Labs/start-os --branch sdk | awk '{ print $1}')" >> $GITHUB_ENV - name: Cache Packages - uses: actions/cache@v3 + uses: buildjet/cache@v3 id: packageCache with: path: | @@ -33,7 +33,7 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-synapse-${{ env.EMBASSYHASH }} + key: ${{ runner.os }}-synapse-${{ env.STARTOSHASH }} - name: Install Dependencies run: | sudo snap install yq deno @@ -44,8 +44,8 @@ jobs: id: packageManager if: steps.packageCache.outputs.cache-hit != 'true' run: | - cd ~/ && git clone https://github.com/Start9Labs/embassy-os.git; - cd embassy-os; + cd ~/ && git clone https://github.com/Start9Labs/start-os.git --branch sdk; + cd start-os; git submodule update --init --recursive cd backend; export RUSTFLAGS=""; @@ -54,7 +54,7 @@ jobs: - name: Build the service package run: | git submodule update --init --recursive - embassy-sdk init + start-sdk init make mv synapse*s9pk ~/ - name: Upload .s9pk diff --git a/.github/workflows/releaseService.yml b/.github/workflows/releaseService.yml index ed6bc79..d0b462e 100644 --- a/.github/workflows/releaseService.yml +++ b/.github/workflows/releaseService.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: tags: - - 'v*.*' + - "v*.*" jobs: ReleasePackage: @@ -18,10 +18,10 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Get EmbassyOS Hash - run: echo "EMBASSYHASH=$(git ls-remote https://github.com/Start9Labs/embassy-os --branch latest | awk '{ print $1}')" >> $GITHUB_ENV + - name: Get StartOS Hash + run: echo "STARTOSHASH=$(git ls-remote https://github.com/Start9Labs/start-os --branch sdk | awk '{ print $1}')" >> $GITHUB_ENV - name: Cache Packages - uses: actions/cache@v3 + uses: buildjet/cache@v3 id: packageCache with: path: | @@ -30,7 +30,7 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-synapse-${{ env.EMBASSYHASH }} + key: ${{ runner.os }}-synapse-${{ env.STARTOSHASH }} - name: Install Dependencies run: | sudo snap install yq deno @@ -41,8 +41,8 @@ jobs: id: packageManager if: steps.packageCache.outputs.cache-hit != 'true' run: | - cd ~/ && git clone https://github.com/Start9Labs/embassy-os.git --branch latest; - cd embassy-os; + cd ~/ && git clone https://github.com/Start9Labs/start-os.git --branch sdk; + cd start-os; git submodule update --init --recursive cd backend; export RUSTFLAGS=""; @@ -51,7 +51,7 @@ jobs: - name: Build the service package run: | git submodule update --init --recursive - embassy-sdk init + start-sdk init make - name: Generate sha256 checksum run: | @@ -60,6 +60,10 @@ jobs: run: | echo "## What's Changed" > change-log.txt yq e '.release-notes' manifest.yaml >> change-log.txt + echo "## SHA256 Hash" >> change-log.txt + echo '```' >> change-log.txt + sha256sum synapse.s9pk >> change-log.txt + echo '```' >> change-log.txt - name: Create Release uses: softprops/action-gh-release@v1 env: @@ -67,6 +71,7 @@ jobs: with: tag_name: ${{ github.ref_name }} name: Synapse ${{ github.ref_name }} + prerelease: true body_path: change-log.txt files: | synapse.s9pk diff --git a/.gitignore b/.gitignore index 76fb38b..6cc5ab7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ .env/ -synapse.s9pk -image.tar +*.s9pk synapse-vps.tar .vscode/ .DS_Store diff --git a/Dockerfile b/Dockerfile index ad0d687..a94cec7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM awesometechnologies/synapse-admin:0.8.7 as synapse-admin -FROM matrixdotorg/synapse:v1.87.0 +FROM matrixdotorg/synapse:v1.94.0 ARG PLATFORM ENV YQ_VER v4.3.2 diff --git a/Dockerfile.vps b/Dockerfile.vps index 89d9bc0..aca30a8 100644 --- a/Dockerfile.vps +++ b/Dockerfile.vps @@ -1,4 +1,4 @@ -FROM matrixdotorg/synapse:v1.75.0 +FROM matrixdotorg/synapse:v1.94.0 RUN sed -i 's#timeout=10000#timeout=20000#g' /usr/local/lib/python3*/site-packages/synapse/crypto/keyring.py RUN sed -i 's#timeout=10000#timeout=20000#g' /usr/local/lib/python3*/site-packages/synapse/federation/transport/client.py diff --git a/Makefile b/Makefile index 2f08bfd..5e05565 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ install: ifeq (,$(wildcard ~/.embassy/config.yaml)) @echo; echo "You must define \"host: http://server-name.local\" in ~/.embassy/config.yaml config file first"; echo else - embassy-cli package install $(PKG_ID).s9pk + start-cli package install $(PKG_ID).s9pk endif clean: @@ -28,19 +28,19 @@ x86: @ARCH=x86_64 $(MAKE) verify: $(PKG_ID).s9pk - @embassy-sdk verify s9pk $(PKG_ID).s9pk + @start-sdk verify s9pk $(PKG_ID).s9pk @echo " Done!" @echo " Filesize: $(shell du -h $(PKG_ID).s9pk) is ready" $(PKG_ID).s9pk: manifest.yaml instructions.md icon.png LICENSE scripts/embassy.js docker-images/aarch64.tar docker-images/x86_64.tar ifeq ($(ARCH),aarch64) - @echo "embassy-sdk: Preparing aarch64 package ..." + @echo "start-sdk: Preparing aarch64 package ..." else ifeq ($(ARCH),x86_64) - @echo "embassy-sdk: Preparing x86_64 package ..." + @echo "start-sdk: Preparing x86_64 package ..." else - @echo "embassy-sdk: Preparing Universal Package ..." + @echo "start-sdk: Preparing Universal Package ..." endif - @embassy-sdk pack + @start-sdk pack docker-images/aarch64.tar: Dockerfile docker_entrypoint.sh check-federation.sh priv-config-forward-onion configurator.py $(shell find ./www) ifeq ($(ARCH),x86_64) diff --git a/README.md b/README.md index a4f9c4b..4c49d31 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Wrapper for synapse +# Wrapper for Synapse `Synapse` is a homeserver for the Matrix protocol @@ -9,84 +9,103 @@ - [yq](https://mikefarah.gitbook.io/yq) - [deno](https://deno.land/) - [make](https://www.gnu.org/software/make/) -- [embassy-sdk](https://github.com/Start9Labs/embassy-os/tree/master/backend) +- [start-sdk](https://github.com/Start9Labs/start-os/tree/sdk/backend) ## Build environment -Prepare your embassyOS build environment. In this example we are using Ubuntu 20.04. + +Prepare your StartOS build environment. In this example we are using Ubuntu 20.04. 1. Install docker + ``` curl -fsSL https://get.docker.com -o- | bash sudo usermod -aG docker "$USER" exec sudo su -l $USER ``` + 2. Set buildx as the default builder + ``` docker buildx install docker buildx create --use ``` + 3. Enable cross-arch emulated builds in docker + ``` docker run --privileged --rm linuxkit/binfmt:v0.8 ``` + 4. Install yq + ``` sudo snap install yq ``` + 5. Install deno + ``` sudo snap install deno ``` + 6. Install essentials build packages + ``` sudo apt-get install -y build-essential openssl libssl-dev libc6-dev clang libclang-dev ca-certificates ``` + 7. Install Rust + ``` curl https://sh.rustup.rs -sSf | sh # Choose nr 1 (default install) source $HOME/.cargo/env ``` -8. Build and install embassy-sdk + +8. Build and install start-sdk + ``` -cd ~/ && git clone --recursive https://github.com/Start9Labs/embassy-os.git -cd embassy-os/backend/ +cd ~/ && git clone --recursive https://github.com/Start9Labs/start-os.git +cd start-os/backend/ ./install-sdk.sh -embassy-sdk init +start-sdk init ``` -Now you are ready to build your Synapse service + +Now you are ready to build your **Synapse** service ## Cloning -Clone the Synapse wrapper locally. Note the submodule link to the original project. +Clone the project locally. ``` git clone https://github.com/Start9Labs/synapse-wrapper.git cd synapse-wrapper -git submodule update --init --recursive ``` ## Building -To build the Synapse service, run the following commands: +To build the **Synapse** service, run the following command: ``` make ``` -## Installing (on Embassy) +## Installing (on StartOS) Run the following commands to determine successful install: -> :information_source: Change embassy-server-name.local to your Embassy address + +> :information_source: Change server-name.local to your Start9 server address ``` -embassy-cli auth login -#Enter your embassy password -embassy-cli --host https://embassy-server-name.local package install synapse.s9pk +start-cli auth login +#Enter your StartOS password +start-cli --host https://server-name.local package install synapse.s9pk ``` -**Tip:** You can also install the ghost.s9pk using **Sideload Service** under the **System > MANAGE** section. + +**Tip:** You can also install the `synapse.s9pk` using **Sideload Service** under the **System > MANAGE** section. + ## Verify Install -Go to your Embassy Services page, select **Synapse**, configure and start the service. +Go to your StartOS Services page, select **Synapse**, configure and start the service. -**Done!** +**Done!** diff --git a/docker_entrypoint.sh b/docker_entrypoint.sh index 32ccd54..4e7e1a3 100755 --- a/docker_entrypoint.sh +++ b/docker_entrypoint.sh @@ -100,8 +100,8 @@ else echo "Synapse-admin user not found. Creating ..." echo admin_password=$(cat /dev/urandom | base64 | head -c 16) - timeout 25s /start.py & - sleep 20 + timeout 210s /start.py & + sleep 205 register_new_matrix_user --config /data/homeserver.yaml --user admin --password $admin_password --admin echo $admin_password > /data/start9/adm.key python /configurator.py diff --git a/icon.png b/icon.png index a6850cb..549ecf1 100644 Binary files a/icon.png and b/icon.png differ diff --git a/manifest.yaml b/manifest.yaml index 20f75bc..e648f11 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -1,11 +1,12 @@ id: synapse title: Synapse -version: 1.87.0 +version: 1.94.0 release-notes: | - * Upgrade to version [1.87.0](https://github.com/matrix-org/synapse/releases/tag/v1.87.0) - * Instructions update - * Minor code changes and improvements - * 21% smaller package size + * Minor code changes and performace improvements + * Standardized and optimized icon + * Use bookworm as the package base + * Readme update + * Full list of upstream changes available [here](https://github.com/matrix-org/synapse/compare/v1.87.0...v1.94.0) license: apache wrapper-repo: https://github.com/Start9Labs/synapse-wrapper upstream-repo: https://github.com/matrix-org/synapse diff --git a/scripts/procedures/migrations.ts b/scripts/procedures/migrations.ts index f727ae7..b9d020f 100644 --- a/scripts/procedures/migrations.ts +++ b/scripts/procedures/migrations.ts @@ -32,4 +32,4 @@ export const migration: T.ExpectedExports.migration = compat.migrations { version: "1.75.0", type: "down" }, ), }, - }, "1.87.0" ); + }, "1.94.0" ); diff --git a/www/synapse/index.html b/www/synapse/index.html index bf70239..64ec1ff 100644 --- a/www/synapse/index.html +++ b/www/synapse/index.html @@ -87,7 +87,7 @@ -
Your Synapse server is listening on this port and is ready for messages.
To use this server you'll need a Matrix client.