From 83dd849fd7bbb0fdb7a14cdad5bce43aeabc829a Mon Sep 17 00:00:00 2001 From: Furkan Sahin Date: Mon, 19 Jul 2021 21:08:50 -0500 Subject: Init --- pages/_app.tsx | 24 +++ pages/greeting.md | 10 + pages/index.tsx | 13 ++ pages/logs/cgit-nginx-ubuntu/cgit-nginx-ubuntu.md | 96 +++++++++ pages/logs/cgit-nginx-ubuntu/index.tsx | 12 ++ pages/logs/index.tsx | 16 ++ pages/logs/logs.md | 6 + pages/logs/packaging-nebula-for-debian/index.tsx | 12 ++ pages/logs/packaging-nebula-for-debian/nebula.md | 248 ++++++++++++++++++++++ 9 files changed, 437 insertions(+) create mode 100644 pages/_app.tsx create mode 100644 pages/greeting.md create mode 100644 pages/index.tsx create mode 100644 pages/logs/cgit-nginx-ubuntu/cgit-nginx-ubuntu.md create mode 100644 pages/logs/cgit-nginx-ubuntu/index.tsx create mode 100644 pages/logs/index.tsx create mode 100644 pages/logs/logs.md create mode 100644 pages/logs/packaging-nebula-for-debian/index.tsx create mode 100644 pages/logs/packaging-nebula-for-debian/nebula.md (limited to 'pages') diff --git a/pages/_app.tsx b/pages/_app.tsx new file mode 100644 index 0000000..08fd51e --- /dev/null +++ b/pages/_app.tsx @@ -0,0 +1,24 @@ +import '../styles/reset.css'; +import '@fontsource/inconsolata/600.css'; +import '@fontsource/inconsolata'; +import '../styles/defaults.scss'; +import type { AppProps } from 'next/app'; +import Head from 'next/head'; +import 'highlight.js/styles/github.css'; + +function MyApp({ Component, pageProps }: AppProps) { + return ( + <> + + furkistan.com + + + + + + + + ); +} + +export default MyApp; \ No newline at end of file diff --git a/pages/greeting.md b/pages/greeting.md new file mode 100644 index 0000000..81409b9 --- /dev/null +++ b/pages/greeting.md @@ -0,0 +1,10 @@ +## Hello, + +You’ve happened upon my homepage. I’m a student, developer, and engi-nerd pursuing a degree in computer engineering at Texas A&M University. + +- [Posts](/posts) +- [My public git projects](https://www.git.furkistan.com) + +Best, + +\- Furkan Sahin diff --git a/pages/index.tsx b/pages/index.tsx new file mode 100644 index 0000000..8201dbf --- /dev/null +++ b/pages/index.tsx @@ -0,0 +1,13 @@ +import MarkdownPage from '../templates/MarkdownPage'; +// @ts-ignore +import md from './greeting.md'; + +export default function Home() { + return ( + <> + + + ) +} diff --git a/pages/logs/cgit-nginx-ubuntu/cgit-nginx-ubuntu.md b/pages/logs/cgit-nginx-ubuntu/cgit-nginx-ubuntu.md new file mode 100644 index 0000000..c225bd4 --- /dev/null +++ b/pages/logs/cgit-nginx-ubuntu/cgit-nginx-ubuntu.md @@ -0,0 +1,96 @@ +Installing cGit behind NGINX on Ubuntu +====================================== + +[cGit](https://git.zx2c4.com/cgit/about/) is a fast web interface based on the CGI specification. It is lightweight and doesn't require a database or web authentication system. + +It's easy to configure. For some reason, all the online guides for Ubuntu decided they needed to compile it from scratch and write their own start scripts in a mix of perl and bash. You don't need superhero sysadmin skills from the late 90s. All components are packaged with systemd units... there is a better way... + +### 1. Install `cgit` and `fcgiwrap`. + +`fcgiwrap` will create a socket NGINX can use to pass the CGI variables to cGit: +``` +sudo apt install fcgiwrap +sudo apt install cgit +``` + +### 2. Modify the `cgitrc` file under `/etc/cgitrc` to your liking: +``` +# See cgitrc(5) +# prepend this string to every url +virtual-root=/ +enable-index-links=1 +enable-commit-graph=1 + +root-title=My Git Repos +root-desc=I exclusivly write code in Smalltalk-71 +logo=/assets/my_custom_logo.png + +# Add site-specific configuration +# ... + +``` + +### 3. Optionally create an assets directory and add your custom logo / css: +``` +mkdir /var/www/html/assets +cp my_custom_logo.png /var/www/html/assets +``` + +### 4. Configure NGINX + +Add the site to NGINX. This launches the `cgit.cgi` executable passing it to the `fcgiwrap` socket: +```conf +echo >/etc/nginx/sites-available/cgit.conf < + ); +} \ No newline at end of file diff --git a/pages/logs/index.tsx b/pages/logs/index.tsx new file mode 100644 index 0000000..7f11e86 --- /dev/null +++ b/pages/logs/index.tsx @@ -0,0 +1,16 @@ +import DefaultPage from '../../templates/Default'; +import Markdown from '../../components/Markdown'; +//@ts-ignore +import md from './logs.md'; + +export default function Logs() { + return( + + + + ); +} \ No newline at end of file diff --git a/pages/logs/logs.md b/pages/logs/logs.md new file mode 100644 index 0000000..5515287 --- /dev/null +++ b/pages/logs/logs.md @@ -0,0 +1,6 @@ +## The Logs + +Eclectic thoughts, miscellany, and discursive drivel + +- [Packaging Nebula for Debian](/logs/packaging-nebula-for-debian) +- [Installing cGit behind NGINX on Ubuntu](/logs/cgit-nginx-ubuntu) diff --git a/pages/logs/packaging-nebula-for-debian/index.tsx b/pages/logs/packaging-nebula-for-debian/index.tsx new file mode 100644 index 0000000..a8e8e2c --- /dev/null +++ b/pages/logs/packaging-nebula-for-debian/index.tsx @@ -0,0 +1,12 @@ +// @ts-ignore +import md from './nebula.md'; +import MarkdownPage from '../../../templates/MarkdownPage'; + +export default function NebulaOnDebian() { + return ( + + ); +} \ No newline at end of file diff --git a/pages/logs/packaging-nebula-for-debian/nebula.md b/pages/logs/packaging-nebula-for-debian/nebula.md new file mode 100644 index 0000000..a309525 --- /dev/null +++ b/pages/logs/packaging-nebula-for-debian/nebula.md @@ -0,0 +1,248 @@ +Packaging Nebula for Debian + +> **Created:** 2021-07-18 **Last Updated:** 2021-07-19 + +# Timeline + +I see that nebula is getting packaged for debian so I will write up install instructions specific to debian derivatives. + +Installation +------------ + +**Step one will currently fail. See [installing from experimental](#installing-from-experimental)** + +For the sake of simplicity, I'm going to assume that you're setting up a network with two nodes -- one lighthouse node and a node on your laptop. Once you understand the process, it easily scales to as many nodes as you wish. Pick your favorite virtualization provider in order to set up the lighthouse. The lighthouse requires minimal resources because it functions as a mutually-reachable node which synchronizes the address mappings. You could use a home server provided that you have a static ip (unlikely) or setup dynamic DNS. The latter may introduce some instability. I'm also assuming both clients are debian derivatives and have access to `apt`. + +If this is not the case, please consult the [upstream instructions](https://github.com/slackhq/nebula#user-content-getting-started-quickly) which will guide you through the processing of installing the binaries directly. + +#### 1. Install Nebula through Aptitude + +You'll need to install Nebula on both endpoints. + +```bash +sudo apt install nebula +``` + +#### 2. Creating a certificate authority + +The certificate authority is to "root of trust" for a Nebula network. Compromising the certificate authority's key file would compromise the integrity and security of the entire network. The upstream instructions recommend that you store the key file in a location with strong encryption [^1]. + +You can generate a `ca.key` and `ca.cert` file with the following command: +```bash +nebula-cert ca -name "Myorganization, Inc" +``` + +You will copy the `ca.crt` file to all the hosts. The `ca.key` file should remain secret. + +#### 4. Nebula host keys and certificates generated from that certificate authority + +With your `ca.key` file in hand, generate keys for each node. + +```bash +nebula-cert sign -name "lighthouse" -ip "192.168.100.1/24" +nebula-cert sign -name "laptop" -ip "192.168.100.2/24" +``` + +Repeate this process for each node. It is important that each is issued a unique internal ip. The IPs are specified in CIDR notation [^2]. This internal ip will be used to configure Nebula later. + +#### 4. Copy the configuration files to each host + +Each host requires the `host.key`, `host.crt`, and `ca.crt` files to be present on the system. By convention, these are located in the `/etc/nebula` directory. Make sure to copy them into this directory. + +For example, to copy the credentials to a lighthouse with ip `203.0.113.11` as `user` you may use sftp and ssh as follows: + +```bash +sftp user@203.0.113.11 </etc/apt/sources.list.d/99-tmp-nebula-overrides.list </etc/apt/preferences.d/99-tmp-nebula-prefer-stable <