Init.
This commit is contained in:
33
Dockerfile
Normal file
33
Dockerfile
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
|
# Install Prosody and dependencies
|
||||||
|
RUN apt-get update --fix-missing && \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
prosody \
|
||||||
|
lua-dbi-mysql \
|
||||||
|
lua-sec \
|
||||||
|
openssl \
|
||||||
|
netcat-traditional \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Create prosody user and set up directories
|
||||||
|
RUN mkdir -p /var/lib/prosody /var/log/prosody /var/run/prosody /etc/prosody/certs && \
|
||||||
|
chown -R prosody:prosody /var/lib/prosody /var/log/prosody /var/run/prosody /etc/prosody
|
||||||
|
|
||||||
|
# Copy entrypoint script
|
||||||
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
# Switch to prosody user
|
||||||
|
USER prosody
|
||||||
|
|
||||||
|
# Expose Prosody ports
|
||||||
|
# 5222: Client to Server (C2S)
|
||||||
|
# 5269: Server to Server (S2S)
|
||||||
|
# 5280: HTTP
|
||||||
|
# 5281: HTTPS
|
||||||
|
EXPOSE 5222 5269 5280 5281
|
||||||
|
|
||||||
|
# Set entrypoint
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
CMD ["prosody", "-F"]
|
||||||
8
LICENSE
Normal file
8
LICENSE
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
ISC License:
|
||||||
|
|
||||||
|
Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC")
|
||||||
|
Copyright (c) 1995-2003 by Internet Software Consortium
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
86
README.md
86
README.md
@@ -1,2 +1,86 @@
|
|||||||
# prosody
|
# Prosody XMPP Server
|
||||||
|
|
||||||
|
Dockerized Prosody XMPP server with MySQL backend.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Docker and Docker Compose
|
||||||
|
- External MySQL network: `mysqlgit_mysql_network`
|
||||||
|
- Environment variables configuration (see Configuration section)
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
This setup uses environment variables for configuration. Create a `.env` file in the project root with:
|
||||||
|
|
||||||
|
```env
|
||||||
|
# XMPP Configuration
|
||||||
|
XMPP_DOMAIN=xmpp.guschin.info
|
||||||
|
XMPP_USER=mish
|
||||||
|
XMPP_PASSWORD=your_password
|
||||||
|
|
||||||
|
# MySQL Configuration
|
||||||
|
MYSQL_HOST=mysql
|
||||||
|
MYSQL_USER=prosody
|
||||||
|
MYSQL_PASSWORD=your_mysql_password
|
||||||
|
MYSQL_DATABASE=prosody
|
||||||
|
```
|
||||||
|
|
||||||
|
## Starting the Server
|
||||||
|
|
||||||
|
Run from the project directory:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
This will:
|
||||||
|
- Build and start the Prosody container
|
||||||
|
- Connect to external MySQL network (`mysqlgit_mysql_network`)
|
||||||
|
- Wait for MySQL to be ready
|
||||||
|
- Generate self-signed SSL/TLS certificates (if not present)
|
||||||
|
- Configure Prosody with MySQL backend
|
||||||
|
|
||||||
|
## Access Points
|
||||||
|
|
||||||
|
| Service | Port | Description |
|
||||||
|
|---------|------|-------------|
|
||||||
|
| C2S (Client to Server) | 5222 | XMPP client connections |
|
||||||
|
| S2S (Server to Server) | 5269 | XMPP federation |
|
||||||
|
| Component Protocol | 5347 | External components |
|
||||||
|
| HTTP/BOSH/WebSocket | 5280 | Web-based connections |
|
||||||
|
| HTTPS | 5281 | Secure web connections |
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- **Virtual Host**: `xmpp.guschin.info`
|
||||||
|
- **Multi-User Chat (MUC)**: `muc.xmpp.guschin.info`
|
||||||
|
- **Storage**: MySQL backend with SQL storage
|
||||||
|
- **Admin User**: `admin@guschin.info`
|
||||||
|
- **Health Checks**: Automatic container health monitoring
|
||||||
|
- **Memory Limit**: 200M
|
||||||
|
- **Auto-restart**: Container restarts unless stopped
|
||||||
|
|
||||||
|
## Enabled Modules
|
||||||
|
|
||||||
|
Core modules: roster, saslauth, tls, dialback, disco, carbons, pep, private, blocking, vcard, version, uptime, time, ping, register, last_activity, admin_adhoc, muc_mam
|
||||||
|
|
||||||
|
## Data Persistence
|
||||||
|
|
||||||
|
Volumes are mounted to persist data:
|
||||||
|
- `./data/prosody` → `/var/lib/prosody`
|
||||||
|
- `./logs/prosody` → `/var/log/prosody`
|
||||||
|
- `./data/prosody/configuration` → `/etc/prosody/conf.d`
|
||||||
|
|
||||||
|
## Connecting Clients
|
||||||
|
|
||||||
|
Use any XMPP client with:
|
||||||
|
- **Server**: xmpp.guschin.info
|
||||||
|
- **Port**: 5222
|
||||||
|
- **Username**: your configured user
|
||||||
|
- **Domain**: xmpp.guschin.info
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
- TLS encryption is not required by default (configurable in [prosody.cfg.lua](data/prosody/configuration/prosody.cfg.lua))
|
||||||
|
- Self-signed certificates are auto-generated on first run
|
||||||
|
- The container depends on an external MySQL network named `mysqlgit_mysql_network`
|
||||||
|
|||||||
81
data/prosody/configuration/prosody.cfg.lua
Normal file
81
data/prosody/configuration/prosody.cfg.lua
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
-- Prosody XMPP Server Configuration
|
||||||
|
-- Domain: xmpp.guschin.info
|
||||||
|
|
||||||
|
admins = { "admin@guschin.info" }
|
||||||
|
|
||||||
|
modules_enabled = {
|
||||||
|
-- Generally required
|
||||||
|
"roster";
|
||||||
|
"saslauth";
|
||||||
|
"tls";
|
||||||
|
"dialback";
|
||||||
|
"disco";
|
||||||
|
|
||||||
|
-- Not essential, but recommended
|
||||||
|
"carbons";
|
||||||
|
"pep";
|
||||||
|
"private";
|
||||||
|
"vcard";
|
||||||
|
"version";
|
||||||
|
"uptime";
|
||||||
|
"time";
|
||||||
|
"ping";
|
||||||
|
"register";
|
||||||
|
|
||||||
|
-- Admin interface
|
||||||
|
"admin_adhoc";
|
||||||
|
};
|
||||||
|
|
||||||
|
modules_disabled = {
|
||||||
|
-- "offline";
|
||||||
|
"posix"; -- Disable posix module to avoid threading issues in Docker
|
||||||
|
};
|
||||||
|
|
||||||
|
-- Logging configuration
|
||||||
|
log = {
|
||||||
|
info = "/var/log/prosody/prosody.log";
|
||||||
|
error = "/var/log/prosody/prosody.err";
|
||||||
|
};
|
||||||
|
|
||||||
|
-- Storage configuration for MySQL
|
||||||
|
storage = "sql"
|
||||||
|
sql = {
|
||||||
|
driver = "MySQL";
|
||||||
|
database = os.getenv("MYSQL_DATABASE") or "prosody";
|
||||||
|
username = os.getenv("MYSQL_USER") or "prosody";
|
||||||
|
password = os.getenv("MYSQL_PASSWORD") or "prosodypass";
|
||||||
|
host = os.getenv("MYSQL_HOST") or "localhost";
|
||||||
|
port = 3306;
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Port configuration (global section)
|
||||||
|
c2s_ports = { 5222 }
|
||||||
|
s2s_ports = { 5269 }
|
||||||
|
component_ports = { 5347 }
|
||||||
|
http_ports = { 5280 }
|
||||||
|
https_ports = { 5281 }
|
||||||
|
|
||||||
|
-- Disable TLS on c2s/s2s by default for docker
|
||||||
|
c2s_require_encryption = false
|
||||||
|
s2s_require_encryption = false
|
||||||
|
|
||||||
|
-- Disable SASLauth external authentication
|
||||||
|
authentication = "internal_plain"
|
||||||
|
|
||||||
|
-- Virtual host definition
|
||||||
|
VirtualHost "guschin.info"
|
||||||
|
ssl = {
|
||||||
|
key = "/etc/prosody/certs/xmpp.guschin.info.key";
|
||||||
|
certificate = "/etc/prosody/certs/xmpp.guschin.info.crt";
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Component for MUC (Multi-User Chat)
|
||||||
|
Component "muc.guschin.info" "muc"
|
||||||
|
modules_enabled = { "muc_mam" }
|
||||||
|
storage = "sql"
|
||||||
|
|
||||||
|
-- Set a default realm for the server
|
||||||
|
default_realm = "guschin.info"
|
||||||
|
|
||||||
|
-- Certificates
|
||||||
|
certificates = "/etc/prosody/certs"
|
||||||
40
docker-compose.yml
Normal file
40
docker-compose.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
prosody:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: prosody-xmpp
|
||||||
|
environment:
|
||||||
|
XMPP_DOMAIN: ${XMPP_DOMAIN}
|
||||||
|
XMPP_USER: ${XMPP_USER}
|
||||||
|
XMPP_PASSWORD: ${XMPP_PASSWORD}
|
||||||
|
MYSQL_HOST: ${MYSQL_HOST:-mysql}
|
||||||
|
MYSQL_USER: ${MYSQL_USER}
|
||||||
|
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
|
||||||
|
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
||||||
|
ports:
|
||||||
|
- "5222:5222"
|
||||||
|
- "5269:5269"
|
||||||
|
- "5347:5347"
|
||||||
|
- "5280:5280"
|
||||||
|
volumes:
|
||||||
|
- ./data/prosody:/var/lib/prosody
|
||||||
|
- ./logs/prosody:/var/log/prosody
|
||||||
|
- ./data/prosody/configuration:/etc/prosody/conf.d
|
||||||
|
networks:
|
||||||
|
- mysql_network
|
||||||
|
restart: unless-stopped
|
||||||
|
mem_limit: 200M
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "nc", "-z", "localhost", "5222"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 40s
|
||||||
|
|
||||||
|
networks:
|
||||||
|
mysql_network:
|
||||||
|
external: true
|
||||||
|
name: mysqlgit_mysql_network
|
||||||
53
entrypoint.sh
Executable file
53
entrypoint.sh
Executable file
@@ -0,0 +1,53 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Prosody Docker Entrypoint Script
|
||||||
|
|
||||||
|
echo "Initializing Prosody XMPP Server..."
|
||||||
|
|
||||||
|
# Wait for MySQL to be ready
|
||||||
|
if [ -n "$MYSQL_HOST" ]; then
|
||||||
|
MYSQL_PORT="${MYSQL_PORT:-3306}"
|
||||||
|
MYSQL_TIMEOUT="${MYSQL_TIMEOUT:-60}"
|
||||||
|
|
||||||
|
echo "Waiting for MySQL at $MYSQL_HOST:$MYSQL_PORT (timeout: ${MYSQL_TIMEOUT}s)..."
|
||||||
|
|
||||||
|
counter=0
|
||||||
|
until nc -z "$MYSQL_HOST" "$MYSQL_PORT" 2>/dev/null || [ $counter -eq $MYSQL_TIMEOUT ]; do
|
||||||
|
counter=$((counter + 1))
|
||||||
|
if [ $((counter % 10)) -eq 0 ]; then
|
||||||
|
echo "Still waiting for MySQL... (${counter}s elapsed)"
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $counter -eq $MYSQL_TIMEOUT ]; then
|
||||||
|
echo "ERROR: MySQL at $MYSQL_HOST:$MYSQL_PORT did not become ready within ${MYSQL_TIMEOUT} seconds"
|
||||||
|
echo "Please check that:"
|
||||||
|
echo " - MySQL container is running"
|
||||||
|
echo " - Both containers are on the same Docker network"
|
||||||
|
echo " - MYSQL_HOST environment variable is correctly set"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "MySQL is ready! (connected after ${counter}s)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ensure necessary directories exist and are writable
|
||||||
|
# (directories are already created in Dockerfile with proper ownership)
|
||||||
|
touch /var/log/prosody/prosody.log /var/log/prosody/prosody.err 2>/dev/null || true
|
||||||
|
|
||||||
|
# Generate self-signed certificate if needed
|
||||||
|
CERT_PATH="/etc/prosody/certs/xmpp.guschin.info.crt"
|
||||||
|
KEY_PATH="/etc/prosody/certs/xmpp.guschin.info.key"
|
||||||
|
|
||||||
|
if [ ! -f "$CERT_PATH" ] || [ ! -f "$KEY_PATH" ]; then
|
||||||
|
echo "Generating self-signed certificate..."
|
||||||
|
openssl req -x509 -newkey rsa:4096 -keyout "$KEY_PATH" -out "$CERT_PATH" \
|
||||||
|
-days 365 -nodes -subj "/CN=xmpp.guschin.info"
|
||||||
|
chmod 600 "$KEY_PATH"
|
||||||
|
chmod 644 "$CERT_PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Starting Prosody..."
|
||||||
|
exec "$@"
|
||||||
41
init.sql
Normal file
41
init.sql
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
-- Prosody MySQL Database Initialization Script
|
||||||
|
|
||||||
|
USE prosody;
|
||||||
|
|
||||||
|
-- Create tables for Prosody storage
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `prosody` (
|
||||||
|
`host` text,
|
||||||
|
`user` text,
|
||||||
|
`store` text,
|
||||||
|
`key` text,
|
||||||
|
`type` text,
|
||||||
|
`value` mediumtext
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `prosody_auth` (
|
||||||
|
`username` varchar(255) NOT NULL,
|
||||||
|
`host` varchar(255) NOT NULL,
|
||||||
|
`password` varchar(255),
|
||||||
|
`created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
PRIMARY KEY (`username`, `host`),
|
||||||
|
INDEX (`host`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `prosody_roster` (
|
||||||
|
`username` varchar(255) NOT NULL,
|
||||||
|
`host` varchar(255) NOT NULL,
|
||||||
|
`jid` varchar(255) NOT NULL,
|
||||||
|
`name` varchar(255),
|
||||||
|
`subscription` varchar(10),
|
||||||
|
`ask` varchar(10),
|
||||||
|
`created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
PRIMARY KEY (`username`, `host`, `jid`),
|
||||||
|
INDEX (`host`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
-- Insert initial admin user
|
||||||
|
INSERT INTO `prosody_auth` (`username`, `host`, `password`)
|
||||||
|
VALUES ('mish', 'xmpp.guschin.info', '3X`V');
|
||||||
|
|
||||||
|
-- Prosody will handle the rest of the initialization automatically
|
||||||
93
install-certs.sh
Normal file
93
install-certs.sh
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Let's Encrypt SSL Certificate Installation Script for xmpp.guschin.info
|
||||||
|
# This script installs SSL certificates via Let's Encrypt (certbot)
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
DOMAIN="xmpp.guschin.info"
|
||||||
|
CERT_PATH="/etc/letsencrypt/live/${DOMAIN}"
|
||||||
|
EMAIL="${EMAIL:-admin@mguschin.info}" # Default email or use EMAIL env var
|
||||||
|
WEBROOT="/var/www/letsencrypt"
|
||||||
|
|
||||||
|
echo "========================================"
|
||||||
|
echo "Let's Encrypt Certificate Installation"
|
||||||
|
echo "========================================"
|
||||||
|
echo "Domain: $DOMAIN"
|
||||||
|
echo "Email: $EMAIL"
|
||||||
|
echo "Certificate Path: $CERT_PATH"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Check if certbot is installed
|
||||||
|
if ! command -v certbot &> /dev/null; then
|
||||||
|
echo "Installing certbot..."
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y certbot
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create webroot directory for ACME challenges
|
||||||
|
if [ ! -d "$WEBROOT" ]; then
|
||||||
|
echo "Creating webroot directory: $WEBROOT"
|
||||||
|
mkdir -p "$WEBROOT"
|
||||||
|
chmod 755 "$WEBROOT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if certificate already exists
|
||||||
|
if [ -d "$CERT_PATH" ]; then
|
||||||
|
echo "Certificate already exists at $CERT_PATH"
|
||||||
|
read -p "Do you want to renew it? (y/n) " -n 1 -r
|
||||||
|
echo
|
||||||
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||||
|
echo "Renewing certificate..."
|
||||||
|
certbot renew --force-renewal --non-interactive
|
||||||
|
else
|
||||||
|
echo "Skipping certificate installation."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Generating new certificate for $DOMAIN..."
|
||||||
|
|
||||||
|
# Install certificate using webroot authenticator
|
||||||
|
# Nginx must be configured to serve $WEBROOT/.well-known/acme-challenge/
|
||||||
|
certbot certonly \
|
||||||
|
--webroot \
|
||||||
|
--webroot-path "$WEBROOT" \
|
||||||
|
--non-interactive \
|
||||||
|
--agree-tos \
|
||||||
|
--email "$EMAIL" \
|
||||||
|
-d "$DOMAIN"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "✓ Certificate installed successfully!"
|
||||||
|
echo " Fullchain: $CERT_PATH/fullchain.pem"
|
||||||
|
echo " Private Key: $CERT_PATH/privkey.pem"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set proper permissions for nginx
|
||||||
|
if id "www-data" &>/dev/null; then
|
||||||
|
chmod 755 $CERT_PATH
|
||||||
|
chmod 755 $CERT_PATH/..
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Optional: Set up automatic renewal via cron
|
||||||
|
echo ""
|
||||||
|
echo "Setting up automatic renewal (optional)..."
|
||||||
|
if ! grep -q "certbot renew" /etc/cron.d/certbot 2>/dev/null; then
|
||||||
|
echo "Configuring automatic certificate renewal..."
|
||||||
|
# Certbot automatically installs cron job on most systems
|
||||||
|
# But you can manually add it:
|
||||||
|
# (crontab -l 2>/dev/null; echo "0 3 * * * certbot renew --quiet") | crontab -
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "========================================"
|
||||||
|
echo "Certificate installation complete!"
|
||||||
|
echo "========================================"
|
||||||
|
echo ""
|
||||||
|
echo "Next steps:"
|
||||||
|
echo "1. Ensure your nginx config points to:"
|
||||||
|
echo " - ssl_certificate: $CERT_PATH/fullchain.pem"
|
||||||
|
echo " - ssl_certificate_key: $CERT_PATH/privkey.pem"
|
||||||
|
echo "2. Reload nginx: nginx -s reload"
|
||||||
|
echo "3. Test your SSL setup: https://www.ssllabs.com/ssltest/"
|
||||||
|
echo ""
|
||||||
178
logs/prosody/prosody.err
Normal file
178
logs/prosody/prosody.err
Normal file
@@ -0,0 +1,178 @@
|
|||||||
|
Jan 07 14:54:08 muc.xmpp.guschin.info:storage_sql error Old database format detected. Please run: prosodyctl mod_storage_sql upgrade
|
||||||
|
Jan 07 14:54:08 sql error Error in SQL transaction: database upgrade needed
|
||||||
|
Jan 07 14:54:08 modulemanager error Unable to load module 'blocking': /usr/lib/prosody/modules/share/lua/5.4/mod_blocking/mod_blocking.lua: No such file or directory
|
||||||
|
Jan 07 14:54:08 mod_posix error Danger, Will Robinson! Prosody doesn't need to be run as root, so don't do it!
|
||||||
|
Jan 07 14:54:08 mod_posix error For more information on running Prosody as root, see https://prosody.im/doc/root
|
||||||
|
Jan 07 14:54:08 modulemanager error Error initializing module 'posix' on 'localhost': /usr/lib/prosody/util/startup.lua:357: attempt to index a nil value (field 'main_thread')
|
||||||
|
stack traceback:
|
||||||
|
/usr/lib/prosody/util/startup.lua:357: in field 'shutdown'
|
||||||
|
/usr/lib/prosody/modules/mod_posix.lua:38: in main chunk
|
||||||
|
[C]: in function 'xpcall'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:270: in upvalue 'do_load_module'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:353: in function 'core.modulemanager.load'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:131: in function 'core.modulemanager.load_modules_for_host'
|
||||||
|
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
|
||||||
|
(...tail calls...)
|
||||||
|
/usr/lib/prosody/core/hostmanager.lua:108: in function 'core.hostmanager.activate'
|
||||||
|
/usr/lib/prosody/core/hostmanager.lua:58: in field '?'
|
||||||
|
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
|
||||||
|
(...tail calls...)
|
||||||
|
/usr/lib/prosody/util/startup.lua:428: in function 'util.startup.prepare_to_start'
|
||||||
|
/usr/lib/prosody/util/startup.lua:707: in function 'util.startup.prosody'
|
||||||
|
/usr/lib/prosody/util/async.lua:156: in upvalue 'func'
|
||||||
|
/usr/lib/prosody/util/async.lua:144: in function </usr/lib/prosody/util/async.lua:142>
|
||||||
|
Jan 07 14:54:08 modulemanager error Unable to load module 'last_activity': /usr/lib/prosody/modules/share/lua/5.4/mod_last_activity/mod_last_activity.lua: No such file or directory
|
||||||
|
Jan 07 14:54:08 modulemanager error Unable to load module 'blocking': /usr/lib/prosody/modules/share/lua/5.4/mod_blocking/mod_blocking.lua: No such file or directory
|
||||||
|
Jan 07 14:54:08 mod_posix error Danger, Will Robinson! Prosody doesn't need to be run as root, so don't do it!
|
||||||
|
Jan 07 14:54:08 mod_posix error For more information on running Prosody as root, see https://prosody.im/doc/root
|
||||||
|
Jan 07 14:54:08 modulemanager error Error initializing module 'posix' on 'xmpp.guschin.info': /usr/lib/prosody/util/startup.lua:357: attempt to index a nil value (field 'main_thread')
|
||||||
|
stack traceback:
|
||||||
|
/usr/lib/prosody/util/startup.lua:357: in field 'shutdown'
|
||||||
|
/usr/lib/prosody/modules/mod_posix.lua:38: in main chunk
|
||||||
|
[C]: in function 'xpcall'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:270: in upvalue 'do_load_module'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:353: in function 'core.modulemanager.load'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:131: in function 'core.modulemanager.load_modules_for_host'
|
||||||
|
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
|
||||||
|
(...tail calls...)
|
||||||
|
/usr/lib/prosody/core/hostmanager.lua:108: in function 'core.hostmanager.activate'
|
||||||
|
/usr/lib/prosody/core/hostmanager.lua:58: in field '?'
|
||||||
|
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
|
||||||
|
(...tail calls...)
|
||||||
|
/usr/lib/prosody/util/startup.lua:428: in function 'util.startup.prepare_to_start'
|
||||||
|
/usr/lib/prosody/util/startup.lua:707: in function 'util.startup.prosody'
|
||||||
|
/usr/lib/prosody/util/async.lua:156: in upvalue 'func'
|
||||||
|
/usr/lib/prosody/util/async.lua:144: in function </usr/lib/prosody/util/async.lua:142>
|
||||||
|
Jan 07 14:54:08 modulemanager error Unable to load module 'last_activity': /usr/lib/prosody/modules/share/lua/5.4/mod_last_activity/mod_last_activity.lua: No such file or directory
|
||||||
|
Jan 17 16:08:28 modulemanager error Unable to load module 'blocking': /usr/lib/prosody/modules/share/lua/5.4/mod_blocking/mod_blocking.lua: No such file or directory
|
||||||
|
Jan 17 16:08:28 modulemanager error Unable to load module 'last_activity': /usr/lib/prosody/modules/share/lua/5.4/mod_last_activity/mod_last_activity.lua: No such file or directory
|
||||||
|
Jan 17 16:08:28 mod_posix error Danger, Will Robinson! Prosody doesn't need to be run as root, so don't do it!
|
||||||
|
Jan 17 16:08:28 mod_posix error For more information on running Prosody as root, see https://prosody.im/doc/root
|
||||||
|
Jan 17 16:08:28 modulemanager error Error initializing module 'posix' on 'xmpp.guschin.info': /usr/lib/prosody/util/startup.lua:357: attempt to index a nil value (field 'main_thread')
|
||||||
|
stack traceback:
|
||||||
|
/usr/lib/prosody/util/startup.lua:357: in field 'shutdown'
|
||||||
|
/usr/lib/prosody/modules/mod_posix.lua:38: in main chunk
|
||||||
|
[C]: in function 'xpcall'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:270: in upvalue 'do_load_module'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:353: in function 'core.modulemanager.load'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:131: in function 'core.modulemanager.load_modules_for_host'
|
||||||
|
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
|
||||||
|
(...tail calls...)
|
||||||
|
/usr/lib/prosody/core/hostmanager.lua:108: in function 'core.hostmanager.activate'
|
||||||
|
/usr/lib/prosody/core/hostmanager.lua:58: in field '?'
|
||||||
|
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
|
||||||
|
(...tail calls...)
|
||||||
|
/usr/lib/prosody/util/startup.lua:428: in function 'util.startup.prepare_to_start'
|
||||||
|
/usr/lib/prosody/util/startup.lua:707: in function 'util.startup.prosody'
|
||||||
|
/usr/lib/prosody/util/async.lua:156: in upvalue 'func'
|
||||||
|
/usr/lib/prosody/util/async.lua:144: in function </usr/lib/prosody/util/async.lua:142>
|
||||||
|
Jan 17 16:08:29 modulemanager error Unable to load module 'blocking': /usr/lib/prosody/modules/share/lua/5.4/mod_blocking/mod_blocking.lua: No such file or directory
|
||||||
|
Jan 17 16:08:29 modulemanager error Unable to load module 'last_activity': /usr/lib/prosody/modules/share/lua/5.4/mod_last_activity/mod_last_activity.lua: No such file or directory
|
||||||
|
Jan 17 16:08:29 mod_posix error Danger, Will Robinson! Prosody doesn't need to be run as root, so don't do it!
|
||||||
|
Jan 17 16:08:29 mod_posix error For more information on running Prosody as root, see https://prosody.im/doc/root
|
||||||
|
Jan 17 16:08:29 modulemanager error Error initializing module 'posix' on 'localhost': /usr/lib/prosody/util/startup.lua:357: attempt to index a nil value (field 'main_thread')
|
||||||
|
stack traceback:
|
||||||
|
/usr/lib/prosody/util/startup.lua:357: in field 'shutdown'
|
||||||
|
/usr/lib/prosody/modules/mod_posix.lua:38: in main chunk
|
||||||
|
[C]: in function 'xpcall'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:270: in upvalue 'do_load_module'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:353: in function 'core.modulemanager.load'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:131: in function 'core.modulemanager.load_modules_for_host'
|
||||||
|
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
|
||||||
|
(...tail calls...)
|
||||||
|
/usr/lib/prosody/core/hostmanager.lua:108: in function 'core.hostmanager.activate'
|
||||||
|
/usr/lib/prosody/core/hostmanager.lua:58: in field '?'
|
||||||
|
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
|
||||||
|
(...tail calls...)
|
||||||
|
/usr/lib/prosody/util/startup.lua:428: in function 'util.startup.prepare_to_start'
|
||||||
|
/usr/lib/prosody/util/startup.lua:707: in function 'util.startup.prosody'
|
||||||
|
/usr/lib/prosody/util/async.lua:156: in upvalue 'func'
|
||||||
|
/usr/lib/prosody/util/async.lua:144: in function </usr/lib/prosody/util/async.lua:142>
|
||||||
|
Jan 18 17:50:39 modulemanager error Unable to load module 'blocking': /usr/lib/prosody/modules/share/lua/5.4/mod_blocking/mod_blocking.lua: No such file or directory
|
||||||
|
Jan 18 17:50:39 modulemanager error Unable to load module 'last_activity': /usr/lib/prosody/modules/share/lua/5.4/mod_last_activity/mod_last_activity.lua: No such file or directory
|
||||||
|
Jan 18 17:50:39 mod_posix error Danger, Will Robinson! Prosody doesn't need to be run as root, so don't do it!
|
||||||
|
Jan 18 17:50:39 mod_posix error For more information on running Prosody as root, see https://prosody.im/doc/root
|
||||||
|
Jan 18 17:50:39 modulemanager error Error initializing module 'posix' on 'localhost': /usr/lib/prosody/util/startup.lua:357: attempt to index a nil value (field 'main_thread')
|
||||||
|
stack traceback:
|
||||||
|
/usr/lib/prosody/util/startup.lua:357: in field 'shutdown'
|
||||||
|
/usr/lib/prosody/modules/mod_posix.lua:38: in main chunk
|
||||||
|
[C]: in function 'xpcall'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:270: in upvalue 'do_load_module'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:353: in function 'core.modulemanager.load'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:131: in function 'core.modulemanager.load_modules_for_host'
|
||||||
|
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
|
||||||
|
(...tail calls...)
|
||||||
|
/usr/lib/prosody/core/hostmanager.lua:108: in function 'core.hostmanager.activate'
|
||||||
|
/usr/lib/prosody/core/hostmanager.lua:58: in field '?'
|
||||||
|
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
|
||||||
|
(...tail calls...)
|
||||||
|
/usr/lib/prosody/util/startup.lua:428: in function 'util.startup.prepare_to_start'
|
||||||
|
/usr/lib/prosody/util/startup.lua:707: in function 'util.startup.prosody'
|
||||||
|
/usr/lib/prosody/util/async.lua:156: in upvalue 'func'
|
||||||
|
/usr/lib/prosody/util/async.lua:144: in function </usr/lib/prosody/util/async.lua:142>
|
||||||
|
Jan 18 17:50:39 modulemanager error Unable to load module 'blocking': /usr/lib/prosody/modules/share/lua/5.4/mod_blocking/mod_blocking.lua: No such file or directory
|
||||||
|
Jan 18 17:50:39 modulemanager error Unable to load module 'last_activity': /usr/lib/prosody/modules/share/lua/5.4/mod_last_activity/mod_last_activity.lua: No such file or directory
|
||||||
|
Jan 18 17:50:39 mod_posix error Danger, Will Robinson! Prosody doesn't need to be run as root, so don't do it!
|
||||||
|
Jan 18 17:50:39 mod_posix error For more information on running Prosody as root, see https://prosody.im/doc/root
|
||||||
|
Jan 18 17:50:39 modulemanager error Error initializing module 'posix' on 'guschin.info': /usr/lib/prosody/util/startup.lua:357: attempt to index a nil value (field 'main_thread')
|
||||||
|
stack traceback:
|
||||||
|
/usr/lib/prosody/util/startup.lua:357: in field 'shutdown'
|
||||||
|
/usr/lib/prosody/modules/mod_posix.lua:38: in main chunk
|
||||||
|
[C]: in function 'xpcall'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:270: in upvalue 'do_load_module'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:353: in function 'core.modulemanager.load'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:131: in function 'core.modulemanager.load_modules_for_host'
|
||||||
|
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
|
||||||
|
(...tail calls...)
|
||||||
|
/usr/lib/prosody/core/hostmanager.lua:108: in function 'core.hostmanager.activate'
|
||||||
|
/usr/lib/prosody/core/hostmanager.lua:58: in field '?'
|
||||||
|
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
|
||||||
|
(...tail calls...)
|
||||||
|
/usr/lib/prosody/util/startup.lua:428: in function 'util.startup.prepare_to_start'
|
||||||
|
/usr/lib/prosody/util/startup.lua:707: in function 'util.startup.prosody'
|
||||||
|
/usr/lib/prosody/util/async.lua:156: in upvalue 'func'
|
||||||
|
/usr/lib/prosody/util/async.lua:144: in function </usr/lib/prosody/util/async.lua:142>
|
||||||
|
Jan 18 17:52:00 modulemanager error Unable to load module 'blocking': /usr/lib/prosody/modules/share/lua/5.4/mod_blocking/mod_blocking.lua: No such file or directory
|
||||||
|
Jan 18 17:52:00 modulemanager error Unable to load module 'last_activity': /usr/lib/prosody/modules/share/lua/5.4/mod_last_activity/mod_last_activity.lua: No such file or directory
|
||||||
|
Jan 18 17:52:00 mod_posix error Danger, Will Robinson! Prosody doesn't need to be run as root, so don't do it!
|
||||||
|
Jan 18 17:52:00 mod_posix error For more information on running Prosody as root, see https://prosody.im/doc/root
|
||||||
|
Jan 18 17:52:00 modulemanager error Error initializing module 'posix' on 'guschin.info': /usr/lib/prosody/util/startup.lua:357: attempt to index a nil value (field 'main_thread')
|
||||||
|
stack traceback:
|
||||||
|
/usr/lib/prosody/util/startup.lua:357: in field 'shutdown'
|
||||||
|
/usr/lib/prosody/modules/mod_posix.lua:38: in main chunk
|
||||||
|
[C]: in function 'xpcall'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:270: in upvalue 'do_load_module'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:353: in function 'core.modulemanager.load'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:131: in function 'core.modulemanager.load_modules_for_host'
|
||||||
|
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
|
||||||
|
(...tail calls...)
|
||||||
|
/usr/lib/prosody/core/hostmanager.lua:108: in function 'core.hostmanager.activate'
|
||||||
|
/usr/lib/prosody/core/hostmanager.lua:58: in field '?'
|
||||||
|
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
|
||||||
|
(...tail calls...)
|
||||||
|
/usr/lib/prosody/util/startup.lua:428: in function 'util.startup.prepare_to_start'
|
||||||
|
/usr/lib/prosody/util/startup.lua:707: in function 'util.startup.prosody'
|
||||||
|
/usr/lib/prosody/util/async.lua:156: in upvalue 'func'
|
||||||
|
/usr/lib/prosody/util/async.lua:144: in function </usr/lib/prosody/util/async.lua:142>
|
||||||
|
Jan 18 17:52:00 modulemanager error Unable to load module 'blocking': /usr/lib/prosody/modules/share/lua/5.4/mod_blocking/mod_blocking.lua: No such file or directory
|
||||||
|
Jan 18 17:52:00 modulemanager error Unable to load module 'last_activity': /usr/lib/prosody/modules/share/lua/5.4/mod_last_activity/mod_last_activity.lua: No such file or directory
|
||||||
|
Jan 18 17:52:00 mod_posix error Danger, Will Robinson! Prosody doesn't need to be run as root, so don't do it!
|
||||||
|
Jan 18 17:52:00 mod_posix error For more information on running Prosody as root, see https://prosody.im/doc/root
|
||||||
|
Jan 18 17:52:00 modulemanager error Error initializing module 'posix' on 'localhost': /usr/lib/prosody/util/startup.lua:357: attempt to index a nil value (field 'main_thread')
|
||||||
|
stack traceback:
|
||||||
|
/usr/lib/prosody/util/startup.lua:357: in field 'shutdown'
|
||||||
|
/usr/lib/prosody/modules/mod_posix.lua:38: in main chunk
|
||||||
|
[C]: in function 'xpcall'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:270: in upvalue 'do_load_module'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:353: in function 'core.modulemanager.load'
|
||||||
|
/usr/lib/prosody/core/modulemanager.lua:131: in function 'core.modulemanager.load_modules_for_host'
|
||||||
|
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
|
||||||
|
(...tail calls...)
|
||||||
|
/usr/lib/prosody/core/hostmanager.lua:108: in function 'core.hostmanager.activate'
|
||||||
|
/usr/lib/prosody/core/hostmanager.lua:58: in field '?'
|
||||||
|
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
|
||||||
|
(...tail calls...)
|
||||||
|
/usr/lib/prosody/util/startup.lua:428: in function 'util.startup.prepare_to_start'
|
||||||
|
/usr/lib/prosody/util/startup.lua:707: in function 'util.startup.prosody'
|
||||||
|
/usr/lib/prosody/util/async.lua:156: in upvalue 'func'
|
||||||
|
/usr/lib/prosody/util/async.lua:144: in function </usr/lib/prosody/util/async.lua:142>
|
||||||
3588
logs/prosody/prosody.log
Normal file
3588
logs/prosody/prosody.log
Normal file
File diff suppressed because it is too large
Load Diff
76
nginx/xmpp.guschin.info.conf
Normal file
76
nginx/xmpp.guschin.info.conf
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
upstream prosody {
|
||||||
|
server localhost:5280;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80 default_server;
|
||||||
|
listen [::]:80 default_server;
|
||||||
|
server_name xmpp.guschin.info;
|
||||||
|
|
||||||
|
# ACME challenge location for Let's Encrypt
|
||||||
|
location /.well-known/acme-challenge/ {
|
||||||
|
root /var/www/letsencrypt;
|
||||||
|
default_type "text/plain";
|
||||||
|
autoindex on;
|
||||||
|
try_files $uri =404;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Redirect HTTP to HTTPS
|
||||||
|
return 301 https://$server_name$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 443 ssl http2;
|
||||||
|
listen [::]:443 ssl http2;
|
||||||
|
server_name xmpp.guschin.info;
|
||||||
|
|
||||||
|
# SSL certificate paths (adjust to your certificate location)
|
||||||
|
ssl_certificate /etc/letsencrypt/live/xmpp.guschin.info/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/xmpp.guschin.info/privkey.pem;
|
||||||
|
|
||||||
|
# SSL configuration
|
||||||
|
ssl_protocols TLSv1.2 TLSv1.3;
|
||||||
|
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||||
|
ssl_prefer_server_ciphers on;
|
||||||
|
|
||||||
|
# Security headers
|
||||||
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||||
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
|
add_header X-Frame-Options "DENY" always;
|
||||||
|
|
||||||
|
# Prosody web interface and HTTP upload
|
||||||
|
location / {
|
||||||
|
proxy_pass http://prosody;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_buffering off;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Websocket endpoint for XMPP
|
||||||
|
location /ws {
|
||||||
|
proxy_pass http://prosody/ws;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
# HTTP File Upload
|
||||||
|
location /upload {
|
||||||
|
proxy_pass http://prosody/upload;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
client_max_body_size 100M;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user