Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
40151d403b
|
|||
| d2992d2af6 | |||
|
|
7930f2ec99 |
4
.github/workflows/ci-cd.yml
vendored
4
.github/workflows/ci-cd.yml
vendored
@@ -79,7 +79,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform linux/amd64 \
|
--platform linux/amd64 \
|
||||||
--tag "git.yejayekhoob.com/db123/auth-proxy:${{ github.sha }}" \
|
--tag "git.yejayekhoob.com/yjkh/auth-proxy:${{ github.sha }}" \
|
||||||
--tag "git.yejayekhoob.com/db123/auth-proxy:latest" \
|
--tag "git.yejayekhoob.com/yjkh/auth-proxy:latest" \
|
||||||
--push \
|
--push \
|
||||||
.
|
.
|
||||||
|
|||||||
5
LICENSE
Normal file
5
LICENSE
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Copyright (c) 2026 db123. All Rights Reserved.
|
||||||
|
|
||||||
|
This software and associated documentation files (the "Software") are proprietary and confidential. No part of the Software may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the copyright holder.
|
||||||
|
|
||||||
|
For licensing inquiries, contact: erfan@db123.ir
|
||||||
17
src/auth.go
17
src/auth.go
@@ -243,9 +243,16 @@ func parseLogFilter(r *http.Request) (*logFilter, error) {
|
|||||||
Offset: 0,
|
Offset: 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
validActions := map[string]bool{
|
||||||
|
"add_temp": true, "delete_temp": true,
|
||||||
|
"add_perm": true, "delete_perm": true, "expire_temp": true,
|
||||||
|
}
|
||||||
|
|
||||||
if v := r.URL.Query().Get("action"); v != "" {
|
if v := r.URL.Query().Get("action"); v != "" {
|
||||||
|
if validActions[v] {
|
||||||
f.Action = v
|
f.Action = v
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if v := r.URL.Query().Get("ip"); v != "" {
|
if v := r.URL.Query().Get("ip"); v != "" {
|
||||||
f.IP = v
|
f.IP = v
|
||||||
}
|
}
|
||||||
@@ -333,13 +340,13 @@ func statusHandler(db *sql.DB) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
var permCount int
|
var permCount int
|
||||||
var tempCount int
|
var tempCount int
|
||||||
dbOK := false
|
dbOK := true
|
||||||
|
|
||||||
if err := db.QueryRow(`SELECT COUNT(*) FROM perm_whitelist`).Scan(&permCount); err == nil {
|
if err := db.QueryRow(`SELECT COUNT(*) FROM perm_whitelist`).Scan(&permCount); err != nil {
|
||||||
dbOK = true
|
dbOK = false
|
||||||
}
|
}
|
||||||
if err := db.QueryRow(`SELECT COUNT(*) FROM temp_whitelist WHERE expires_at > ?`, time.Now().Format(time.RFC3339)).Scan(&tempCount); err == nil {
|
if err := db.QueryRow(`SELECT COUNT(*) FROM temp_whitelist WHERE expires_at > ?`, time.Now().Format(time.RFC3339)).Scan(&tempCount); err != nil {
|
||||||
dbOK = true
|
dbOK = false
|
||||||
}
|
}
|
||||||
|
|
||||||
health := map[string]interface{}{
|
health := map[string]interface{}{
|
||||||
|
|||||||
Reference in New Issue
Block a user