From 52094d584d0f1d9f5b23619bf1d1c1f4e9a5ccdd Mon Sep 17 00:00:00 2001 From: niharokz Date: Thu, 1 Jul 2021 09:52:14 +0530 Subject: Gemini Protocol Added --- gemini.html | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 gemini.html diff --git a/gemini.html b/gemini.html new file mode 100644 index 0000000..08d5095 --- /dev/null +++ b/gemini.html @@ -0,0 +1,114 @@ + + + + How to set up your own gemini server + + + + + + + +

Creating and serving gemini capsules

+ +
+

What is Gemini?

+

Gemini is a new internet protocol which is different from the web. It's neither Gopher. It's much cleaner.

+

Why use gemini protocol?

+ +

To access any gemini urls i.e. gemini://landchad.net, you can use any gemini client such as amfora, lagrange, elpher, etc. +

Instructions

+

To create and serve a gemini capsule, we need three basic steps:

+
    +
  1. Content
  2. +
  3. TLS certificate
  4. +
  5. Gemini server
  6. +
+

We can create three different directories to simplify the process:

+

+mkdir -p gemini/{content,certificate,server}
+        
+

Content

+

Gemini uses text/gemini markup. It heavily borrows from Markdown. Similar to .html or .md, gemini uses .gmi as its extension.

+

To create one gemini file, go inside the content directory and create one index.gmi file.

+

+touch gemini/content/index.gmi
+        
+

Update the file content of index.gmi

+

+# This is Sample Gemini page
+## With header 1 and header 2
+And a short paragraph like this.
+=> /index.gmi Link to the same page
+        
+

TLS certificate

+

Go to the certificate directory which we have created earlier. Generate the TLS certificate using OpenSSL. Change YOURDOMAIN.COM to the domain of your gemini capsule.

+

+openssl req -new -subj "/CN=YOURDOMAIN.COM" -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -days 3650 -nodes -out cert.pem -keyout key.pem
+        
+

Gemini server

+

There are many gemini servers available. You can check the list of servers here.

+

We will use agate server for now. This is a simple gemini server written in Rust. Go to server directory and download agate server.

+

+wget https://github.com/mbrubeck/agate/releases/download/v3.1.0/agate.x86_64-unknown-linux-gnu.gz
+        
+

Unzip the gz

+

+gunzip agate.x86_64-unknown-linux-gnu.gz
+        
+

Rename and make it executable

+

+mv agate.x86_64-unknown-linux-gnu agate-server
+chmod +x agate-server
+        
+

Now we need to create a systemd service

+

+sudo touch /etc/systemd/system/agate.service
+        
+

Copy the below file and paste in agate.service.

+

+[Unit]
+Description=agate
+After=network.target
+
+[Service]
+User=USER
+Type=simple
+ExecStart=/home/USER/gemini/agate-server --content /home/USER/gemini/content --certs /home/USER/gemini/certificate/ --hostname YOURDOMAIN.COM --lang en-US
+
+[Install]
+WantedBy=default.target
+        
+ +

Now we are ready to run server. Enable and run agate server.

+

+sudo systemctl enable agate
+

+sudo systemctl start agate
+

Finalization

+

Now your server should be running. If everything went okay, you can access your gemini via any gemini client with this url

+

+gemini://YOURDOMAIN.COM
+        
+

Sample gemini site for reference:

+

+gemini://gemini.circumlunar.space
+        
+

Enjoy your first gemini capsule.

+
+

Written by nihar.page

+ + + +
+ + + -- cgit v1.2.3 From 73ced75cda933f43113e3262d5171311c68bbfaf Mon Sep 17 00:00:00 2001 From: el3ctr0lyte <69082962+el3ctr0lyte@users.noreply.github.com> Date: Thu, 1 Jul 2021 09:10:05 +0200 Subject: Updated tor guide --- tor.html | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tor.html b/tor.html index 0d54b5f..52941ed 100644 --- a/tor.html +++ b/tor.html @@ -25,9 +25,20 @@

Setting up Tor

-

First, install tor. On Debian it's as simple as:

+

Firstly we need to add the tor repo's to have the latest up to date version or tor.

-
 apt install tor
+
echo "deb https://deb.torproject.org/torproject.org buster main" > /etc/apt/sources.list.d/
+
echo "deb-src https://deb.torproject.org/torproject.org buster main" >> /etc/apt/sources.list.d/
+ +

Then we need to add the gpg keys to our keyring

+ +
curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import
+	
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -
+	    
+	

Now update and install tor

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

Then edit the file /etc/tor/torrc, uncommenting the following lines:

        HiddenServiceDir /var/lib/tor/hidden_service/
@@ -72,6 +83,10 @@
         

From here we are almost done, all we have to do is enable the site and reload nginx which is also covered in the webserver tutorial.

+

Also make sure to update tor on a regular basis by running

+
apt update
+
apt install tor
+ Contributor - tomfasano.xyz -- cgit v1.2.3 From 49f45ee59d713b53c96e77cf93ecc05b8a016037 Mon Sep 17 00:00:00 2001 From: el3ctr0lyte <69082962+el3ctr0lyte@users.noreply.github.com> Date: Thu, 1 Jul 2021 09:15:11 +0200 Subject: Update tor.html --- tor.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tor.html b/tor.html index 52941ed..fb8c896 100644 --- a/tor.html +++ b/tor.html @@ -26,7 +26,7 @@

Setting up Tor

Firstly we need to add the tor repo's to have the latest up to date version or tor.

- +
apt install apt-transport-https
echo "deb https://deb.torproject.org/torproject.org buster main" > /etc/apt/sources.list.d/
echo "deb-src https://deb.torproject.org/torproject.org buster main" >> /etc/apt/sources.list.d/
-- cgit v1.2.3 From eb18006d34821e3309acc8fd48633762cee301a4 Mon Sep 17 00:00:00 2001 From: el3ctr0lyte <69082962+el3ctr0lyte@users.noreply.github.com> Date: Thu, 1 Jul 2021 09:33:53 +0200 Subject: Update tor.html --- tor.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tor.html b/tor.html index fb8c896..5b5aa41 100644 --- a/tor.html +++ b/tor.html @@ -27,8 +27,8 @@

Firstly we need to add the tor repo's to have the latest up to date version or tor.

apt install apt-transport-https
-
echo "deb https://deb.torproject.org/torproject.org buster main" > /etc/apt/sources.list.d/
-
echo "deb-src https://deb.torproject.org/torproject.org buster main" >> /etc/apt/sources.list.d/
+
echo "deb https://deb.torproject.org/torproject.org buster main" > /etc/apt/sources.list.d/tor
+
echo "deb-src https://deb.torproject.org/torproject.org buster main" >> /etc/apt/sources.list.d/tor

Then we need to add the gpg keys to our keyring

-- cgit v1.2.3 From b36d214114f24323be0d69f2834bded0af91af87 Mon Sep 17 00:00:00 2001 From: Ashish Panigrahi Date: Thu, 1 Jul 2021 13:34:56 +0530 Subject: fixed typo --- bitcoin.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitcoin.html b/bitcoin.html index ce3206b..ec41f23 100644 --- a/bitcoin.html +++ b/bitcoin.html @@ -46,10 +46,10 @@

These words are your money. Once you are shown them, immediately write them down on physical paper, and you will be storing this somewhere it will not be lost or found. - You can memorize these tweleve words if you trust your memory. + You can memorize these twelve words if you trust your memory.

- These tweleve words unlock all of the funds/addresses you will have on this wallet. + These twelve words unlock all of the funds/addresses you will have on this wallet. Whoever has your seed has the ability to spend your money.

Note obviously that I have included a picture of a seed phrase above in this tutorial. -- cgit v1.2.3 From d6f2ba4d5f73192157f8f93f65a2314736e2333c Mon Sep 17 00:00:00 2001 From: MasterMax13124 Date: Thu, 1 Jul 2021 12:35:23 +0200 Subject: Fixed typos, slightly improved phrasing --- sshkeys.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sshkeys.html b/sshkeys.html index 53382ee..24154ba 100644 --- a/sshkeys.html +++ b/sshkeys.html @@ -18,15 +18,15 @@ This allows us to do two main things:

    -
  1. Password-less login: With SSH keys, we can permanently designate our profile on our local computer as safe for hour server, allowing us to bypass password verification when logging into our server.
  2. +
  3. Password-less login: With SSH keys, we can permanently designate our profile on our local computer as safe for our server, allowing us to bypass password verification when logging into our server.
  4. Prevent hacking: Since we no longer need a password to log in, we can simply deactivate password logins on our server altogether, which prevents hacking from people who may be so lucky as to guess our password!

- In order words, using an SSH key to login is both safer, faster and easier. + In other words, using an SSH key to login is both safer, faster and easier.

- This is especially better once you start making scripts on your computer that interact with your server. + This is especially useful once you start making scripts on your computer that interact with your server. You can upload files in the background, edit your spam filters or anything else from your local computer without having to input your password each time you touch the server.

@@ -58,15 +58,15 @@

Making your server trust your key.

- Now that you have an SSH key generate, just run the following: + Now that you have generated an SSH key, just run the following:

ssh-copy-id root@yourdomain.com

- That will ask for your server's root password and will log you in briefly. + The command will ask for your server's root password and log you in briefly. What this does is that it puts your public SSH key fingerprint on your server in a file /root/.ssh/authorized_keys. - What this does is that it allows approved SSH keys to login without passwords. + This file in turn allows approved SSH keys to log in without passwords.

- Once we've done that, we will reload hour SSH daemon: + Once we've done that, we will reload our SSH daemon:

systemctl reload sshd
@@ -142,11 +142,11 @@ UsePAM no

What if I lose my SSH key?!

- Firstly, don't do this. Make every precaution that you have a backup. + Firstly, don't do this. Take every precaution that you have a backup.

- If this does happens, Vultr and most other VPS providers will have one little out. + If this does happen, Vultr and most other VPS providers will have a way out. Log onto their website and select the server you want to log into.

@@ -163,7 +163,7 @@ UsePAM no

- From here, simply reverse the settings we set above and you can login via SSH with a password and you can reapprove a newly created SSH key or whatever you want to do. + From here, simply reverse the settings we set above and you can log in via SSH with a password and reapprove a newly created SSH key or whatever you want to do.

-- cgit v1.2.3 From 0f329b39023b3db4b849818596cc689b5267a79f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 1 Jul 2021 07:14:21 -0400 Subject: fix tor screw-ups --- tor.html | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/tor.html b/tor.html index 5b5aa41..bbe8147 100644 --- a/tor.html +++ b/tor.html @@ -17,32 +17,31 @@

Now that you have a website, why not offer it on a private alternative such as the onion network?

-

Setting up Tor

+

Installing Tor

+

Firstly we need to add the tor repo's to have the latest up to date version or tor.

-
apt install apt-transport-https
-
echo "deb https://deb.torproject.org/torproject.org buster main" > /etc/apt/sources.list.d/tor
-
echo "deb-src https://deb.torproject.org/torproject.org buster main" >> /etc/apt/sources.list.d/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
+

Then we need to add the gpg keys to our keyring

- -
curl 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 --import
+gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -
+

Now update and install tor

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

Enabling Tor

Then edit the file /etc/tor/torrc, uncommenting the following lines:

-
        HiddenServiceDir /var/lib/tor/hidden_service/
-        HiddenServicePort 80 127.0.0.1:80
+
HiddenServiceDir /var/lib/tor/hidden_service/
+HiddenServicePort 80 127.0.0.1:80
href="https://m-chrzan.xyz">website, donate - + ]]> Requiring Passwords for Webpages (HTTP Authentication) – LandChad.net -https://lukesmith.xyz/auth.html -https://lukesmith.xyz/auth.html +https://landchad.net/auth.html +https://landchad.net/auth.html Thu, 01 Jul 2021 07:19:27 -0400

Requiring Passwords for Webpages

- +
access control with nginx

HTTP basic authentication will allow you to secure parts (or all) of your website with a username and password without the trouble of PHP or Javascript. @@ -262,19 +262,19 @@ mkdir git

Reload nginx and you're good to go!

Contributor - tomfasano.xyz - + ]]> Cronjobs – LandChad.net -https://lukesmith.xyz/cron.html -https://lukesmith.xyz/cron.html +https://landchad.net/cron.html +https://landchad.net/cron.html Thu, 01 Jul 2021 07:19:04 -0400

Using Cronjobs to run scheduled tasks

- +

Cron is a service that lets you run scheduled tasks. These tasks are called cronjobs. If you have already followed the initial course you will have already used cron when you set up certbot. @@ -398,15 +398,15 @@ mkdir git

  • Edits and examples by Luke
  • - + ]]>
    Mirror your site over tor -https://lukesmith.xyz/tor.html -https://lukesmith.xyz/tor.html +https://landchad.net/tor.html +https://landchad.net/tor.html Thu, 01 Jul 2021 07:15:39 -0400

    Mirror Your Site Over Tor

    -- cgit v1.2.3 From c03bc90ce47f1bf340f06f036b78c1483f005211 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 1 Jul 2021 07:37:37 -0400 Subject: safety --- cron.html | 2 +- rss.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cron.html b/cron.html index 6b12269..3f61f23 100644 --- a/cron.html +++ b/cron.html @@ -56,7 +56,7 @@ | | | | .---- day of week (0 - 6) | | | | | * * * * * -30 3 * * 1 apt -y update && apt -y dist-upgrade +30 3 * * 1 apt -y update && apt -y upgrade

    Some notes

      diff --git a/rss.xml b/rss.xml index 88f9a33..50dda18 100644 --- a/rss.xml +++ b/rss.xml @@ -317,7 +317,7 @@ mkdir git | | | | .---- day of week (0 - 6) | | | | | * * * * * -30 3 * * 1 apt -y update && apt -y dist-upgrade +30 3 * * 1 apt -y update && apt -y upgrade

      Some notes

      • On the day of the week option, Sunday is 0 and counting up from there, Saturday will be 6.
      • -- cgit v1.2.3 From f6e08e46491e1efc54628de717484efda1dbcf61 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 1 Jul 2021 08:36:13 -0400 Subject: begin gemini tweaks --- dns.html | 2 +- gemini.html | 60 +++++++++++++++++------------------------------------------- 2 files changed, 18 insertions(+), 44 deletions(-) diff --git a/dns.html b/dns.html index d14ea02..3464eaa 100644 --- a/dns.html +++ b/dns.html @@ -115,7 +115,7 @@ Pinging landchad.net

        - As you can see, our ping to landchad.net is now being directed to 104.238.126.105. + As you can see, our ping to landchad.net is now being directed to 104.238.128.105. That means we have successfully set up our DNS records! You can also run the command host if you have it, which will list both IPv4 and IPv6 addresses for a domain name.

        diff --git a/gemini.html b/gemini.html index 08d5095..2962d09 100644 --- a/gemini.html +++ b/gemini.html @@ -13,7 +13,7 @@

        What is Gemini?

        -

        Gemini is a new internet protocol which is different from the web. It's neither Gopher. It's much cleaner.

        +

        Gemini is a new internet protocol which is different from the HTTP and Gopher. It's much cleaner.

        Why use gemini protocol?

        • Gemini capsules (webpages of gemini) are lightweight, minimal, and don't use many resources to operate.
        • @@ -29,49 +29,32 @@
        • Gemini server
        • We can create three different directories to simplify the process:

          -
          
          -mkdir -p gemini/{content,certificate,server}
          -        
          +
          mkdir -p gemini/{content,certificate,server}

          Content

          Gemini uses text/gemini markup. It heavily borrows from Markdown. Similar to .html or .md, gemini uses .gmi as its extension.

          To create one gemini file, go inside the content directory and create one index.gmi file.

          -
          
          -touch gemini/content/index.gmi
          -        
          +
          touch gemini/content/index.gmi

          Update the file content of index.gmi

          -
          
          -# This is Sample Gemini page
          +        
          # This is Sample Gemini page
           ## With header 1 and header 2
           And a short paragraph like this.
          -=> /index.gmi Link to the same page
          -        
          +=> /index.gmi Link to the same page

          TLS certificate

          Go to the certificate directory which we have created earlier. Generate the TLS certificate using OpenSSL. Change YOURDOMAIN.COM to the domain of your gemini capsule.

          -
          
          -openssl req -new -subj "/CN=YOURDOMAIN.COM" -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -days 3650 -nodes -out cert.pem -keyout key.pem
          -        
          +
          openssl req -new -subj "/CN=YOURDOMAIN.COM" -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -days 3650 -nodes -out cert.pem -keyout key.pem

          Gemini server

          There are many gemini servers available. You can check the list of servers here.

          We will use agate server for now. This is a simple gemini server written in Rust. Go to server directory and download agate server.

          -
          
          -wget https://github.com/mbrubeck/agate/releases/download/v3.1.0/agate.x86_64-unknown-linux-gnu.gz
          -        
          +
          wget https://github.com/mbrubeck/agate/releases/download/v3.1.0/agate.x86_64-unknown-linux-gnu.gz

          Unzip the gz

          -
          
          -gunzip agate.x86_64-unknown-linux-gnu.gz
          -        
          +
          gunzip agate.x86_64-unknown-linux-gnu.gz

          Rename and make it executable

          -
          
          -mv agate.x86_64-unknown-linux-gnu agate-server
          -chmod +x agate-server
          -        
          +
          mv agate.x86_64-unknown-linux-gnu agate-server
          +chmod +x agate-server

          Now we need to create a systemd service

          -
          
          -sudo touch /etc/systemd/system/agate.service
          -        
          +
          sudo touch /etc/systemd/system/agate.service

          Copy the below file and paste in agate.service.

          -
          
          -[Unit]
          +        
          [Unit]
           Description=agate
           After=network.target
           
          @@ -81,33 +64,24 @@ Type=simple
           ExecStart=/home/USER/gemini/agate-server --content /home/USER/gemini/content --certs /home/USER/gemini/certificate/ --hostname YOURDOMAIN.COM --lang en-US
           
           [Install]
          -WantedBy=default.target
          -        
          +WantedBy=default.target
          • Change /home/USER/gemini to your gemini directory path.
          • Change YOURDOMAIN.COM to your domain without http/https.
          • Change en-US to your country language. en-IN for India, en-GB for UK, etc.

          Now we are ready to run server. Enable and run agate server.

          -
          
          -sudo systemctl enable agate
          -
          
          -sudo systemctl start agate
          +
          systemctl enable agate
          +systemctl start agate

          Finalization

          Now your server should be running. If everything went okay, you can access your gemini via any gemini client with this url

          -
          
          -gemini://YOURDOMAIN.COM
          -        
          +
          gemini://example.org

          Sample gemini site for reference:

          -
          
          -gemini://gemini.circumlunar.space
          -        
          +
          gemini://gemini.circumlunar.space

          Enjoy your first gemini capsule.


          Written by nihar.page

          - -
        LandChad.net
        Because Everyone should be an Internet LandChad.
      • chad
      • RSS
      • BTC
      • XMR
      • Github
      • -- cgit v1.2.3 From 48aa1775a693a33768b019fc828117eb4d345dfc Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 1 Jul 2021 08:45:52 -0400 Subject: more submission guidelines --- README.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 31f4c3d..78663d2 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,35 @@ Simple step-by-step text and image-based tutorials for creating websites, email Suggestions welcome. -## Submissions +## Submission guidelines - follow the general style of pre-existing articles +- use the root user (i.e. no `sudo`) unless there is a specific need. +- do not preface commands with `$` or `#` or anything. - use `.svg` files for icons/logos and for illustrative images, keep filesize low +- Use `example.org` +- custom command/file info should be highlighted with `` tags + +### On `
        ` tags
        +
        +
        +In-line code should be in `` tags, while codeblocks should be in a `` tag *inside* of a `
        ` tag.
        +`
        ` allows formatting preserving whitespace.
        +That said, do *not* format `
        ` tags as following:
        +
        +```
        +
        
        +	echo "Here is a command."
        +	echo "Here is another."
        +
        +``` + +but do it like this: + +``` +
        echo "Here is a command."
        +echo "Here is another."
        +``` + +**All** whitespace, including tabbing in and initial and final newlines are displayed by `
        `.
        +To maintain consistency and avoid goofy-looking extra lines, add no extra whitespace.
        -- 
        cgit v1.2.3
        
        
        From 8d48cb1b8aa8d4f430d1d05c0beaea4e389d1038 Mon Sep 17 00:00:00 2001
        From: MasterMax13124 
        Date: Thu, 1 Jul 2021 18:34:57 +0200
        Subject: Tor: Typos fixed, colons added
        
        ---
         tor.html | 18 +++++++++---------
         1 file changed, 9 insertions(+), 9 deletions(-)
        
        diff --git a/tor.html b/tor.html
        index bbe8147..eb7bad9 100644
        --- a/tor.html
        +++ b/tor.html
        @@ -1,7 +1,7 @@
         
         
             
        -        Mirror your site over tor
        +        Mirror your site over Tor
                 
                 
                 
        @@ -22,24 +22,24 @@
         
                 

        Installing Tor

        -

        Firstly we need to add the tor repo's to have the latest up to date version or tor.

        +

        Firstly 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
        -

        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 -
        -

        Now update and install tor

        +

        Now update and install Tor:

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

        Enabling Tor

        -

        Then edit the file /etc/tor/torrc, uncommenting the following lines:

        +

        Next edit the file /etc/tor/torrc, uncommenting the following lines:

        HiddenServiceDir /var/lib/tor/hidden_service/
         HiddenServicePort 80 127.0.0.1:80
        HiddenServiceDir line.

        -

        Now start and enable tor at boot

        +

        Now start and enable Tor at boot:

         systemctl enable --now tor 

        If the next command outputs active in green you're golden!

         systemctl status tor
        -

        Now you're server is on the dark web. The following command will give you your onion address:

        +

        Now your server is on the dark web. The following command will give you your onion address:

         cat /var/lib/tor/hidden_service/hostname

        Adding the Nginx Config

        From here, the steps are almost identical to setting up a normal website configuration file. - Follow the steps as if you were making a new website on the webserver + Follow the steps as if you were making a new website in the webserver tutorial up until the server block of code. Instead, paste this:

        @@ -80,7 +80,7 @@ HiddenServicePort 80 127.0.0.1:80

        The root line is the path to whichever website of yours you'd like to mirror.

        - From here we are almost done, all we have to do is enable the site and reload nginx which is also covered in the webserver tutorial. + Now we are almost done, all we have to do is enable the site and reload nginx which, is also covered in the webserver tutorial.

        Update regularly!

        -- cgit v1.2.3 From c2460482e0cf79e2ecde463a13700c73deed9e0f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 1 Jul 2021 13:34:49 -0400 Subject: gemini tweaks --- gemini.html | 75 ++++++++++++++++++++++++++++++++++++------------------------- index.html | 1 + 2 files changed, 46 insertions(+), 30 deletions(-) diff --git a/gemini.html b/gemini.html index 2962d09..aa6d83e 100644 --- a/gemini.html +++ b/gemini.html @@ -13,72 +13,87 @@

        What is Gemini?

        -

        Gemini is a new internet protocol which is different from the HTTP and Gopher. It's much cleaner.

        +

        Gemini is a new internet protocol which is different from the HTTP and Gopher. It's much cleaner and has a growing community and audience of hackers.

        Why use gemini protocol?

        • Gemini capsules (webpages of gemini) are lightweight, minimal, and don't use many resources to operate.
        • It can run along with your websites. Gemini capsules use port 1965 by default. Your webserver can run at port 80 or 443 along with gemini server at port 1965.
        • By exploring an alternative protocol, you can check different ways to serve data and blogs.
        -

        To access any gemini urls i.e. gemini://landchad.net, you can use any gemini client such as amfora, lagrange, elpher, etc. +

        To access any gemini urls i.e. gemini://example.org, you can use any gemini client such as amfora, lagrange, elpher, etc.

        Instructions

        +

        Create a gemini user

        +

        + It is most secure and clean to have a separate gemini user, so let's create one: +

        +
        useradd -m -s /bin/bash gemini
        +

        Now log in as gemini with the following command:

        +
        su -l gemini

        To create and serve a gemini capsule, we need three basic steps:

          -
        1. Content
        2. -
        3. TLS certificate
        4. -
        5. Gemini server
        6. +
        7. Content – the webpages in our capsule
        8. +
        9. TLS certificate – Gemini requires encrypted connection.
        10. +
        11. Gemini server – the program that makes our capsule available (similar to Nginx for HTTP)
        -

        We can create three different directories to simplify the process:

        -
        mkdir -p gemini/{content,certificate,server}
        +

        As the gemini user, we can create three different directories to simplify the process:

        +
        mkdir -p ~/gemini/{content,certificate,server}

        Content

        -

        Gemini uses text/gemini markup. It heavily borrows from Markdown. Similar to .html or .md, gemini uses .gmi as its extension.

        +

        This will be the directory where you capsule files will be contained. Gemini uses text/gemini markup (in place of HTTP's equivalent HTML). It heavily borrows from Markdown. Similar to .html or .md, gemini uses .gmi as its extension.

        To create one gemini file, go inside the content directory and create one index.gmi file.

        -
        touch gemini/content/index.gmi
        -

        Update the file content of index.gmi

        +
        nano gemini/content/index.gmi
        +

        We can add the content we want in our Gemini capsule here:

        # This is Sample Gemini page
         ## With header 1 and header 2
         And a short paragraph like this.
         => /index.gmi Link to the same page

        TLS certificate

        -

        Go to the certificate directory which we have created earlier. Generate the TLS certificate using OpenSSL. Change YOURDOMAIN.COM to the domain of your gemini capsule.

        -
        openssl req -new -subj "/CN=YOURDOMAIN.COM" -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -days 3650 -nodes -out cert.pem -keyout key.pem
        +

        Go to the certificate directory which we created earlier and generate a TLS certificate using OpenSSL.

        +
        cd ~/gemini/certificate/
        +openssl req -new -subj "/CN=example.org" -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -days 3650 -nodes -out cert.pem -keyout key.pem

        Gemini server

        -

        There are many gemini servers available. You can check the list of servers here.

        -

        We will use agate server for now. This is a simple gemini server written in Rust. Go to server directory and download agate server.

        -
        wget https://github.com/mbrubeck/agate/releases/download/v3.1.0/agate.x86_64-unknown-linux-gnu.gz
        -

        Unzip the gz

        -
        gunzip agate.x86_64-unknown-linux-gnu.gz
        -

        Rename and make it executable

        -
        mv agate.x86_64-unknown-linux-gnu agate-server
        +        

        Download and prepare the server

        +

        There are many gemini server software choices available. + We will use agate server for now. This is a simple gemini server written in Rust.

        +

        It's a good idea to always get the most recent version, which you can see on the agate releases page. At the time of this writing, that is agate v3.1.0 which we will now download. We will download it to the server directory we made.

        +
        cd ~/gemini/server
        +wget https://github.com/mbrubeck/agate/releases/download/v3.1.0/agate.x86_64-unknown-linux-gnu.gz
        +

        Unzip the gz, then rename and make it executable:

        +
        gunzip agate.x86_64-unknown-linux-gnu.gz
        +mv agate.x86_64-unknown-linux-gnu agate-server
         chmod +x agate-server
        -

        Now we need to create a systemd service

        -
        sudo touch /etc/systemd/system/agate.service
        -

        Copy the below file and paste in agate.service.

        +

        Create a system service

        +

        Now we need to create a systemd service to autostart and manage agate. + The gemini user does not have permission to do this, so press ctrl-d to log out of the gemini user and return to root. + As root, create the file below by opening it in your text editor (nano, vim, etc.):

        +
        nano /etc/systemd/system/agate.service
        +

        Add the following content to the file customizing highlighted text to your use.

        [Unit]
         Description=agate
         After=network.target
         
         [Service]
        -User=USER
        +User=gemini
         Type=simple
        -ExecStart=/home/USER/gemini/agate-server --content /home/USER/gemini/content --certs /home/USER/gemini/certificate/ --hostname YOURDOMAIN.COM --lang en-US
        +ExecStart=/home/gemini/gemini/server/agate-server --content /home/gemini/gemini/content --certs /home/gemini/gemini/certificate/ --hostname example.org --lang en-US
         
         [Install]
         WantedBy=default.target
        -
          -
        • Change /home/USER/gemini to your gemini directory path.
        • -
        • Change YOURDOMAIN.COM to your domain without http/https.
        • -
        • Change en-US to your country language. en-IN for India, en-GB for UK, etc.
        • -

        Now we are ready to run server. Enable and run agate server.

        systemctl enable agate
         systemctl start agate
        +

        Firewall

        +

        Lastly, if you have a firewall running, remember to open port 1965, which is the port number used by gemini:

        +
        ufw allow 1965

        Finalization

        -

        Now your server should be running. If everything went okay, you can access your gemini via any gemini client with this url

        +

        Now your server should be running. If everything went okay, you can access your gemini capsule via any gemini client with a url like this:

        gemini://example.org

        Sample gemini site for reference:

        gemini://gemini.circumlunar.space

        Enjoy your first gemini capsule.

        +

        + For information about how to write in "gemtext" the markup language in Gemini, see this site: https://gemini.circumlunar.space/docs/gemtext.gmi. + As you might guess it also has an analogous gemini capsule here: gemini://gemini.circumlunar.space/docs/gemtext.gmi +


        Written by nihar.page

        diff --git a/index.html b/index.html index cab7e9e..87aa19b 100644 --- a/index.html +++ b/index.html @@ -52,6 +52,7 @@
      • Schedule tasks with Crontabs/Cronjobs.
      • Mirror your site on Tor.
      • Password-protecting Webpages (HTTP Authentication)
      • +
      • Create a Gemini Capsule.

      "Build your own platform!"

      -- cgit v1.2.3