Dockerize passman for modern environments

Ported the original passman PHP/MySQL application to a Docker-based setup using Apache and MariaDB.
Fixed compatibility issues with modern PHP/MariaDB versions (HTTP header handling and database collation) using minimal, targeted changes.
Preserved the original application logic and structure while ensuring correct execution in a contemporary containerized environment.
This commit is contained in:
2026-01-10 19:20:00 +02:00
parent 61c777f33a
commit b814885a96
8 changed files with 214 additions and 151 deletions
+16 -16
View File
@@ -1,13 +1,3 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Registration Form</title>
</head>
<body>
<h3>New user registration</h3>
<?php
// Start a new session (or resume an existing one)
session_start();
@@ -31,12 +21,13 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
mysqli_report(MYSQLI_REPORT_OFF); // disable exceptions
// Connect to the database
$conn=mysqli_connect("localhost","root","","pwd_mgr");
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
exit();
}
//$conn=mysqli_connect("localhost","root","","pwd_mgr");
//// Check connection
//if (mysqli_connect_errno()) {
// echo "Failed to connect to MySQL: " . mysqli_connect_error();
// exit();
//}
require_once __DIR__ . "/config.php";
// Insert a new user
$sql_query = "INSERT INTO login_users (username,password) VALUES ('{$new_username}','{$new_password}');";
@@ -62,7 +53,16 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Registration Form</title>
</head>
<body>
<h3>New user registration</h3>
<p/>
<form method="POST" action="register.php">
<input type="text" name="new_username" placeholder="Username"><br />