Исправления в ветке main

This commit is contained in:
2025-10-28 11:58:22 +06:00
parent 0da366cad5
commit 7a0d0746d4
10 changed files with 36 additions and 29 deletions

View File

@@ -1 +1 @@
v2.0.3
v2.0.4

View File

@@ -59,20 +59,20 @@ spec:
# Health checks
startupProbe:
httpGet:
path: /login
path: /lcg
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
failureThreshold: 30
readinessProbe:
httpGet:
path: /login
path: /lcg
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /login
path: /lcg
port: 8080
initialDelaySeconds: 10
periodSeconds: 60

View File

@@ -127,15 +127,24 @@ fi
if [ "$current_branch" != "main" ]; then
git checkout main
git merge --no-ff -m "Merged branch '$current_branch' into main while building $VERSION" "$current_branch"
git push origin main
elif [ "$current_branch" = "main" ]; then
log "🔄 Вы находитесь на ветке main. Слияние с release..."
git add .
git commit -m "Исправления в ветке $current_branch"
git push origin main
fi
# переключиться на ветку release и слить с веткой main
git checkout release
git merge --no-ff -m "Merged main into release while building $VERSION" main
if git show-ref --quiet refs/heads/release; then
log " Branch 'release' exists. Proceeding with merge."
git checkout release
git merge --no-ff -m "Merged main into release while building $VERSION" main
else
log "❌ Branch 'release' does not exist. Please create the branch before proceeding."
git checkout -b release
git merge --no-ff -m "Merged main into release while building $VERSION" main
fi
# если тег $VERSION существует, удалить его и принудительно запушить
tag_exists=$(git tag -l "$VERSION")

View File

@@ -1 +1 @@
v2.0.3
v2.0.4

View File

@@ -5,7 +5,7 @@ metadata:
namespace: lcg
data:
# Основные настройки
LCG_VERSION: "v2.0.3"
LCG_VERSION: "v2.0.4"
LCG_BASE_PATH: "/lcg"
LCG_SERVER_HOST: "0.0.0.0"
LCG_SERVER_PORT: "8080"

View File

@@ -5,7 +5,7 @@ metadata:
namespace: lcg
labels:
app: lcg
version: v2.0.3
version: v2.0.4
spec:
replicas: 1
selector:
@@ -15,11 +15,11 @@ spec:
metadata:
labels:
app: lcg
version: v2.0.3
version: v2.0.4
spec:
containers:
- name: lcg
image: kuznetcovay/lcg:v2.0.3
image: kuznetcovay/lcg:v2.0.4
imagePullPolicy: Always
ports:
- containerPort: 8080
@@ -59,20 +59,20 @@ spec:
# Health checks
startupProbe:
httpGet:
path: /login
path: /lcg
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
failureThreshold: 30
readinessProbe:
httpGet:
path: /login
path: /lcg
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /login
path: /lcg
port: 8080
initialDelaySeconds: 10
periodSeconds: 60

View File

@@ -5,7 +5,7 @@ metadata:
namespace: lcg
labels:
app: lcg
version: v2.0.3
version: v2.0.4
spec:
entryPoints:
- websecure

View File

@@ -15,11 +15,11 @@ resources:
# Common labels
commonLabels:
app: lcg
version: v2.0.3
version: v2.0.4
managed-by: kustomize
# Images
images:
- name: lcg
newName: kuznetcovay/lcg
newTag: v2.0.3
newTag: v2.0.4

View File

@@ -5,7 +5,7 @@ metadata:
namespace: lcg
labels:
app: lcg
version: v2.0.3
version: v2.0.4
spec:
type: ClusterIP
ports:
@@ -15,4 +15,4 @@ spec:
name: http
selector:
app: lcg
version: v2.0.3
version: v2.0.4

View File

@@ -1,6 +1,7 @@
package ssl
import (
"slices"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
@@ -139,25 +140,22 @@ func LoadOrGenerateCert(host string) (*tls.Certificate, error) {
// IsSecureHost проверяет, является ли хост безопасным для HTTP
func IsSecureHost(host string) bool {
secureHosts := []string{"localhost", "127.0.0.1", "::1"}
for _, secureHost := range secureHosts {
if host == secureHost {
return true
}
}
return false
return slices.Contains(secureHosts, host)
}
// ShouldUseHTTPS определяет, нужно ли использовать HTTPS
func ShouldUseHTTPS(host string) bool {
// Если явно разрешен HTTP, используем HTTP
if config.AppConfig.Server.AllowHTTP {
return false
}
// Если хост не localhost/127.0.0.1, принуждаем к HTTPS
if !IsSecureHost(host) {
return true
}
// Если явно разрешен HTTP, используем HTTP
if config.AppConfig.Server.AllowHTTP {
return false
}
// По умолчанию для localhost используем HTTP
return false