Преглед на файлове

replace ircd with darkirc

Dastan-glitch преди 2 години
родител
ревизия
7266011ec1

+ 6 - 7
bin/darkirc/config/inbound.toml

@@ -1,28 +1,28 @@
 ## JSON-RPC listen URL
-rpc_listen="127.0.0.1:1234"
+rpc_listen = "127.0.0.1:1234"
 
 ## IRC listen URL
-irc_listen="127.0.0.1:11067"
+irc_listen = "127.0.0.1:11067"
 
 ## Sets Datastore Path
-datastore="~/.config/ircd-inbound"
+datastore = "~/.config/darkirc-inbound"
 
 ## Raft net settings
 [net]
 ## P2P accept addresses
-inbound=["127.0.0.1:11002"]
+inbound = ["127.0.0.1:11002"]
 
 ## Connection slots
 #outbound_connections=5
 
 ## P2P external addresses
-external_addr=["127.0.0.1:11004"]
+external_addr = ["127.0.0.1:11004"]
 
 ## Peers to connect to
 #peers=["127.0.0.1:11003"]
 
 ## Seed nodes to connect to 
-seeds=["127.0.0.1:11001"]
+seeds = ["127.0.0.1:11001"]
 
 ## these are the default configuration for the p2p network
 #manual_attempt_limit=0
@@ -30,4 +30,3 @@ seeds=["127.0.0.1:11001"]
 #connect_timeout_seconds=10
 #channel_handshake_seconds=4
 #channel_heartbeat_seconds=10
-

+ 5 - 6
bin/darkirc/config/outbound.toml

@@ -1,11 +1,11 @@
 ## JSON-RPC listen URL
-rpc_listen="127.0.0.1:7777"
+rpc_listen = "127.0.0.1:7777"
 
 ## IRC listen URL
-irc_listen="127.0.0.1:11066"
+irc_listen = "127.0.0.1:11066"
 
 ## Sets Datastore Path
-datastore="~/.config/ircd-outbound"
+datastore = "~/.config/darkirc-outbound"
 
 ## Raft net settings
 [net]
@@ -13,7 +13,7 @@ datastore="~/.config/ircd-outbound"
 # inbound=["127.0.0.1:11002"]
 
 ## Connection slots
-outbound_connections=5
+outbound_connections = 5
 
 ## P2P external addresses
 #external_addr=["127.0.0.1:11002"]
@@ -22,7 +22,7 @@ outbound_connections=5
 #peers=["127.0.0.1:11003"]
 
 ## Seed nodes to connect to 
-seeds=["127.0.0.1:11001"]
+seeds = ["127.0.0.1:11001"]
 
 ## these are the default configuration for the p2p network
 #manual_attempt_limit=0
@@ -30,4 +30,3 @@ seeds=["127.0.0.1:11001"]
 #connect_timeout_seconds=10
 #channel_handshake_seconds=4
 #channel_heartbeat_seconds=10
-

+ 4 - 5
bin/darkirc/config/seed.toml

@@ -1,16 +1,16 @@
 ## JSON-RPC listen URL
-rpc_listen="127.0.0.1:8000"
+rpc_listen = "127.0.0.1:8000"
 
 ## IRC listen URL
-irc_listen="127.0.0.1:11065"
+irc_listen = "127.0.0.1:11065"
 
 ## Sets Datastore Path
-datastore="~/.config/ircd-seed"
+datastore = "~/.config/darkirc-seed"
 
 ## Raft net settings
 [net]
 ## P2P accept addresses
-inbound=["127.0.0.1:11001"]
+inbound = ["127.0.0.1:11001"]
 
 ## Connection slots
 # outbound_connections=5
@@ -30,4 +30,3 @@ inbound=["127.0.0.1:11001"]
 #connect_timeout_seconds=10
 #channel_handshake_seconds=4
 #channel_heartbeat_seconds=10
-

+ 2 - 2
bin/darkirc/darkirc_config.toml

@@ -8,10 +8,10 @@
 #irc_listen = "tcp://127.0.0.1:6667"
 
 ## TLS certificate path if IRC acceptor uses TLS (optional)
-#irc_tls_cert = "/etc/letsencrypt/ircd/fullchain.pem"
+#irc_tls_cert = "/etc/letsencrypt/darkirc/fullchain.pem"
 
 ## TLS secret key path if IRC acceptor uses TLS (optional)
-#irc_tls_secret = "/etc/letsencrypt/ircd/privkey.pem"
+#irc_tls_secret = "/etc/letsencrypt/darkirc/privkey.pem"
 
 ## Sets Datastore Path
 #datastore = "~/.local/darkfi/darkirc"

+ 0 - 0
bin/darkirc/script/tmux_session/ircd_full_node1.toml → bin/darkirc/script/tmux_session/darkirc_full_node1.toml


+ 0 - 0
bin/darkirc/script/tmux_session/ircd_full_node2.toml → bin/darkirc/script/tmux_session/darkirc_full_node2.toml


+ 0 - 0
bin/darkirc/script/tmux_session/ircd_full_node3.toml → bin/darkirc/script/tmux_session/darkirc_full_node3.toml


+ 0 - 0
bin/darkirc/script/tmux_session/ircd_full_node4.toml → bin/darkirc/script/tmux_session/darkirc_full_node4.toml


+ 2 - 2
bin/darkirc/script/tmux_session/seed.toml

@@ -11,10 +11,10 @@ datastore = "/tmp/darkirc_test/darkirc_seed"
 autojoin = ["#dev"]
 
 ## TLS certificate path if IRC acceptor uses TLS (optional)
-#irc_tls_cert = "/etc/letsencrypt/ircd/fullchain.pem"
+#irc_tls_cert = "/etc/letsencrypt/darkirc/fullchain.pem"
 
 ## TLS secret key path if IRC acceptor uses TLS (optional)
-#irc_tls_secret = "/etc/letsencrypt/ircd/privkey.pem"
+#irc_tls_secret = "/etc/letsencrypt/darkirc/privkey.pem"
 
 ## P2P net settings
 [net]

+ 1 - 1
bin/tau/tau-cli/src/main.rs

@@ -90,7 +90,7 @@ enum TauSubcommand {
     /// @person1 @person2
     ///
     /// All keys example:
-    ///     tau add Improve CLI desc:"Description here" project:tau,ircd @dave @rusty due:0210 rank:2.2
+    ///     tau add Improve CLI desc:"Description here" project:tau,darkirc @dave @rusty due:0210 rank:2.2
     ///
     #[clap(verbatim_doc_comment)]
     Add {

+ 42 - 0
contrib/localnet/darkirc-four-nodes/darkirc_full_node1.toml

@@ -0,0 +1,42 @@
+## JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:8890"
+
+## IRC listen URL
+irc_listen = "tcp://127.0.0.1:22022"
+
+## Sets Datastore Path
+datastore = "/tmp/darkirc_test/darkirc1"
+
+## List of channels to autojoin for new client connections
+autojoin = ["#dev", "#test"]
+
+## P2P net settings
+[net]
+## Connection slots
+outbound_connections = 3
+
+inbound = ["tcp://127.0.0.1:25552"]
+
+external_addrs = ["tcp://127.0.0.1:25552"]
+
+# peers = []
+
+## Seed nodes to connect to 
+seeds = ["tcp://127.0.0.1:25551"]
+
+# Prefered transports for outbound connections
+allowed_transports = ["tcp"]
+
+localnet = true
+#
+# [channel."#dev"]
+# topic = "DarkFi Development HQ"
+
+[channel."#test"]
+secret = "HoLfk8vXBvNsBZ73e2xRPBZ9vEbnF9FVi4fDdyU9AZLU"
+
+[secret_key."FCFYzvZ98gAncGNadFp35pTAJSuoJKZFddsi12PnREwp"]
+
+[contact."node2"]
+## contact public key
+public_key = "D6UzKA6qCG5Mep16i6pJYkUCQcnp46E1jPBsUhyJiXhb"

+ 42 - 0
contrib/localnet/darkirc-four-nodes/darkirc_full_node2.toml

@@ -0,0 +1,42 @@
+## JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:8891"
+
+## IRC listen URL
+irc_listen = "tcp://127.0.0.1:22023"
+
+## Sets Datastore Path
+datastore = "/tmp/darkirc_test/darkirc2"
+
+## List of channels to autojoin for new client connections
+autojoin = ["#dev", "#test"]
+
+## P2P net settings
+[net]
+## Connection slots
+outbound_connections = 3
+
+inbound = ["tcp://127.0.0.1:25553"]
+
+external_addrs = ["tcp://127.0.0.1:25553"]
+
+# peers = ["tcp://127.0.0.1:25552"]
+
+## Seed nodes to connect to 
+seeds = ["tcp://127.0.0.1:25551"]
+
+# Prefered transports for outbound connections
+allowed_transports = ["tcp"]
+
+localnet = true
+#
+# [channel."#dev"]
+# topic = "DarkFi Development HQ"
+
+[channel."#test"]
+secret = "HoLfk8vXBvNsBZ73e2xRPBZ9vEbnF9FVi4fDdyU9AZLU"
+
+[secret_key."GnS3vqKQtCnbJJcFMsUfTJc7w3B1E49MgZ8jKiksumYh"]
+
+[contact."node1"]
+## contact public key
+public_key = "9sfMEVLphJ4dTX3SEvm6NBhTbWDqfsxu7R2bo88CtV8g"

+ 36 - 0
contrib/localnet/darkirc-four-nodes/darkirc_full_node3.toml

@@ -0,0 +1,36 @@
+## JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:8892"
+
+## IRC listen URL
+irc_listen = "tcp://127.0.0.1:22024"
+
+## Sets Datastore Path
+datastore = "/tmp/darkirc_test/darkirc3"
+
+## List of channels to autojoin for new client connections
+autojoin = ["#dev", "#test"]
+
+## P2P net settings
+[net]
+## Connection slots
+outbound_connections = 3
+
+inbound = ["tcp://127.0.0.1:25554"]
+
+external_addrs = ["tcp://127.0.0.1:25554"]
+
+# peers = ["tcp://127.0.0.1:25552"]
+
+## Seed nodes to connect to 
+seeds = ["tcp://127.0.0.1:25551"]
+
+# Prefered transports for outbound connections
+allowed_transports = ["tcp"]
+
+localnet = true
+#
+# [channel."#dev"]
+# topic = "DarkFi Development HQ"
+
+[channel."#test"]
+secret = "HoLfk8vXBvNsBZ73e2xRPBZ9vEbnF9FVi4fDdyU9AZLU"

+ 36 - 0
contrib/localnet/darkirc-four-nodes/darkirc_full_node4.toml

@@ -0,0 +1,36 @@
+## JSON-RPC listen URL
+rpc_listen = "tcp://127.0.0.1:8893"
+
+## IRC listen URL
+irc_listen = "tcp://127.0.0.1:22025"
+
+## Sets Datastore Path
+datastore = "/tmp/darkirc_test/darkirc4"
+
+## List of channels to autojoin for new client connections
+autojoin = ["#dev", "#test"]
+
+## P2P net settings
+[net]
+## Connection slots
+outbound_connections = 3
+
+inbound = ["tcp://127.0.0.1:25555"]
+
+external_addrs = ["tcp://127.0.0.1:25555"]
+
+# peers = ["tcp://127.0.0.1:25554"]
+
+## Seed nodes to connect to
+seeds = ["tcp://127.0.0.1:25551"]
+
+# Prefered transports for outbound connections
+allowed_transports = ["tcp"]
+
+localnet = true
+#
+# [channel."#dev"]
+# topic = "DarkFi Development HQ"
+
+[channel."#test"]
+secret = "HoLfk8vXBvNsBZ73e2xRPBZ9vEbnF9FVi4fDdyU9AZLU"

+ 39 - 0
contrib/localnet/darkirc-four-nodes/seed.toml

@@ -0,0 +1,39 @@
+## JSON-RPC listen URL
+# rpc_listen="tcp://127.0.0.1:8888"
+
+## IRC listen URL
+# irc_listen="tcp://127.0.0.1:22020"
+
+## Sets Datastore Path
+datastore = "/tmp/darkirc_test/darkirc_seed"
+
+## List of channels to autojoin for new client connections
+autojoin = ["#dev"]
+
+## TLS certificate path if IRC acceptor uses TLS (optional)
+#irc_tls_cert = "/etc/letsencrypt/darkirc/fullchain.pem"
+
+## TLS secret key path if IRC acceptor uses TLS (optional)
+#irc_tls_secret = "/etc/letsencrypt/darkirc/privkey.pem"
+
+## P2P net settings
+[net]
+## Connection slots
+# outbound_connections=8
+
+## P2P accept addresses
+inbound = ["tcp://127.0.0.1:25551"]
+
+# Prefered transports for outbound connections
+outbound_transports = ["tcp"]
+
+localnet = true
+
+## Seed nodes to connect to 
+# seeds = ["tcp://127.0.0.1:25551", "tls://lilith1.dark.fi:25551"]
+#
+# [channel."#dev"]
+# topic = "DarkFi Development HQ"
+
+# [channel."#test1"]
+# secret = "HoLfk8vXBvNsBZ73e2xRPBZ9vEbnF9FVi4fDdyU9AZLU"

+ 30 - 0
contrib/localnet/darkirc-four-nodes/tmux_sessions.sh

@@ -0,0 +1,30 @@
+#!/bin/sh
+# Start a tmux session of four darkirc nodes, and optionally four weechat clients.
+set -e
+
+tmux new-session -s "darkirc" -n "darkirc" -d
+tmux send-keys "../../../../darkirc --config seed.toml" Enter && sleep 1
+tmux split-window -h
+tmux send-keys "../../../../darkirc --config darkirc_full_node1.toml" Enter && sleep 1
+tmux split-window -h
+tmux send-keys "../../../../darkirc --config darkirc_full_node2.toml" Enter
+tmux select-pane -t 0
+tmux split-window -v
+tmux send-keys "../../../../darkirc --config darkirc_full_node3.toml" Enter
+tmux select-pane -t 2
+tmux split-window -v
+tmux send-keys "../../../../darkirc --config darkirc_full_node4.toml" Enter
+
+if [ -z "$1" ]; then
+	tmux new-window -t "darkirc:1" -n "weechat"
+	tmux send-keys "weechat -t -r '/server add darkirc_a 127.0.0.1/22022 -notls;/connect darkirc_a;/nick Alice'" Enter
+	tmux split-window -v
+	tmux send-keys "weechat -t -r '/server add darkirc_b 127.0.0.1/22023 -notls;/connect darkirc_b;/nick Bob'" Enter
+	tmux split-window -h
+	tmux send-keys "weechat -t -r '/server add darkirc_c 127.0.0.1/22024 -notls;/connect darkirc_c;/nick Charlie'" Enter
+	tmux select-pane -t 0
+	tmux split-window -h
+	tmux send-keys "weechat -t -r '/server add darkirc_d 127.0.0.1/22025 -notls;/connect darkirc_d;/nick Dave'" Enter
+fi
+
+tmux attach

+ 0 - 22
contrib/localnet/ircd-five-peers/README.md

@@ -1,22 +0,0 @@
-ircd-five-peers
-===============
-
-A local simulation of an ircd network with the topology of five peers.
-
-Connections:
-
-* `A <--> B`
-* `A <--> C`
-* `A <--> D`
-* `B <--> E`
-
-
-## Ports
-
-|Node|JSON-RPC|  P2P  |  IRC  |
-|----|--------|-------|-------|
-| A  | 25550  | 25560 | 25570 |
-| B  | 25551  | 25561 | 25571 |
-| C  | 25552  | 25562 | 25572 |
-| D  | 25553  | 25563 | 25573 |
-| E  | 25554  | 25564 | 25574 |

+ 0 - 15
contrib/localnet/ircd-five-peers/ircd_a.toml

@@ -1,15 +0,0 @@
-# Node A
-rpc_listen = "tcp://127.0.0.1:25550"
-irc_listen = "tcp://127.0.0.1:25570"
-
-[net]
-outbound_connections = 0
-inbound = ["tls://127.0.0.1:25560"]
-external_addr = ["tls://127.0.0.1:25560"]
-seeds = []
-peers = []
-localnet = true
-channel_log = true
-
-[channel."#plain"]
-topic = "Plain unencrypted channel"

+ 0 - 19
contrib/localnet/ircd-five-peers/ircd_b.toml

@@ -1,19 +0,0 @@
-# Node B
-rpc_listen = "tcp://127.0.0.1:25551"
-irc_listen = "tcp://127.0.0.1:25571"
-
-[net]
-outbound_connections = 0
-inbound = ["tls://127.0.0.1:25561"]
-external_addr = ["tls://127.0.0.1:25561"]
-seeds = []
-peers = ["tls://127.0.0.1:25560"]
-localnet = true
-channel_log = true
-
-[channel."#encrypted"]
-topic ="Encrypted channel"
-secret = "7CkVuFgwTUpJn5Sv67Q3fyEDpa28yrSeL5Hg2GqQ4jfM"
-
-[channel."#plain"]
-topic = "Plain unencrypted channel"

+ 0 - 19
contrib/localnet/ircd-five-peers/ircd_c.toml

@@ -1,19 +0,0 @@
-# Node C
-rpc_listen = "tcp://127.0.0.1:25552"
-irc_listen = "tcp://127.0.0.1:25572"
-
-[net]
-outbound_connections = 0
-inbound = ["tls://127.0.0.1:25562"]
-external_addr = ["tls://127.0.0.1:25562"]
-seeds = []
-peers = ["tls://127.0.0.1:25560"]
-localnet = true
-channel_log = true
-
-[channel."#encrypted"]
-topic ="Encrypted channel"
-secret = "7CkVuFgwTUpJn5Sv67Q3fyEDpa28yrSeL5Hg2GqQ4jfM"
-
-[channel."#plain"]
-topic = "Plain unencrypted channel"

+ 0 - 19
contrib/localnet/ircd-five-peers/ircd_d.toml

@@ -1,19 +0,0 @@
-# Node D
-rpc_listen = "tcp://127.0.0.1:25553"
-irc_listen = "tcp://127.0.0.1:25573"
-
-[net]
-outbound_connections = 0
-inbound = ["tls://127.0.0.1:25563"]
-external_addr = ["tls://127.0.0.1:25563"]
-seeds = []
-peers = ["tls://127.0.0.1:25560"]
-localnet = true
-channel_log = true
-
-[channel."#encrypted"]
-topic ="Encrypted channel"
-secret = "7CkVuFgwTUpJn5Sv67Q3fyEDpa28yrSeL5Hg2GqQ4jfM"
-
-[channel."#plain"]
-topic = "Plain unencrypted channel"

+ 0 - 19
contrib/localnet/ircd-five-peers/ircd_e.toml

@@ -1,19 +0,0 @@
-# Node D
-rpc_listen = "tcp://127.0.0.1:25554"
-irc_listen = "tcp://127.0.0.1:25574"
-
-[net]
-outbound_connections = 0
-inbound = ["tls://127.0.0.1:25564"]
-external_addr = ["tls://127.0.0.1:25564"]
-seeds = []
-peers = ["tls://127.0.0.1:25561"]
-localnet = true
-channel_log = true
-
-[channel."#encrypted"]
-topic ="Encrypted channel"
-secret = "7CkVuFgwTUpJn5Sv67Q3fyEDpa28yrSeL5Hg2GqQ4jfM"
-
-[channel."#plain"]
-topic = "Plain unencrypted channel"

+ 0 - 33
contrib/localnet/ircd-five-peers/tmux_sessions.sh

@@ -1,33 +0,0 @@
-#!/bin/sh
-# Start a tmux session of five ircd nodes, and optionally 5 weechat clients.
-set -e
-
-tmux new-session -s "ircd" -n "ircd" -d
-tmux send-keys "../../../ircd --config ircd_a.toml" Enter && sleep 1
-tmux split-window -h
-tmux send-keys "../../../ircd --config ircd_b.toml" Enter && sleep 1
-tmux select-pane -t 0
-tmux split-window -v
-tmux send-keys "../../../ircd --config ircd_c.toml" Enter
-tmux select-pane -t 2
-tmux split-window -v
-tmux send-keys "../../../ircd --config ircd_d.toml" Enter
-tmux split-window -h
-tmux send-keys "../../../ircd --config ircd_e.toml" Enter
-
-if [ -z "$1" ]; then
-	tmux new-window -t "ircd:1" -n "weechat"
-	tmux send-keys "weechat -t -r '/server add ircd_a 127.0.0.1/25570;/connect ircd_a'" Enter
-	tmux split-window -v
-	tmux send-keys "weechat -t -r '/server add ircd_b 127.0.0.1/25571;/connect ircd_b'" Enter
-	tmux split-window -v
-	tmux send-keys "weechat -t -r '/server add ircd_c 127.0.0.1/25572;/connect ircd_c'" Enter
-	tmux select-pane -t 0
-	tmux split-window -h
-	tmux send-keys "weechat -t -r '/server add ircd_d 127.0.0.1/25573;/connect ircd_d'" Enter
-	tmux select-pane -t 2
-	tmux split-window -h
-	tmux send-keys "weechat -t -r '/server add ircd_e 127.0.0.1/25574;/connect ircd_e'" Enter
-fi
-
-tmux attach