Compare commits

...

9 Commits
main ... prod

Author SHA1 Message Date
c4e53afdf1
fix: contact order
All checks were successful
/ deploy (push) Successful in 35s
2024-12-21 11:15:06 +00:00
08557f45db
feat: linkedin
All checks were successful
/ deploy (push) Successful in 46s
2024-12-21 11:13:23 +00:00
186491250e
feat: range over files for paths
All checks were successful
/ deploy (push) Successful in 46s
2024-12-14 09:19:13 +00:00
e9fc659a5a
feat: html static templates
All checks were successful
/ deploy (push) Successful in 46s
2024-12-14 08:34:47 +00:00
9d0da00371
feat: open links in new tabs
All checks were successful
/ deploy (push) Successful in 34s
2024-12-12 14:31:36 +00:00
4b530d332c
feat: copy button
All checks were successful
/ deploy (push) Successful in 46s
2024-12-12 14:28:45 +00:00
b9d7553420
feat: gpg and ssh keys
All checks were successful
/ deploy (push) Successful in 34s
2024-12-10 18:30:56 +00:00
f08dfa02ab
fix: typo
All checks were successful
/ deploy (push) Successful in 46s
2024-12-10 03:07:35 +00:00
aaac5d780b
feat: better route function
All checks were successful
/ deploy (push) Successful in 48s
2024-12-10 03:04:52 +00:00
20 changed files with 299 additions and 154 deletions

View File

@ -1,14 +1,15 @@
ARG VER=1.23
FROM "docker.io/golang:$VER" as build
FROM docker.io/golang:1.23 AS build
WORKDIR /build/
ARG VER
COPY main.go .
RUN printf "module yw5n\ngo $VER" > go.mod && CGO_ENABLED=0 go build -o /app
COPY go.mod go.sum .
RUN go mod download
COPY src/ .
RUN CGO_ENABLED=0 go build -o /app
FROM scratch
COPY --from=build /app /app
COPY static/ /static/
COPY html/ /html/
COPY --from=build /app .
COPY html/ html/
COPY css/ css/
COPY static/ static/
COPY tmpl/ tmpl/
EXPOSE 3000
CMD ["/app"]
CMD ["./app"]

View File

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

11
css/resume.css Normal file
View File

@ -0,0 +1,11 @@
@media print {
@page {
size: A4;
size: portrait;
margin: 5mm;
}
#menu, #credits {
display: none;
}
}

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

@ -1,33 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Ange DUHAYON</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<div id="header">
<a id="headerLink" href="/">Ange DUHAYON</a>
<span id="headerSubtitle">Engineer DevOps</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">
<a href="/">contact</a>
<a href="/resume">resume</a>
<a href="/about"><b>about me</b></a>
<span class="right">
<a href="//git.gmoker.com/yw5n/" target="_blank" rel="noreferrer noopener">source</a>
</span>
</div>
<div id="content">
<!--
<div id="nav">
<ul>
</ul>
</div>
-->
<div id="main">
</div>
</div>
</body>
</html>

69
html/contact.html Normal file
View File

@ -0,0 +1,69 @@
<!DOCTYPE html>
<html>
<head>
{{template "head.tmpl" .}}
<script src="static/copy.js"></script>
</head>
<body>
{{template "header.tmpl" .}}
<div id="content">
<!--
<div id="nav">
<ul>
<li><a href="#matrix">Matrix</a></li>
<li><a href="#discord">Discord</a></li>
<li><a href="#phone">Phone (France)</a></li>
<li><a href="#email">Email</a></li>
<li><a href="#wa">WhatsApp</a></li>
</ul>
</div>
-->
<div id="main">
<table>
<tr>
<td>Matrix (Element)</td>
<td id="matrix"><a href="//app.element.io/#/user/@ange:gmoker.com" target="_blank" rel="noreferrer noopener">@ange:gmoker.com</a></td>
<td><button onclick="copyElem('matrix')">Copy</button></td>
</tr>
<tr>
<td>Discord</td>
<td id="discord">@elrilio</td>
<td><button onclick="copyElem('discord')">Copy</button></td>
</tr>
<tr>
<td>Phone (France)</td>
<td id="phone"><a href="tel:+33582951623" target="_blank" rel="noreferrer noopener">+33 5 82 95 16 23</a></td>
<td><button onclick="copyElem('phone', / /g)">Copy</button></td>
</tr>
<tr>
<td>Email</td>
<td id="email"><a href="mailto:ange@yw5n.com" target="_blank" rel="noreferrer noopener">ange@yw5n.com</a></td>
<td><button onclick="copyElem('email')">Copy</button></td>
</tr>
<tr>
<td>WhatsApp</td>
<td id="wa"><a href="//wa.me/6285333559453" target="_blank" rel="noreferrer noopener">+62 853-3355-9453</a></td>
<td><button onclick="copyElem('wa', /[ |-]/g)">Copy</button></td>
</tr>
<tr>
<td>LinkedIn</td>
<td id="in"><a href="https://www.linkedin.com/in/angedhn" target="_blank" rel="noreferrer noopener">www.linkedin.com/in/angedhn</a></td>
<td><button onclick="copyElem('in')">Copy</button></td>
</tr>
<tr>
<td>PGP</td>
<td id="pgp"><a href="/static/pgp.asc" target="_blank" rel="noreferrer noopener">pgp.asc</a></td>
<td><button onclick="copyFile('pgp')">Copy</button></td>
</tr>
<tr>
<td>SSH</td>
<td id="ssh"><a href="/static/ssh" target="_blank" rel="noreferrer noopener">ssh</a></td>
<td><button onclick="copyFile('ssh')">Copy</button></td>
</tr>
</table>
</div>
</div>
</body>
</html>

View File

@ -1,49 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Ange DUHAYON</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<div id="header">
<a id="headerLink" href="/">Ange DUHAYON</a>
<span id="headerSubtitle">Engineer DevOps</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">
<a href="/"><b>contact</b></a>
<a href="/resume">resume</a>
<!--
<a href="/about">about me</a>
-->
<span class="right">
<a href="//git.gmoker.com/yw5n/" target="_blank" rel="noreferrer noopener">source</a>
</span>
</div>
<div id="content">
<!--
<div id="nav">
<ul>
<li><a href="#matrix">Matrix</a></li>
<li><a href="#discord">Discord</a></li>
<li><a href="#phone">Phone (France)</a></li>
<li><a href="#email">Email</a></li>
<li><a href="#wa">WhatsApp</a></li>
</ul>
</div>
-->
<div id="main">
<table>
<tr id="matrix"><td>Matrix (Element)</td><td><a href="//app.element.io/#/user/@ange:gmoker.com">@ange:gmoker.com</a></td></tr>
<tr id="discord"><td>Discord</td><td>@elrilio</td></tr>
<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>
</table>
</div>
</div>
</body>
</html>

View File

@ -1,68 +1,56 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Ange DUHAYON</title>
<link rel="stylesheet" href="style.css"/>
{{template "head.tmpl" .}}
<link rel="stylesheet" href="resume.css"/>
</head>
<body>
<div id="header">
<a id="headerLink" href="/">Ange DUHAYON</a>
<span id="headerSubtitle">Engineer DevOps</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">
<a href="/">contact</a>
<a href="/resume"><b>resume</b></a>
<!--
<a href="/about">about me</a>
-->
<span class="right">
<a href="//git.gmoker.com/yw5n/" target="_blank" rel="noreferrer noopener">source</a>
</span>
</div>
<hr class="hidden"/>
{{template "header.tmpl" .}}
<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 (math, functional programming)</li>
<li>DevOps (GitHub Actions, Docker, Ansible, Kubernetes)</li>
<li>DevOps (GitHub Actions, Docker, Ansible, K8S)</li>
</ul>
<h2 id="experience">EXPERIENCE</h2>
<h3><b>Freelance</b> - DevOps</h3>
SEPTEMBER 2023 - TODAY
<ul>
<li>Server setup (Debian, Docker/K8s, web server, customer application)</li>
<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</li>
<li>Nextcloud, Matrix.org, Jellyfin, SearXNG</li>
</ul>
<h3><b>EPITECH CodingClub association, Toulouse</b> - Cobra</h3>
JANUARY 2021 - JUNE 2024
<ul>
<li>Coding workshops for high school students</li>
</ul>
<h3><b>Predicloud, Toulouse</b> - DevOps / Site Reliability Manager</h3>
<h3><b>Predicloud, Toulouse</b> - DevOps SRE</h3>
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 +61,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>JS</td> <td>K8S</td></tr>
</table>
</div>

32
main.go
View File

@ -1,32 +0,0 @@
package main
import (
"log"
"net/http"
"path/filepath"
)
func html(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/style.css" {
http.ServeFile(w, r, "/html/style.css")
return
}
if len(r.URL.Path) > len("/static/") && r.URL.Path[:len("/static/")] == "/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)
err := http.ListenAndServe(":3000", nil)
if err != nil {
log.Fatal(err)
}
}

14
src/main.go Normal file
View File

@ -0,0 +1,14 @@
package main
import (
"log"
"net/http"
)
func main() {
http.HandleFunc("/", route)
generateTmpl()
if err := http.ListenAndServe(":3000", nil); err != nil {
log.Fatal(err)
}
}

51
src/route.go Normal file
View File

@ -0,0 +1,51 @@
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("/static/.+"), static},
{[]string{"GET"}, url("/(.+\\.css)"), css},
{[]string{"GET"}, url("/([^/]+)"), html},
}
func url(s string) *regexp.Regexp {
return regexp.MustCompile("^" + s + "/?$")
}
func getParam(r *http.Request, i int) string {
return r.Context().Value(URLParam{}).([]string)[i]
}
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,
)
return
}
fmt.Println(r.Method, r.URL.Path)
rt.handler(w, r.WithContext(
context.WithValue(r.Context(), URLParam{}, matches[1:])),
)
return
}
}
http.NotFound(w, r)
}

31
src/tmpl.go Normal file
View File

@ -0,0 +1,31 @@
package main
import (
"bytes"
"html/template"
"path/filepath"
"regexp"
)
var TMPL map[string][]byte
func generateTmpl() {
files, _ := filepath.Glob("html/*.html")
re := regexp.MustCompile("html/(.+).html")
names := make([]string, len(files))
for i, f := range files {
names[i] = re.FindStringSubmatch(f)[1]
}
TMPL = make(map[string][]byte, len(files))
for i, f := range files {
b := new(bytes.Buffer)
t, _ := template.ParseFiles(f)
t.ParseGlob("tmpl/*.tmpl")
t.Execute(b, map[string]any{
"name": names[i],
"names": names,
})
TMPL[names[i]] = b.Bytes()
}
}

28
src/views.go Normal file
View File

@ -0,0 +1,28 @@
package main
import (
"path/filepath"
"net/http"
"fmt"
)
func index(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/contact", http.StatusMovedPermanently)
}
func static(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, r.URL.Path)
}
func css(w http.ResponseWriter, r *http.Request) {
fmt.Println(filepath.Join("css", getParam(r, 0)))
http.ServeFile(w, r, filepath.Join("css", getParam(r, 0)))
}
func html(w http.ResponseWriter, r *http.Request) {
if t, found := TMPL[getParam(r, 0)]; found {
w.Write(t)
} else {
http.NotFound(w, r)
}
}

13
static/copy.js Normal file
View File

@ -0,0 +1,13 @@
function copyElem(id, r='') {
navigator.clipboard.writeText(
document.getElementById(id).innerText.replaceAll(r, ''),
);
}
function copyFile(id) {
fetch(document.getElementById(id).childNodes[0].href).then(f => {
f.text().then(t => {
navigator.clipboard.writeText(t);
})
})
}

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

3
tmpl/head.tmpl Normal file
View File

@ -0,0 +1,3 @@
<meta charset="UTF-8">
<title>Ange DUHAYON</title>
<link rel="stylesheet" href="style.css"/>

14
tmpl/header.tmpl Normal file
View File

@ -0,0 +1,14 @@
<div id="header">
<a id="headerLink" href="/">Ange DUHAYON</a>
<span id="headerSubtitle">DevOps Engineer</span>
<span id="credits" 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">
{{$name := .name}}
{{range .names}}
<a href="/{{.}}">{{if eq $name .}}<b>{{.}}</b>{{else}}{{.}}{{end}}</a>
{{end}}
<span class="right">
<a href="//git.gmoker.com/yw5n" target="_blank" rel="noreferrer noopener">source</a>
</span>
</div>