# ops **Repository Path**: tanoo/ops ## Basic Information - **Project Name**: ops - **Description**: 一个自用的运维项目! - **Primary Language**: Unknown - **License**: LGPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-08-21 - **Last Updated**: 2025-06-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 运维项目 > 处理 ssl证书,密钥管理,端口查询,数据库备份 ## run 1. 先启动 ops-server 项目 `java -jar ops-server-0.0.1-SNAPSHOT.jar` 2. 在启动 ops-website 项目 `npm run dev ` ## 环境 ### Api 1. JDK 17 2. Spring boot 3.2.7 ### admin 1. npm 10.8.2 2. node v20.8.0 ## nginx 配置 ```yaml # 接口地址 location /ops-api/ { proxy_pass http://localhost:8898/; proxy_read_timeout 300s; proxy_send_timeout 300s; proxy_set_header Host $proxy_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } # 前端访问地址 - 前缀 location /ops { alias /usr/share/nginx/html/page/dist; index index.html; try_files $uri $uri/ /ops/index.html; } # 前端访问地址 - 没有前缀 location / { alias D:/project/生产管理系统/production/ops/dist/; index index.html; try_files $uri $uri/ /index.html; } ``` ## 部署注释 ### 内网 1. jdk 位置: /home/software/jdk-17.0.11/bin/java ```nginx configuration server { listen 3004 ; server_name 192.168.1.1; index index.php index.html index.htm default.php default.htm default.html; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Real-IP $remote_addr; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; access_log /www/sites/192.168.1.141/log/access.log main; error_log /www/sites/192.168.1.141/log/error.log; location ^~ /.well-known/acme-challenge { allow all; root /usr/share/nginx/html; } root /www/sites/192.168.1.1/index; error_page 404 /404.html; include /www/sites/192.168.1.1/proxy/*.conf; } ## include /www/sites/192.168.1.141/proxy/*.conf; location /ops-api/ { proxy_pass http://192.168.1.93:8898/; 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 REMOTE-HOST $remote_addr; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; proxy_set_header X-Forwarded-Proto $scheme; proxy_http_version 1.1; add_header X-Cache $upstream_cache_status; add_header Cache-Control no-cache; proxy_ssl_server_name off; proxy_ssl_name $proxy_host; } ``` ### 前端嵌入jar 1. 前端打包 运行: npm run build:jar 2. 将 dist下的所有文件放入 java 项目 src/resources/static 目录下 3. 打jar包 mvn clean package 4. 运行jar ### 命令行修改配置文件中的`${}` ```shell java -jar -DREDIS_HOST="192.168.0.1" .\ops-api-0.0.1-SNAPSHOT.jar ``` # docker 项目 > docker应用管理