mirror of
https://github.com/r-smith/deceptifeed.git
synced 2025-11-02 05:03:42 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
425
internal/threatfeed/templates/docs.html
Normal file
425
internal/threatfeed/templates/docs.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user