feat: Added permalink header

This commit is contained in:
Christian Ditaputratama 2024-11-06 18:00:25 +07:00
parent fb6f6c2b5c
commit 3beb3ba60e
No known key found for this signature in database
GPG key ID: 31D3D06D77950979
4 changed files with 15 additions and 6 deletions

View file

@ -12,6 +12,7 @@ IPV6_CAPABLE=false
# Server Config
# #############
APP_URL="https://xmr.ditatompel.com" # URL where user can access the web UI, don't put trailing slash
# Fiber Config
APP_PREFORK=false

View file

@ -13,6 +13,9 @@ type App struct {
LogLevel string
// configuration for server
URL string // URL where user can access the web UI, don't put trailing slash
// fiber specific config
Prefork bool
Host string
Port int
@ -55,6 +58,9 @@ func LoadApp() {
}
// server configuration
app.URL = os.Getenv("APP_URL")
// fiber specific config
app.Host = os.Getenv("APP_HOST")
app.Port, _ = strconv.Atoi(os.Getenv("APP_PORT"))
app.Prefork, _ = strconv.ParseBool(os.Getenv("APP_PREFORK"))

View file

@ -20,7 +20,7 @@ func (s *fiberServer) homeHandler(c *fiber.Ctx) error {
Description: "A website that helps you monitor your favourite Monero remote nodes, but YOU BETTER RUN AND USE YOUR OWN NODE.",
Keywords: "monero,monero,xmr,monero node,xmrnode,cryptocurrency,monero remote node,monero testnet,monero stagenet",
Robots: "INDEX,FOLLOW",
Permalink: "https://xmr.ditatompel.com",
Permalink: s.url,
Identifier: "/",
}
@ -61,7 +61,7 @@ func (s *fiberServer) addNodeHandler(c *fiber.Ctx) error {
Description: "You can use this page to add known remote node to the system so my bots can monitor it.",
Keywords: "monero,monero node,monero public node,monero wallet,list monero node,monero node monitoring",
Robots: "INDEX,FOLLOW",
Permalink: "https://xmr.ditatompel.com/add-node",
Permalink: s.url + "/add-node",
Identifier: "/add-node",
}
@ -115,7 +115,7 @@ func (s *fiberServer) remoteNodesHandler(c *fiber.Ctx) error {
Description: "Although it's possible to use these existing public Monero nodes, you're MUST RUN AND USE YOUR OWN NODE!",
Keywords: "monero remote nodes,public monero nodes,monero public nodes,monero wallet,tor monero node,monero cors rpc",
Robots: "INDEX,FOLLOW",
Permalink: "https://xmr.ditatompel.com/remote-nodes",
Permalink: s.url + "/remote-nodes",
Identifier: "/remote-nodes",
}
@ -241,7 +241,7 @@ func (s *fiberServer) nodeHandler(c *fiber.Ctx) error {
Description: fmt.Sprintf("Monero %s remote node %s running on port %d", node.Nettype, node.Hostname, node.Port),
Keywords: fmt.Sprintf("monero log,monero node log,monitoring monero log,monero,xmr,monero node,xmrnode,cryptocurrency,monero %s,%s", node.Nettype, node.Hostname),
Robots: "INDEX,FOLLOW",
Permalink: fmt.Sprintf("https://xmr.ditatompel.com/remote-nodes/id/%d", node.ID),
Permalink: s.url + "/remote-nodes/id/" + strconv.Itoa(int(node.ID)),
Identifier: "/remote-nodes",
}

View file

@ -9,6 +9,7 @@ import (
type fiberServer struct {
*fiber.App
db *database.DB
url string
}
// NewServer returns a new fiber server
@ -23,6 +24,7 @@ func NewServer() *fiberServer {
AppName: "XMR Nodes Aggregator " + config.Version,
}),
db: database.GetDB(),
url: config.AppCfg().URL,
}
return server