worked out some bugs in exporting messages, not all in new code - mechanisms will be needed to cope with the bugs in the database

This commit is contained in:
2026-02-15 16:40:56 -07:00
parent fc92f4038a
commit 777b5ca846
5 changed files with 43 additions and 22 deletions
+8 -2
View File
@@ -20,6 +20,7 @@ import (
"strconv"
argparse "github.com/alexflint/go-arg"
log "github.com/sirupsen/logrus"
"gopkg.in/yaml.v3"
)
@@ -31,8 +32,9 @@ const AMSTERDAM_COPYRIGHT = "2025-2026"
// AmCLI is the command-line interface arguments structure.
type AmCLI struct {
ConfigFile string `arg:"-C,--config" help:"Location of the configuration file."`
DebugPanic bool `arg:"--debug-panic" help:"Development Only - disable Echo panic recovery"`
ConfigFile string `arg:"-C,--config" help:"Location of the configuration file."`
DebugPanic bool `arg:"--debug-panic" help:"Development Only - disable Echo panic recovery"`
BuggyAttachments bool `arg:"--buggy-attachments" help:"Some attachments may be buggy - truncate data if necessary"`
}
// CommandLine is the command-line arguments passed to Amsterdam.
@@ -239,6 +241,10 @@ func parseDataSize(s string) (int32, error) {
func SetupConfig() {
argparse.MustParse(&CommandLine)
if CommandLine.BuggyAttachments {
log.Warn("WARNING: --buggy-attachments flag set - NOT recommended for production usage")
}
if CommandLine.ConfigFile != "" {
// load the data and use it to unmarshal the loaded configuration
data, err := os.ReadFile(CommandLine.ConfigFile)