-
-
Notifications
You must be signed in to change notification settings - Fork 12
Running the project
Building and running rsslay its easy and there are several options to do so! The options are the following:
- From source
- With Docker
- Pulling the image from Docker Hub or GitHub packages
- Building the image from source
- It's necessary to have gcc due to CGO (more info)
- Go v1.20.0
-
Clone this repository (or fork it).
-
Set the
SECRET
environment variable (a random string to be used to generate virtual private keys). -
Set the following flags (may differ per environment):
export CGO_ENABLED=1 export GOARCH=amd64 export GOOS=linux
-
Proceed to build the binary with the following command:
go build -ldflags="-s -w -linkmode external -extldflags '-static'" -o ./rsslay cmd/rsslay/main.go
Or if you prefer make, just execute
make
👾 -
Run the relay!
./rsslay
Note: it will create a local database file to store the currently known RSS feed URLs.
-
SECRET
: mandatory, a random string to be used to generate virtual private keys. -
DB_DIR
: path with filename where the database should be created, defaults to.\db\rsslay.sqlite
. -
DEFAULT_PROFILE_PICTURE_URL
: default profile picture URL for feeds that don't have an image. -
REPLAY_TO_RELAYS
: set to true if you want to send the fetched events to other relays defined inRELAYS_TO_PUBLISH_TO
(default is false) -
RELAYS_TO_PUBLISH_TO
: string with relays separated by,
to re-publish events to in formatwss://[URL],wss://[URL2]
whereURL
andURL2
are URLs of valid relays (default is empty) -
DEFAULT_WAIT_TIME_BETWEEN_BATCHES
: default time to wait between sending batches of requests to other relays in milliseconds (default 60000, 60 seconds) -
DEFAULT_WAIT_TIME_FOR_RELAY_RESPONSE
: default time to wait for relay response for possible auth event in milliseconds (default is 3000, 3 seconds). -
MAX_EVENTS_TO_REPLAY
: maximum number of events to send to a relay inRELAYS_TO_PUBLISH_TO
in a batch -
ENABLE_AUTO_NIP05_REGISTRATION
: enables NIP-05 automatic registration for all feed profiles in the format[URL]@[MAIN_DOMAIN_NAME]
where URL is the main URL for the feed andMAIN_DOMAIN_NAME
the below environment variable (defaultfalse
) -
MAIN_DOMAIN_NAME
: main domain name where this relay will be available (only for NIP-05 purposes if enabled withENABLE_AUTO_NIP05_REGISTRATION
) -
OWNER_PUBLIC_KEY
: public key to show at the/.well-known/nostr.json
endpoint by default mapped as the domain owner (_@[MAIN_DOMAIN_NAME]
whereMAIN_DOMAIN_NAME
is the environment variable) -
MAX_SUBROUTINES
: maximum number to maintain in order to replay events to other relays (to prevent crash, default 20) -
INFO_RELAY_NAME
: relay name to inform for NIP-11 requests (defaults to "rsslay") -
INFO_CONTACT
: contact URI (schemesmailto
orhttps
to provide users with a means of contact) to inform for NIP-11 requests (defaults to "~") -
MAX_CONTENT_LENGTH
: maximum number of characters to limit the description to (defaults to 250 characters max, not counting title, links and comments link). It is recommended to not exceed 15.000 characters due to some known relays defaults (which may vary by relay operators configurations).
The Docker image for this project is published in GitHub Packages and Docker Hub, so you can directly pull the image from that feeds.
Nevertheless, you can always use the git repository and its source code to build and run it by yourself.
- Pull the image from GitHub or Docker Hub (both are the same):
# From GitHub (you can change the tag to a specific version) docker pull ghcr.io/piraces/rsslay:latest
# From DockerHub (you can change the tag to a specific version) docker pull piraces/rsslay:latest
- Copy the
.env.sample
file to.env
and replace the variable values as needed. - Run the final image!
# This will run in "detached" mode exposing the port 8080, change the port as needed # In case you downloaded the image from DockerHub docker run -d --env-file .env -p 8080:8080 --name rsslay piraces/rsslay:latest # If you downloaded the image from GitHub docker run -d --env-file .env -p 8080:8080 --name rsslay ghcr.io/piraces/rsslay:latest
- Now you can access the instance in
localhost:8080
(or other port you choose).
Note: you can skip step 2 and 3 from below and directly go and run:
docker build github.com/piraces/rsslay -t rsslay
- Make sure you have already installed Docker.
- Clone this repository (or fork it).
- Perform a docker build:
docker build . -t rsslay
- Copy the
.env.sample
file to.env
and replace the variable values as needed. - Run the final image!
# This will run in "detached" mode exposing the port 8080, change the port as needed docker run -d --env-file .env -p 8080:8080 --name rsslay rsslay
- Now you can access the instance in
localhost:8080
(or other port you choose).
Feel free to open an issue, provide feedback in discussions, or fork the repo and open a PR with your contribution!
All kinds of contributions are welcome!
You can also donate for development ⚡: https://getalby.com/p/piraces
You can reach me on nostr npub1ftpy6thgy2354xypal6jd0m37wtsgsvcxljvzje5vskc9cg3a5usexrrtq
Also on the bird site, and Mastodon.