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)
- nip-11 pubkey as bech32 should be rejected or warned or well documented to avoid HOT 2
- Using a Reverse Proxy like e.g. NGINX HOT 3
- strfry distribution channels HOT 2
- Write policy applied to sync? HOT 1
- Large database performance HOT 13
- Document all the secret strfry commands HOT 1
- Can I log the reason for "Request ID too long"? HOT 1
- REQ plugin HOT 1
- Compilation Errors HOT 2
- Trying to install HOT 2
- Dockerfile build fails HOT 1
- MDB_MAP_FULL: Environment mapsize limit reached HOT 5
- Work to change database HOT 2
- NWC events are no longer sent HOT 1
- Crash: page allocation failure HOT 2
- Ubuntu docker build is broken HOT 2
- A question regarding the sync command HOT 2
- Up-to-date docker image in dockerhub HOT 1
- Cron deletes events that are not expired HOT 1
- Importing events from another relay using .jsonl import HOT 4
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.