mirror of
https://github.com/Direct-Dev-Ru/go-lcg.git
synced 2025-11-16 01:29:55 +00:00
Исправления в ветке main
This commit is contained in:
@@ -1 +1 @@
|
|||||||
v2.0.3
|
v2.0.4
|
||||||
|
|||||||
@@ -59,20 +59,20 @@ spec:
|
|||||||
# Health checks
|
# Health checks
|
||||||
startupProbe:
|
startupProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /login
|
path: /lcg
|
||||||
port: 8080
|
port: 8080
|
||||||
initialDelaySeconds: 10
|
initialDelaySeconds: 10
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
failureThreshold: 30
|
failureThreshold: 30
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /login
|
path: /lcg
|
||||||
port: 8080
|
port: 8080
|
||||||
initialDelaySeconds: 5
|
initialDelaySeconds: 5
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /login
|
path: /lcg
|
||||||
port: 8080
|
port: 8080
|
||||||
initialDelaySeconds: 10
|
initialDelaySeconds: 10
|
||||||
periodSeconds: 60
|
periodSeconds: 60
|
||||||
|
|||||||
@@ -127,15 +127,24 @@ fi
|
|||||||
if [ "$current_branch" != "main" ]; then
|
if [ "$current_branch" != "main" ]; then
|
||||||
git checkout main
|
git checkout main
|
||||||
git merge --no-ff -m "Merged branch '$current_branch' into main while building $VERSION" "$current_branch"
|
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
|
elif [ "$current_branch" = "main" ]; then
|
||||||
log "🔄 Вы находитесь на ветке main. Слияние с release..."
|
log "🔄 Вы находитесь на ветке main. Слияние с release..."
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Исправления в ветке $current_branch"
|
git commit -m "Исправления в ветке $current_branch"
|
||||||
|
git push origin main
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# переключиться на ветку release и слить с веткой main
|
# переключиться на ветку release и слить с веткой main
|
||||||
|
if git show-ref --quiet refs/heads/release; then
|
||||||
|
log "ℹ️ Branch 'release' exists. Proceeding with merge."
|
||||||
git checkout release
|
git checkout release
|
||||||
git merge --no-ff -m "Merged main into release while building $VERSION" main
|
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 существует, удалить его и принудительно запушить
|
# если тег $VERSION существует, удалить его и принудительно запушить
|
||||||
tag_exists=$(git tag -l "$VERSION")
|
tag_exists=$(git tag -l "$VERSION")
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
v2.0.3
|
v2.0.4
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ metadata:
|
|||||||
namespace: lcg
|
namespace: lcg
|
||||||
data:
|
data:
|
||||||
# Основные настройки
|
# Основные настройки
|
||||||
LCG_VERSION: "v2.0.3"
|
LCG_VERSION: "v2.0.4"
|
||||||
LCG_BASE_PATH: "/lcg"
|
LCG_BASE_PATH: "/lcg"
|
||||||
LCG_SERVER_HOST: "0.0.0.0"
|
LCG_SERVER_HOST: "0.0.0.0"
|
||||||
LCG_SERVER_PORT: "8080"
|
LCG_SERVER_PORT: "8080"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ metadata:
|
|||||||
namespace: lcg
|
namespace: lcg
|
||||||
labels:
|
labels:
|
||||||
app: lcg
|
app: lcg
|
||||||
version: v2.0.3
|
version: v2.0.4
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
@@ -15,11 +15,11 @@ spec:
|
|||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: lcg
|
app: lcg
|
||||||
version: v2.0.3
|
version: v2.0.4
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: lcg
|
- name: lcg
|
||||||
image: kuznetcovay/lcg:v2.0.3
|
image: kuznetcovay/lcg:v2.0.4
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
@@ -59,20 +59,20 @@ spec:
|
|||||||
# Health checks
|
# Health checks
|
||||||
startupProbe:
|
startupProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /login
|
path: /lcg
|
||||||
port: 8080
|
port: 8080
|
||||||
initialDelaySeconds: 10
|
initialDelaySeconds: 10
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
failureThreshold: 30
|
failureThreshold: 30
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /login
|
path: /lcg
|
||||||
port: 8080
|
port: 8080
|
||||||
initialDelaySeconds: 5
|
initialDelaySeconds: 5
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /login
|
path: /lcg
|
||||||
port: 8080
|
port: 8080
|
||||||
initialDelaySeconds: 10
|
initialDelaySeconds: 10
|
||||||
periodSeconds: 60
|
periodSeconds: 60
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ metadata:
|
|||||||
namespace: lcg
|
namespace: lcg
|
||||||
labels:
|
labels:
|
||||||
app: lcg
|
app: lcg
|
||||||
version: v2.0.3
|
version: v2.0.4
|
||||||
spec:
|
spec:
|
||||||
entryPoints:
|
entryPoints:
|
||||||
- websecure
|
- websecure
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ resources:
|
|||||||
# Common labels
|
# Common labels
|
||||||
commonLabels:
|
commonLabels:
|
||||||
app: lcg
|
app: lcg
|
||||||
version: v2.0.3
|
version: v2.0.4
|
||||||
managed-by: kustomize
|
managed-by: kustomize
|
||||||
|
|
||||||
# Images
|
# Images
|
||||||
images:
|
images:
|
||||||
- name: lcg
|
- name: lcg
|
||||||
newName: kuznetcovay/lcg
|
newName: kuznetcovay/lcg
|
||||||
newTag: v2.0.3
|
newTag: v2.0.4
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ metadata:
|
|||||||
namespace: lcg
|
namespace: lcg
|
||||||
labels:
|
labels:
|
||||||
app: lcg
|
app: lcg
|
||||||
version: v2.0.3
|
version: v2.0.4
|
||||||
spec:
|
spec:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
ports:
|
ports:
|
||||||
@@ -15,4 +15,4 @@ spec:
|
|||||||
name: http
|
name: http
|
||||||
selector:
|
selector:
|
||||||
app: lcg
|
app: lcg
|
||||||
version: v2.0.3
|
version: v2.0.4
|
||||||
|
|||||||
18
ssl/ssl.go
18
ssl/ssl.go
@@ -1,6 +1,7 @@
|
|||||||
package ssl
|
package ssl
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"slices"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"crypto/rsa"
|
"crypto/rsa"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
@@ -139,26 +140,23 @@ func LoadOrGenerateCert(host string) (*tls.Certificate, error) {
|
|||||||
// IsSecureHost проверяет, является ли хост безопасным для HTTP
|
// IsSecureHost проверяет, является ли хост безопасным для HTTP
|
||||||
func IsSecureHost(host string) bool {
|
func IsSecureHost(host string) bool {
|
||||||
secureHosts := []string{"localhost", "127.0.0.1", "::1"}
|
secureHosts := []string{"localhost", "127.0.0.1", "::1"}
|
||||||
for _, secureHost := range secureHosts {
|
return slices.Contains(secureHosts, host)
|
||||||
if host == secureHost {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ShouldUseHTTPS определяет, нужно ли использовать HTTPS
|
// ShouldUseHTTPS определяет, нужно ли использовать HTTPS
|
||||||
func ShouldUseHTTPS(host string) bool {
|
func ShouldUseHTTPS(host string) bool {
|
||||||
// Если хост не localhost/127.0.0.1, принуждаем к HTTPS
|
|
||||||
if !IsSecureHost(host) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// Если явно разрешен HTTP, используем HTTP
|
// Если явно разрешен HTTP, используем HTTP
|
||||||
if config.AppConfig.Server.AllowHTTP {
|
if config.AppConfig.Server.AllowHTTP {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Если хост не localhost/127.0.0.1, принуждаем к HTTPS
|
||||||
|
if !IsSecureHost(host) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// По умолчанию для localhost используем HTTP
|
// По умолчанию для localhost используем HTTP
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user