mirror of
https://github.com/Dasemu/chatgpt-imagegen-mcp.git
synced 2026-11-26 23:36:26 +00:00
feat: add authenticated self-update endpoint, update script and systemd unit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b46db0cf6a
commit
5a6bc4aeb9
6 files changed
+386
No files matched your search
@@ -0,0 +1,25 @@
|
||||
[Unit]
|
||||
Description=ChatGPT image generation MCP server
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=mcp
|
||||
Group=mcp
|
||||
WorkingDirectory=/opt/chatgpt-imagegen-mcp
|
||||
EnvironmentFile=/opt/chatgpt-imagegen-mcp/.env
|
||||
ExecStart=/usr/bin/xvfb-run -a --server-args="-screen 0 1440x900x24" /usr/bin/node dist/index.js
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
TimeoutStopSec=30
|
||||
|
||||
# Hardening that keeps Chromium and the sudo-based update restart working.
|
||||
# Do not set NoNewPrivileges=true: it breaks `sudo systemctl restart` in scripts/update.sh.
|
||||
ProtectSystem=full
|
||||
ProtectHome=true
|
||||
PrivateTmp=true
|
||||
ReadWritePaths=/opt/chatgpt-imagegen-mcp
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,26 @@
|
||||
# Include inside the `server { ... }` block of your TLS vhost.
|
||||
|
||||
location /chatgptimagegen/public-media/ {
|
||||
proxy_pass http://127.0.0.1:8088/public-media/;
|
||||
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;
|
||||
proxy_read_timeout 300s;
|
||||
}
|
||||
|
||||
location /chatgptimagegen/ {
|
||||
proxy_pass http://127.0.0.1:8088/;
|
||||
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;
|
||||
proxy_set_header Connection "";
|
||||
proxy_buffering off;
|
||||
proxy_request_buffering off;
|
||||
proxy_read_timeout 3600s;
|
||||
proxy_send_timeout 3600s;
|
||||
client_max_body_size 40m;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
# Install as /etc/sudoers.d/chatgpt-imagegen-mcp (mode 0440), validate with: visudo -cf <file>
|
||||
mcp ALL=(root) NOPASSWD: /usr/bin/systemctl restart chatgpt-imagegen-mcp.service
|
||||
Reference in new issue
Block a user