feat: gpg and ssh keys #2

Merged
ange merged 10 commits from devel into prod 2024-12-10 18:36:42 +00:00
13 changed files with 121 additions and 56 deletions

View File

@ -1,6 +1,9 @@
FROM docker.io/golang:1.23 as build
FROM docker.io/golang:1.23 AS build
WORKDIR /build/
COPY go.mod go.sum .
RUN go mod download
COPY src/ .
RUN printf 'module yw5n\ngo 1.23' > go.mod && CGO_ENABLED=0 go build -o /app
RUN CGO_ENABLED=0 go build -o /app
FROM scratch
COPY --from=build /app /app

View File

@ -4,3 +4,10 @@ services:
build: .
ports:
- "3000:3000"
develop:
watch:
- action: rebuild
path: src/
- action: sync+restart
path: html/
target: /html

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module main
go 1.23.3

0
go.sum Normal file
View File

View File

@ -8,7 +8,7 @@
<body>
<div id="header">
<a id="headerLink" href="/">Ange DUHAYON</a>
<span id="headerSubtitle">Engineer DevOps</span>
<span id="headerSubtitle">DevOps Engineer</span>
<span class="right" style="font-size: .4em;">Website heavily inspired from <a href="//suckless.org/" target="_blank" rel="noreferrer noopener">suckless.org</a></span>
</div>
<div id="menu">

View File

@ -8,7 +8,7 @@
<body>
<div id="header">
<a id="headerLink" href="/">Ange DUHAYON</a>
<span id="headerSubtitle">Engineer DevOps</span>
<span id="headerSubtitle">DevOps Engineer</span>
<span class="right" style="font-size: .4em;">Website heavily inspired from <a href="//suckless.org/" target="_blank" rel="noreferrer noopener">suckless.org</a></span>
</div>
<div id="menu">
@ -41,6 +41,8 @@
<tr id="phone"><td>Phone (France)</td><td><a href="tel:+33582951623">+33 5 82 95 16 23</a></td></tr>
<tr id="email"><td>Email</td><td><a href="mailto:ange@yw5n.com">ange@yw5n.com</a></td></tr>
<tr id="wa"><td>WhatsApp</td><td><a href="//wa.me/6285333559453">+62 853-3355-9453</a></td></tr>
<tr id="pgp"><td>PGP</td><td><a href="/static/pgp.asc">pgp.asc</a></td></tr>
<tr id="ssh"><td>SSH</td><td><a href="/static/ssh">ssh</a></td></tr>
</table>
</div>

View File

@ -8,7 +8,7 @@
<body>
<div id="header">
<a id="headerLink" href="/">Ange DUHAYON</a>
<span id="headerSubtitle">Engineer DevOps</span>
<span id="headerSubtitle">DevOps Engineer</span>
<span class="right" style="font-size: .4em;">Website heavily inspired from <a href="//suckless.org/" target="_blank" rel="noreferrer noopener">suckless.org</a></span>
</div>
<div id="menu">
@ -21,38 +21,41 @@
<a href="//git.gmoker.com/yw5n/" target="_blank" rel="noreferrer noopener">source</a>
</span>
</div>
<hr class="hidden"/>
<div id="content">
<!--
<div id="nav">
<!--
<ul>
<li><a href="#formation">Formation</a></li>
<li><a href="#experience">Experience</a></li>
<li><a href="#competences">Competences</a></li>
</ul>
-->
<img src="static/2404.webp" alt="Ange DUHAYON" width="128">
</div>
-->
<div id="main">
<h1>4th year EPITECH student</h1>
<img src="static/2404.webp" alt="Ange DUHAYON" width="128">
<h2 id="formation">FORMATION</h2>
<h3><b>EPITECH Toulouse</b> - Promo 2026</h3>
<h3><b>EPITECH Toulouse</b> - Bachelor 2024</h3>
<ul>
<li>C/C++ (system programming, AI, ciphering, games)</li>
<li>Free languages (maths, functional programming)</li>
<li>DevOps (GitHub Actions, Docker, Ansible, Kubernetes)</li>
<li>Free languages (math, functional programming)</li>
<li>DevOps (GitHub Actions, Docker, Ansible, K8S)</li>
</ul>
<h2 id="experience">EXPERIENCE</h2>
<h3><b>Freelance</b> - DevOps</h3>
SEPTEMBER 2023 - Today
SEPTEMBER 2023 - TODAY
<ul>
<li>Server setup (Debian, Docker/K8s, web server, customer application)</li>
<li>CI/CD, real-time monitoring</li>
</ul>
<h3><b>Selfhost</b> - DevOps</h3>
JANUARY 2022 - TODAY
<ul>
<li>Debian + K8S + Gitea CI/CD + Nextcloud + Matrix.org + Jellyfin + SearXNG</li>
</ul>
<h3><b>EPITECH CodingClub association, Toulouse</b> - Cobra</h3>
JANUARY 2021 - TODAY
JANUARY 2021 - JUNE 2024
<ul>
<li>Coding workshops for high school students</li>
</ul>
@ -60,9 +63,8 @@
JUNE 2022 - JULY 2023
<ul>
<li>CI/CD, K8S monitoring</li>
<li>Authentication solution (LDAP, SSO, Webhook)</li>
<li>Authentication solution (LDAP, SSO, Webhook) + Python backend</li>
<li>Mail server (Postfix, Dovecot)</li>
<li>Python backend</li>
<li>Customer communication and troubleshooting</li>
</ul>
@ -73,7 +75,7 @@
<tr><td>Python</td> <td>Git</td></tr>
<tr><td>Bash</td> <td>Vim</td></tr>
<tr><td>Go</td> <td>Docker</td></tr>
<tr><td>JavaScript</td><td>Kubernetes</td></tr>
<tr><td>JavaScript</td><td>K8S</td></tr>
</table>
</div>

View File

@ -3,28 +3,10 @@ package main
import (
"log"
"net/http"
"path/filepath"
"strings"
)
func html(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/style.css" {
http.ServeFile(w, r, "/html/style.css")
return
}
if strings.HasPrefix(r.URL.Path, "/static/") {
http.ServeFile(w, r, r.URL.Path)
return
}
if r.URL.Path == "/" {
http.ServeFile(w, r, "/html/index.html")
return
}
http.ServeFile(w, r, filepath.Join("/html", r.URL.Path + ".html"))
}
func main() {
http.HandleFunc("/", html)
http.HandleFunc("/", Route)
err := http.ListenAndServe(":3000", nil)
if err != nil {

46
src/route.go Normal file
View File

@ -0,0 +1,46 @@
package main
import (
"context"
"fmt"
"net/http"
"regexp"
"slices"
)
type URLParam struct{}
var routes = []struct {
methods []string
regex *regexp.Regexp
handler http.HandlerFunc
}{
{[]string{"GET"}, URL(""), Index},
{[]string{"GET"}, URL("/style\\.css"), Style},
{[]string{"GET"}, URL("/static/.+"), Static},
{[]string{"GET"}, URL("/[^/]+"), HTML},
}
func URL(s string) *regexp.Regexp {
return regexp.MustCompile("^" + s + "/?$")
}
func Route(w http.ResponseWriter, r *http.Request) {
for _, rt := range routes {
matches := rt.regex.FindStringSubmatch(r.URL.Path)
if len(matches) > 0 {
if !slices.Contains(rt.methods, r.Method) {
w.Header().Set("Allow", r.Method)
http.Error(
w, "405 method not allowed", http.StatusMethodNotAllowed,
)
fmt.Println(r.Method, r.URL.Path)
}
rt.handler(w, r.WithContext(
context.WithValue(r.Context(), URLParam{}, matches[1:])),
)
return
}
}
http.NotFound(w, r)
}

View File

@ -1,19 +0,0 @@
package vars
import (
"path/filepath"
)
var (
templates string
static string
html string
css string
)
func init() {
templates = "templates"
static = "static"
html = filepath.Join(static, "html")
css = filepath.Join(static, "css")
}

22
src/views.go Normal file
View File

@ -0,0 +1,22 @@
package main
import (
"net/http"
"path/filepath"
)
func Index(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, filepath.Join("html", "index.html"))
}
func Style(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "/html/style.css")
}
func Static(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, r.URL.Path)
}
func HTML(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, filepath.Join("html", r.URL.Path + ".html"))
}

16
static/pgp.asc Normal file
View File

@ -0,0 +1,16 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEZZrW3RYJKwYBBAHaRw8BAQdAMGz3VvtiVS7x3o/vyS78SovgFsB1mVnMWSU8
sLb2QPe0FGFuZ2UgPGFuZ2VAeXc1bi5jb20+iI4EExYKADYCGwMCF4AWIQSC7Npn
RPOETDoVXXmeDEFXu3vrHQUCZb0M5gQLCQgHBRUKCQgLBBYCAwECHgUACgkQngxB
V7t76x26JAEAoS8KVxiVqT3/7idNbLkMXj0xLaZZQ2bY4F9Y13N17nYA/3u53+ZQ
gU6rm/YlAY4VMGNKaaSN2bavQrHPO56L3r8GuDgEZZrW3RIKKwYBBAGXVQEFAQEH
QFggUlxGt6JJPzluPVouPSZoJ2lJxTKI6FRISwNGht4KAwEIB4h4BBgWCgAgFiEE
guzaZ0TzhEw6FV15ngxBV7t76x0FAmWa1t0CGwwACgkQngxBV7t76x3SJAD9FpRY
omgI/X4t0YvPOOhZYiA7ZS8iAQ8fHEIVAadyHAQBAOlaXQR/x8HoBlkfH5kxy0V+
e93ULsxwcC/c6liRSYkEuDMEZZrW8hYJKwYBBAHaRw8BAQdANRxx2WBQfNX4CFYP
KPBwbhDBI1vJshXwwXtzpekpCXiIeAQYFgoAIBYhBILs2mdE84RMOhVdeZ4MQVe7
e+sdBQJlmtbyAhsgAAoJEJ4MQVe7e+sduyAA/iaw4bd8lIMnHku34/gzPByFc6FU
00vyLLODY4oV0vmTAQC5m2qKl4keqziTH+opyv1nqGgEjHLO92gWYSkRpA6CDg==
=VMSs
-----END PGP PUBLIC KEY BLOCK-----

1
static/ssh Normal file
View File

@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDUccdlgUHzV+AhWDyjwcG4QwSNbybIV8MF7c6XpKQl4