Skip to content

Commit

Permalink
limit metric display
Browse files Browse the repository at this point in the history
  • Loading branch information
trinidz committed Nov 25, 2024
1 parent d75a429 commit 7b02056
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
rssnotes is a nostr relay that functions as an rss to nostr bridge by creating nostr profiles and notes for RSS feeds. rssnotes is a read only relay. rssnotes is a fork of [rsslay](https://github.com/piraces/rsslay).

## Features

- Convert RSS feeds into Nostr profiles.
- Creates a pubkey, npubkey and QR code for each RSS feed profile that you can use to follow the RSS feed on nostr.
- The rssnotes relay also has its own pubkey. The rssnotes relay pubkey automatically follows all of the rss feed profiles. So if you login to nostr as the rssnotes relay you will see all of your RSS feeds.
- Option to import and export multiple RSS feeds at once using an opml file.
- Option to automatically delete old notes.
- Selection of relay metrics dislayed on main page. (Metrics are per session and will reset if relay is reset.)
- Selection of relay metrics dislayed on main page. (Metrics are per session and will reset if relay is restarted.)
- Prometheus metrics available on /metrics path.
- Search bar
- Relay logs exposed on the /log path.
Expand Down
2 changes: 1 addition & 1 deletion feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func checkAllFeeds() {

parsedFeed, entity := parseFeedForPubkey(currentEntity.PubKey, s.DeleteFailingFeeds)
if parsedFeed == nil {
return
continue
}

if err := createMetadataNote(currentEntity.PubKey, currentEntity.PrivateKey, parsedFeed, s.DefaultProfilePicUrl); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ func getPrometheusMetric(promParam *prometheus.Desc) string {
log.Print("[ERROR]", err)
return "?"
}
if countInt > 9999 {
if countInt < 0 || countInt > 9999 {
return "+9999"
}
return count
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type Settings struct {
RelayIcon string `envconfig:"RELAY_ICON" default:"https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/commafeed.png"`
RandomSecret string `envconfig:"RANDOM_SECRET" required:"true"`
OwnerPubkey string `envconfig:"OWNER_PUBKEY"`
Version string `envconfig:"VERSION" default:"0.0.8"`
Version string `envconfig:"VERSION" default:"0.0.10"`

LogLevel string `envconfig:"LOG_LEVEL" default:"WARN"`
Port string `envconfig:"PORT" default:"3334"`
Expand Down
9 changes: 6 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
BINARY_NAME := rssnotes
GIT_TAG := $(shell git describe --tags)

build:
@go build -o bin/rssnotes
@go build -o bin/$(BINARY_NAME)

run: build
@./bin/rssnotes
@./bin/$(BINARY_NAME)

new: build
@go build -o bin/rssnotes && ./bin/rssnotes
@go build -o bin/$(BINARY_NAME) && ./bin/$(BINARY_NAME)

test:
@go test -v ./...

0 comments on commit 7b02056

Please sign in to comment.