mirror of
https://github.com/veops/oneterm.git
synced 2025-10-31 02:46:29 +08:00
chore: release v25.8.1
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package middleware
|
package middleware
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
@@ -16,10 +17,18 @@ func LoggerMiddleware() gin.HandlerFunc {
|
|||||||
ctx.Next()
|
ctx.Next()
|
||||||
|
|
||||||
cost := time.Since(start)
|
cost := time.Since(start)
|
||||||
|
|
||||||
|
// Skip logging for web proxy requests to reduce noise
|
||||||
|
url := ctx.Request.URL.String()
|
||||||
|
host := ctx.Request.Host
|
||||||
|
if strings.HasPrefix(host, "asset-") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Only log errors and slow requests
|
// Only log errors and slow requests
|
||||||
status := ctx.Writer.Status()
|
status := ctx.Writer.Status()
|
||||||
if status >= 400 || cost > 1*time.Second {
|
if status >= 400 || cost > 1*time.Second {
|
||||||
logger.L().Info(ctx.Request.URL.String(),
|
logger.L().Info(url,
|
||||||
zap.String("method", ctx.Request.Method),
|
zap.String("method", ctx.Request.Method),
|
||||||
zap.Int("status", status),
|
zap.Int("status", status),
|
||||||
zap.String("ip", ctx.ClientIP()),
|
zap.String("ip", ctx.ClientIP()),
|
||||||
@@ -27,7 +36,7 @@ func LoggerMiddleware() gin.HandlerFunc {
|
|||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
// Normal requests use debug level to reduce log noise
|
// Normal requests use debug level to reduce log noise
|
||||||
logger.L().Debug(ctx.Request.URL.String(),
|
logger.L().Debug(url,
|
||||||
zap.String("method", ctx.Request.Method),
|
zap.String("method", ctx.Request.Method),
|
||||||
zap.Int("status", status),
|
zap.Int("status", status),
|
||||||
zap.String("ip", ctx.ClientIP()),
|
zap.String("ip", ctx.ClientIP()),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
oneterm-api:
|
oneterm-api:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/veops/oneterm-api:v25.7.1.fix
|
image: registry.cn-hangzhou.aliyuncs.com/veops/oneterm-api:v25.8.1
|
||||||
container_name: oneterm-api
|
container_name: oneterm-api
|
||||||
environment:
|
environment:
|
||||||
ONETERM_RDP_DRIVE_PATH: /rdp
|
ONETERM_RDP_DRIVE_PATH: /rdp
|
||||||
@@ -95,7 +95,7 @@ services:
|
|||||||
- redis
|
- redis
|
||||||
|
|
||||||
oneterm-ui:
|
oneterm-ui:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/veops/oneterm-ui:v25.7.1.fix2
|
image: registry.cn-hangzhou.aliyuncs.com/veops/oneterm-ui:v25.8.1
|
||||||
container_name: oneterm-ui
|
container_name: oneterm-ui
|
||||||
depends_on:
|
depends_on:
|
||||||
oneterm-api:
|
oneterm-api:
|
||||||
|
|||||||
Reference in New Issue
Block a user