From f966564ba32b8769873752a9d672fe7288d7d970 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 4 Mar 2024 15:36:52 +0200 Subject: radicle-other-node: set up for testing ci broker Signed-off-by: Lars Wirzenius Sponsored-by: author --- ansible/radicle-other-node.yml | 137 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 123 insertions(+), 14 deletions(-) (limited to 'ansible') diff --git a/ansible/radicle-other-node.yml b/ansible/radicle-other-node.yml index 7509dfc..e6db600 100644 --- a/ansible/radicle-other-node.yml +++ b/ansible/radicle-other-node.yml @@ -5,7 +5,123 @@ - role: sane_debian_system - role: sshd - role: unix_users - - role: radicle_node + - role: rust-rustup + - role: liw + tasks: + - apt: + name: + - curl + - git + - jq + - psmisc + - rsync + - screen + + - name: "install radicle using installer" + shell: | + filename="/home/liw/.radicle/bin/rad" + + install=false + if [ ! -e "$filename" ]; then + install=true + else + weekago="$(date -d 'week ago' +%s)" + mtime="$(stat -c %Y "$filename")" + if [ "$mtime" -lt "$weekago" ]; then + install=true + fi + fi + + if $install; then + curl -sSf https://radicle.xyz/install | sudo -u liw bash + fi + + - name: "create liw/.radicle/keys" + file: + state: directory + path: /home/liw/.radicle/keys + owner: liw + group: liw + mode: 0755 + + - name: "install radicle private key" + copy: + content: "{{ radicle_key }}" + dest: /home/liw/.radicle/keys/radicle + owner: liw + group: liw + mode: 0600 + + - name: "install radicle public key" + copy: + content: "{{ radicle_pub }}" + dest: /home/liw/.radicle/keys/radicle.pub + owner: liw + group: liw + mode: 0644 + + - name: "configure rad" + copy: + content: | + { + "publicExplorer": "https://app.radicle.xyz/nodes/$host/$rid$path", + "preferredSeeds": [ + ], + "web": { + "pinned": { + "repositories": [] + } + }, + "cli": { + "hints": true + }, + "node": { + "alias": "liw-other-node", + "listen": [], + "peers": { + "type": "dynamic", + "target": 8 + }, + "connect": [ + "z6MkfXa53s1ZSFy8rktvyXt5ADCojnxvjAoQpzajaXyLqG5n@radicle.liw.fi:8776" + ], + "externalAddresses": [], + "network": "main", + "relay": true, + "limits": { + "routingMaxSize": 1000, + "routingMaxAge": 604800, + "gossipMaxAge": 1209600, + "fetchConcurrency": 1, + "maxOpenFiles": 4096, + "rate": { + "inbound": { + "fillRate": 0.2, + "capacity": 32 + }, + "outbound": { + "fillRate": 1.0, + "capacity": 64 + } + } + }, + "policy": "block", + "scope": "followed" + } + } + dest: /home/liw/.radicle/config.json + owner: liw + group: liw + mode: 0644 + + - name: "create /srv/http" + file: + state: directory + path: /srv/http + owner: liw + group: liw + mode: 0o755 + vars: sane_debian_system_version: 2 sane_debian_system_hostname: "{{ inventory_hostname }}" @@ -15,21 +131,14 @@ - repo: | deb http://security.debian.org/debian-security bookworm-security main + - repo: deb http://apt.liw.fi/debian unstable main + signing_key: "{{ apt_liw_fi_signing_key }}" + unix_users_version: 2 unix_users: - - username: _rad - comment: Radicle node + - username: liw sshd_version: 1 - radicle_node_version: 1 - radicle_node_backup: "/home/liw/data/_rad@radicle-other-node" - radicle_node_key: "{{ lookup('pipe', 'pass radicle/radicle-other-node/key') }}" - radicle_node_key_pub: "{{ lookup('pipe', 'pass radicle/radicle-other-node/key.pub') }}" - radicle_node_connections: - - nid: z6MkfXa53s1ZSFy8rktvyXt5ADCojnxvjAoQpzajaXyLqG5n - host: radicle.liw.fi - port: 8776 - radicle_node_repositories: - - rid: "rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5" - - rid: "rad:zZnk3hS8C3WAhnv7mWcCUToCqpBs" + radicle_key: "{{ lookup('pipe', 'pass radicle/radicle-other-node/key') }}" + radicle_pub: "{{ lookup('pipe', 'pass radicle/radicle-other-node/key.pub') }}" -- cgit v1.2.1