Initial commit
This commit is contained in:
38
pages/email_autoconfig.go
Normal file
38
pages/email_autoconfig.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package pages
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type EmailAutoconfigTemplateData struct {
|
||||
Domain string
|
||||
DisplayName string
|
||||
ShortDisplayName string
|
||||
ImapServer string
|
||||
PopServer string
|
||||
SmtpServer string
|
||||
}
|
||||
|
||||
func emailAutoconfig(w http.ResponseWriter, r *http.Request) {
|
||||
templateFile := "templates/email_autoconfig.tmpl"
|
||||
files, err := template.New(templateFile).ParseFS(content, templateFile)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
err = files.ExecuteTemplate(w, "email_autoconfig.tmpl", EmailAutoconfigTemplateData{
|
||||
Domain: "prettysunflower.moe",
|
||||
DisplayName: "prettysunflower's mail server",
|
||||
ShortDisplayName: "prettysunflower",
|
||||
ImapServer: "mail.prettysunflower.moe",
|
||||
PopServer: "mail.prettysunflower.moe",
|
||||
SmtpServer: "mail.prettysunflower.moe",
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
}
|
32
pages/init.go
Normal file
32
pages/init.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package pages
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"html/template"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
//go:embed templates/*
|
||||
var content embed.FS
|
||||
|
||||
func InitHttpHandlers() {
|
||||
http.HandleFunc("/{$}", homepage)
|
||||
http.HandleFunc("/.well-known/autoconfig/mail/config-v1.1.xml", emailAutoconfig)
|
||||
http.HandleFunc("/mail/config-v1.1.xml", emailAutoconfig)
|
||||
}
|
||||
|
||||
func homepage(w http.ResponseWriter, r *http.Request) {
|
||||
templateFile := "templates/homepage.tmpl"
|
||||
files, err := template.New(templateFile).ParseFS(content, templateFile)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
err = files.ExecuteTemplate(w, "homepage.tmpl", nil)
|
||||
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
}
|
28
pages/templates/email_autoconfig.tmpl
Normal file
28
pages/templates/email_autoconfig.tmpl
Normal file
@@ -0,0 +1,28 @@
|
||||
<clientConfig version="1.1">
|
||||
<emailProvider id="{{ .Domain }}">
|
||||
<domain>{{ .Domain }}</domain>
|
||||
<displayName>{{ .DisplayName }}</displayName>
|
||||
<displayShortName>{{ .ShortDisplayName }}</displayShortName>
|
||||
<incomingServer type="imap">
|
||||
<hostname>{{ .ImapServer }}</hostname>
|
||||
<port>993</port>
|
||||
<socketType>SSL</socketType>
|
||||
<authentication>password-cleartext</authentication>
|
||||
<username>%EMAILADDRESS%</username>
|
||||
</incomingServer>
|
||||
<incomingServer type="pop3">
|
||||
<hostname>{{ .PopServer }}</hostname>
|
||||
<port>995</port>
|
||||
<socketType>SSL</socketType>
|
||||
<authentication>password-cleartext</authentication>
|
||||
<username>%EMAILADDRESS%</username>
|
||||
</incomingServer>
|
||||
<outgoingServer type="smtp">
|
||||
<hostname>{{ .SmtpServer }}</hostname>
|
||||
<port>587</port>
|
||||
<socketType>STARTTLS</socketType>
|
||||
<authentication>password-cleartext</authentication>
|
||||
<username>%EMAILADDRESS%</username>
|
||||
</outgoingServer>
|
||||
</emailProvider>
|
||||
</clientConfig>
|
78
pages/templates/homepage.tmpl
Normal file
78
pages/templates/homepage.tmpl
Normal file
@@ -0,0 +1,78 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>prettysunflower</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/static/css/style.css">
|
||||
</head>
|
||||
<body class="page-index">
|
||||
<header>
|
||||
<div>
|
||||
<img src="https://kakigoori.dev/5819581e-42b9-41a7-bab6-c3f99de30934/auto" alt="Avatar of prettysunflower">
|
||||
|
||||
<div>
|
||||
<h1>prettysunflower</h1>
|
||||
<p>
|
||||
Nyallo! We're Remilia, Xeon, and Takeno!
|
||||
</p>
|
||||
<p>
|
||||
We're a system of 3, we're software and website developers at
|
||||
the <a href="https://koumbit.org">Réseau Koumbit</a>, we're Touhou and Factorio players,
|
||||
and we're your local trans women/enby/plural person wishing you a good day!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<div class="columns">
|
||||
<div>
|
||||
<h2>Our pronouns 🏳️⚧</h2>
|
||||
|
||||
<p>
|
||||
<strong>Remilia:</strong> <a href="https://pronouns.within.lgbt/they/them/their/theirs/themself">they/them</a> and <a href="https://pronouns.within.lgbt/she/her/her/hers/herself">she/her</a><br>
|
||||
<strong>Xeon:</strong> <a href="https://pronouns.within.lgbt/they/them/their/theirs/themselves">they/them</a><br>
|
||||
<strong>Takeno:</strong> <a href="https://pronouns.within.lgbt/she/her/her/hers/herself">she/her</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2>The ways to contact us</h2>
|
||||
<p>
|
||||
<a href="mailto:me@prettysunflower.moe">me@prettysunflower.moe</a><br>
|
||||
<a href="https://bsky.app/profile/prettysunflower.moe">Bluesky</a><br>
|
||||
<a href="https://akkoma.prettysunflower.moe">Fediverse</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2>Our code</h2>
|
||||
<p>
|
||||
<a href="https://git.prettysunflower.moe">Gitea</a><br>
|
||||
<a href="https://github.com/prettysunflower">GitHub</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="main-projects">
|
||||
<h2>Our main projects</h2>
|
||||
|
||||
<div>
|
||||
<img src="https://kakigoori.dev/bcf6fdd9-3855-4f4d-9b5a-0791e14e29c7/height/200/auto">
|
||||
|
||||
<div>
|
||||
<h3>Kakigoori</h3>
|
||||
<p>
|
||||
Kakigoori is an picture distribution system to publish images on the web.
|
||||
Upload it once, and Kakigoori will create versions of the image
|
||||
optimized for the web (AVIF, WebP).
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user