This commit is contained in:
bvn13 2026-02-28 01:13:14 +03:00
parent f854c14c45
commit fa87882498
12 changed files with 102 additions and 6 deletions

2
server/.gitignore vendored
View File

@ -1 +1,3 @@
secrets.env
prosody.cfg.lua
snikket.conf

View File

@ -54,16 +54,16 @@ services:
env_file:
- secrets.env
environment:
S3_BUCKET: "your-snikket-uploads-bucket"
S3_REGION: "us-east-1"
S3_BUCKET: "jabogram"
S3_REGION: "ru-msk"
# For MinIO or other S3-compatible storage, uncomment:
# S3_ENDPOINT: "http://127.0.0.1:9000"
S3_ENDPOINT: "https://hb.vkcloud-storage.ru"
PRESIGN_EXPIRE: "3600"
restart: "unless-stopped"
postgres:
container_name: snikket-postgres
image: postgres:15
image: postgres:17
env_file:
- secrets.env
environment:

View File

@ -32,7 +32,7 @@ modules_enabled = {
-- This is NOT the S3 bucket URL directly. You need to run a separate
-- upload handler service (e.g. prosody-filer, or a custom Lambda/endpoint)
-- that validates Prosody's HMAC signature and proxies files to/from S3.
http_upload_external_base_url = "https://uploads.chat.example.org/upload/"
http_upload_external_base_url = "http://chat.example.org:5050/upload/"
-- Shared secret between Prosody and the upload handler service
-- (must match the secret configured in the upload handler)
@ -43,3 +43,16 @@ http_upload_external_expire_after = 3600
-- Max file size in bytes (10 MB)
http_upload_external_file_size_limit = 10485760
-- звонки
webrtc = {
stun_servers = { "stun:stun.l.google.com:19302" },
turn_servers = {
{
host = "turn.jbr.bvn13.me",
port = 3478,
username = os.getenv("TURN_SERVER_USERNAME"),
password = os.getenv("TURN_SERVER_PASSWORD"),
}
}
}

10
server/scripts/cmd.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
SNIKKET_DOMAIN=$(grep ^SNIKKET_DOMAIN= snikket.conf | cut -d= -f2)
if [[ -z "$SNIKKET_DOMAIN" ]]; then
echo "Failed to read SNIKKET_DOMAIN from snikket.conf, unable to continue";
exit 1;
fi
exec docker exec -it snikket prosodyctl $@

View File

@ -0,0 +1,10 @@
#!/bin/bash
SNIKKET_DOMAIN=$(grep ^SNIKKET_DOMAIN= snikket.conf | cut -d= -f2)
if [[ -z "$SNIKKET_DOMAIN" ]]; then
echo "Failed to read SNIKKET_DOMAIN from snikket.conf, unable to continue";
exit 1;
fi
exec docker exec -it snikket prosodyctl shell invite list $SNIKKET_DOMAIN

View File

@ -0,0 +1,11 @@
#!/bin/bash
SNIKKET_DOMAIN=$(grep ^SNIKKET_DOMAIN= snikket.conf | cut -d= -f2)
if [[ -z "$SNIKKET_DOMAIN" ]]; then
echo "Failed to read SNIKKET_DOMAIN from snikket.conf, unable to continue";
exit 1;
fi
#exec docker exec -it snikket prosodyctl shell invite create_account "bvn13@$SNIKKET_DOMAIN"
exec docker exec -it snikket create-invite --admin --group default "bvn13@$SNIKKET_DOMAIN"

View File

@ -0,0 +1,10 @@
#!/bin/bash
SNIKKET_DOMAIN=$(grep ^SNIKKET_DOMAIN= snikket.conf | cut -d= -f2)
if [[ -z "$SNIKKET_DOMAIN" ]]; then
echo "Failed to read SNIKKET_DOMAIN from snikket.conf, unable to continue";
exit 1;
fi
exec docker exec -it snikket prosodyctl shell invite create_account "bvn13@$SNIKKET_DOMAIN"

View File

@ -0,0 +1,10 @@
#!/bin/bash
SNIKKET_DOMAIN=$(grep ^SNIKKET_DOMAIN= snikket.conf | cut -d= -f2)
if [[ -z "$SNIKKET_DOMAIN" ]]; then
echo "Failed to read SNIKKET_DOMAIN from snikket.conf, unable to continue";
exit 1;
fi
exec docker exec -it snikket prosodyctl shell invite delete $SNIKKET_DOMAIN $1

View File

@ -0,0 +1,10 @@
#!/bin/bash
SNIKKET_DOMAIN=$(grep ^SNIKKET_DOMAIN= snikket.conf | cut -d= -f2)
if [[ -z "$SNIKKET_DOMAIN" ]]; then
echo "Failed to read SNIKKET_DOMAIN from snikket.conf, unable to continue";
exit 1;
fi
exec docker exec -it snikket prosodyctl help invite

View File

@ -0,0 +1,10 @@
#!/bin/bash
SNIKKET_DOMAIN=$(grep ^SNIKKET_DOMAIN= snikket.conf | cut -d= -f2)
if [[ -z "$SNIKKET_DOMAIN" ]]; then
echo "Failed to read SNIKKET_DOMAIN from snikket.conf, unable to continue";
exit 1;
fi
exec docker exec -it snikket prosodyctl shell help invite

View File

@ -0,0 +1,10 @@
#!/bin/bash
SNIKKET_DOMAIN=$(grep ^SNIKKET_DOMAIN= snikket.conf | cut -d= -f2)
if [[ -z "$SNIKKET_DOMAIN" ]]; then
echo "Failed to read SNIKKET_DOMAIN from snikket.conf, unable to continue";
exit 1;
fi
exec docker exec -it snikket prosodyctl deluser "$1@$SNIKKET_DOMAIN"

View File

@ -5,7 +5,7 @@
SNIKKET_DOMAIN=chat.example.org
# Admin email — used for Let's Encrypt certificate registration
SNIKKET_ADMIN_EMAIL=admin@example.org
SNIKKET_ADMIN_EMAIL=mail@chat.example.org
# Uncomment the lines below if running behind a reverse proxy (e.g., nginx):
# SNIKKET_TWEAK_HTTP_PORT=5080