mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-10 02:28:45 +00:00
Compare commits
2 Commits
Xe/toggle-
...
Xe/ddwrt-l
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e86e7fd7a | ||
|
|
11128f6ece |
6
.github/actions/spelling/expect.txt
vendored
6
.github/actions/spelling/expect.txt
vendored
@@ -80,6 +80,7 @@ databento
|
|||||||
dayjob
|
dayjob
|
||||||
dco
|
dco
|
||||||
DDOS
|
DDOS
|
||||||
|
ddwrt
|
||||||
Debian
|
Debian
|
||||||
debrpm
|
debrpm
|
||||||
decaymap
|
decaymap
|
||||||
@@ -102,6 +103,7 @@ duckduckbot
|
|||||||
eerror
|
eerror
|
||||||
ellenjoe
|
ellenjoe
|
||||||
emacs
|
emacs
|
||||||
|
embe
|
||||||
enbyware
|
enbyware
|
||||||
etld
|
etld
|
||||||
everyones
|
everyones
|
||||||
@@ -119,7 +121,6 @@ FCr
|
|||||||
fcrdns
|
fcrdns
|
||||||
fediverse
|
fediverse
|
||||||
ffprobe
|
ffprobe
|
||||||
FFXIV
|
|
||||||
fhdr
|
fhdr
|
||||||
financials
|
financials
|
||||||
finfos
|
finfos
|
||||||
@@ -221,7 +222,6 @@ LLU
|
|||||||
loadbalancer
|
loadbalancer
|
||||||
lol
|
lol
|
||||||
lominsa
|
lominsa
|
||||||
maintainership
|
|
||||||
malware
|
malware
|
||||||
mcr
|
mcr
|
||||||
memes
|
memes
|
||||||
@@ -239,7 +239,6 @@ mymaster
|
|||||||
mypass
|
mypass
|
||||||
myuser
|
myuser
|
||||||
nbf
|
nbf
|
||||||
Necron
|
|
||||||
nepeat
|
nepeat
|
||||||
netsurf
|
netsurf
|
||||||
nginx
|
nginx
|
||||||
@@ -334,7 +333,6 @@ spyderbot
|
|||||||
srcip
|
srcip
|
||||||
srv
|
srv
|
||||||
stackoverflow
|
stackoverflow
|
||||||
Stargate
|
|
||||||
startprecmd
|
startprecmd
|
||||||
stoppostcmd
|
stoppostcmd
|
||||||
storetest
|
storetest
|
||||||
|
|||||||
@@ -73,6 +73,9 @@ Anubis is brought to you by sponsors and donors like:
|
|||||||
<a href="https://www.anexia.com/">
|
<a href="https://www.anexia.com/">
|
||||||
<img src="./docs/static/img/sponsors/anexia-cloudsolutions-logo.webp" alt="ANEXIA Cloud Solutions" height="64">
|
<img src="./docs/static/img/sponsors/anexia-cloudsolutions-logo.webp" alt="ANEXIA Cloud Solutions" height="64">
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://dd-wrt.com/">
|
||||||
|
<img src="./docs/static/img/sponsors/ddwrt-logo.webp" alt="embeDD GmbH" height="64">
|
||||||
|
</a>
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ func main() {
|
|||||||
|
|
||||||
internal.SetHealth("anubis", healthv1.HealthCheckResponse_NOT_SERVING)
|
internal.SetHealth("anubis", healthv1.HealthCheckResponse_NOT_SERVING)
|
||||||
|
|
||||||
lg := internal.InitSlog(*slogLevel, os.Stderr, false)
|
lg := internal.InitSlog(*slogLevel, os.Stderr)
|
||||||
lg.Info("starting up Anubis")
|
lg.Info("starting up Anubis")
|
||||||
|
|
||||||
if *healthcheck {
|
if *healthcheck {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ func main() {
|
|||||||
flagenv.Parse()
|
flagenv.Parse()
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
slog.SetDefault(internal.InitSlog(*slogLevel, os.Stderr, false))
|
slog.SetDefault(internal.InitSlog(*slogLevel, os.Stderr))
|
||||||
|
|
||||||
koDockerRepo := strings.TrimSuffix(*dockerRepo, "/"+filepath.Base(*dockerRepo))
|
koDockerRepo := strings.TrimSuffix(*dockerRepo, "/"+filepath.Base(*dockerRepo))
|
||||||
|
|
||||||
@@ -159,8 +159,8 @@ func run(command string) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setOutput(key, val string) {
|
func setOutput(key, val string) {
|
||||||
github_output := os.Getenv("GITHUB_OUTPUT")
|
github_output := os.Getenv("GITHUB_OUTPUT")
|
||||||
f, _ := os.OpenFile(github_output, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
|
f, _ := os.OpenFile(github_output, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
|
||||||
fmt.Fprintf(f, "%s=%s\n", key, val)
|
fmt.Fprintf(f, "%s=%s\n", key, val)
|
||||||
f.Close()
|
f.Close()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,10 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Fixed mixed tab/space indentation in Caddy documentation code block
|
- Fixed mixed tab/space indentation in Caddy documentation code block
|
||||||
- Improve error messages and fix broken REDIRECT_DOMAINS link in docs ([#1193](https://github.com/TecharoHQ/anubis/issues/1193))
|
- Improve error messages and fix broken REDIRECT_DOMAINS link in docs ([#1193](https://github.com/TecharoHQ/anubis/issues/1193))
|
||||||
- Add Bulgarian locale ([#1394](https://github.com/TecharoHQ/anubis/pull/1394))
|
- Add Bulgarian locale ([#1394](https://github.com/TecharoHQ/anubis/pull/1394))
|
||||||
- Add option to hide source code origin of log lines in [logging configuration](./admin/policies.mdx#logging-management)
|
|
||||||
|
|
||||||
<!-- This changes the project to: -->
|
<!-- This changes the project to: -->
|
||||||
|
|
||||||
- Fix CEL internal errors when iterating `headers`/`query` map wrappers by implementing map iterators for `HTTPHeaders` and `URLValues` ([#1465](https://github.com/TecharoHQ/anubis/pull/1465)).
|
- Fix CEL internal errors when iterating `headers`/`query` map wrappers by implementing map iterators for `HTTPHeaders` and `URLValues` ([#1465](https://github.com/TecharoHQ/anubis/pull/1465)).
|
||||||
|
|
||||||
## v1.25.0: Necron
|
## v1.25.0: Necron
|
||||||
|
|||||||
@@ -339,7 +339,6 @@ Anubis exposes the following logging settings in the policy file:
|
|||||||
| `level` | [log level](#log-levels) | `info` | The logging level threshold. Any logs that are at or above this threshold will be drained to the sink. Any other logs will be discarded. |
|
| `level` | [log level](#log-levels) | `info` | The logging level threshold. Any logs that are at or above this threshold will be drained to the sink. Any other logs will be discarded. |
|
||||||
| `sink` | string | `stdio`, `file` | The sink where the logs drain to as they are being recorded in Anubis. |
|
| `sink` | string | `stdio`, `file` | The sink where the logs drain to as they are being recorded in Anubis. |
|
||||||
| `parameters` | object | | Parameters for the given logging sink. This will vary based on the logging sink of choice. See below for more information. |
|
| `parameters` | object | | Parameters for the given logging sink. This will vary based on the logging sink of choice. See below for more information. |
|
||||||
| `hideSource` | boolean | `false` | If set, hide the details of which line of code triggered a log line. Setting this to `true` may make getting support more difficult. |
|
|
||||||
|
|
||||||
Anubis supports the following logging sinks:
|
Anubis supports the following logging sinks:
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,9 @@ Anubis is brought to you by sponsors and donors like:
|
|||||||
height="64"
|
height="64"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="https://dd-wrt.com/">
|
||||||
|
<img src="/img/sponsors/ddwrt-logo.webp" alt="embeDD GmbH" height="64" />
|
||||||
|
</a>
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
|
|||||||
BIN
docs/static/img/sponsors/ddwrt-logo.webp
vendored
Normal file
BIN
docs/static/img/sponsors/ddwrt-logo.webp
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
@@ -10,7 +10,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func InitSlog(level string, sink io.Writer, hideSource bool) *slog.Logger {
|
func InitSlog(level string, sink io.Writer) *slog.Logger {
|
||||||
var programLevel slog.Level
|
var programLevel slog.Level
|
||||||
if err := (&programLevel).UnmarshalText([]byte(level)); err != nil {
|
if err := (&programLevel).UnmarshalText([]byte(level)); err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "invalid log level %s: %v, using info\n", level, err)
|
fmt.Fprintf(os.Stderr, "invalid log level %s: %v, using info\n", level, err)
|
||||||
@@ -20,16 +20,10 @@ func InitSlog(level string, sink io.Writer, hideSource bool) *slog.Logger {
|
|||||||
leveler := &slog.LevelVar{}
|
leveler := &slog.LevelVar{}
|
||||||
leveler.Set(programLevel)
|
leveler.Set(programLevel)
|
||||||
|
|
||||||
opts := &slog.HandlerOptions{
|
h := slog.NewJSONHandler(sink, &slog.HandlerOptions{
|
||||||
AddSource: true,
|
AddSource: true,
|
||||||
Level: leveler,
|
Level: leveler,
|
||||||
}
|
})
|
||||||
|
|
||||||
if hideSource {
|
|
||||||
opts.AddSource = false
|
|
||||||
}
|
|
||||||
|
|
||||||
h := slog.NewJSONHandler(sink, opts)
|
|
||||||
result := slog.New(h)
|
result := slog.New(h)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ type Logging struct {
|
|||||||
Sink string `json:"sink"` // Logging sink, either "stdio" or "file"
|
Sink string `json:"sink"` // Logging sink, either "stdio" or "file"
|
||||||
Level *slog.Level `json:"level"` // Log level, if set supersedes the level in flags
|
Level *slog.Level `json:"level"` // Log level, if set supersedes the level in flags
|
||||||
Parameters *LoggingFileConfig `json:"parameters"` // Logging parameters, to be dynamic in the future
|
Parameters *LoggingFileConfig `json:"parameters"` // Logging parameters, to be dynamic in the future
|
||||||
HideSource bool `json:"hideSource"` // If true, hide the `source` field in log lines
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ func ParseConfig(ctx context.Context, fin io.Reader, fname string, defaultDiffic
|
|||||||
|
|
||||||
switch c.Logging.Sink {
|
switch c.Logging.Sink {
|
||||||
case config.LogSinkStdio:
|
case config.LogSinkStdio:
|
||||||
result.Logger = internal.InitSlog(logLevel, os.Stderr, c.Logging.HideSource)
|
result.Logger = internal.InitSlog(logLevel, os.Stderr)
|
||||||
case config.LogSinkFile:
|
case config.LogSinkFile:
|
||||||
out := &logrotate.Logger{
|
out := &logrotate.Logger{
|
||||||
Filename: c.Logging.Parameters.Filename,
|
Filename: c.Logging.Parameters.Filename,
|
||||||
@@ -87,7 +87,7 @@ func ParseConfig(ctx context.Context, fin io.Reader, fname string, defaultDiffic
|
|||||||
Compress: c.Logging.Parameters.Compress,
|
Compress: c.Logging.Parameters.Compress,
|
||||||
}
|
}
|
||||||
|
|
||||||
result.Logger = internal.InitSlog(logLevel, out, c.Logging.HideSource)
|
result.Logger = internal.InitSlog(logLevel, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
lg := result.Logger.With("at", "config-validate")
|
lg := result.Logger.With("at", "config-validate")
|
||||||
|
|||||||
Reference in New Issue
Block a user