-
@ Notoshi⚡
2024-10-18 08:05:37Strfry เป็นซอฟต์แวร์รีเลย์ที่ส่วนใหญ่เลือกจะติดตั้งใช้งานงานกันเนืองจากมันถูกเขียนด้วยภาษา C++ ทำให้รีเลย์มีขนาดที่เบาไม่กินทรัพยากรเครื่องมากอีกข้อดีคือรองรับ nip เยอะพอสมควร
ถ้าเราอยากจะเป็นเจ้ารีเลย์ Strfry บ้างล่ะต้องทำยังไง
วิธีติดตั้งรีเลย์ Strfry โดยใช้ Docker
อย่าลืมติดตั้ง Docker ให้เรียบร้อยก่อน
ดาวน์โหลดไฟล์ strfry.conf และโฟรเดอร์ strfry-db
git clone https://github.com/notoshi404/nostr-relay-docker.git
cd nostr-relay-docker/strfry
แก้ไขไฟล์ strfry.confsudo nano strfry.conf
``` . . relay { # Interface to listen on. Use 0.0.0.0 to listen on all interfaces (restart required) bind = "0.0.0.0"# Port to open for the nostr websocket protocol (restart required) port = 7777 # Set OS-limit on maximum number of open files/sockets (if 0, don't attempt to set) (restart required) nofiles = 0 # HTTP header that contains the client's real IP, before reverse proxying (ie x-real-ip) (MUST be all lower-case) realIpHeader = "" info { # NIP-11: Name of this server. Short/descriptive (< 30 characters) name = "strfry" # NIP-11: Detailed information about relay, free-form description = "This is a strfry instance." # NIP-11: Administrative nostr pubkey, for contact purposes pubkey = "[Public_Key(hex)]" # NIP-11: Alternative administrative contact (email, website, etc) contact = "" # NIP-11: URL pointing to an image to be used as an icon for the relay icon = "" # List of supported lists as JSON array, or empty string to use default. Example: [1,2] nips = "" }
. . ```
docker-compose.yaml
services: strfry: container_name: strfry image: notoshi/strfry # original dockurr/strfry ports: - 7777:7777 volumes: - ./strfry-db:/app/strfry-db - ./strfry.conf:/etc/strfry.conf
docker pull notoshi/strfry
docker compose up -d
เพียงเท่านี้เราก็ได้รีเลย์แล้วถ้าใครอยากเปิดเป็น public ให้เพื่อน ๆ ใช้ด้วยอย่าลืมทำ proxy ใน nginx หรือใครไม่มี publicIP ก็ใช้ cloudflare tunnel ช่วยได้
มีข้อมูลจุดไหนผิดพลาดต้องขออภัยไว้ ณ ที่นี้ด้วยช่วยเสริมพูดคุยกันได้
หวังว่าบทความนี้จะเป็นประโยชน์ แล้วเจอกันใหม่ในครั้งจะพาทำเรื่องอะไรนั้นรอติดตามกัน
NOT YOUR RELAY NOT YOUR DATA
siamstr #nostr #relay