aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--config/shione/wireguard/debian/changelog5
-rw-r--r--config/shione/wireguard/debian/compat1
-rw-r--r--config/shione/wireguard/debian/control16
-rw-r--r--config/shione/wireguard/debian/copyright8
-rw-r--r--config/shione/wireguard/debian/files2
-rwxr-xr-xconfig/shione/wireguard/debian/rules4
-rw-r--r--config/shione/wireguard/debian/source/format1
-rw-r--r--config/shione/wireguard/debian/wireguard-config.install1
-rw-r--r--config/shione/wireguard/files/etc/sysctl.d/wireguard.conf3
-rwxr-xr-xconfig/shione/wireguard/generate_keys.sh9
11 files changed, 51 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 4189866..ac9e65d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@
*.postinst.debhelper
*.substvars
*.tar.xz
+config/shione/wireguard/files/etc/wireguard
diff --git a/config/shione/wireguard/debian/changelog b/config/shione/wireguard/debian/changelog
new file mode 100644
index 0000000..534c970
--- /dev/null
+++ b/config/shione/wireguard/debian/changelog
@@ -0,0 +1,5 @@
+wireguard-config (1.0) unstable; urgency=low
+
+ * Initial release.
+
+ -- Renken <renken@shione.net> Sun, 24 Dec 2023 23:46:00 +0100
diff --git a/config/shione/wireguard/debian/compat b/config/shione/wireguard/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/config/shione/wireguard/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/config/shione/wireguard/debian/control b/config/shione/wireguard/debian/control
new file mode 100644
index 0000000..81d04ba
--- /dev/null
+++ b/config/shione/wireguard/debian/control
@@ -0,0 +1,16 @@
+Source: wireguard-config
+Section: tasks
+Priority: optional
+Maintainer: Renken <renken@shione.net>
+Rules-Requires-Root: no
+Build-Depends: debhelper (>= 13.11~), config-package-dev (>= 4.15~)
+Standards-Version: 4.1.0
+
+Package: wireguard-config
+Architecture: all
+Multi-Arch: foreign
+Depends: ${misc:Depends}, wireguard, wireguard-tools
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Description: Shione wireguard configuration.
+ Shione wireguard configuration.
diff --git a/config/shione/wireguard/debian/copyright b/config/shione/wireguard/debian/copyright
new file mode 100644
index 0000000..2fff8a7
--- /dev/null
+++ b/config/shione/wireguard/debian/copyright
@@ -0,0 +1,8 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Source: https://gitlab.com/renken/nichijou
+Upstream-Contact: Renken <renken@shione.net>
+
+Files:
+ *
+Copyright: 2023, Renken <renken@shione.net>
+License: GPL-3
diff --git a/config/shione/wireguard/debian/files b/config/shione/wireguard/debian/files
new file mode 100644
index 0000000..287ae41
--- /dev/null
+++ b/config/shione/wireguard/debian/files
@@ -0,0 +1,2 @@
+wireguard-config_1.0_all.deb tasks optional
+wireguard-config_1.0_amd64.buildinfo tasks optional
diff --git a/config/shione/wireguard/debian/rules b/config/shione/wireguard/debian/rules
new file mode 100755
index 0000000..a089a9e
--- /dev/null
+++ b/config/shione/wireguard/debian/rules
@@ -0,0 +1,4 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@ --with config-package
diff --git a/config/shione/wireguard/debian/source/format b/config/shione/wireguard/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/config/shione/wireguard/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/config/shione/wireguard/debian/wireguard-config.install b/config/shione/wireguard/debian/wireguard-config.install
new file mode 100644
index 0000000..5b79850
--- /dev/null
+++ b/config/shione/wireguard/debian/wireguard-config.install
@@ -0,0 +1 @@
+files/* /
diff --git a/config/shione/wireguard/files/etc/sysctl.d/wireguard.conf b/config/shione/wireguard/files/etc/sysctl.d/wireguard.conf
new file mode 100644
index 0000000..d51aa3c
--- /dev/null
+++ b/config/shione/wireguard/files/etc/sysctl.d/wireguard.conf
@@ -0,0 +1,3 @@
+# Configuration required for wireguard.
+net.ipv4.ip_forward = 1
+net.ipv6.conf.all.forwarding = 1
diff --git a/config/shione/wireguard/generate_keys.sh b/config/shione/wireguard/generate_keys.sh
new file mode 100755
index 0000000..4c564a4
--- /dev/null
+++ b/config/shione/wireguard/generate_keys.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -eux
+
+cd -- files/etc/wireguard
+(umask 077; wg genkey | tee shione.private.key | wg pubkey > shione.public.key)
+# TODO: chmod 0600 all files under files/etc/wireguard.
+# TODO: Update files/etc/wireguard/wg0.conf accordingly.
+cd -- -