feat: gpg and ssh keys
All checks were successful
/ deploy (push) Successful in 34s

This commit is contained in:
ange 2024-12-10 18:30:56 +00:00
parent f08dfa02ab
commit b9d7553420
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
6 changed files with 45 additions and 18 deletions

View File

@ -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

@ -5,8 +5,6 @@ import (
"net/http"
)
// TODO: html templates
// TODO: download resume as PDF
func main() {
http.HandleFunc("/", Route)

View File

@ -4,33 +4,21 @@ import (
"context"
"fmt"
"net/http"
"path/filepath"
"regexp"
"slices"
)
type URLParam struct{}
type W = http.ResponseWriter
type R = *http.Request
var routes = []struct {
methods []string
regex *regexp.Regexp
handler http.HandlerFunc
}{
{[]string{"GET"}, URL(""), func(w W, r R) {
http.ServeFile(w, r, filepath.Join("html", "index.html"))
}},
{[]string{"GET"}, URL("/style\\.css"), func(w W, r R) {
http.ServeFile(w, r, "/html/style.css")
}},
{[]string{"GET"}, URL("/static/.+"), func(w W, r R) {
http.ServeFile(w, r, r.URL.Path)
}},
{[]string{"GET"}, URL("/[^/]+"), func(w W, r R) {
http.ServeFile(w, r, filepath.Join("html", r.URL.Path + ".html"))
}},
{[]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 {

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