summaryrefslogtreecommitdiff
path: root/gemini.html
diff options
context:
space:
mode:
authorniharokz <hi@nihars.com>2021-07-01 09:52:14 +0530
committerniharokz <hi@nihars.com>2021-07-01 09:52:14 +0530
commit52094d584d0f1d9f5b23619bf1d1c1f4e9a5ccdd (patch)
treed73def2756694700b2e512da5d9e5511d6bcb297 /gemini.html
parentdfdf13023df6b53e0490b788d92528f81368bbbe (diff)
Gemini Protocol Added
Diffstat (limited to 'gemini.html')
-rw-r--r--gemini.html114
1 files changed, 114 insertions, 0 deletions
diff --git a/gemini.html b/gemini.html
new file mode 100644
index 0000000..08d5095
--- /dev/null
+++ b/gemini.html
@@ -0,0 +1,114 @@
+<!DOCTYPE html>
+<html lang=en>
+ <head>
+ <title>How to set up your own gemini server</title>
+ <meta charset="utf-8"/>
+ <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel='alternate' type='application/rss+xml' title='Land Chad RSS' href='/rss.xml'>
+ </head>
+<body>
+ <header><h1> Creating and serving gemini capsules </h1></header>
+ <nav></nav>
+ <main>
+ <h2 id="whatis">What is Gemini?</h2>
+ <p><a href="https://gemini.circumlunar.space" target="_blank">Gemini</a> is a new internet protocol which is different from the web. It's neither Gopher. It's much cleaner.</p>
+ <h3>Why use gemini protocol?</h3>
+ <ul>
+ <li>Gemini capsules (webpages of gemini) are lightweight, minimal, and don't use many resources to operate.</li>
+ <li>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. </li>
+ <li>By exploring an alternative protocol, you can check different ways to serve data and blogs.</li>
+ </ul>
+ <p>To access any gemini urls i.e. <code>gemini://landchad.net</code>, you can use any gemini client such as <a href="https://github.com/makeworld-the-better-one/amfora" target="_blank">amfora</a>, <a href="https://gmi.skyjake.fi/lagrange" target="_blank">lagrange</a>, <a href="https://thelambdalab.xyz/elpher/" target="_blank">elpher</a>, etc.
+ <h2 id="instructions">Instructions</h2>
+ <p>To create and serve a gemini capsule, we need three basic steps:</p>
+ <ol>
+ <li>Content</li>
+ <li>TLS certificate</li>
+ <li>Gemini server</li>
+ </ol>
+ <p>We can create three different directories to simplify the process:</p>
+ <pre><code>
+mkdir -p gemini/{content,certificate,server}
+ </code></pre>
+ <h3>Content</h3>
+ <p>Gemini uses text/gemini markup. It heavily borrows from Markdown. Similar to .html or .md, gemini uses .gmi as its extension.</p>
+ <p>To create one gemini file, go inside the <code>content</code> directory and create one <code>index.gmi</code> file.</p>
+ <pre><code>
+touch gemini/content/index.gmi
+ </code></pre>
+ <p>Update the file content of index.gmi</p>
+ <pre><code>
+# This is Sample Gemini page
+## With header 1 and header 2
+And a short paragraph like this.
+=> /index.gmi Link to the same page
+ </code></pre>
+ <h3>TLS certificate</h3>
+ <p>Go to the <code>certificate</code> directory which we have created earlier. Generate the TLS certificate using OpenSSL. Change YOURDOMAIN.COM to the domain of your gemini capsule.</p>
+ <pre><code>
+openssl req -new -subj "/CN=YOURDOMAIN.COM" -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -days 3650 -nodes -out cert.pem -keyout key.pem
+ </code></pre>
+ <h3>Gemini server</h3>
+ <p>There are many gemini servers available. You can check the list of servers <a href="https://gemini.circumlunar.space/software" target="_blank">here</a>.</p>
+ <p>We will use <code>agate</code> server for now. This is a simple gemini server written in Rust. Go to <code>server</code> directory and download agate server.</p>
+ <pre><code>
+wget https://github.com/mbrubeck/agate/releases/download/v3.1.0/agate.x86_64-unknown-linux-gnu.gz
+ </code></pre>
+ <p>Unzip the gz</p>
+ <pre><code>
+gunzip agate.x86_64-unknown-linux-gnu.gz
+ </code></pre>
+ <p>Rename and make it executable</p>
+ <pre><code>
+mv agate.x86_64-unknown-linux-gnu agate-server
+chmod +x agate-server
+ </code></pre>
+ <p>Now we need to create a systemd service</p>
+ <pre><code>
+sudo touch /etc/systemd/system/agate.service
+ </code></pre>
+ <p>Copy the below file and paste in agate.service.</p>
+ <pre><code>
+[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
+ </code></pre>
+ <ul>
+ <li>Change <code>/home/USER/gemini</code> to your gemini directory path.</li>
+ <li>Change <code>YOURDOMAIN.COM</code> to your domain without http/https.</li>
+ <li>Change <code>en-US</code> to your country language. en-IN for India, en-GB for UK, etc.</li>
+ </ul>
+ <p>Now we are ready to run server. Enable and run agate server.</p>
+ <pre><code>
+sudo systemctl enable agate</code></pre>
+ <pre><code>
+sudo systemctl start agate</code></pre>
+ <h2>Finalization</h2>
+ <p>Now your server should be running. If everything went okay, you can access your gemini via any gemini client with this url</p>
+ <pre><code>
+gemini://YOURDOMAIN.COM
+ </code></pre>
+ <p>Sample gemini site for reference:</p>
+ <pre><code>
+gemini://gemini.circumlunar.space
+ </code></pre>
+ <p>Enjoy your first gemini capsule.</p>
+ <hr>
+ <p><em>Written by <a href="https://nihar.page">nihar.page</a></em></p>
+
+ <!--<span class=next><a href="<++>">Next:<++></a></span>--!>
+
+ </main>
+ <footer><a href="https://landchad.net">LandChad.net</a></br>Because Everyone should be an Internet LandChad.</br><li><a href="index.html"><img src="pix/chad.gif" alt="chad"></a></li><li><a href="rss.xml"><img src="pix/rss.svg" alt="RSS"></a></li><li><a href="pix/btc.png"><img src="pix/btc.svg" alt="BTC"></a></li><li><a href="pix/xmr.png"><img src="pix/xmr.svg" alt="XMR"></a></li><li><a href="https://github.com/lukesmithxyz/landchad"><img src="pix/git.svg" alt="Github"></a></footer>
+</body>
+</html>