Skip to content

服务配置

igs的配置文件为igserver_for_java/config/application.properties,修改配置后,需重启生效

开启https

properties
server.ssl.enabled=true
#秘钥文件的路径
server.ssl.key-store=igs/https/ldkeystore.p12
#秘钥密码
server.ssl.key-store-password=123456
#秘钥类型
server.ssl.key-store-type=PKCS12
#秘钥别名
server.ssl.key-alias=undertow

安全配置

跨站点请求伪造CSRF

开启csrf的referer校验,配置项

properties
#开启配置
security.csrf.referer.enabled=true
#默认不需要配置,如果有通过三方应用调用manager api的需求,则手动添加,多个用英文逗号分隔
security.csrf.referer.allowUrls=
#默认不需要配置,默认值为/igs/rest/manager/*,仅对manager的服务做校验
security.csrf.referer.filterUrlPatterns=

SpringBoot actuator 未授权访问

关闭所有管理类接口(推荐)

properties
management.endpoints.web.exposure.exclude=*

关闭管理类服务(推荐)

properties
management.server.port=-1

也关闭指定管理类接口

properties
management.endpoint.env.enabled=false

也可将其他非必要的管理类接口均关闭

云管需要支持prometheus、gateway

properties
management.endpoints.web.exposure.include=info,health

服务目录根目录 未授权访问

properties
igs.serviceDirectory.rootAuthEnabled=true

云管

properties
mapgis-cloud.serviceDirectory.rootAuthEnabled=true

禁止访问到swagger-ui

properties
# 关闭swagger的api接口
springdoc.api-docs.enabled=false
# 关闭swagger的ui
springdoc.swagger-ui.enabled=false
# 关闭首页的静态api html链接
apiDoc.enabled=false
# 关闭首页的swagger链接
swagger.enabled=false

云管

properties
springdoc.api-docs.enabled=false
springdoc.swagger-ui.enabled=false

CORS 策略根据任意初始头进行设置

添加配置项,指定允许跨域的源地址,比如只需要服务在一张图中调用,则写一张图的地址 http://ip:8015,支持用*代表任意

properties
spring.web.cors.allowedOriginPatterns[0]=http://*:8015

完整的CORS配置

properties
#设置允许跨域源,支持*
spring.web.cors.allowedOriginPatterns[0]=http://*:8015
#设置允许跨域源
spring.web.cors.allowedOrigins[0]=http://127.0.0.1:8015
spring.web.cors.allowedMethods[0]=GET
spring.web.cors.allowedHeaders[0]=*
spring.web.cors.exposedHeaders[0]=*
spring.web.cors.allowCredentials=true

老云管(<=10.7.2.10)配置前缀为mapgis-cloud.cors

properties
mapgis-cloud.cors.allowedOriginPatterns[0]=
#设置允许跨域源
mapgis-cloud.cors.allowedOrigins[0]=http://127.0.0.1:8015
mapgis-cloud.cors.allowedMethods[0]=GET
mapgis-cloud.cors.allowedHeaders[0]=*
mapgis-cloud.cors.exposedHeaders[0]=*
mapgis-cloud.cors.allowCredentials=true

新云管(>=10.7.4.10)配置前缀为manager.cors

properties
manager.cors.allowedOriginPatterns[0]=
#设置允许跨域源
manager.cors.allowedOrigins[0]=http://127.0.0.1:8015
manager.cors.allowedMethods[0]=GET
manager.cors.allowedHeaders[0]=*
manager.cors.exposedHeaders[0]=*
manager.cors.allowCredentials=true

启用了不安全的“OPTIONS”HTTP 方法

appscan中推理逻辑为:“Allow 头显示危险的 HTTP 选项是已允许的,这表示在服务器上启用了 WebDAV。”

添加Allow头校验,默认添加过滤器即可

properties
# 默认值为 GET,HEAD,OPTIONS
security.allowHeader.setValues=GET

HOST头校验

properties
security.hostHeader.checkEnabled=true
#允许的host头,被代理时需要指定代理服务器的ip
security.hostHeader.allowValues=ip1,ip2

定时重启

新版已支持在Manager"设置"->"定时任务"配置

properties
#通过keepalived实现的定时重启,重启时间
igs.restartScheduleTask.startTime=02:00:00
# 重启周期 h小时 d天
igs.restartScheduleTask.period=1d

其他配置

properties
# 首页标题、描述自定义
manager-frontend.dashboard.title=
manager-frontend.dashboard.description=

# postgresql客户端连接池大小,默认值为cpu核心数*2
igs.postgresqlClient.dataSource.maximumPoolSize=10
# mongodb客户端连接池大小,默认值为100
igs.mongoClient.connectionPoolSettings.maxSize=100

# 是否开启manager api的token认证
igs.managerApiAuthEnabled=false
# 是否开启加密敏感配置信息
igs.encryptSensitiveInfoEnabled=false

# 是否开启prometheus的node_exporter或windows_exporter
igs.exporterEnabled=false
igs.windowsExporterPort=9182
igs.nodeExporterPort=9100

# 是否开启告警功能
igs.alerting.enabled=true
# 是否开启服务健康巡检
igs.serviceBasic.serviceHealthCheck.enabled=true
# 巡检频率,默认1小时
igs.serviceBasic.serviceHealthCheck.periodSeconds=3600
# 执行健康检测时,请求超时时间,默认180秒
igs.serviceBasic.serviceHealthCheck.timeoutSeconds=180
# 服务发布时,是否开启支持设置图层静态过滤条件
igs.serviceBasic.serviceLayersFilter.staticLayersFilterEnabled=false
# 要素查询是否与地图显示过滤配置关联
igs.mapDisplayFilterForQueryFeatureEnabled=false

# 当线程池已耗尽时,是否关闭进程,默认关闭
igs.rpcConfig.killProcessOnThreadPoolExhausted=true

# 保留arcgis瓦片的原始比例尺,不做转换
igs.serviceOptions.preserveArcgisTileScale=false
# 临时资源(临时地图文档)缓存最大的空闲时间,超过该时间清理缓存;默认4小时
igs.serviceOptions.tempDataMaxIdleSeconds=
# 用于要素服务的简单要素类缓存最大的空闲时间,超过该时间清理缓存;默认4小时
igs.serviceOptions.vectorClsMaxIdleSeconds=
# 二维数据(mapx)缓存最大空闲时间,超过该时间清理缓存;默认不开启
igs.serviceOptions.data2dMaxIdleSeconds=
# 三维数据(mapx,m3d)缓存最大空闲时间,超过该时间清理缓存;默认不开启
igs.serviceOptions.data3dMaxIdleSeconds=
# 瓦片数据最大空闲时间,超过该时间清理缓存;默认不开启
igs.serviceOptions.tileMaxIdleSeconds=
# 影像数据最大空闲时间,超过该时间清理缓存;默认不开启
igs.serviceOptions.rasterMaxIdleSeconds=
# 临时文档文件保存天数,默认5天
igs.serviceOptions.tempDocFileSaveDays=5
# 临时工作流文件保存天数,默认7天
igs.serviceOptions.tempWorkflowFileSaveDays=7
# 快显任务超时时间,默认48小时(dubbo超时是int)
igs.serviceOptions.hiRenderTaskTimeoutSeconds=

#是否开启快显1.0地图预加载,默认true
igs.preloadMapsForHiRenderV1Enabled=true
#是否开启瓦片预加载,默认false
igs.preloadTilesEnabled=false
# 要素查询的最大条数,全局控制参数
igs.maxCountForQueryFeature=100000
# 要素服务返回几何坐标最大小数位
igs.maxDecimalsForGeometryCoordinate=8
#要素查询默认的缓冲半径(米)
igs.defaultDistanceMeterForQueryFeature=0.1
#使用java客户端在M3d服务中来处理M3D 2.0数据,包括mongo和本地文档,不使用内核
igs.javaClientForM3dServerEnabled=false
#瓦片服务客户端缓存时长,默认24小时
igs.tileCacheControlSeconds=
#m3d服务客户端缓存时长,默认一个月
igs.m3dCacheControlSeconds=
# 瓦片裁剪任务线与服务器核心数倍数,默认为2
igs.tileCutTaskThreadsMultiple=2

#上传文件后缀黑名单
igs.forbiddenUploadFileSuffixes=.php,.php3,.php4,.php5,.phtml,.phar,.jsp,.jspx,.java,.class,.jar,.war,.asp,.aspx,.ashx,.asmx,.cer,.asa,.html,.htm,.js,.exe,.bat,.sh,.cmd,.vbs,.ps1,.dll,.msi,.scr,.pl,.cgi,.py,.htaccess,.config

#日志级别,注意com.zondy.mapgis包受igs日志配置影响
logging.level.root=info
# 开启gc日志
igs.gcLogEnabled=true
# 在启动其他进程时是否重定向进程输出到日志,仅用于调试(因为日志文件没法清理,可能无限增长)
igs.processRedirectOutputEnabled=false
#dcs dubbo起始端口
dcs.dubboPort=30080
#快显并发裁图任务的最大个数
dcs.hiRenderMaxConcurrentTaskCount=4
# 是否开启DCS OPS进程管理,开启后可应用与健康检测
dcs.opsProcess.enabled=true
# 空闲时,是否关闭DCS OPS进程,默认关闭
dcs.opsProcess.killProcessOnIdle=true
# 运维进程闲置时间,超过该时间,则关闭进程,默认30分钟
dcs.opsProcess.maxIdleSeconds=
# 快显1.0本地瓦片并发裁图任务的最大个数
dcs.hiRenderMaxConcurrentTaskCount=4
# 数据转换任务的最大个数
dcs.dataConvertMaxConcurrentTaskCount=4
# dcs中矢量图层读写锁超时时间,默认60秒
dcs.vectorClsLock.timeout=60000
# dcs提供的dubbo服务,默认超时3分钟
dcs.provider.timeout=180000
# dcs中瓦片读写锁超时时间,默认60秒
dcs.tileLock.timeout=60000

#工作量dubbo起始端口
workflow.dubboPort=30280
#工作流的最大进程数,默认值为宿主机核心数与4的较大者
workflow.maxProcessCount=
# 单任务单进程模式,一个任务对应一个进程,执行完后进程销毁
workflow.oneProcessToOneTaskModeEnabled=false
# workflow server进程启动的额外JVM参数
workflow.jvmOpts[0]=

#进程起始端口号
task.dubboPort=30480
# task server进程启动的额外JVM参数
task.jvmOpts[0]=

# 开启重复提交过滤器,默认false ,会缓存请求体
mapgis.repeatSubmit.enabled=true
# 单独设置开启缓存请求体,目前服务访问日志,必须手动添加该配置才能支持application/json,application/xml,text/plain格式的请求体缓存
mapgis.cacheRequestBody.enabled=true
# 设置记录请求体的最大值,避免内存问题,默认16M
mapgis.cacheRequestBody.maxSize=16M

限流配置

properties
igs.rateLimit.enabled=true
# 全局限流,每秒最多处理多少请求
igs.rateLimit.rate=200
# 单个服务,每秒最多处理多少请求
igs.rateLimit.ratePerService=50
# 单个IP,每秒最多处理多少请求
igs.rateLimit.ratePerIp=10
# 被限流时,等待超时的时间,默认为1s
igs.rateLimit.waitPermitsTimeout=1s

keepalive探针配置

properties
# keepalive的igs探针参数
igs.keepalived.igsProb.enabled=true
# 初始等待时间
igs.keepalived.igsProb.initialDelaySeconds=120
# 请求超时时间
igs.keepalived.igsProb.timeoutSeconds=10
# 成功次数阈值
igs.keepalived.igsProb.successThreshold=1
# 失败次数阈值
igs.keepalived.igsProb.failureThreshold=6
# 探针执行周期
igs.keepalived.igsProb.periodSeconds=10
# keepalive的dcs探针参数
igs.keepalived.dcsProb.enabled=true
# 初始等待时间
igs.keepalived.dcsProb.initialDelaySeconds=60
# 请求超时时间
igs.keepalived.dcsProb.timeoutSeconds=10
# 成功次数阈值
igs.keepalived.dcsProb.successThreshold=1
# 失败次数阈值
igs.keepalived.dcsProb.failureThreshold=6
# 探针执行周期
igs.keepalived.dcsProb.periodSeconds=10