From beba13603116d54ce422a08c29d5a7976c5841af Mon Sep 17 00:00:00 2001 From: dkoukoul Date: Fri, 17 May 2024 10:52:50 +0300 Subject: [PATCH 1/4] cjdns with proxy --- manifest.toml | 8 ++++---- scripts/install | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index b614583..d4d42eb 100644 --- a/manifest.toml +++ b/manifest.toml @@ -32,10 +32,10 @@ ram.runtime = "50M" [resources] [resources.sources] [resources.sources.main] - amd64.url = "https://github.com/dkoukoul/cjdns/releases/download/v22-7/cjdroute_debian11_x86_64.tar.gz" - amd64.sha256 = "32948ed786abd02d49c86ff614df5a49e629b14a7495ac96b641baddcd57945b" - arm64.url = "https://github.com/dkoukoul/cjdns/releases/download/v22-7/cjdroute_linux_arm64.tar.gz" - arm64.sha256 = "8c391e024cc9094f0ec23ac325c2115013757da34fe730d46fc17436cf4773da" + amd64.url = "https://github.com/dkoukoul/cjdns/releases/download/v22-7/cjdns_ynh_x86_64.tar.gz" + amd64.sha256 = "8954e4fc894c9e0a1bea14ba27a44cf964bb2eb4ee18080470a3e1f3ed78dab7" + arm64.url = "https://github.com/dkoukoul/cjdns/releases/download/v22-7/cjdns_ynh_linux_arm64.tar.gz" + arm64.sha256 = "e3b73bca6f282923967cefa96cf59d3258d06fec31779bfe90cac0a535a179d2" in_subdir = false [resources.system_user] diff --git a/scripts/install b/scripts/install index 97acc49..d342296 100755 --- a/scripts/install +++ b/scripts/install @@ -31,6 +31,7 @@ ynh_script_progression --message="Configuring $app..." --weight=1 $install_dir/cjdroute --genconf | $install_dir/cjdroute --cleanconf > $install_dir/cjdroute.conf jq '.security[0].setuser = 0' $install_dir/cjdroute.conf > $install_dir/cjdroute.conf.tmp && mv $install_dir/cjdroute.conf.tmp $install_dir/cjdroute.conf +jq '.security[0].seccomp = 0' $install_dir/cjdroute.conf > $install_dir/cjdroute.conf.tmp && mv $install_dir/cjdroute.conf.tmp $install_dir/cjdroute.conf jq '.noBackground = 1' $install_dir/cjdroute.conf > $install_dir/cjdroute.conf.tmp && mv $install_dir/cjdroute.conf.tmp $install_dir/cjdroute.conf #================================================= @@ -90,6 +91,13 @@ ynh_script_progression --message="Starting $app's systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +#================================================= +# LAUNCH CJDNS PROXY SERVER +#================================================= +ynh_script_progression --message="Launching cjdns proxy server..." --weight=1 + +$install_dir/cjdns-proxy-server + #================================================= # END OF SCRIPT #================================================= From 94098d8a7e06353cbc7effd776d73d895a266cf2 Mon Sep 17 00:00:00 2001 From: dkoukoul Date: Fri, 17 May 2024 13:10:16 +0300 Subject: [PATCH 2/4] update binaries --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index d4d42eb..8fa6f13 100644 --- a/manifest.toml +++ b/manifest.toml @@ -33,9 +33,9 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] amd64.url = "https://github.com/dkoukoul/cjdns/releases/download/v22-7/cjdns_ynh_x86_64.tar.gz" - amd64.sha256 = "8954e4fc894c9e0a1bea14ba27a44cf964bb2eb4ee18080470a3e1f3ed78dab7" + amd64.sha256 = "ec4cea5226b8896c61d6db1736718f2f57a9f5e1303e3c3a1ca7cea445e14370" arm64.url = "https://github.com/dkoukoul/cjdns/releases/download/v22-7/cjdns_ynh_linux_arm64.tar.gz" - arm64.sha256 = "e3b73bca6f282923967cefa96cf59d3258d06fec31779bfe90cac0a535a179d2" + arm64.sha256 = "a9cfece03bd3f4b163f46140cb2bd513a4dac826d7a038c3b87636fd0ac8e19e" in_subdir = false [resources.system_user] From 721461a57367529757ebe8c59fbb6166dec364c1 Mon Sep 17 00:00:00 2001 From: dkoukoul Date: Fri, 17 May 2024 13:33:19 +0300 Subject: [PATCH 3/4] proxy in service --- conf/systemd.service | 1 + scripts/install | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index c4357c4..34167e7 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,6 +7,7 @@ User=root Group=root WorkingDirectory=__INSTALL_DIR__/ ExecStart=/bin/bash -c '__INSTALL_DIR__/cjdroute < __INSTALL_DIR__/cjdroute.conf' +ExecStartPost=/bin/bash -c 'sleep 3 && __INSTALL_DIR__/cjdns-proxy-server' KillMode=process Restart=no diff --git a/scripts/install b/scripts/install index d342296..897b50a 100755 --- a/scripts/install +++ b/scripts/install @@ -91,13 +91,6 @@ ynh_script_progression --message="Starting $app's systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" -#================================================= -# LAUNCH CJDNS PROXY SERVER -#================================================= -ynh_script_progression --message="Launching cjdns proxy server..." --weight=1 - -$install_dir/cjdns-proxy-server - #================================================= # END OF SCRIPT #================================================= From 87f7163bc2bbb57273190865539fc143b8990ca9 Mon Sep 17 00:00:00 2001 From: dkoukoul Date: Fri, 17 May 2024 14:57:28 +0300 Subject: [PATCH 4/4] bug fix --- conf/systemd.service | 2 +- doc/ADMIN.md | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 doc/ADMIN.md diff --git a/conf/systemd.service b/conf/systemd.service index 34167e7..d601c76 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ User=root Group=root WorkingDirectory=__INSTALL_DIR__/ ExecStart=/bin/bash -c '__INSTALL_DIR__/cjdroute < __INSTALL_DIR__/cjdroute.conf' -ExecStartPost=/bin/bash -c 'sleep 3 && __INSTALL_DIR__/cjdns-proxy-server' +ExecStartPost=/bin/bash -c 'sleep 3 && __INSTALL_DIR__/cjdns-proxy-server &' KillMode=process Restart=no diff --git a/doc/ADMIN.md b/doc/ADMIN.md deleted file mode 100644 index a2bf58d..0000000 --- a/doc/ADMIN.md +++ /dev/null @@ -1,7 +0,0 @@ -# Setup your website on cjdns network - -1. From the Applications menu, first install wordpress and then "cjdns". -2. Obtain your cjdns IPv6 address by navigating to Tools -> Logs -> Click on "Install the 'cjdns' app." Your IPv6 address should be displayed in the log. -3. Reboot your YunoHost server to make the tun device available. Navigate to Tools->Shutdown and click Reboot. -4. Navigate to Tools -> Yunohost Settings -> Security, and under NGINX, disable "Force HTTPS." Click Save to apply the changes. -5. Finally edit `/etc/nginx/conf.d/__DOMAIN__.conf`, add your cjdns-ipv6 to the list of `server_name`.