From 6173b1f435f9a3dbff97a82b3a903acf9b2e3c20 Mon Sep 17 00:00:00 2001 From: climbTheStairs Date: Sun, 5 Dec 2021 02:00:31 -0800 Subject: Edit tor.html to follow official instructions Remove OS-specific code, check CPU architecture, make tabs/spaces consistent --- tor.html | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tor.html b/tor.html index 4135080..ddaa9d2 100644 --- a/tor.html +++ b/tor.html @@ -22,19 +22,21 @@

Installing Tor

-

Firstly we need to add the Tor repos to our system to get the latest version of Tor:

+

First, we need to ensure that our CPU architecture is supported. Ensure that it is either amd64, arm64, or i386:

+
dpkg --print-architecture
+ +

We need to add the Tor repos to our system to get the latest version of Tor:

apt install -y apt-transport-https gpg
-echo "deb https://deb.torproject.org/torproject.org buster main
-deb-src https://deb.torproject.org/torproject.org buster main" > /etc/apt/sources.list.d/tor.list
+echo "deb [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org $(lsb_release -cs) main +deb-src [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org $(lsb_release -cs) main" > /etc/apt/sources.list.d/tor.list -

Then we need to add the gpg keys to our keyring:

+

Then we need to add the GPG keys to our keyring:

-
curl -s https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import
-gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -
+
curl -s https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor > /usr/share/keyrings/tor-archive-keyring.gpg
-

Now update and install Tor:

+

Now install Tor:

-
apt update
+        
apt update
 apt install tor deb.torproject.org-keyring

Enabling Tor

@@ -104,6 +106,6 @@ apt install tor

Contributor - tomfasano.co

- + -- cgit v1.2.3 From 81ba81a76579ae209f8971967e1892248272baf5 Mon Sep 17 00:00:00 2001 From: climbTheStairs Date: Mon, 13 Dec 2021 04:24:29 +0000 Subject: Fix inconsistent spaces/tabs in cgit.html --- cgit.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cgit.html b/cgit.html index 2ca026d..75e7ba7 100644 --- a/cgit.html +++ b/cgit.html @@ -46,9 +46,9 @@ server { listen 443 ssl; listen [::]:443 ssl; - ssl_certificate /etc/ssl/nginx/git.example.org.crt; - ssl_certificate_key /etc/ssl/nginx/git.example.org.key; - server_name git.example.org; + ssl_certificate /etc/ssl/nginx/git.example.org.crt; + ssl_certificate_key /etc/ssl/nginx/git.example.org.key; + server_name git.example.org; root /usr/share/cgit ; try_files $uri @cgit ; -- cgit v1.2.3 From 914c976c44f1e68ac7ad793964628f851e28776c Mon Sep 17 00:00:00 2001 From: climbTheStairs Date: Mon, 13 Dec 2021 04:27:44 +0000 Subject: Remove ugly extra lines in `
` tags

---
 cgit.html | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/cgit.html b/cgit.html
index 75e7ba7..b750a48 100644
--- a/cgit.html
+++ b/cgit.html
@@ -42,8 +42,7 @@
 			You should have an NGINX server running with a TLS certificate by now. Add the following configuration
 			to your server to pass the requests to Cgit, while serving static files directly:

-

-server {
+		
server {
 	listen 443 ssl;
 	listen [::]:443 ssl;
 	ssl_certificate /etc/ssl/nginx/git.example.org.crt;
@@ -60,8 +59,7 @@ server {
 		fastcgi_param QUERY_STRING $query_string;
 		fastcgi_pass unix:/run/fcgiwrap.socket;
 	}
-}
-		
+}

Then get NGINX to reload your configuration.

@@ -70,8 +68,7 @@ server { To change this, we need to configure Cgit to our liking, by editing /etc/cgitrc.

-

-css=/cgit.css
+		
css=/cgit.css
 logo=/cgit.svg
 virtual-root=/
 
@@ -80,8 +77,7 @@ root-title=Chad's git server
 root-desc=A web interface to LandChad's git repositories, powered by Cgit
 
 # The location where git repos are stored on the server
-scan-path=/srv/git/
-		
+scan-path=/srv/git/

This configuration assumes you followed the git hosting guide and store your repositories on the /srv/git/ directory.

@@ -96,9 +92,7 @@ scan-path=/srv/git/ user to give it your name:

-

-usermod -c "Your Name" git
-		
+
usermod -c "Your Name" git

Changing the repository description

@@ -110,8 +104,7 @@ usermod -c "Your Name" git to determine the idle time. Inside your repository, create a file hooks/post-receive and add the following contents:

-

-#!/bin/sh
+		
#!/bin/sh
 
 agefile="$(git rev-parse --git-dir)"/info/web/last-modified
 
@@ -119,8 +112,7 @@ mkdir -p "$(dirname "$agefile")" &&
 git for-each-ref \
 	--sort=-authordate --count=1 \
 	--format='%(authordate:iso8601)' \
-	>"$agefile"
-		
+ >"$agefile"

And give it execution permissions with:

-- cgit v1.2.3