feat: implement email validation, CI/CD pipeline, migration history, and web templates
Some checks failed
CI / lint (push) Failing after 21s
CI / build (push) Has been skipped
CI / test (push) Has been skipped
CI / docker (push) Has been skipped

Email validation:
- Replace @/. check with net/mail.ParseAddress on register
- Add size limit check (max 254 chars, RFC 5321)

CI/CD Pipeline:
- Add .gitea/workflows/ci.yml (lint → test → build → docker push)
- Registry: gitea.mrixs.me/Mrixs/MrixsCraft-server
- Push only on main branch

Database:
- Add migrations/002_migration_history.sql (tracking applied migrations)
- Add migrations/README.md (manual apply instructions)

Web Templates:
- Add base.html with Minecraft-themed layout (dark + green accent)
- Add index.html, login.html, register.html with POST forms
- Rewrite templates.go for data-driven rendering with pageData struct
- Fallback placeholder preserved when templates dir missing
This commit is contained in:
2026-05-30 00:39:51 +03:00
parent e1cc999ea8
commit 7ad02cb1b2
10 changed files with 375 additions and 33 deletions

View File

@@ -0,0 +1,103 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{.Title}} — MrixsCraft</title>
<style>
:root {
--bg: #1a1a2e;
--surface: #16213e;
--accent: #4ade80;
--accent-hover: #22c55e;
--text: #e2e8f0;
--text-muted: #94a3b8;
--error: #f87171;
--border: #334155;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: system-ui, -apple-system, sans-serif;
background: var(--bg);
color: var(--text);
min-height: 100vh;
display: flex;
flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header {
background: var(--surface);
border-bottom: 1px solid var(--border);
padding: 0.75rem 0;
}
header .container {
max-width: 960px;
margin: 0 auto;
padding: 0 1rem;
display: flex;
align-items: center;
justify-content: space-between;
}
header .logo { font-size: 1.25rem; font-weight: 700; color: var(--accent); }
header nav a { margin-left: 1rem; font-size: 0.9rem; }
main { flex: 1; padding: 2rem 1rem; }
.container { max-width: 960px; margin: 0 auto; }
h1, h2 { margin-bottom: 1rem; }
p { margin-bottom: 0.75rem; color: var(--text-muted); line-height: 1.6; }
form { max-width: 360px; }
label { display: block; margin-bottom: 0.25rem; font-size: 0.85rem; color: var(--text-muted); }
input[type="text"], input[type="email"], input[type="password"] {
width: 100%;
padding: 0.6rem 0.75rem;
margin-bottom: 1rem;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 6px;
color: var(--text);
font-size: 1rem;
}
input:focus { outline: none; border-color: var(--accent); }
.btn {
display: inline-block;
background: var(--accent);
color: #000;
border: none;
padding: 0.7rem 1.5rem;
border-radius: 6px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 8px;
padding: 2rem;
margin-bottom: 1.5rem;
}
footer {
text-align: center;
padding: 1rem;
color: var(--text-muted);
font-size: 0.8rem;
border-top: 1px solid var(--border);
}
</style>
</head>
<body>
<header>
<div class="container">
<span class="logo">MrixsCraft</span>
<nav>
<a href="/">Главная</a>
<a href="/login">Вход</a>
<a href="/register">Регистрация</a>
</nav>
</div>
</header>
<main><div class="container">{{template "content" .}}</div></main>
<footer>MrixsCraft Server &copy; 2026</footer>
</body>
</html>