Commit 6d58b2e9 authored by wangteng's avatar wangteng

代码提交

parent 7725b457
server {
listen 80;
server_name 192.168.20.175;
location = /db-tool {
return 301 /db-tool/;
}
location ^~ /db-tool/api/ {
proxy_pass http://127.0.0.1:8767/api/;
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_connect_timeout 10s;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
}
location ^~ /db-tool/ {
root /opt/web;
try_files $uri $uri/ /db-tool/index.html;
index index.html;
add_header Cache-Control "no-cache, max-age=0, must-revalidate" always;
}
}
[Unit]
Description=db-tool FastAPI backend
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/app/db-tool
Environment=PYTHONPATH=/opt/app/db-tool
Environment=WEB_DB_PATH=/opt/app/db-tool/web/data/web.db
Environment=WEB_HOST=127.0.0.1
Environment=WEB_PORT=8767
ExecStart=/opt/app/db-tool/.venv/bin/python -m web.backend.start
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
#!/usr/bin/env python3
"""db-tools 服务器远程命令助手 — python rssh.py "命令" (密码不落盘, 从环境变量 DBTOOL_PW 读)"""
import sys, os, paramiko
HOST, USER = "192.168.20.175", "root"
pw = os.environ.get("DBTOOL_PW")
if not pw:
sys.exit("set DBTOOL_PW first")
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect(HOST, username=USER, password=pw, timeout=10, look_for_keys=False, allow_agent=False)
cmd = sys.argv[1] if len(sys.argv) > 1 else "echo no-cmd"
_, out, err = c.exec_command(cmd, timeout=560)
sys.stdout.write(out.read().decode("utf-8", "replace"))
e = err.read().decode("utf-8", "replace")
if e.strip():
sys.stderr.write("[stderr] " + e)
c.close()
...@@ -12,5 +12,7 @@ from .rule_library import FieldRule, RuleLibrary ...@@ -12,5 +12,7 @@ from .rule_library import FieldRule, RuleLibrary
from .task import Task from .task import Task
from .task_group import TaskGroup from .task_group import TaskGroup
from .data_source import DataSource from .data_source import DataSource
from .operation_record import OperationRecord
from .table_design_config import TableDesignConfig
__all__ = ["ConnectionPreset", "Field", "Rule", "RuleLibrary", "FieldRule", "Task", "TaskGroup", "DataSource"] __all__ = ["ConnectionPreset", "Field", "Rule", "RuleLibrary", "FieldRule", "Task", "TaskGroup", "DataSource", "OperationRecord", "TableDesignConfig"]
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* (如 DataQualityView 的「中断查询」按钮) * (如 DataQualityView 的「中断查询」按钮)
*/ */
const BASE = '/api' const BASE = `${import.meta.env.BASE_URL}api`.replace(/\/$/, '')
function errorDetailText(detail) { function errorDetailText(detail) {
if (typeof detail === 'string') return detail if (typeof detail === 'string') return detail
......
...@@ -4,6 +4,7 @@ import { fileURLToPath, URL } from 'node:url' ...@@ -4,6 +4,7 @@ import { fileURLToPath, URL } from 'node:url'
export default defineConfig(({ mode }) => ({ export default defineConfig(({ mode }) => ({
plugins: [vue()], plugins: [vue()],
base: mode === 'production' ? '/db-tool/' : '/',
resolve: { resolve: {
alias: { alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)), '@': fileURLToPath(new URL('./src', import.meta.url)),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment