Skip to content

Commit

Permalink
Update to upstream 6.0.4, bug fixes, and code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
k0gen committed Sep 18, 2024
1 parent 04e3809 commit ad989f2
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 11 deletions.
36 changes: 30 additions & 6 deletions docker_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,35 @@ if [ ! -f "$confd/smp-server.ini" ]; then
# Init certificates and configs
smp-server init -y -l --password $PASS

else
export PASS=$(grep -i "^create_password" $confd/smp-server.ini | awk -F ':' '{print $2}' | awk '{$1=$1};1')
else
export PASS=$(grep -i "^create_password" $confd/smp-server.ini | awk -F ':' '{print $2}' | awk '{$1=$1};1')
fi

# Function to add or update a section in the smp-server.ini config file
add_or_update_section() {
local file="$1"
local section="$2"
local content="$3"

if grep -q "^\[$section\]" "$file"; then
# Section exists, update it
sed -i "/^\[$section\]/,/^\[/c\\[$section]\n$content" "$file"
echo "$section section updated in $file"
else
# Section doesn't exist, add it
echo -e "\n[$section]\n$content" >> "$file"
echo "$section section added to $file"
fi
}
# Add or update INFORMATION section
add_or_update_section "$confd/smp-server.ini" "INFORMATION" "source_code: https://github.com/simplex-chat/simplexmq"

# Add or update PROXY section
add_or_update_section "$confd/smp-server.ini" "PROXY" "socks_proxy: 127.0.0.1:9050\nsocks_mode: onion"

# Add or update WEB section
add_or_update_section "$confd/smp-server.ini" "WEB" "static_path: /var/opt/simplex/www"

# Check if xftp-server has been initialized
if [ ! -f "$xftp/file-server.ini" ]; then
# Init certificates and configs
Expand Down Expand Up @@ -74,12 +99,11 @@ data:
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"
# Run smp-server and xftp-server as background processes
# Set up a trap to catch INT signal for graceful shutdown

_term() {
echo "Caught TERM signal!"
echo "Caught INT signal!"
kill -INT "$smp_process" 2>/dev/null
kill -INT "$xftp_process" 2>/dev/null
}
Expand Down
7 changes: 4 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: 6.0.3
version: 6.0.4
release-notes: |
- ALl upstream code update to 6.0.3
- More changes can be found in the [6.0.3 changelog](https://github.com/simplex-chat/simplexmq/blob/master/CHANGELOG.md#603)
- All upstream code updated to 6.0.4
- Bug fixes and code cleanup
- More changes can be found in the [6.0.4 changelog](https://github.com/simplex-chat/simplexmq/blob/master/CHANGELOG.md#604)
license: MIT
wrapper-repo: "https://github.com/Start9Labs/simplex-startos"
upstream-repo: "https://github.com/simplex-chat/simplexmq/"
Expand Down
2 changes: 1 addition & 1 deletion scripts/procedures/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ export const migration: T.ExpectedExports.migration =
),
},
},
"6.0.3"
"6.0.4"
);
2 changes: 1 addition & 1 deletion simplexmq
Submodule simplexmq updated 42 files
+22 −0 CHANGELOG.md
+1 −1 apps/ntf-server/Main.hs
+2 −1 package.yaml
+18 −0 rfcs/2024-07-06-ios-notifications.md
+0 −0 rfcs/done/2023-12-29-pqdr.md
+0 −0 rfcs/done/2024-03-03-pqdr-version.md
+0 −0 rfcs/done/2024-06-14-fast-connection.md
+7 −1 simplexmq.cabal
+11 −10 src/Simplex/FileTransfer/Agent.hs
+8 −5 src/Simplex/FileTransfer/Server.hs
+2 −3 src/Simplex/FileTransfer/Server/Stats.hs
+10 −6 src/Simplex/FileTransfer/Server/Store.hs
+3 −3 src/Simplex/FileTransfer/Server/StoreLog.hs
+16 −18 src/Simplex/Messaging/Agent.hs
+1 −0 src/Simplex/Messaging/Agent/Client.hs
+5 −0 src/Simplex/Messaging/Agent/Protocol.hs
+13 −13 src/Simplex/Messaging/Agent/Store/SQLite.hs
+11 −5 src/Simplex/Messaging/Encoding/String.hs
+5 −0 src/Simplex/Messaging/Notifications/Protocol.hs
+2 −1 src/Simplex/Messaging/Notifications/Server.hs
+8 −1 src/Simplex/Messaging/Notifications/Server/Main.hs
+15 −2 src/Simplex/Messaging/Notifications/Server/Push/APNS.hs
+4 −6 src/Simplex/Messaging/Notifications/Server/Stats.hs
+8 −0 src/Simplex/Messaging/Protocol.hs
+161 −128 src/Simplex/Messaging/Server.hs
+17 −10 src/Simplex/Messaging/Server/Env/STM.hs
+6 −5 src/Simplex/Messaging/Server/Main.hs
+23 −22 src/Simplex/Messaging/Server/MsgStore/STM.hs
+18 −1 src/Simplex/Messaging/Server/QueueStore.hs
+34 −26 src/Simplex/Messaging/Server/QueueStore/STM.hs
+41 −34 src/Simplex/Messaging/Server/Stats.hs
+58 −15 src/Simplex/Messaging/Server/StoreLog.hs
+9 −2 src/Simplex/Messaging/Transport.hs
+0 −1 src/Simplex/Messaging/Transport/HTTP2.hs
+8 −8 src/Simplex/Messaging/Transport/Server.hs
+1 −1 src/Simplex/Messaging/Util.hs
+1 −1 src/Simplex/RemoteControl/Discovery.hs
+5 −3 tests/AgentTests/NotificationTests.hs
+2 −2 tests/AgentTests/SQLiteTests.hs
+5 −5 tests/NtfServerTests.hs
+13 −5 tests/ServerTests.hs
+2 −2 tests/XFTPAgent.hs

0 comments on commit ad989f2

Please sign in to comment.