Compare commits

...

4 Commits

Author SHA1 Message Date
8df7c00a14 Add relay icon 2024-10-16 12:42:03 +02:00
1f34459091 Upgrade strfry to 1.0.1 2024-10-16 12:41:51 +02:00
a4756377b4 Add stryfry policy option 2024-06-11 22:55:51 +02:00
65b6d65527 Only run compilation when source code is updated 2024-06-08 17:13:51 +02:00
3 changed files with 18 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
node.default["strfry"]["repo"] = "https://github.com/hoytech/strfry.git" node.default["strfry"]["repo"] = "https://github.com/hoytech/strfry.git"
node.default["strfry"]["revision"] = "master" node.default["strfry"]["revision"] = "1.0.1"
node.default["strfry"]["download_url"] = nil node.default["strfry"]["download_url"] = nil
node.default["strfry"]["checksum"] = nil node.default["strfry"]["checksum"] = nil
node.default["strfry"]["user"] = "strfry" node.default["strfry"]["user"] = "strfry"
@@ -8,3 +8,4 @@ node.default["strfry"]["db_path"] = "/var/lib/strfry"
node.default["strfry"]["bind_ip"] = "0.0.0.0" node.default["strfry"]["bind_ip"] = "0.0.0.0"
node.default["strfry"]["real_ip_header"] = "" node.default["strfry"]["real_ip_header"] = ""
node.default["strfry"]["info"] = {} node.default["strfry"]["info"] = {}
node.default["strfry"]["policy_path"] = ""

View File

@@ -40,7 +40,7 @@ else
execute "compile" do execute "compile" do
cwd "/usr/local/src/strfry" cwd "/usr/local/src/strfry"
command "make setup-golpe && make -j$(nproc)" command "make setup-golpe && make -j$(nproc)"
# action :nothing action :nothing
notifies :create, "link[/usr/local/bin/strfry]", :immediately notifies :create, "link[/usr/local/bin/strfry]", :immediately
notifies :restart, "service[strfry]", :delayed notifies :restart, "service[strfry]", :delayed
end end
@@ -55,8 +55,8 @@ group node["strfry"]["group"]
user node["strfry"]["user"] do user node["strfry"]["user"] do
gid node["strfry"]["group"] gid node["strfry"]["group"]
manage_home false manage_home true
shell "/usr/sbin/nologin" shell "/bin/bash"
end end
directory node["strfry"]["db_path"] do directory node["strfry"]["db_path"] do
@@ -76,7 +76,8 @@ template "/etc/strfry.conf" do
real_ip_header: node["strfry"]["real_ip_header"], real_ip_header: node["strfry"]["real_ip_header"],
port: node["strfry"]["port"], port: node["strfry"]["port"],
nofiles: node["strfry"]["nofiles"], nofiles: node["strfry"]["nofiles"],
info: node["strfry"]["info"] info: node["strfry"]["info"],
policy_path: node["strfry"]["policy_path"]
} }
notifies :restart, "service[strfry]", :delayed notifies :restart, "service[strfry]", :delayed
end end
@@ -97,7 +98,7 @@ systemd_unit "strfry.service" do
ExecStart: "/usr/local/bin/strfry relay", ExecStart: "/usr/local/bin/strfry relay",
Restart: "on-failure", Restart: "on-failure",
RestartSec: "5", RestartSec: "5",
ProtectHome: "yes", ProtectHome: "no",
NoNewPrivileges: "yes", NoNewPrivileges: "yes",
ProtectSystem: "full", ProtectSystem: "full",
LimitCORE: "1000000000" LimitCORE: "1000000000"

View File

@@ -48,18 +48,22 @@ relay {
# HTTP header that contains the client's real IP, before reverse proxying (ie x-real-ip) (MUST be all lower-case) # HTTP header that contains the client's real IP, before reverse proxying (ie x-real-ip) (MUST be all lower-case)
realIpHeader = "<%= @config[:real_ip_header] %>" realIpHeader = "<%= @config[:real_ip_header] %>"
# NIP-11
info { info {
# NIP-11: Name of this server. Short/descriptive (< 30 characters) # Name of this server. Short/descriptive (< 30 characters)
name = "<%= @config[:info][:name] || "strfry default" %>" name = "<%= @config[:info][:name] || "strfry default" %>"
# NIP-11: Detailed information about relay, free-form # Detailed information about relay, free-form
description = "<%= @config[:info][:description] || "This is a strfry instance." %>" description = "<%= @config[:info][:description] || "This is a strfry instance." %>"
# NIP-11: Administrative nostr pubkey, for contact purposes # Administrative nostr pubkey, for contact purposes
pubkey = "<%= @config[:info][:pubkey] || "" %>" pubkey = "<%= @config[:info][:pubkey] || "" %>"
# NIP-11: Alternative administrative contact (email, website, etc) # Alternative administrative contact (email, website, etc)
contact = "<%= @config[:info][:contact] || "" %>" contact = "<%= @config[:info][:contact] || "" %>"
# URL pointing to an image to be used as an icon for the relay
icon = "<%= @config[:info][:icon] || "" %>"
} }
# Maximum accepted incoming websocket frame size (should be larger than max event) (restart required) # Maximum accepted incoming websocket frame size (should be larger than max event) (restart required)
@@ -82,7 +86,7 @@ relay {
writePolicy { writePolicy {
# If non-empty, path to an executable script that implements the writePolicy plugin logic # If non-empty, path to an executable script that implements the writePolicy plugin logic
plugin = "" plugin = "<%= @config[:policy_path] %>"
} }
compression { compression {
@@ -95,7 +99,7 @@ relay {
logging { logging {
# Dump all incoming messages # Dump all incoming messages
dumpInAll = false dumpInAll = true
# Dump all incoming EVENT messages # Dump all incoming EVENT messages
dumpInEvents = false dumpInEvents = false