Skip to content

Commit

Permalink
Bump upstream to v5.8.2 + include XFTP (#2)
Browse files Browse the repository at this point in the history
* Bump upstream to v5.8.2

* Instructions and migrations update

* instructions: Use markdown for links and small fixes

* Update build and release workflows

* declare hardware requirements in manifest
  • Loading branch information
k0gen authored Jul 4, 2024
1 parent 2d28f74 commit 8c49ac5
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 52 deletions.
1 change: 1 addition & 0 deletions .github/workflows/buildService.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
make
PACKAGE_ID=$(yq -oy ".id" manifest.*)
echo "package_id=$PACKAGE_ID" >> $GITHUB_ENV
printf "\n SHA256SUM: $(sha256sum ${PACKAGE_ID}.s9pk) \n"
shell: bash

- name: Upload .s9pk
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/releaseService.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- name: Generate sha256 checksum
run: |
PACKAGE_ID=${{ env.package_id }}
printf "\n SHA256SUM: $(sha256sum ${PACKAGE_ID}.s9pk) \n"
sha256sum ${PACKAGE_ID}.s9pk > ${PACKAGE_ID}.s9pk.sha256
shell: bash

Expand Down
63 changes: 28 additions & 35 deletions docker_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,15 @@ if [ ! -f "$confd/smp-server.ini" ]; then
export PASS=$(grep -i "^create_password" $confd/smp-server.ini | awk -F ':' '{print $2}' | awk '{$1=$1};1')
fi

if [ -f "$xftp/file-server.ini" ]; then
# Remove the directory if file-server.ini exists
rm -r $xftp/*
else
echo "Nice and clean."
fi
# # Check if xftp-server has been initialized
# if [ ! -f "$xftp/file-server.ini" ]; then
# # Init certificates and configs
# mkdir -p /root/xftp
# xftp-server init -q '10gb' -p /root/xftp/
# Check if xftp-server has been initialized
if [ ! -f "$xftp/file-server.ini" ]; then
# Init certificates and configs
mkdir -p /root/xftp
xftp-server init -q '10gb' -p /root/xftp/

# else
# echo "All good! - XFTP initialized"
# fi
else
echo "All good! - XFTP initialized"
fi

# Backup store log just in case
#
Expand All @@ -54,7 +48,7 @@ unset -v _file
TOR_ADDRESS=$(sed -n -e 's/^tor-address: \(.*\)/\1/p' /root/start9/config.yaml)
XFTP_ADDRESS=$(sed -n -e 's/^xftp-address: \(.*\)/\1/p' /root/start9/config.yaml)
SMP_FINGERPRINT=$(cat $confd/fingerprint)
# XFTP_FINGERPRINT=$(cat $xftp/fingerprint)
XFTP_FINGERPRINT=$(cat $xftp/fingerprint)

SMP_URL="smp://$SMP_FINGERPRINT:$PASS@$TOR_ADDRESS"
XFTP_URL="xftp://$XFTP_FINGERPRINT@$XFTP_ADDRESS"
Expand All @@ -71,32 +65,31 @@ data:
copyable: true
qr: true
masked: true
SimpleX XFTP Server Address:
type: string
value: $XFTP_URL
description: Your XFTP Server address, used in client applications.
copyable: true
qr: true
masked: true
EOF
# SimpleX XFTP Server Address:
# type: string
# value: $XFTP_URL
# description: Your XFTP Server address, used in client applications.
# copyable: true
# qr: true
# masked: true
# EOF

# Finally, run smp-sever and xftp-server. Notice that "exec" here is important:
# smp-server replaces our helper script, so that it can catch INT signal
# exec tini -s -- sh -c "smp-server start +RTS -N -RTS & xftp-server start +RTS -N -RTS; wait"
exec tini -s -- smp-server start +RTS -N -RTS
# _term() {
# echo "Caught TERM signal!"
# kill -INT "$smp_process" 2>/dev/null
# kill -INT "$xftp_process" 2>/dev/null
# }

# smp-server start +RTS -N -RTS &
# smp_process=$!
_term() {
echo "Caught TERM signal!"
kill -INT "$smp_process" 2>/dev/null
kill -INT "$xftp_process" 2>/dev/null
}

smp-server start +RTS -N -RTS &
smp_process=$!

# xftp-server start +RTS -N -RTS &
# xftp_process=$!
xftp-server start +RTS -N -RTS &
xftp_process=$!

# trap _term INT
trap _term INT

# wait $xftp_process $smp_process
wait $xftp_process $smp_process
34 changes: 25 additions & 9 deletions instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,43 @@

## About

Your SimpleX Server comes with an <a href="https://simplex.chat/docs/server.html" target="_blank">SMP server</a> for relaying messages.
Your SimpleX Server comes with an [SMP server](https://simplex.chat/docs/server.html) (for relaying messages) and an [XFTP server](https://simplex.chat/docs/xftp-server.html) (for transferring files and media).

SimpleX chats are unique in that each participant chooses which server to use for receiving messages. I receive messages through `Server A`, and you receive messages through `Server B`. This means that I must send messages to `Server B`, and you must send messages to `Server A`.

SimpleX servers function as queues. Servers only store messages until a client retrieves them, after which they are deleted. This means message histories are stored on client devices, so it is client devices that must be backed up to prevent loss of messages.

## General Usage Instructions

For detailed instructions on using SimpleX, check out the <a href="https://simplex.chat/docs/guide/readme.html" target="_blank">official docs</a>.
For detailed instructions on using SimpleX, check out the [official docs](https://simplex.chat/docs/guide/readme.html).

## Connecting to Your Own Server

1. Ensure your SimpleX Server is running, and health checks are passing.

1. Follow instructions in the <a href="https://docs.start9.com">Start9 docs</a> for running Tor on your client device (phone/laptop).
1. Follow instructions in the [Start9 docs](https://docs.start9.com) for running Tor on your client device (phone/laptop).

1. Download and Install the <a href="https://simplex.chat/" target="_blank">SimpleX app</a> to your client device.
1. Download and install the [SimpleX app](https://simplex.chat/) on your client device.

1. During initial setup, if you choose to create a profile, _do not_ create a SimpleX address. You can do this later after you connect to your own server.

### Enable Tor

1. In SimpleX client app, go to `Settings > Network & Servers`.
1. In the SimpleX client app, go to `Settings > Network & Servers`.

1. Enable "Use SOCKS proxy".

1. For `Use .onion hosts`, you have two options:
- `Required` (recommended): you can only send messages to someone who receives via a .onion URL. For sending and receiving with non-Tor users, we recommend creating another profile entirely.
- `When Available`: you can send messages to anyone. NOTE: you still receive via a .onion URL, which means your counterparty must have Tor running on their client device and "Use SOCKS proxy" enabled in their SimpleX app.
- `Required` (recommended): You can only send messages to someone who receives via a .onion URL. For sending and receiving with non-Tor users, we recommend creating another profile entirely.
- `When Available`: You can send messages to anyone. NOTE: You still receive via a .onion URL, which means your counterparty must have Tor running on their client device and "Use SOCKS proxy" enabled in their SimpleX app.

1. Remember, for this profile, you are choosing to receive messages via a Tor (.onion) server. This means whoever messages you must have Tor running on their client device and "Use SOCKS proxy" enabled in their SimpleX app.

### Connect SMP Server

1. In SimpleX client app, go to `Settings > Network & Servers > SMP Servers`.
1. In the SimpleX client app, go to `Settings > Network & Servers > SMP Servers`.

1. You will see some default receiving servers (e.g. smp8, smp9, smp10). _Delete them all_. If you want to receive via these default clearnet servers, we recommend creating another profile entirely. If you chose not to delete these default servers, at least disable the "Use for new connections" setting on each of them. This will prevent them from being used without your explicit instruction.
1. You will see some default receiving servers (e.g. smp8, smp9, smp10). _Delete them all_. If you want to receive via these default clearnet servers, we recommend creating another profile entirely. If you choose not to delete these default servers, at least disable the "Use for new connections" setting on each of them. This will prevent them from being used without your explicit instruction.

1. Click "Add Server".

Expand All @@ -51,3 +51,19 @@ For detailed instructions on using SimpleX, check out the <a href="https://simpl
1. Click "Save servers".

1. You can now create a SimpleX Address if you want.

### Connect XFTP Server

1. In the SimpleX client app, go to `Settings > Network & Servers > XFTP Servers`.

1. You will see some default XFTP servers (e.g. xftp1, xftp2, xftp3). _Delete them all_. If you want to use these default clearnet servers, we recommend creating another profile entirely. If you choose not to delete these default servers, at least disable the "Use for new connections" setting on each of them. This will prevent them from being used without your explicit instruction.

1. Click "Add server...".

1. Tap "Scan QR Code".

1. Scan your XFTP Server Address QR code, located in StartOS UI under `SimpleX Server > Properties > XFTP Server Address`.

1. Click "Test servers" and wait for the test to pass.

1. Click "Save servers".
11 changes: 8 additions & 3 deletions manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
id: simplex
title: "SimpleX Server"
version: 5.7.3
version: 5.8.2
release-notes: |
- SMP upstream update to 5.7.3 - See [full changelog](https://github.com/simplex-chat/simplexmq/releases/tag/v5.7.3)
- Bugfixes
- SMP upstream update to 5.8.2
- Added XFTP Server
- Instructions update
license: MIT
wrapper-repo: "https://github.com/Start9Labs/simplex-startos"
upstream-repo: "https://github.com/simplex-chat/simplexmq/"
Expand All @@ -29,6 +30,10 @@ main:
conf: /etc/opt/simplex
xftp: /etc/opt/simplex-xftp
log: /var/opt/simplex
hardware-requirements:
arch:
- x86_64
- aarch64
health-checks:
api:
name: Listening
Expand Down
8 changes: 4 additions & 4 deletions scripts/procedures/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { compat, types as T } from "../deps.ts";
export const migration: T.ExpectedExports.migration =
compat.migrations.fromMapping(
{
"5.6.2": {
"5.8.2": {
up: compat.migrations.updateConfig(
(config: any) => {
config["xftp-address"];

return config;
},
true,
{ version: "5.6.2", type: "up" }
{ version: "5.8.2", type: "up" }
),
down: compat.migrations.updateConfig(
(config: any) => {
Expand All @@ -20,9 +20,9 @@ export const migration: T.ExpectedExports.migration =
return config;
},
true,
{ version: "5.6.2", type: "down" }
{ version: "5.8.2", type: "down" }
),
},
},
"5.7.3"
"5.8.2"
);
2 changes: 1 addition & 1 deletion simplexmq
Submodule simplexmq updated 167 files

0 comments on commit 8c49ac5

Please sign in to comment.