mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
chore: update caddy configuration
This commit is contained in:
+32
-12
@@ -1,20 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Exit immediately if a command exits with a non-zero status.
|
||||
set -e
|
||||
|
||||
# Initialize IPFS
|
||||
ipfs init
|
||||
|
||||
# Optimize local discovery and connectivity
|
||||
ipfs config --json Discovery.MDNS.Enabled true
|
||||
ipfs config --json Routing.Type "dhtclient"
|
||||
ipfs config --json Swarm.ConnMgr.LowWater 200
|
||||
ipfs config --json Swarm.ConnMgr.HighWater 500
|
||||
|
||||
# Set up the Cloudflare IPFS gateway peers
|
||||
ipfs config --json Peering.Peers '[
|
||||
{"ID": "QmcFf2FH3CEgTNHeMRGhN7HNHU1EXAxoEk6EFuSyXCsvRE", "Addrs": ["/dnsaddr/node-1.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcFmLd5ySfk2WZuJ1mfSWLDjdmHZq7rSAua4GoeSQfs1z", "Addrs": ["/dnsaddr/node-2.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcfFmzSDVbwexQ9Au2pt5YEXHK5xajwgaU6PpkbLWerMa", "Addrs": ["/dnsaddr/node-3.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcfJeB3Js1FG7T8YaZATEiaHqNKVdQfybYYkbT1knUswx", "Addrs": ["/dnsaddr/node-4.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcfVvzK4tMdFmpJjEKDUoqRgP4W9FnmJoziYX5GXJJ8eZ", "Addrs": ["/dnsaddr/node-5.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcfZD3VKrUxyP9BbyUnZDpbqDnT7cQ4WjPP8TRLXaoE7G", "Addrs": ["/dnsaddr/node-6.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcfZP2LuW4jxviTeG8fi28qjnZScACb8PEgHAc17ZEri3", "Addrs": ["/dnsaddr/node-7.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcfgsJsMtx6qJb74akCw1M24X1zFwgGo11h1cuhwQjtJP", "Addrs": ["/dnsaddr/node-8.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "Qmcfr2FC7pFzJbTSDfYaSy1J8Uuy8ccGLeLyqJCKJvTHMi", "Addrs": ["/dnsaddr/node-9.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcfR3V5YAtHBzxVACWCzXTt26SyEkxdwhGJ6875A8BuWx", "Addrs": ["/dnsaddr/node-10.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "Qmcfuo1TM9uUiJp6dTbm915Rf1aTqm3a3dnmCdDQLHgvL5", "Addrs": ["/dnsaddr/node-11.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcfV2sg9zaq7UUHVCGuSvT2M2rnLBAPsiE79vVyK3Cuev", "Addrs": ["/dnsaddr/node-12.ingress.cloudflare-ipfs.com"]}
|
||||
{"ID": "QmcFf2FH3CEgTNHeMRGhN7HNHU1EXAxoEk6EFuSyXCsvRE", "Addrs": ["/dnsaddr/node-1.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcFmLd5ySfk2WZuJ1mfSWLDjdmHZq7rSAua4GoeSQfs1z", "Addrs": ["/dnsaddr/node-2.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcfFmzSDVbwexQ9Au2pt5YEXHK5xajwgaU6PpkbLWerMa", "Addrs": ["/dnsaddr/node-3.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcfJeB3Js1FG7T8YaZATEiaHqNKVdQfybYYkbT1knUswx", "Addrs": ["/dnsaddr/node-4.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcfVvzK4tMdFmpJjEKDUoqRgP4W9FnmJoziYX5GXJJ8eZ", "Addrs": ["/dnsaddr/node-5.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcfZD3VKrUxyP9BbyUnZDpbqDnT7cQ4WjPP8TRLXaoE7G", "Addrs": ["/dnsaddr/node-6.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcfZP2LuW4jxviTeG8fi28qjnZScACb8PEgHAc17ZEri3", "Addrs": ["/dnsaddr/node-7.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcfgsJsMtx6qJb74akCw1M24X1zFwgGo11h1cuhwQjtJP", "Addrs": ["/dnsaddr/node-8.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "Qmcfr2FC7pFzJbTSDfYaSy1J8Uuy8ccGLeLyqJCKJvTHMi", "Addrs": ["/dnsaddr/node-9.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcfR3V5YAtHBzxVACWCzXTt26SyEkxdwhGJ6875A8BuWx", "Addrs": ["/dnsaddr/node-10.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "Qmcfuo1TM9uUiJp6dTbm915Rf1aTqm3a3dnmCdDQLHgvL5", "Addrs": ["/dnsaddr/node-11.ingress.cloudflare-ipfs.com"]},
|
||||
{"ID": "QmcfV2sg9zaq7UUHVCGuSvT2M2rnLBAPsiE79vVyK3Cuev", "Addrs": ["/dnsaddr/node-12.ingress.cloudflare-ipfs.com"]}
|
||||
]'
|
||||
|
||||
# Configure API and Gateway addresses to listen on localhost only
|
||||
ipfs config Addresses.API /ip4/127.0.0.1/tcp/5001
|
||||
ipfs config Addresses.Gateway /ip4/127.0.0.1/tcp/8080
|
||||
|
||||
# Enable experimental features
|
||||
ipfs config --json Experimental.FilestoreEnabled true
|
||||
ipfs config --json Experimental.UrlstoreEnabled true
|
||||
|
||||
# Start the IPFS daemon with additional options for better performance and compatibility
|
||||
ipfs daemon --enable-gc --migrate --enable-pubsub-experiment --enable-namesys-pubsub
|
||||
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Exit immediately if a command exits with a non-zero status.
|
||||
set -e
|
||||
|
||||
# Function to check if a command exists.
|
||||
command_exists() {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
echo "Starting the build process for Caddy with Cloudflare DNS module..."
|
||||
|
||||
# Check if Go is installed
|
||||
if ! command_exists go; then
|
||||
echo "Go is not installed. Please install Go before running this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set Go environment variables
|
||||
export GOPATH=$(go env GOPATH)
|
||||
export GOBIN=$GOPATH/bin
|
||||
export PATH=$PATH:$GOBIN
|
||||
|
||||
# Install xcaddy if not present
|
||||
if ! command_exists xcaddy; then
|
||||
echo "xcaddy not found. Installing xcaddy..."
|
||||
curl -sSfL https://raw.githubusercontent.com/caddyserver/xcaddy/master/install.sh | bash -s -- -b $GOBIN
|
||||
fi
|
||||
|
||||
# Build Caddy with the Cloudflare DNS module
|
||||
echo "Building Caddy with the Cloudflare DNS module..."
|
||||
xcaddy build --with github.com/caddy-dns/cloudflare
|
||||
mv caddy ../build/caddy
|
||||
echo "Caddy has been built successfully with the Cloudflare DNS module."
|
||||
|
||||
# Optional: Move the caddy binary to /usr/local/bin (requires sudo)
|
||||
# echo "Moving caddy to /usr/local/bin (requires sudo)..."
|
||||
# sudo mv caddy /usr/local/bin/
|
||||
|
||||
# echo "Caddy has been installed to /usr/local/bin."
|
||||
Reference in New Issue
Block a user