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