seed default channel(s) on boot
ci / build (pull_request) Successful in 23s
ci / image (pull_request) Skipped

fresh relay seeds configured open channels (RELAY_DEFAULT_CHANNELS,
default general) so a client always has a room. relay-signed 9007
through the normal pipeline; idempotent; never reopens a closed group.

also adds mission/roadmap and separation rationale to the readme.
This commit is contained in:
Robert Goodall
2026-07-25 08:11:39 -04:00
parent 294616642f
commit 8e9235a820
7 changed files with 220 additions and 15 deletions
+17
View File
@@ -5,10 +5,27 @@ import (
"os"
"path/filepath"
"strconv"
"strings"
"fiatjaf.com/nostr"
)
// parseChannels splits a comma-separated channel list into cleaned group ids: a
// leading `#` is tolerated and blanks/dupes are dropped. Order is preserved.
func parseChannels(s string) []string {
var out []string
seen := map[string]bool{}
for _, part := range strings.Split(s, ",") {
id := strings.TrimPrefix(strings.TrimSpace(part), "#")
if id == "" || seen[id] {
continue
}
seen[id] = true
out = append(out, id)
}
return out
}
func envOr(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v