Skip to content

Commit 1a7f8bb

Browse files
committed
Minor Bug Fixes and Improvements
1 parent 9b7aa68 commit 1a7f8bb

File tree

4 files changed

+30
-6
lines changed

4 files changed

+30
-6
lines changed

.goreleaser.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ release:
4141
1. **Cloudflare API Integration**: Automated DNS zone mapping based on Traefik host labels.
4242
2. **Cloudflare Zone Registry**: Manage multiple Cloudflare accounts and zones with an interactive selection menu.
4343
3. **Database Backup Automation(Infrastructure)**: Easily backup Infrastructure databases to S3/R2(Experimental).
44-
4. **Bug Fixes**: Improved domain detection and duplicate record handling.
44+
4. **Bug Fixes and Improvements**:
45+
- Improved domain detection,
46+
- Duplicate record handling,
47+
- Ghcr image linking,
48+
- Boilerplate service priority guidelines,
49+
- Webhook detection and error handling.
4550
4651
### V2 Highlights:
4752
This release introduces significant enhancements to Graft, moving from basic local-to-server deployments to a more robust CI/CD-driven workflow using GitHub Actions and our new `graft-hook` service.

cmd/graft/main.go

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func main() {
3030
if len(args) > 0 {
3131
arg := args[0]
3232
if arg == "-v" || arg == "--version" {
33-
fmt.Println("v2.1.1")
33+
fmt.Println("v2.1.2")
3434
return
3535
}
3636
if arg == "--help" {
@@ -635,6 +635,19 @@ func runInit(args []string) {
635635
// Fetch existing hook URL from global registry if available
636636
if srv, exists := gCfg.Servers[registryName]; exists {
637637
currentHookURL = srv.GraftHookURL
638+
if currentHookURL == "" {
639+
fmt.Println("⚠️ Warning: graft-hook URL not found in registry.")
640+
fmt.Print("Enter the graft-hook domain (e.g. graft-hook.example.com): ")
641+
hookDomain, _ := reader.ReadString('\n')
642+
hookDomain = strings.TrimSpace(hookDomain)
643+
if hookDomain != "" {
644+
currentHookURL = fmt.Sprintf("https://%s", hookDomain)
645+
}
646+
} else {
647+
fmt.Printf("📍 Using hook URL from registry: %s\n", currentHookURL)
648+
}
649+
} else {
650+
fmt.Println("⚠️ Warning: Server not found in registry, cannot retrieve hook URL.")
638651
}
639652
}
640653
}
@@ -651,7 +664,6 @@ services:
651664
image: ghcr.io/skssmd/graft-hook:latest
652665
environment:
653666
- configpath=/opt/graft/config/projects.json
654-
- RUST_LOG=info
655667
labels:
656668
- "graft.mode=serverbuild"
657669
- "traefik.enable=true"
@@ -684,7 +696,13 @@ networks:
684696
if srv, exists := gCfg.Servers[registryName]; exists {
685697
srv.GraftHookURL = currentHookURL
686698
gCfg.Servers[registryName] = srv
687-
config.SaveGlobalConfig(gCfg)
699+
if err := config.SaveGlobalConfig(gCfg); err != nil {
700+
fmt.Printf("⚠️ Warning: Could not save hook URL to global registry: %v\n", err)
701+
} else {
702+
fmt.Println("✅ Hook URL saved to global registry")
703+
}
704+
} else {
705+
fmt.Printf("⚠️ Warning: Server '%s' not found in global registry, cannot save hook URL\n", registryName)
688706
}
689707
}
690708
}

internal/deploy/compose_sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func SyncComposeOnly(client *ssh.Client, p *Project, heave bool, stdout, stderr
8080
}
8181

8282
if ownerRepo != "" {
83-
sPtr.Image = fmt.Sprintf("ghcr.io/%s/%s:latest", ownerRepo, sName)
83+
sPtr.Image = fmt.Sprintf("ghcr.io/%s/%s:latest", strings.ToLower(ownerRepo), sName)
8484
sPtr.Build = nil // Remove build context
8585
}
8686
}

internal/deploy/project.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ services:
186186
# 1. Define the Router (The "Entry" rule)
187187
# serves %s/api/* and strips /api prefix
188188
- "traefik.http.routers.%s-backend.rule=Host(` + "`%s`" + `) && PathPrefix(` + "`/api`" + `)"
189-
- "traefik.http.routers.%s-backend.priority=1"
189+
# Important to add more priority of any path based reverse proxy than the main "/" path to prevent path not found issues
190+
- "traefik.http.routers.%s-backend.priority=10"
190191
191192
# 2. Define the Service & Middleware
192193
- "traefik.http.middlewares.%s-backend-strip.stripprefix.prefixes=/api"

0 commit comments

Comments
 (0)