diff --git a/nostr-relay/data/relay/config.toml b/nostr-relay/data/relay/config.toml new file mode 100644 index 00000000..b09da5c7 --- /dev/null +++ b/nostr-relay/data/relay/config.toml @@ -0,0 +1,154 @@ +# Nostr-rs-relay configuration + +[info] +# The advertised URL for the Nostr websocket. +# relay_url = "wss://nostr.example.com/" + +# Relay information for clients. Put your unique server name here. +name = "Umbrel Nostr Relay" + +# Description +description = "A Nostr Relay running on Umbrel" + +# Administrative contact pubkey +#pubkey = "0c2d168a4ae8ca58c9f1ab237b5df682599c6c7ab74307ea8b05684b60405d41" + +# Administrative contact URI +#contact = "mailto:contact@example.com" + +[diagnostics] +# Enable tokio tracing (for use with tokio-console) +#tracing = false + +[database] +# Database engine (sqlite/postgres). Defaults to sqlite. +# Support for postgres is currently experimental. +#engine = "sqlite" + +# Directory for SQLite files. Defaults to the current directory. Can +# also be specified (and overriden) with the "--db dirname" command +# line option. +#data_directory = "." + +# Use an in-memory database instead of 'nostr.db'. +# Requires sqlite engine. +# Caution; this will not survive a process restart! +#in_memory = false + +# Database connection pool settings for subscribers: + +# Minimum number of SQLite reader connections +#min_conn = 4 + +# Maximum number of SQLite reader connections. Recommend setting this +# to approx the number of cores. +#max_conn = 8 + +# Database connection string. Required for postgres; not used for +# sqlite. +#connection = "postgresql://postgres:nostr@localhost:7500/nostr" + +[network] +# Bind to this network address +address = "0.0.0.0" + +# Listen on this port +port = 8080 + +# If present, read this HTTP header for logging client IP addresses. +# Examples for common proxies, cloudflare: +#remote_ip_header = "x-forwarded-for" +#remote_ip_header = "cf-connecting-ip" + +# Websocket ping interval in seconds, defaults to 5 minutes +#ping_interval = 300 + +[options] +# Reject events that have timestamps greater than this many seconds in +# the future. Recommended to reject anything greater than 30 minutes +# from the current time, but the default is to allow any date. +reject_future_seconds = 1800 + +[limits] +# Limit events created per second, averaged over one minute. Must be +# an integer. If not set (or set to 0), there is no limit. Note: +# this is for the server as a whole, not per-connection. +# +# Limiting event creation is highly recommended if your relay is +# public! +# +#messages_per_sec = 5 + +# Limit client subscriptions created per second, averaged over one +# minute. Must be an integer. If not set (or set to 0), defaults to +# unlimited. Strongly recommended to set this to a low value such as +# 10 to ensure fair service. +#subscriptions_per_min = 0 + +# UNIMPLEMENTED... +# Limit how many concurrent database connections a client can have. +# This prevents a single client from starting too many expensive +# database queries. Must be an integer. If not set (or set to 0), +# defaults to unlimited (subject to subscription limits). +#db_conns_per_client = 0 + +# Limit blocking threads used for database connections. Defaults to 16. +#max_blocking_threads = 16 + +# Limit the maximum size of an EVENT message. Defaults to 128 KB. +# Set to 0 for unlimited. +#max_event_bytes = 131072 + +# Maximum WebSocket message in bytes. Defaults to 128 KB. +#max_ws_message_bytes = 131072 + +# Maximum WebSocket frame size in bytes. Defaults to 128 KB. +#max_ws_frame_bytes = 131072 + +# Broadcast buffer size, in number of events. This prevents slow +# readers from consuming memory. +#broadcast_buffer = 16384 + +# Event persistence buffer size, in number of events. This provides +# backpressure to senders if writes are slow. +#event_persist_buffer = 4096 + +# Event kind blacklist. Events with these kinds will be discarded. +#event_kind_blacklist = [ +# 70202, +#] + +[authorization] +# Pubkey addresses in this array are whitelisted for event publishing. +# Only valid events by these authors will be accepted, if the variable +# is set. +#pubkey_whitelist = [ +# "35d26e4690cbe1a898af61cc3515661eb5fa763b57bd0b42e45099c8b32fd50f", +# "887645fef0ce0c3c1218d2f5d8e6132a19304cdc57cd20281d082f38cfea0072", +#] + +[verified_users] +# NIP-05 verification of users. Can be "enabled" to require NIP-05 +# metadata for event authors, "passive" to perform validation but +# never block publishing, or "disabled" to do nothing. +#mode = "disabled" + +# Domain names that will be prevented from publishing events. +#domain_blacklist = ["wellorder.net"] + +# Domain names that are allowed to publish events. If defined, only +# events NIP-05 verified authors at these domains are persisted. +#domain_whitelist = ["example.com"] + +# Consider an pubkey "verified" if we have a successful validation +# from the NIP-05 domain within this amount of time. Note, if the +# domain provides a successful response that omits the account, +# verification is immediately revoked. +#verify_expiration = "1 week" + +# How long to wait between verification attempts for a specific author. +#verify_update_frequency = "24 hours" + +# How many consecutive failed checks before we give up on verifying +# this author. +#max_consecutive_failures = 20 diff --git a/nostr-relay/data/relay/db/.gitkeep b/nostr-relay/data/relay/db/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/nostr-relay/docker-compose.yml b/nostr-relay/docker-compose.yml new file mode 100644 index 00000000..6221a21e --- /dev/null +++ b/nostr-relay/docker-compose.yml @@ -0,0 +1,24 @@ +version: "3.7" + +services: + app_proxy: + environment: + APP_HOST: nostr-relay_web_1 + APP_PORT: 3000 + PROXY_AUTH_ADD: "false" + + web: + image: getumbrel/umbrel-nostr-relay:v0.1.0@sha256:1c3c2b0563e567258a37e75e5c98028dce02503e522d29914b2a34e6d2eb3421 + user: "1000:1000" + restart: on-failure + environment: + RELAY_HOST: "nostr-relay_relay_1" + RELAY_PORT: "8080" + + relay: + image: getumbrel/nostr-rs-relay:0.8.1@sha256:a6c857aecd4964bf058ec5c3c0fea95e0d87ed0cc789f2140f96de108e5515ec + user: "1000:1000" + restart: on-failure + volumes: + - ${APP_DATA_DIR}/data/relay/config.toml:/app/config.toml + - ${APP_DATA_DIR}/data/relay/db:/app/db diff --git a/nostr-relay/umbrel-app.yml b/nostr-relay/umbrel-app.yml new file mode 100644 index 00000000..e16c40b7 --- /dev/null +++ b/nostr-relay/umbrel-app.yml @@ -0,0 +1,36 @@ +manifestVersion: 1 +id: nostr-relay +category: Networking +name: Nostr Relay +version: "1.0.0" +tagline: Backup all your Nostr activity with your private relay +description: > + Introducing Nostr Relay — an official app by Umbrel. + + + Connect your Nostr clients, such as Damus, Astral, and Amethyst, to your private relay for seamless backup of all your activity on Nostr. This ensures that your activity is not lost even if you are censored or blocked by public relays. + + + In Damus, go to Settings > Relays to add your Relay URL. + + + Tip: Install Tailscale on your Umbrel and your devices for an uninterrupted connection between your clients and your relay, even when you're away from your home network. Enable Tailscale's MagicDNS and use ws://umbrel:4848 as your Relay URL. + + + Nostr Relay is powered by the open source nostr-rs-relay project — a Rust implementation of Nostr relay. It currently supports the entire relay protocol, including NIP-01, NIP-02, NIP-03, NIP-05, NIP-09, NIP-11, NIP-12, NIP-15, NIP-16, NIP-20, NIP-22, NIP-26, NIP-28, and NIP-33. +releaseNotes: "" +developer: Umbrel +website: https://umbrel.com +dependencies: [] +repo: https://github.com/getumbrel/umbrel-nostr-relay +support: https://community.getumbrel.com +port: 4848 +gallery: + - 1.jpg + - 2.jpg + - 3.jpg +path: "" +deterministicPassword: false +torOnly: false +submitter: Umbrel +submission: https://github.com/getumbrel/umbrel-apps/pull/398 \ No newline at end of file