Compare commits
2 Commits
84621ce12e
...
cbceac786d
| Author | SHA1 | Date | |
|---|---|---|---|
| cbceac786d | |||
| ae3eed3ff8 |
@@ -5,6 +5,6 @@ metadata:
|
||||
namespace: {{ .Release.Namespace }}
|
||||
data:
|
||||
OAUTH_ALLOWED_HOST: webapp.arcodange.duckdns.org
|
||||
OAUTH_DEVICE_CODE_ALLOWED_IPS: 90.16.102.250,
|
||||
OAUTH_DEVICE_CODE_ALLOWED_IPS: 86.247.157.144,
|
||||
DATABASE_URL: postgres://pgbouncer_auth:pgbouncer_auth@pgbouncer.tools/postgres?sslmode=disable
|
||||
# DATABASE_URL: postgres://username:password@localhost/dbname?sslmode=disable
|
||||
6
main.go
6
main.go
@@ -287,13 +287,14 @@ func retrieveHandler(w http.ResponseWriter, r *http.Request) {
|
||||
if err != nil ||
|
||||
!slices.Contains(oauthDeviceCodeAllowedIPs, userIP) &&
|
||||
!slices.Contains(oauthDeviceCodeAllowedIPs, userIPforwarded) {
|
||||
fmt.Fprintln(os.Stderr, "denied userIP: "+userIP)
|
||||
fmt.Fprintln(os.Stderr, "denied userIP: "+userIP+" forwarded: "+userIPforwarded)
|
||||
fmt.Fprintf(os.Stderr, "alowed ips: %+v", oauthDeviceCodeAllowedIPs)
|
||||
// Parcourir tous les headers
|
||||
for name, values := range r.Header {
|
||||
// name représente le nom de l'en-tête
|
||||
// values est une slice contenant toutes les valeurs associées à cet en-tête
|
||||
for _, value := range values {
|
||||
fmt.Fprintf(os.Stderr,"%s: %s\n", name, value)
|
||||
fmt.Fprintf(os.Stderr, "%s: %s\n", name, value)
|
||||
}
|
||||
}
|
||||
http.Error(w, "Access denied: invalid IP", http.StatusForbidden)
|
||||
@@ -493,7 +494,6 @@ func main() {
|
||||
http.HandleFunc("/retrieve", retrieveHandler)
|
||||
http.HandleFunc("/test-oauth-callback", test_oauth2_callback)
|
||||
|
||||
|
||||
// Start the HTTP server
|
||||
port := ":8080"
|
||||
log.Printf("Server starting on port %s\n", port)
|
||||
|
||||
Reference in New Issue
Block a user