From 18c5210c383de4bde2f1301e57e2ec4e34a28a4f Mon Sep 17 00:00:00 2001 From: Dimitris Date: Wed, 27 Dec 2023 16:07:11 +0200 Subject: [PATCH 1/8] Update Admin.md --- doc/Admin.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/doc/Admin.md b/doc/Admin.md index bfa96ef..a710f17 100644 --- a/doc/Admin.md +++ b/doc/Admin.md @@ -1,14 +1,11 @@ # Setup your website on cjdns network -1. Install YunoHost by following the detailed instructions provided [here](link-to-instructions). -2. Once the installation is complete, log in as an administrator at `yunohost.local`. Perform a system update, which may take some time. -3. Return to `yunohost.local` after the update and navigate to the Applications menu. Click on Install, search for "wordpress," select it, and proceed with the installation. -4. In the Applications menu, search for "cjdns" and install it. If it does not appear due to not being published yet. You can sideload it by pasting the following URL: `https://github.com/dkoukoul/cjdns_ynh` into the "Install custom app" section. -5. 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. -6. Reboot your YunoHost server to make the tun device available. Navigate to Tools->Shutdown and click Reboot. -7. Navigate to Tools -> Yunohost Settings -> Security, and under NGINX, disable "Force HTTPS." Click Save to apply the changes. -8. Edit `/etc/nginx/conf.d/[your-domain].conf`, add your cjdns-ipv6 to the list of `server_name`. -9. Finally, to allow public access for cjdns requests to your new wordpress site you can do the following: +1. In the Applications menu, search for "cjdns" and install it. +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. Edit `/etc/nginx/conf.d/[your-domain].conf`, add your cjdns-ipv6 to the list of `server_name`. +6. Finally, to allow public access for cjdns requests to your new wordpress site you can do the following: 1. SSH into your yunoHost server 2. Copy current sso configuration file to persistent: `cp /etc/ssowat/conf.json /etc/ssowat/conf.json.persistent` 3. Then edit the persistent file: `nano /etc/ssowat/conf.json.persistent` From 0c344784e933938dc79d61ea2efe65c3c8211b21 Mon Sep 17 00:00:00 2001 From: Dimitris Date: Wed, 27 Dec 2023 18:30:02 +0200 Subject: [PATCH 2/8] Update systemd.service some restrictions need to be removed for cjdns to be able to create the tun0 device --- conf/systemd.service | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 7915a85..c4357c4 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -3,8 +3,8 @@ Description=Cjdns: Encrypted IPv6 network After=network.target cjdns.service [Service] -User=__APP__ -Group=__APP__ +User=root +Group=root WorkingDirectory=__INSTALL_DIR__/ ExecStart=/bin/bash -c '__INSTALL_DIR__/cjdroute < __INSTALL_DIR__/cjdroute.conf' KillMode=process @@ -16,12 +16,9 @@ Restart=no # Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html NoNewPrivileges=yes PrivateTmp=yes -PrivateDevices=yes RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK RestrictNamespaces=yes RestrictRealtime=yes -DevicePolicy=closed -ProtectClock=yes ProtectHostname=yes ProtectProc=invisible ProtectSystem=full @@ -30,7 +27,6 @@ ProtectKernelModules=yes ProtectKernelTunables=yes LockPersonality=yes SystemCallArchitectures=native -SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap @cpu-emulation @privileged # Denying access to capabilities that should not be relevant for webapps # Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html @@ -41,7 +37,7 @@ CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE -CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW +CapabilityBoundingSet=~CAP_NET_RAW CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG [Install] From 3637f4d48419965df5fa5f6e9ed3791f079e0019 Mon Sep 17 00:00:00 2001 From: dkoukoul Date: Fri, 29 Dec 2023 12:35:32 +0200 Subject: [PATCH 3/8] edit ssowat --- scripts/install | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/install b/scripts/install index 0ed4ee2..6062354 100755 --- a/scripts/install +++ b/scripts/install @@ -97,6 +97,12 @@ ynh_script_progression --message="Launching cjdns service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +#================================================= +# MAKE WORDPRESS AVAILABLE ON CJDNS +#================================================= + +yunohost tools shell -c "from yunohost.permission import permission_url; permission_url('wordpress.main', add_url=['re:^.fc.*'])" + #================================================= # END OF SCRIPT #================================================= From 3eb53e258dc646ca500cb3ac538c8ad1cc41bf0c Mon Sep 17 00:00:00 2001 From: dkoukoul Date: Fri, 29 Dec 2023 12:36:31 +0200 Subject: [PATCH 4/8] remove ssowat edit --- doc/Admin.md | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/doc/Admin.md b/doc/Admin.md index a710f17..123c31b 100644 --- a/doc/Admin.md +++ b/doc/Admin.md @@ -4,24 +4,4 @@ 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. Edit `/etc/nginx/conf.d/[your-domain].conf`, add your cjdns-ipv6 to the list of `server_name`. -6. Finally, to allow public access for cjdns requests to your new wordpress site you can do the following: - 1. SSH into your yunoHost server - 2. Copy current sso configuration file to persistent: `cp /etc/ssowat/conf.json /etc/ssowat/conf.json.persistent` - 3. Then edit the persistent file: `nano /etc/ssowat/conf.json.persistent` - 4. Change `public` to `true` and add this line under the `wordpress.main uris` section: `"re:^.fc.*"`. Remember to add a trailing “,” to the above entry. For example: - -```json -"wordpress.main": { - "auth_header": true, - "label": "WordPress", - "public": true, - "show_tile": true, - "uris": [ - "example.nohost.me/blog", - "re:^.fc.*" - ], - "use_remote_user_var_in_nginx_conf": false, - "users": [] -} -`````` +5. Finally edit `/etc/nginx/conf.d/[your-domain].conf`, add your cjdns-ipv6 to the list of `server_name`. From 2a529b741a57695c9046bbfbce23551286f22adb Mon Sep 17 00:00:00 2001 From: dkoukoul Date: Fri, 29 Dec 2023 12:43:07 +0200 Subject: [PATCH 5/8] after wordpress --- doc/Admin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Admin.md b/doc/Admin.md index 123c31b..b3b4ccc 100644 --- a/doc/Admin.md +++ b/doc/Admin.md @@ -1,6 +1,6 @@ # Setup your website on cjdns network -1. In the Applications menu, search for "cjdns" and install it. +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. From f25b42b4ae1df80c457bac0f90354fb306c189f8 Mon Sep 17 00:00:00 2001 From: Dimitris Date: Wed, 3 Jan 2024 14:55:25 +0200 Subject: [PATCH 6/8] Update Admin.md --- doc/Admin.md | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/doc/Admin.md b/doc/Admin.md index a710f17..2babc24 100644 --- a/doc/Admin.md +++ b/doc/Admin.md @@ -1,27 +1,7 @@ # Setup your website on cjdns network 1. In the Applications menu, search for "cjdns" and install it. -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. Edit `/etc/nginx/conf.d/[your-domain].conf`, add your cjdns-ipv6 to the list of `server_name`. -6. Finally, to allow public access for cjdns requests to your new wordpress site you can do the following: - 1. SSH into your yunoHost server - 2. Copy current sso configuration file to persistent: `cp /etc/ssowat/conf.json /etc/ssowat/conf.json.persistent` - 3. Then edit the persistent file: `nano /etc/ssowat/conf.json.persistent` - 4. Change `public` to `true` and add this line under the `wordpress.main uris` section: `"re:^.fc.*"`. Remember to add a trailing “,” to the above entry. For example: - -```json -"wordpress.main": { - "auth_header": true, - "label": "WordPress", - "public": true, - "show_tile": true, - "uris": [ - "example.nohost.me/blog", - "re:^.fc.*" - ], - "use_remote_user_var_in_nginx_conf": false, - "users": [] -} -`````` +2. Copy your cjdns ipv6 that is shown when installation completes. +3. Navigate to Tools -> Yunohost Settings -> Security, and under NGINX, disable "Force HTTPS." Click Save to apply the changes. +5. Edit `/etc/nginx/conf.d/[your-domain].conf`, add your cjdns-ipv6 to the list of `server_name` inside square brackets [] and make sure to remove any leading 0 from the address sections. +6. Finally, restart nginx and you should be able now to access your wordpress site on the cjdns network. From 06523a155e62093b8fd4bb784cde2fbcf37daa34 Mon Sep 17 00:00:00 2001 From: Dimitris Date: Wed, 3 Jan 2024 14:57:15 +0200 Subject: [PATCH 7/8] Update install edit permissions --- scripts/install | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/install b/scripts/install index 0ed4ee2..0e9c81d 100755 --- a/scripts/install +++ b/scripts/install @@ -96,6 +96,11 @@ ynh_script_progression --message="Launching cjdns service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +#================================================= +# MAKE WORDPRESS AVAILABLE ON CJDNS +#================================================= + +yunohost tools shell -c "from yunohost.permission import permission_url; permission_url('wordpress.main', add_url=['re:^.fc.*'])" #================================================= # END OF SCRIPT From bc14245217af66f21075d3b49690d82dab6fccac Mon Sep 17 00:00:00 2001 From: dkoukoul Date: Wed, 10 Jan 2024 10:17:49 +0200 Subject: [PATCH 8/8] rename admin, update curl --- doc/{Admin.md => ADMIN.md} | 0 scripts/install | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename doc/{Admin.md => ADMIN.md} (100%) diff --git a/doc/Admin.md b/doc/ADMIN.md similarity index 100% rename from doc/Admin.md rename to doc/ADMIN.md diff --git a/scripts/install b/scripts/install index f75ccee..3aecd93 100755 --- a/scripts/install +++ b/scripts/install @@ -39,7 +39,7 @@ jq '.noBackground = 1' $install_dir/cjdroute.conf > $install_dir/cjdroute.conf.t #================================================= ynh_script_progression --message="Getting cjdns peers..." --weight=1 # Fetch the JSON data -json=$(curl -s https://vpn.anode.co/api/0.3/vpn/cjdns/peeringlines/) +json=$(curl -s -A "ynh" https://vpn.anode.co/api/0.4/vpn/cjdns/peeringlines/) echo "Got peering lines" length=$(echo $json | jq '. | length')