Skip to content

Commit

Permalink
Update/1.93.0 (#60)
Browse files Browse the repository at this point in the history
* Use new sdk and cli tools

* Update and clean README.md

* Bump version number

* Fix CI build/release and add SHA256 hash to release

* Fix index.html and update .gitignore

* Standardized and optimized icon

* bump version, update release notes

* Lite should work now...
  • Loading branch information
k0gen authored Oct 12, 2023
1 parent 2d38e21 commit 9022906
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 57 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/buildService.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -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="";
Expand All @@ -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
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/releaseService.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
tags:
- 'v*.*'
- "v*.*"

jobs:
ReleasePackage:
Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -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="";
Expand All @@ -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: |
Expand All @@ -60,13 +60,18 @@ 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:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
name: Synapse ${{ github.ref_name }}
prerelease: true
body_path: change-log.txt
files: |
synapse.s9pk
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.env/
synapse.s9pk
image.tar
*.s9pk
synapse-vps.tar
.vscode/
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.vps
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down
57 changes: 38 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Wrapper for synapse
# Wrapper for Synapse

`Synapse` is a homeserver for the Matrix protocol

Expand All @@ -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!**
4 changes: 2 additions & 2 deletions docker_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions manifest.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/procedures/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ export const migration: T.ExpectedExports.migration = compat.migrations
{ version: "1.75.0", type: "down" },
),
},
}, "1.87.0" );
}, "1.94.0" );
2 changes: 1 addition & 1 deletion www/synapse/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
</g>
</svg>
</div>
<h1>It works! Synapse is running on Your Embassy</h1>
<h1>It works! Synapse is running on Your Start9 server</h1>
<p>Your Synapse server is listening on this port and is ready for messages.</p>
<p>To use this server you'll need <a href="https://matrix.org/docs/projects/try-matrix-now.html#clients" target="_blank" rel="noopener noreferrer">a Matrix client</a>.
</p>
Expand Down

0 comments on commit 9022906

Please sign in to comment.