Comments (5)
As I said in another comment, I want to build a strfry router
that would let you do this with a single plugin. I don't have a timeframe for this, but maybe I can get a basic solution to this problem as a start.
from strfry.
I have pushed a commit that implements strfry router
, and this will be in the next release. Docs are here: https://github.com/hoytech/strfry/blob/master/docs/router.md
I kind of think of this like "nginx for nostr". It lets you manage many up/down/both streams to remote relays using a single process and config file, and you can edit that config file without interrupting existing streams (mostly).
You can also use nostr filters and/or plugins to filter the traffic in both up and down directions, independently.
from strfry.
Just a thought: Templated SystemD units?
# [email protected]
[Unit]
Description=strfry relay: %i
[Service]
ExecStart=/usr/local/bin/strfry stream wss://%i --dir both
[Install]
WantedBy=multi-user.target
Should allow to systemctl start [email protected]
, as %s
is...
the string between the first "@" character and the type suffix. Empty for non-instantiated units.
via: https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Specifiers
This could possibly be extended to depend on a root-service for the actual relay.
Thoughts?
from strfry.
I adapted the Headscale SystemD unit, so this could be a root unit.
[Unit]
After=syslog.target
After=network.target
Description=strfry (Nostr Relay)
[Service]
Type=simple
User=strfry
Group=strfry
ExecStart=/usr/local/bin/strfry relay
Restart=always
RestartSec=5
#If needed, this can be used to pass environment vars.
#Could be useful for passing data and other storage dirs?
#Environment="key=value"
WorkingDirectory=/var/lib/strfry
ReadWritePaths=/var/lib/strfry
AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_CHOWN
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_CHOWN
LockPersonality=true
NoNewPrivileges=true
PrivateDevices=true
PrivateMounts=true
PrivateTmp=true
ProcSubset=pid
ProtectClock=true
ProtectControlGroups=true
ProtectHome=true
ProtectHome=yes
ProtectHostname=true
ProtectKernelLogs=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectProc=invisible
ProtectSystem=strict
RemoveIPC=true
RestrictAddressFamilies=AF_INET AF_INET6
RestrictNamespaces=true
RestrictRealtime=true
RestrictSUIDSGID=true
SystemCallArchitectures=native
SystemCallFilter=@chown
SystemCallFilter=@system-service
SystemCallFilter=~@privileged
UMask=0077
[Install]
WantedBy=multi-user.target
This can be adapted to be a template, as described before, just with an added Requires=strfry.service
in the [Service]
section (as explained here).
Hope this helps :)
from strfry.
@IngwiePhoenix thanks for your effort. It certainly helps to learn about using SystemD but I think it doesn't address well the "many relays" part.
from strfry.
Related Issues (20)
- Compilation fails on alpine 3.19.1
- Add support for icon URL in NIP-11 document
- access reports HOT 2
- What happened to the Docker images? HOT 4
- SIGTERM HOT 3
- Search by tag and tag substring returns no results HOT 1
- NIP-48 support HOT 2
- Relay eventually times out all events when using a writePolicy plugin HOT 3
- Idea integration with strfry HOT 1
- Importing events from another relay using .jsonl import HOT 4
- Feature: retention period HOT 5
- Feature request: NIP-45 Event Count HOT 6
- Build Error HOT 6
- Favicon for relay HOT 1
- Cryptic error messages returned in OK messages HOT 1
- logging controls not documented/working
- docker-compose not working HOT 4
- REQ limit is too low HOT 1
- strify crashes on start HOT 3
- OSX build error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strfry.