Refactor server configuration and update certificate handling

- Changed the NotifyUrl in PostMeasureTaskToNF to use a hardcoded port (33030).
- Updated GetEMSState to retrieve the port from the server configuration instead of the YAML config.
- Removed deprecated RestParam struct and related code from YamlConfig.
- Deleted old certificate files (omc-server.crt, omc-server.key, omc-web.crt, omc-web.key).
- Added new certificate files (www.omc.net.crt, www.omc.net.key) for updated server configuration.
- Modified local/omc.yaml to reflect changes in server configuration and certificate paths.
- Updated main.go to load server configuration instead of rest configuration, ensuring proper handling of multiple HTTP services.
This commit is contained in:
TsMask
2025-04-27 17:21:55 +08:00
parent 80d612c56c
commit afbe029a28
12 changed files with 232 additions and 253 deletions

View File

@@ -1,24 +1,15 @@
# server version: std/lite
serverVersion: "std"
# operation mode system/docker
# serverMode: "system"
# login authentication, default true
# serverLoginAuth: true
# interface encryption, default false
# serverCryptoApi: false
# file: log file name
# level: /trace/debug/info/warn/error/fatal, default: debug
# duration: rotation time with xx hours, example: 1/12/24 hours
# count: rotation count of log, default is 30 rotation
logger:
file: /usr/local/omc/log/omc.log
level: warn
duration: 24
count: 90
# pprof: false(default)/true to disable/enable pprof
pprof:
enabled: true
addr: "0.0.0.0:33060"
# rest agent listen ipv4/v6 and port, support multiple routines
# service listen ipv4/v6 and port, support multiple routines
# ip: 0.0.0.0 or ::0, support IPv4/v6
rest:
server:
- ipv4: "0.0.0.0"
ipv6: ""
port: 33040
@@ -27,9 +18,11 @@ rest:
ipv6: ""
port: 33443
schema: https
certFile: ./local/certs/omc-server.crt
keyFile: ./local/certs/omc-server.key
certFile: ./local/certs/www.omc.net.crt
keyFile: ./local/certs/www.omc.net.key
# web service configuration
# if you are using nginx to take over, you can disable the
webServer:
enabled: false
rootDir: ./local/web
@@ -38,19 +31,14 @@ webServer:
schema: http
- addr: "0.0.0.0:443"
schema: https
certFile: ./local/certs/omc-web.crt
keyFile: ./local/certs/omc-web.key
certFile: ./local/certs/www.omc.net.crt
keyFile: ./local/certs/www.omc.net.key
# 静态文件配置, 相对项目根路径或填绝对路径
staticFile:
# 默认资源dir目录需要预先创建
default:
prefix: "/static"
dir: "C:/usr/local/omc/static"
# 文件上传资源目录映射,与项目目录同级
upload:
prefix: "/upload"
dir: "C:/usr/local/omc/upload"
# track configuration for NE
trace:
enabled: true
host: "192.168.5.58" # fill in the specific IP address
port: 33033
# data sources
database:
@@ -72,18 +60,43 @@ database:
# used to specify the default data source for multiple data resourece
defaultDataSourceName: "std"
# Redis data cache
# redis cached data
redis:
dataSource:
# OMC system db
default:
port: 16379 # Redis port
host: "192.168.9.58" # Redis host
port: 16379 # port
host: "192.168.9.58" # host
password: "helloearth"
db: 10 # Redis db_num
# used to specify the default data source for multiple data resourece
db: 10 # db_num
# default data source name
defaultDataSourceName: "default"
# file: log file name
# level: /trace/debug/info/warn/error/fatal, default: debug
# duration: rotation time with xx hours, example: 1/12/24 hours
# count: rotation count of log, default is 30 rotation
logger:
file: "C:/var/log/omc_restagent.log"
level: warn
duration: 24
count: 90
# pprof grafana Performance Monitor
pprof:
enabled: true
addr: "0.0.0.0:33060"
# 静态文件配置, 相对项目根路径或填绝对路径
staticFile:
# 默认资源dir目录需要预先创建
default:
prefix: "/static"
dir: "C:/usr/local/omc/static"
# 文件上传资源目录映射,与项目目录同级
upload:
prefix: "/upload"
dir: "C:/usr/local/omc/upload"
# sleep: time delay for after write buffer (millisecond)
# deadLine: timeout for io read and write (second)
mml:
@@ -94,12 +107,6 @@ mml:
bufferSize: 65535
mmlHome: ./mmlhome
# Tracking configuration
trace:
enabled: false
host: "172.16.5.100" # Fill in the specific IP address
port: 33033
# NE config
ne:
user: omcuser
@@ -128,8 +135,8 @@ omc:
dn: ""
chk2ne: false
capability: 50
sn: "-"
expiryDate: "-"
sn: "12345678"
expiryDate: "2099-12-31"
checksign: false
rootDir: /usr/local/omc
binDir: /usr/local/omc/bin