Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef7abd386e | ||
|
|
bdc0d9beb2 | ||
|
|
eb8ba0eb74 | ||
|
|
31afa58ace | ||
|
|
63dba60c44 | ||
| b6d71a3929 | |||
|
|
3ba6d61117 | ||
|
|
6ea4019d55 | ||
|
|
91c53e5968 | ||
|
|
684ac2a8c3 |
5
.github/workflows/ci-cd.yml
vendored
5
.github/workflows/ci-cd.yml
vendored
@@ -4,7 +4,7 @@ on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
paths:
|
||||
- 'src/'
|
||||
- 'src/**'
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
|
||||
@@ -22,6 +22,9 @@ jobs:
|
||||
- name: Download dependencies
|
||||
run: /usr/local/go/bin/go mod download
|
||||
|
||||
- name: Tidy modules
|
||||
run: /usr/local/go/bin/go mod tidy
|
||||
|
||||
- name: Check formatting
|
||||
run: |
|
||||
if [ "$(/usr/local/go/bin/gofmt -l $(find . -name '*.go' -not -path './vendor/*'))" ]; then
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
*.exe
|
||||
*.env
|
||||
*.env
|
||||
*.db*
|
||||
|
||||
@@ -302,8 +302,8 @@ func logsHandler(db *sql.DB) http.HandlerFunc {
|
||||
logs := make([]map[string]interface{}, 0)
|
||||
for rows.Next() {
|
||||
var ts time.Time
|
||||
var action, apiClientIP string
|
||||
var ip, reason sql.NullString
|
||||
var action string
|
||||
var ip, reason, apiClientIP sql.NullString
|
||||
var ttlSeconds sql.NullInt64
|
||||
if err := rows.Scan(&ts, &action, &ip, &ttlSeconds, &reason, &apiClientIP); err != nil {
|
||||
continue
|
||||
@@ -311,7 +311,7 @@ func logsHandler(db *sql.DB) http.HandlerFunc {
|
||||
entry := map[string]interface{}{
|
||||
"timestamp": ts,
|
||||
"action": action,
|
||||
"api_client_ip": apiClientIP,
|
||||
"api_client_ip": apiClientIP.String,
|
||||
"reason": reason.String,
|
||||
}
|
||||
if ip.Valid {
|
||||
|
||||
Reference in New Issue
Block a user