83 lines
1.9 KiB
Markdown
83 lines
1.9 KiB
Markdown
# Titan Deployment
|
|
|
|
Recommended path on Titan:
|
|
|
|
```text
|
|
/root/compose/aishare
|
|
```
|
|
|
|
Clone/update the repo:
|
|
|
|
```bash
|
|
ssh titan-reverse
|
|
mkdir -p /root/compose
|
|
git clone https://git.xcel.me/cabbage/aishare.git /root/compose/aishare
|
|
cd /root/compose/aishare
|
|
cp .env.example .env
|
|
```
|
|
|
|
Edit `/root/compose/aishare/.env` and set `AISHARE_ADMIN_TOKEN`.
|
|
Keep `AISHARE_BASE_PATH=/aishare` for the legacy `xcel.me/aishare` endpoint.
|
|
|
|
Start:
|
|
|
|
```bash
|
|
cd /root/compose/aishare
|
|
mkdir -p data
|
|
chown -R 1001:1001 data
|
|
docker-compose -f compose.yml up --build -d
|
|
docker-compose -f compose.yml logs --tail=80 aishare
|
|
```
|
|
|
|
Add this location block to the existing `server_name xcel.me` server in `/root/compose/nginx/etc/nginx/sites-available/xcel.me.conf`, before `location /`:
|
|
|
|
```nginx
|
|
location = /aishare {
|
|
return 301 /aishare/;
|
|
}
|
|
|
|
location ^~ /aishare/ {
|
|
if ($https != on) {
|
|
return 307 https://$host$request_uri;
|
|
}
|
|
client_max_body_size 20m;
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Forwarded-Host $http_host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Real-Ip $remote_addr;
|
|
proxy_pass http://127.0.0.1:8088;
|
|
}
|
|
```
|
|
|
|
Reload nginx:
|
|
|
|
```bash
|
|
nginx -t
|
|
docker exec nginx nginx -s reload
|
|
```
|
|
|
|
## Proxying From Other Hosts Or Paths
|
|
|
|
The app does not require a fixed hostname. Reader pages use relative links, and the admin UI derives API and share URLs from the browser's current URL.
|
|
|
|
For direct serving, set the app mount explicitly:
|
|
|
|
```env
|
|
AISHARE_BASE_PATH=/
|
|
```
|
|
|
|
or:
|
|
|
|
```env
|
|
AISHARE_BASE_PATH=/services/aishare
|
|
```
|
|
|
|
For thin proxy servers that should forward to this origin, use the compose stack in [`../proxy`](../proxy). It can expose URLs such as:
|
|
|
|
- `https://aishare.domain.com/`
|
|
- `https://domain.com/services/aishare/`
|
|
- `https://xcel.me/aishare/`
|
|
|
|
while forwarding to an origin such as `https://x1.xcel.me/aishare/`.
|