87 lines
3.0 KiB
Markdown
87 lines
3.0 KiB
Markdown
# Server Information
|
|
|
|
**SSH Access:** `ssh root@39.102.124.161` (Alibaba Cloud)
|
|
**OS:** CentOS with Baota panel pre-configured
|
|
**Website:** https://www.thereisnospoonadu.com/
|
|
**Web Server:** Tengine (Alibaba's fork of Nginx) — use `tengine` commands, NOT `nginx`
|
|
|
|
## Gitea (self-hosted Git server)
|
|
|
|
**Web UI:** https://git.thereisnospoonadu.com
|
|
**Admin username:** beastgitea2026
|
|
**API token:** paste fresh when needed (not stored)
|
|
**SSH remote:** `git@git.thereisnospoonadu.com:beastgitea2026/<repo>.git`
|
|
**SSH port:** 222 — configured in `~/.ssh/config` on dev machine
|
|
**Gitea data:** `/var/lib/gitea/` | **Docker container name:** `gitea`
|
|
**Tengine config:** `/etc/tengine/conf.d/gitea.conf`
|
|
|
|
## Critical File Paths
|
|
|
|
**Web Root:** `/www/wwwroot/soft_download/`
|
|
**Tengine Config (ACTUAL):** `/etc/tengine/conf.d/thereisnospoonadu.conf`
|
|
- Site uses HTTPS (port 443), HTTP redirects to HTTPS
|
|
- Always test changes with: `tengine -t && tengine -s reload`
|
|
|
|
**Auth File:** `/etc/tengine/.htpasswd`
|
|
**Logs:** Check tengine log paths inside `/etc/tengine/conf.d/thereisnospoonadu.conf`
|
|
|
|
## User Management
|
|
|
|
Add a new end user (can login and download files):
|
|
```bash
|
|
# Add user (file already exists — do NOT use -c or it will overwrite all users)
|
|
htpasswd /etc/tengine/.htpasswd username
|
|
|
|
# Verify a user's password
|
|
htpasswd -v /etc/tengine/.htpasswd username
|
|
|
|
# Delete a user
|
|
htpasswd -D /etc/tengine/.htpasswd username
|
|
|
|
# List current users
|
|
cat /etc/tengine/.htpasswd
|
|
```
|
|
Note: `htpasswd` requires `httpd-tools` package (`yum install -y httpd-tools`).
|
|
|
|
## Architecture
|
|
|
|
**Download Portal System:**
|
|
- Login page: `/login.html` (public)
|
|
- File listing: `/list/` (requires HTTP Basic Auth via Authorization header)
|
|
- File downloads: Direct links to `.exe`, `.md`, `.pdf`, etc. (NO auth required)
|
|
- Security model: Must login to see file list, but downloads are public once you know the filename
|
|
|
|
**Key Files:**
|
|
- `/www/wwwroot/soft_download/index.html` - Main file browser
|
|
- `/www/wwwroot/soft_download/login.html` - Login page
|
|
- `/www/wwwroot/soft_download/api/validate` - Auth validation endpoint
|
|
|
|
## Important Notes
|
|
|
|
- When making Tengine changes, ALWAYS edit `/etc/tengine/conf.d/thereisnospoonadu.conf`
|
|
- Test against the actual domain: `curl -I https://www.thereisnospoonadu.com/filename`
|
|
- PHP is NOT configured/working on this server - use Tengine-only solutions
|
|
- Large files (170MB+ exe) need native browser downloads, not blob/XHR approach
|
|
|
|
## Verification Checklist (Before Making Changes)
|
|
|
|
```bash
|
|
# 1. Verify which Tengine config is active
|
|
tengine -T | grep -A 30 'server_name.*thereisnospoonadu'
|
|
|
|
# 2. Test current behavior against actual domain
|
|
curl -I https://www.thereisnospoonadu.com/版本升级说明(用记事本打开).md
|
|
|
|
# 3. After changes: test and reload
|
|
tengine -t && tengine -s reload
|
|
```
|
|
|
|
## Troubleshooting (Only When Issues Occur)
|
|
|
|
```bash
|
|
# Find log paths from config
|
|
grep 'access_log\|error_log' /etc/tengine/conf.d/thereisnospoonadu.conf
|
|
```
|
|
|
|
**Note:** Logs are automatically rotated daily, keeping 7 days of history (compressed).
|