Skip to content

Commit 114458b

Browse files
committed
Improve asset caching and nullable API responses
Serve frontend assets from /assets with long-term caching while forcing no-cache for index.html to avoid stale hashed asset references. Update README with embedded images, docs link, license, support, and acknowledgments; bump docker image tag to hhftechnology/crowdsec-manager:v1.0.0. Remove now-unreferenced image files from images/. Normalize frontend API query handlers to return explicit nulls/defaults (using ?? null / ?? []), adjust related type annotations, and tweak a component prop to avoid runtime undefined values.
1 parent 388fab2 commit 114458b

29 files changed

Lines changed: 73 additions & 27 deletions

README.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,30 @@ CrowdSec Manager is a web-based management interface for CrowdSec operations, Tr
1717
- Current baseline: `1.0.0`
1818
- Multi-proxy support: not available in this release
1919

20+
## Images
21+
22+
<img width="1200" height="630" alt="Dashboard" src="/images/Dashboard.png"/>
23+
<img width="1200" height="630" alt="Health & Diagnostics" src="/images/Health & Diagnostics.png"/>
24+
<img width="1200" height="630" alt="Whitelist Management" src="/images/Whitelist Management.png"/>
25+
<img width="1200" height="630" alt="IP Management" src="/images/IP Management.png"/>
26+
<img width="1200" height="630" alt="CrowdSec Allowlist Management" src="/images/CrowdSec Allowlist Management.png"/>
27+
<img width="1200" height="630" alt="Scenario Management" src="/images/Scenario Management.png"/>
28+
<img width="1200" height="630" alt="Captcha Setup" src="/images/Captcha Setup.png"/>
29+
<img width="1200" height="630" alt="Decision List Analysis" src="/images/Decision List Analysis.png"/>
30+
<img width="1200" height="630" alt="Alert List Analysis" src="/images/Alert List Analysis.png"/>
31+
<img width="1200" height="630" alt="Logs Viewer" src="/images/Logs Viewer.png"/>
32+
<img width="1200" height="630" alt="Backup Management" src="/images/Backup Management.png"/>
33+
<img width="1200" height="630" alt="System Update" src="/images/System Update.png"/>
34+
<img width="1200" height="630" alt="Cron Job Management" src="/images/Cron Job Management.png"/>
35+
<img width="1200" height="630" alt="Services Management" src="/images/Services Management.png"/>
36+
<img width="1200" height="630" alt="Configuration" src="/images/Configuration.png"/>
37+
2038
## Minimum Docker Compose
2139

2240
```yaml
2341
services:
2442
crowdsec-manager:
25-
image: hhftechnology/crowdsec-manager:1.0.0
43+
image: hhftechnology/crowdsec-manager:v1.0.0
2644
container_name: crowdsec-manager
2745
restart: unless-stopped
2846
expose:
@@ -64,4 +82,24 @@ curl http://localhost:8080/health
6482

6583
## Documentation
6684

67-
For installation details, feature guides, and API reference, use the docs in [`docs/`](/docs).
85+
For installation details, feature guides, and API reference, use the docs in [`docs`](https://crowdsec-manager.hhf.technology).
86+
87+
## License
88+
89+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
90+
91+
## Support
92+
93+
- **Issues**: [GitHub Issues](https://github.com/hhftechnology/crowdsec_manager/issues)
94+
- **Discussions**: [GitHub Discussions](https://github.com/hhftechnology/crowdsec_manager/discussions)
95+
96+
## Acknowledgments
97+
98+
- Original bash script by hhf-technology
99+
- CrowdSec for the security engine
100+
- Traefik for reverse proxy
101+
- Shadcn/ui for UI components
102+
103+
---
104+
105+
**Built with ❤️ for the CrowdSec/Pangolin community**

cmd/server/main.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,20 @@ func main() {
160160
// Suppress unused variable warnings — publisher will be used by handlers in Phase 4
161161
_ = publisher
162162

163-
// Serve React frontend static assets and handle client-side routing
163+
// Serve React frontend static assets and handle client-side routing.
164+
// Assets use content-hashed filenames so they can be cached indefinitely.
164165
router.Static("/assets", "./web/dist/assets")
165-
router.StaticFile("/", "./web/dist/index.html")
166-
router.NoRoute(func(c *gin.Context) {
166+
// index.html must not be cached — it references hashed asset URLs that
167+
// change on each build. Without no-cache the browser may serve a stale
168+
// copy (304) that points to old, non-existent JS chunks.
169+
serveIndex := func(c *gin.Context) {
170+
c.Header("Cache-Control", "no-cache, no-store, must-revalidate")
171+
c.Header("Pragma", "no-cache")
172+
c.Header("Expires", "0")
167173
c.File("./web/dist/index.html")
168-
})
174+
}
175+
router.GET("/", func(c *gin.Context) { serveIndex(c) })
176+
router.NoRoute(serveIndex)
169177

170178
// Create HTTP server with production-ready timeouts to prevent resource exhaustion
171179
srv := &http.Server{

images/Alert List Analysis.png

-151 KB
Binary file not shown.

images/Backup Management.png

-172 KB
Binary file not shown.

images/Captcha Setup.png

-145 KB
Binary file not shown.

images/Configuration.png

-156 KB
Binary file not shown.

images/Cron Job Management.png

-136 KB
Binary file not shown.
-221 KB
Binary file not shown.

images/Dashboard.png

-134 KB
Binary file not shown.

images/Decision List Analysis.png

-153 KB
Binary file not shown.

0 commit comments

Comments
 (0)