Compare commits
No commits in common. "45b30d8bbc192149d11fb79464a8d266f896c436" and "508af46e662a260e4dcc9d8e9ac2997d1ee5364e" have entirely different histories.
45b30d8bbc
...
508af46e66
18
README.md
18
README.md
@ -1,21 +1,3 @@
|
||||
# gtz blog
|
||||
An opinionated blog.
|
||||
I write posts about technology and other interests that I have.
|
||||
|
||||
To iterate locally:
|
||||
```sh
|
||||
docker build -t wip .
|
||||
docker run --rm -it -p 8080:8080 wip hugo serve --bind 0.0.0.0 --port 8080
|
||||
```
|
||||
|
||||
## Things I want to write
|
||||
|
||||
### Opinions
|
||||
- [ ] Clean Architecture is stupid - dependency injection is king
|
||||
- [ ] VIM Bindings everywhere please
|
||||
|
||||
### Digital Soverignty
|
||||
- [x] how to host a blog
|
||||
- [ ] how to securely "self-host" using a VPS, portainer and traefik
|
||||
- [x] how to configure neomutt
|
||||
- [ ] how to securely host a mail server
|
||||
|
@ -3,17 +3,5 @@ title: About gtz blog
|
||||
author: Asger Gitz-Johansen
|
||||
---
|
||||
|
||||
I am a software engineer from Denmark working at [GomSpace](https://gomspace.com/home.aspx).
|
||||
This is just my simple blog that I use for letting out "blogging-steam".
|
||||
I write GNU/Linux based tutorials and sometimes I write opinion pieces.
|
||||
I hope you find my stuff useful.
|
||||
If you want more from me, check my links:
|
||||
|
||||
- [GitHub](https://github.com/sillydan1)
|
||||
- [Model Based Development Paper 1](https://github.com/sillydan1/aaltitoad/blob/master/.github/resources/docs/SW9__AALTITOAD.pdf)
|
||||
- [Model Based Development Paper 2](https://github.com/sillydan1/aaltitoad/blob/master/.github/resources/docs/SW10__Tick_Tock_Automata.pdf)
|
||||
- [Model Based Development Paper 3](https://github.com/sillydan1/aaltitoad/blob/master/.github/resources/docs/aaltitoad-v1.0.0.pdf)
|
||||
- [Graphedit](https://github.com/sillydan1/graphedit) (in hibernation)
|
||||
- [AALTITOAD](https://github.com/sillydan1/aaltitoad) (in hibernation)
|
||||
|
||||
{{< centered image="/6616144.png" >}}
|
||||
This is just a simple blog.
|
||||
<!-- TODO: Add more shit about myself. -->
|
||||
|
@ -5,7 +5,4 @@ title = 'Example'
|
||||
tags = ['tutorial']
|
||||
categories = ['technical']
|
||||
+++
|
||||
|
||||
content goes here.
|
||||
|
||||
{{< centered image="/6616144.png" >}}
|
||||
|
@ -1,89 +0,0 @@
|
||||
+++
|
||||
date = '2024-12-19'
|
||||
title = 'Neomutt and Outlook'
|
||||
tags = ['howto', 'tutorial', 'mutt', '2fa', 'oauth2']
|
||||
categories = ['technical']
|
||||
+++
|
||||
Neomutt is a great way to read, send and manage your email.
|
||||
In this tutorial we will configure neomutt to be able to synchronize e-mails with Outlook (or other popular e-mail provider) addresses!
|
||||
By the end of this tutorial, you will be able to manually synchronize your emails using the `mailsync` command and read/manage your emails in an interface that looks like so:
|
||||
|
||||
{{< centered image="/neomutt-screenshot.png" >}}
|
||||
|
||||
Apologies for the blur, but I dont want you to read **my** e-mails.
|
||||
|
||||
## First Things First
|
||||
First, sign in to your mail through the browser. This is needed for the OAuth2 authorization flow.
|
||||
|
||||
You should also obviously install neomutt.
|
||||
This can just be done through your package manager.
|
||||
As I am using Arch linux, I will do so using `pacman`, but on Ubuntu or Debian you should use `apt`:
|
||||
|
||||
```sh
|
||||
pacman -S neomutt
|
||||
```
|
||||
|
||||
## GPG
|
||||
The first thing you'll need is a `gpg` key for encryption purposes.
|
||||
You can check your keys using `gpg --list-keys`.
|
||||
If you don't already have a `gpg` key, you can generate one with the `--full-gen-key` flag.
|
||||
|
||||
```sh
|
||||
gpg --full-gen-key
|
||||
```
|
||||
|
||||
## OAuth2
|
||||
As part of installing neomutt, you should have the oauth2 python script located in `/usr/share/neomutt/oauth2/`.
|
||||
We need to register neomutt as an already trusted app.
|
||||
We will simply abuse the thunderbird client-id for this, which is: `9e5f94bc-e8a4-4e73-b8be-63364c29d753` - with this you don't need to specify a client secret:
|
||||
|
||||
```sh
|
||||
/usr/share/neomutt/oauth2/mutt_oauth2.py \
|
||||
-v \
|
||||
-t \
|
||||
--authorize \
|
||||
--client-id "9e5f94bc-e8a4-4e73-b8be-63364c29d753" \
|
||||
--client-secret "" \
|
||||
--email "your-email-here" \
|
||||
--provider microsoft \
|
||||
$HOME/email-token
|
||||
```
|
||||
|
||||
This will ask you a couple questions.
|
||||
Select `authcode` for the preferred OAuth2 flow.
|
||||
If prompted for a client secret, simply press enter.
|
||||
You should get a link - enter that link into your browser and allow the app.
|
||||
By the end of the flow you should end up at an empty website.
|
||||
Copy the last part of the URL and paste it into your terminal.
|
||||
After this you should have a token file located at `$HOME/email-token`.
|
||||
It's a good idea to take a backup of this file just in case you overwrite it.
|
||||
But if you do loose it, you can just run the flow again.
|
||||
|
||||
## Mutt-Wizard
|
||||
We are almost there!
|
||||
The wonderful Luke Smith has made a neat setup wizard called [mutt-wizard](https://muttwizard.com/).
|
||||
Install (see the mutt-wizard website), run it and enter your email information.
|
||||
After this, you should edit your `~/.mbsyncrc` file, as the default `PassCmd` is not quite configured yet.
|
||||
It should look something like this (make sure to change `your-email-here` and `username` to the appropriate values):
|
||||
|
||||
```
|
||||
...
|
||||
PassCmd "/usr/share/neomutt/oauth2/mutt_oauth2.py --encryption-pipe 'gpg -e -r your-email-here' /home/username/email-token"
|
||||
...
|
||||
```
|
||||
|
||||
You should now be able to run `mailsync` (installed with mutt-wizard):
|
||||
|
||||
```sh
|
||||
mailsync
|
||||
```
|
||||
|
||||
It might ask you to select which profile to sync.
|
||||
Just provide the name you set when setting up your gpg profile and everything should sync now!
|
||||
After a successful sync, you should be able to just open `neomutt` and start reading, replying and whatever you do with email!
|
||||
|
||||
```sh
|
||||
neomutt
|
||||
```
|
||||
|
||||
{{< centered image="/6616144.png" >}}
|
@ -209,5 +209,3 @@ Just focus on writing posts and publish them by merging to `main`. Nice and auto
|
||||
## P.S.
|
||||
You may notice that the CI script on the real blog repository is a bit more complicated than what we've went through in this post, but the extra complexity only comes from some stupid technicalities regarding my build server being based on ARM rather than x86 (raspberry pi).
|
||||
The script we made here is plenty good to get you started.
|
||||
|
||||
{{< centered image="/6616144.png" >}}
|
||||
|
@ -1,78 +0,0 @@
|
||||
+++
|
||||
date = '2024-12-04'
|
||||
draft = true
|
||||
title = "How to Host Docker Containers Easily in The Cloud"
|
||||
tags = ["howto", "tutorial", "web"]
|
||||
categories = ["technical"]
|
||||
+++
|
||||
|
||||
In this post, we will be going over how to set up a [portainer]() managed docker environment, and how to use it.
|
||||
This is ideal if you want to host a personal website, a [blog](/posts/how-to-blog), a personal [github](git.gtz.dk) or whatever your development heart desire.
|
||||
If you choose to follow along, by the end of it, you will have an environment where you can just add or remove docker based services. It's even quite secure!
|
||||
|
||||
## Portainer
|
||||
|
||||
## Traefik
|
||||
|
||||
## Keycloak
|
||||
|
||||
## Automatic backups
|
||||
|
||||
## TODOs
|
||||
- [ ] 2FA the control dashboards through keycloak
|
||||
- [ ] geoblocking the control dashboards
|
||||
- [ ] start the article with a demo of what we'll be making
|
||||
- MAYBE:
|
||||
- [ ] portainer introduction (maybe)
|
||||
- [ ] traefik introduction (maybe)
|
||||
- [ ] add a "skip if you already know portainer and traefik"
|
||||
|
||||
|
||||
```yaml
|
||||
services:
|
||||
postgresql:
|
||||
image: postgres:16
|
||||
environment:
|
||||
- POSTGRES_USER=keycloak
|
||||
_ POSTGRES_DB=keycloak
|
||||
- POSTGRES_PASSWORD=secret
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- keycloak
|
||||
|
||||
|
||||
keycloak:
|
||||
image: quay.io/keycloa/keycloak:22
|
||||
restart: always
|
||||
command: start
|
||||
depends_on:
|
||||
- postgresql
|
||||
environment:
|
||||
# traefik handles ssl
|
||||
- KC_PROXY_ADDRESS_FORWARDING=true
|
||||
- KC_HOSTNAME_STRUCT=false
|
||||
- KC_HOSTNAME=keycloak.gtz.dk
|
||||
- KC_PROXY=edge
|
||||
- KC_HTTP_ENABLED=true
|
||||
# connect to the postgres thing
|
||||
- DB=keycloak
|
||||
- DB_URL='jdbc:postgresql://postgres:5432/postgresql?ssl=allow'
|
||||
- DB_USERNAME=keycloak
|
||||
- DB_PASSWORD=secret
|
||||
- KEYCLOAK_ADMIN=admin
|
||||
- KEYCLOAK_ADMIN_PASSWORD=admin
|
||||
networks:
|
||||
- proxy
|
||||
- keycloa
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- port=8080
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
keycloak:
|
||||
```
|
||||
|
||||
{{< centered image="/6616144.png" >}}
|
Binary file not shown.
Before Width: | Height: | Size: 5.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 274 KiB |
Loading…
x
Reference in New Issue
Block a user