summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-10-04 10:31:35 +0300
committerPaul Buetow <paul@buetow.org>2024-10-04 10:31:35 +0300
commit68b2a1ba2615c19642c8417d1350b9c6b867b1bb (patch)
treeb298e4c4c0c313c5b8ade72986e2865f18706639 /cmd
parentd5edaafc454dffd50cac1fed3cf03fbe9a05c50c (diff)
initial secrets config and initial mastodon
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gos/main.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/gos/main.go b/cmd/gos/main.go
index 3724f3e..752370a 100644
--- a/cmd/gos/main.go
+++ b/cmd/gos/main.go
@@ -5,6 +5,8 @@ import (
"flag"
"fmt"
"log"
+ "os"
+ "path/filepath"
"strings"
"time"
@@ -18,17 +20,25 @@ func main() {
dry := flag.Bool("dry", false, "Dry run")
version := flag.Bool("version", false, "Display version")
gosDir := flag.String("gosDir", "./gosdir", "Gos' directory")
+ secretsConfig := filepath.Join(os.Getenv("HOME"), ".config/gos/gosec.json")
+ secretsConfig = *flag.String("secretsConfig", secretsConfig, "Gos' secret config")
platforms := flag.String("platforms", "Mastodon,LinkedIn", "Platforms enabled")
target := flag.Int("target", 2, "How many posts per week are the target?")
lookback := flag.Int("lookback", 30, "How many days look back in time for posting history")
flag.Parse()
+ secrets, err := config.NewSecrets(secretsConfig)
+ if err != nil {
+ log.Fatal(err)
+ }
+
args := config.Args{
DryRun: *dry,
GosDir: *gosDir,
Platforms: strings.Split(*platforms, ","),
Target: *target,
Lookback: time.Duration(*lookback) * time.Hour * 24,
+ Secrets: secrets,
}
if err := args.Validate(); err != nil {