]> xn--ix-yja.es Git - alex.git/commitdiff
Add bitlbee setup
authoralex <alex@pdp7.net>
Sat, 28 Oct 2023 09:40:25 +0000 (09:40 +0000)
committeralex <alex@pdp7.net>
Sat, 28 Oct 2023 09:40:25 +0000 (09:40 +0000)
scripts/p7s/bitlbee.py [new file with mode: 0644]
scripts/pyproject.toml

diff --git a/scripts/p7s/bitlbee.py b/scripts/p7s/bitlbee.py
new file mode 100644 (file)
index 0000000..4f0acbd
--- /dev/null
@@ -0,0 +1,31 @@
+import pathlib
+import textwrap
+
+
+def setup_bitlbee():
+    home = pathlib.Path.home()
+    config = home / ".config" / "containers" / "systemd"
+    config.mkdir(parents=True, exist_ok=True)
+    (config / "bitlbee.container").write_text(textwrap.dedent("""
+        [Unit]
+        Description=IM-IRC bridge
+
+        [Container]
+        Image=quay.io/alexpdp7/workstation:latest
+        Volume=/home/alex/.local/lib/bitlbee:/var/lib/bitlbee/
+        # running this on an LXC container, which borks SecurityLabelDisable
+        #SecurityLabelDisable=true
+        PublishPort=6668:6667
+
+        Exec=bitlbee -Fnv
+
+        [Service]
+        # Extend Timeout to allow time to pull the image
+        TimeoutStartSec=900
+
+        [Install]
+        # Start by default on boot
+        WantedBy=multi-user.target default.target
+    """).lstrip())
+
+    (home / ".local" / "lib" / "bitlbee").mkdir(parents=True, exist_ok=True)
index 51aa351f0af9ded10cafdc4ce1be491a7f978162..27e545f977e0d0e5fbf2ecb875f3e1971d472f3f 100644 (file)
@@ -22,3 +22,4 @@ db-create = 'p7s.distrobox:create'
 db-enter = 'p7s.distrobox:enter'
 nextcloud_setup = 'p7s.nextcloud:setup_nextcloud'
 soju_setup = 'p7s.soju:setup_soju'
+bitlbee_setup = 'p7s.bitlbee:setup_bitlbee'