init: projet complet copymail pour Raspberry Pi

Stack: Nginx + PHP 8.2 + MariaDB + Postfix + Dovecot + Samba
- install.sh: script installation automatisé pour RPi OS Bookworm
- Interface web: visionneuse mails + admin (comptes, domaine, dashboard)
- Chaque compte mail génère automatiquement un share Samba
- Processeur cron: extraction pièces jointes via zbateson/mail-mime-parser
- Zéro injection SQL (PDO + prepared statements)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jules
2026-05-04 09:36:35 +02:00
commit 0be1b9119a
21 changed files with 1627 additions and 0 deletions

52
web/login.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
require_once __DIR__ . '/includes/db.php';
require_once __DIR__ . '/includes/auth.php';
require_once __DIR__ . '/includes/layout.php';
auth_start();
if (!empty($_SESSION['admin_id'])) {
header('Location: /');
exit;
}
$error = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$username = trim($_POST['username'] ?? '');
$password = $_POST['password'] ?? '';
if (auth_login($username, $password)) {
header('Location: /');
exit;
}
$error = 'Identifiants incorrects.';
}
html_head('Connexion');
?>
<div class="min-vh-100 d-flex align-items-center justify-content-center bg-light">
<div class="card shadow" style="width:360px">
<div class="card-body p-4">
<div class="text-center mb-4">
<i class="bi bi-envelope-arrow-down-fill text-primary" style="font-size:2.5rem"></i>
<h4 class="mt-2 fw-bold">CopyMail</h4>
</div>
<?php if ($error): ?>
<div class="alert alert-danger py-2"><i class="bi bi-exclamation-triangle-fill me-1"></i><?= htmlspecialchars($error) ?></div>
<?php endif; ?>
<form method="post">
<div class="mb-3">
<label class="form-label">Nom d'utilisateur</label>
<input type="text" name="username" class="form-control" autofocus required>
</div>
<div class="mb-3">
<label class="form-label">Mot de passe</label>
<input type="password" name="password" class="form-control" required>
</div>
<button type="submit" class="btn btn-primary w-100">
<i class="bi bi-box-arrow-in-right me-1"></i>Connexion
</button>
</form>
</div>
</div>
</div>
<?php html_foot(); ?>