mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-08-29 03:28:42 +00:00
docker+scripts: XFTP servers installation, update docs, install scripts (#750)
* docker: major overhaul with xftp support * github: update docker actions * install: add installation scripts * readme: update readme to reflect latest changes
This commit is contained in:
@@ -5,21 +5,28 @@ logd="/var/opt/simplex/"
|
||||
# Check if server has been initialized
|
||||
if [ ! -f "$confd/smp-server.ini" ]; then
|
||||
# If not, determine ip or domain
|
||||
case $addr in
|
||||
'') printf "Please specify \$addr environment variable.\n"; exit 1 ;;
|
||||
*[a-zA-Z]*) set -- -n $addr ;;
|
||||
*) set -- --ip $addr ;;
|
||||
case "$ADDR" in
|
||||
'') printf "Please specify \$ADDR environment variable.\n"; exit 1 ;;
|
||||
*[a-zA-Z]*)
|
||||
case "$ADDR" in
|
||||
*:*) set -- --ip "$ADDR" ;;
|
||||
*) set -- -n "$ADDR" ;;
|
||||
esac
|
||||
;;
|
||||
*) set -- --ip "$ADDR" ;;
|
||||
esac
|
||||
|
||||
case $pass in
|
||||
# Optionally, set password
|
||||
case "$PASS" in
|
||||
'') set -- "$@" --no-password ;;
|
||||
*) set -- "$@" --password $pass ;;
|
||||
*) set -- "$@" --password "$PASS" ;;
|
||||
esac
|
||||
|
||||
# And init certificates and configs
|
||||
smp-server init -y -l "$@"
|
||||
fi
|
||||
|
||||
# backup store log
|
||||
# Backup store log just in case
|
||||
[ -f "$logd/smp-server-store.log" ] && cp "$logd"/smp-server-store.log "$logd"/smp-server-store.log."$(date +'%FT%T')"
|
||||
|
||||
# Finally, run smp-sever. Notice that "exec" here is important:
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env sh
|
||||
confd="/etc/opt/simplex-xftp"
|
||||
logd="/var/opt/simplex-xftp"
|
||||
|
||||
# Check if server has been initialized
|
||||
if [ ! -f "$confd/file-server.ini" ]; then
|
||||
# If not, determine ip or domain
|
||||
case "$ADDR" in
|
||||
'') printf "Please specify \$ADDR environment variable.\n"; exit 1 ;;
|
||||
*[a-zA-Z]*)
|
||||
case "$ADDR" in
|
||||
*:*) set -- --ip "$ADDR" ;;
|
||||
*) set -- -n "$ADDR" ;;
|
||||
esac
|
||||
;;
|
||||
*) set -- --ip "$ADDR" ;;
|
||||
esac
|
||||
|
||||
# Set quota
|
||||
case "$QUOTA" in
|
||||
'') printf "Please specify \$QUOTA environment variable.\n"; exit 1 ;;
|
||||
*) set -- "$@" --quota "$QUOTA" ;;
|
||||
esac
|
||||
|
||||
# Init the certificates and configs
|
||||
xftp-server init -l -p /srv/xftp "$@"
|
||||
fi
|
||||
|
||||
# Backup store log just in case
|
||||
[ -f "$logd/file-server-store.log" ] && cp "$logd"/file-server-store.log "$logd"/file-server-store.log."$(date +'%FT%T')"
|
||||
|
||||
# Finally, run xftp-sever. Notice that "exec" here is important:
|
||||
# smp-server replaces our helper script, so that it can catch INT signal
|
||||
exec xftp-server start +RTS -N -RTS
|
||||
|
||||
Reference in New Issue
Block a user