🚀 Setup automated deployment system with comprehensive credential protection

- Added Express server with Git info API endpoint
- Created automated deployment scripts (systemd-based, not PM2)
- Implemented 5-minute auto-sync with GitHub
- Enhanced .gitignore with 200+ credential protection patterns
- Added Git version badge to UI footer
- Created comprehensive deployment documentation
- Added TurnKey Nginx fix for default control panel issue
- Included security verification tools

All credentials protected and verified safe for deployment.
This commit is contained in:
2025-12-27 21:34:08 +11:00
parent b4bddb2aa0
commit d7f534284a
22 changed files with 3540 additions and 0 deletions

42
server.js Normal file
View File

@@ -0,0 +1,42 @@
const express = require("express");
const path = require("path");
const fs = require("fs");
const { exec } = require("child_process");
const app = express();
const PORT = process.env.PORT || 3000;
// Serve static files
app.use(express.static(__dirname));
// API endpoint to get Git commit info
app.get("/api/git-info", (req, res) => {
exec('git log -1 --format="%H|%cr"', (error, stdout, stderr) => {
if (error) {
console.error("Error getting git info:", error);
return res.json({
commitId: "unknown",
commitAge: "unknown",
error: true,
});
}
const [commitId, commitAge] = stdout.trim().split("|");
res.json({
commitId: commitId.substring(0, 7),
commitAge: commitAge,
error: false,
});
});
});
// Serve index.html for all other routes
app.get("*", (req, res) => {
res.sendFile(path.join(__dirname, "index.html"));
});
app.listen(PORT, () => {
console.log(`🚀 Server running on port ${PORT}`);
console.log(`📁 Serving files from: ${__dirname}`);
console.log(`🌐 Environment: ${process.env.NODE_ENV || "development"}`);
});