Minor visual and structural revisions

- Remove the `/feed` endpoint, as this is already handled by `/plain`.
- Rename `/html` endpoint to `/threatfeed`.
- Add a `/docs` endpoint for displaying information on accessing the threat feed.
- Make the Deceptifeed logo smaller on HTML pages.
- Revise the layout of the initial homepage. Endpoint docs are now moved and linked to /docs.
- Remove `/html` from the list of threat feed endpoints in the docs, as it doesn't belong here (there is a link to the html threat feed on the home page).
This commit is contained in:
Ryan Smith
2025-03-07 13:34:41 -08:00
parent 3e72919170
commit 96b5be5758
5 changed files with 475 additions and 277 deletions

View File

@@ -303,6 +303,15 @@ func handleHome(w http.ResponseWriter, r *http.Request) {
}
}
func handleDocs(w http.ResponseWriter, r *http.Request) {
tmpl := template.Must(template.ParseFS(templates, "templates/docs.html"))
err := tmpl.Execute(w, nil)
if err != nil {
fmt.Fprintln(os.Stderr, "Failed to parse /docs template:", err)
return
}
}
// handleHTML returns the threat feed as a web page for viewing in a browser.
func handleHTML(w http.ResponseWriter, r *http.Request) {
opt, err := parseParams(r)

View File

@@ -54,10 +54,11 @@ func Start(c *config.Config) {
mux := http.NewServeMux()
mux.HandleFunc("GET /", enforcePrivateIP(handleNotFound))
mux.HandleFunc("GET /{$}", enforcePrivateIP(handleHome))
mux.HandleFunc("GET /feed", enforcePrivateIP(disableCache(handlePlain)))
mux.HandleFunc("GET /docs", enforcePrivateIP(handleDocs))
// Threat feed handlers.
mux.HandleFunc("GET /threatfeed", enforcePrivateIP(disableCache(handleHTML)))
mux.HandleFunc("GET /plain", enforcePrivateIP(disableCache(handlePlain)))
mux.HandleFunc("GET /csv", enforcePrivateIP(disableCache(handleCSV)))
mux.HandleFunc("GET /html", enforcePrivateIP(disableCache(handleHTML)))
mux.HandleFunc("GET /json", enforcePrivateIP(disableCache(handleJSON)))
mux.HandleFunc("GET /stix", enforcePrivateIP(disableCache(handleSTIX)))
// TAXII 2.1 handlers.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -25,8 +25,7 @@
/* Logo */
/* ==== */
.logo {
max-height: 63px;
max-width: 370px;
max-width: 280px;
}
/* ====== */
@@ -124,13 +123,13 @@
}
a:hover {
color: #ffac11;
color: #fa1;
text-decoration: underline;
text-underline-offset: .1875rem;
}
a:active {
background: #ffac11;
background: #fa1;
color: black;
text-decoration: none;
}