summaryrefslogtreecommitdiff
path: root/internal/config/config.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-28 10:16:18 +0200
committerPaul Buetow <paul@buetow.org>2026-03-28 10:16:18 +0200
commit73c6a37ecf0aac04711e5624455743b3493a7ef5 (patch)
treeac58cce0dcd03ccac3f5f3e313a46ebe9d352b30 /internal/config/config.go
parent1615abaacccdbb5002404a77270fd333ce8ad718 (diff)
feat(sync): auto-sync full backups and showcase cgit linksv0.17.0main
Diffstat (limited to 'internal/config/config.go')
-rw-r--r--internal/config/config.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 4e40cdf..02f2fee 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -10,11 +10,13 @@ import (
// Organization represents a git organization with its host and name
type Organization struct {
- Host string `json:"host"`
- Name string `json:"name"`
- GitHubToken string `json:"github_token,omitempty"`
- CodebergToken string `json:"codeberg_token,omitempty"`
- BackupLocation bool `json:"backupLocation,omitempty"` // Mark this as a backup-only destination
+ Host string `json:"host"`
+ Name string `json:"name"`
+ GitHubToken string `json:"github_token,omitempty"`
+ CodebergToken string `json:"codeberg_token,omitempty"`
+ BackupLocation bool `json:"backupLocation,omitempty"` // Mark this as a backup-only destination
+ DescriptionSyncHost string `json:"descriptionSyncHost,omitempty"` // SSH host with shell access for updating backup descriptions
+ DescriptionSyncRoot string `json:"descriptionSyncRoot,omitempty"` // Filesystem path on DescriptionSyncHost where bare repos live
}
// Config holds the application configuration
@@ -101,6 +103,11 @@ func (c *Config) Validate() error {
if org.Name == "" && !strings.HasPrefix(org.Host, "file://") && !org.IsSSH() {
return fmt.Errorf("organization %d: missing name", i)
}
+ hasDescriptionSyncHost := strings.TrimSpace(org.DescriptionSyncHost) != ""
+ hasDescriptionSyncRoot := strings.TrimSpace(org.DescriptionSyncRoot) != ""
+ if hasDescriptionSyncHost != hasDescriptionSyncRoot {
+ return fmt.Errorf("organization %d: descriptionSyncHost and descriptionSyncRoot must be set together", i)
+ }
}
for repo, branch := range c.ShowcaseStatsBranches {