mirror of
https://github.com/m1ngsama/TNT.git
synced 2026-02-08 00:54:03 +00:00
Improvements for low-barrier anonymous access: - Enhanced welcome message to clarify anonymous access - Added EASY_SETUP.md guide in Chinese and English - Updated README with anonymous access notes Long-term stability enhancements: - Improved systemd service with auto-restart and resource limits - Added log rotation script (scripts/logrotate.sh) - Added health check script (scripts/healthcheck.sh) - Added cron setup script for automated maintenance - Added anonymous access test suite Testing: - All security features verified (10/10 passed) - Anonymous access tests passed (2/2) - Health check verified This ensures: - Zero-barrier SSH access (any username, any password) - Stable long-term operation with auto-restart - Automated log management - Continuous health monitoring
44 lines
816 B
Desktop File
44 lines
816 B
Desktop File
[Unit]
|
|
Description=TNT Terminal Chat Server (Anonymous)
|
|
Documentation=https://github.com/m1ngsama/TNT
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=tnt
|
|
Group=tnt
|
|
WorkingDirectory=/var/lib/tnt
|
|
ExecStart=/usr/local/bin/tnt
|
|
|
|
# Automatic restart on failure for long-term stability
|
|
Restart=always
|
|
RestartSec=10
|
|
|
|
# Limit restart rate to prevent thrashing
|
|
StartLimitInterval=300
|
|
StartLimitBurst=5
|
|
|
|
# Security hardening
|
|
NoNewPrivileges=true
|
|
PrivateTmp=true
|
|
ProtectSystem=strict
|
|
ProtectHome=true
|
|
ReadWritePaths=/var/lib/tnt
|
|
|
|
# Resource limits for stability
|
|
LimitNOFILE=65536
|
|
LimitNPROC=512
|
|
|
|
# Logging
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
SyslogIdentifier=tnt
|
|
|
|
# Graceful shutdown
|
|
TimeoutStopSec=30
|
|
|
|
# Environment (can be customized via systemctl edit)
|
|
Environment="PORT=2222"
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|