Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
245 changes: 245 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#0b0d12" />
<meta
name="description"
content="Server-VibeCheck – simple server health checks."
/>
<title>Server-VibeCheck</title>
<style>
:root {
color-scheme: dark;
--bg: #0b0d12;
--panel: #10141b;
--text: #f3f5f8;
--muted: #9aa7ba;
--green: #62f2a2;
--border: #303947;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100vh;
padding: 64px 22px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: radial-gradient(
ellipse at 50% 15%,
#14251e 0,
var(--bg) 48%
);
color: var(--text);
font-family:
system-ui,
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
sans-serif;
}
main {
width: min(100%, 820px);
text-align: center;
}
.logo {
display: block;
width: min(240px, 62vw);
max-height: 170px;
object-fit: contain;
margin: 0 auto 22px;
}
h1 {
margin: 0;
font-size: clamp(2.5rem, 8vw, 4.5rem);
line-height: 1.08;
letter-spacing: -0.06em;
}
h1 span {
color: var(--green);
}
.tagline {
margin: 18px 0 28px;
color: var(--muted);
font-size: clamp(1rem, 3vw, 1.2rem);
}
.github {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 12px 18px;
border: 1px solid var(--border);
border-radius: 9px;
color: var(--text);
text-decoration: none;
font-weight: 650;
transition:
border-color 0.15s ease,
transform 0.15s ease;
}
.github:hover {
border-color: var(--green);
transform: translateY(-1px);
}
h2 {
margin: 78px 0 14px;
color: var(--muted);
font:
700 0.9rem/1.4 ui-monospace,
SFMono-Regular,
Menlo,
Consolas,
monospace;
letter-spacing: 0.12em;
}
.terminal {
overflow: hidden;
text-align: left;
border: 1px solid var(--border);
border-radius: 11px;
background: rgba(12, 15, 21, 0.92);
}
.terminal-bar {
display: flex;
gap: 8px;
padding: 14px 16px;
border-bottom: 1px solid #202733;
}
.dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: #596272;
}
.dot:first-child {
background: #ff6868;
}
.dot:nth-child(2) {
background: #ffc34f;
}
.dot:nth-child(3) {
background: #36d879;
}
pre {
margin: 0;
padding: 18px;
overflow-x: auto;
white-space: pre-wrap;
overflow-wrap: anywhere;
color: #cbd6e5;
font:
0.9rem/1.8 ui-monospace,
SFMono-Regular,
Menlo,
Consolas,
monospace;
}
.cmd {
color: var(--green);
}
.copy {
display: block;
margin: 12px 0 0 auto;
padding: 8px 12px;
border: 1px solid var(--border);
border-radius: 7px;
background: var(--panel);
color: var(--muted);
font:
500 0.82rem system-ui,
sans-serif;
cursor: pointer;
}
.copy:hover {
color: var(--text);
border-color: var(--green);
}
@media (max-width: 520px) {
body {
padding: 48px 16px;
}
h2 {
margin-top: 58px;
}
pre {
font-size: 0.78rem;
padding: 14px;
}
}
@media (prefers-reduced-motion: reduce) {
* {
transition: none !important;
}
}
</style>
</head>
<body>
<main>
<img
class="logo"
src="https://raw.githubusercontent.com/Knuspii/Server-VibeCheck/main/assets/server-vibecheck_logo.png"
alt="Server-VibeCheck logo"
width="240"
height="160"
/>

<h1>Server-<span>VibeCheck</span></h1>
<a href="https://www.gnu.org/software/bash/"
><img
src="https://img.shields.io/github/languages/top/Knuspii/Server-VibeCheck?color=green"
alt="Bash"
/></a>
<a href="https://github.com/knuspii/server-vibecheck/stargazers"
><img
src="https://img.shields.io/github/stars/knuspii/server-vibecheck?style=social"
alt="GitHub Stars"
/></a>
<p class="tagline">Check your server. Keep the vibe.</p>
<a
class="github"
href="https://github.com/Knuspii/Server-VibeCheck"
target="_blank"
rel="noopener noreferrer"
>View on GitHub ↗</a
>

<h2>INSTALLATION</h2>
<section class="terminal" aria-label="Installation command">
<div class="terminal-bar" aria-hidden="true">
<span class="dot"></span><span class="dot"></span
><span class="dot"></span>
</div>
<pre
id="install-command"
><span class="cmd">curl -L</span> https://github.com/Knuspii/Server-VibeCheck/releases/latest/download/server-vibecheck.sh -o svc <span class="cmd">&amp;&amp; sudo</span> install -m 755 svc /usr/local/bin/server-vibecheck <span class="cmd">&amp;&amp;</span> rm svc</pre>
</section>
<button class="copy" type="button" id="copy-command">
Copy command
</button>
</main>
<script>
const command =
"curl -L https://github.com/Knuspii/Server-VibeCheck/releases/latest/download/server-vibecheck.sh -o svc && sudo install -m 755 svc /usr/local/bin/server-vibecheck && rm svc";
document
.getElementById("copy-command")
.addEventListener("click", async () => {
const button = document.getElementById("copy-command");
try {
await navigator.clipboard.writeText(command);
button.textContent = "Copied!";
setTimeout(
() => (button.textContent = "Copy command"),
1600,
);
} catch {
button.textContent = "Select and copy command";
}
});
</script>
</body>
</html>
61 changes: 48 additions & 13 deletions server-vibecheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

set -euo pipefail

VERSION="v0.3"
VERSION="v0.4"
GREEN="\033[32m"
YELLOW="\033[33m"
BLUE="\033[34m"
Expand Down Expand Up @@ -55,12 +55,14 @@ Usage:
server-vibecheck [OPTIONS]

Options:
NO OPTION Start scan
-h, --help Show this help message
-l, --log <file> Write output to log file
-u, --update Update to the latest version
-d, --debug Enable debug output
-v, --version Show version
NO OPTION Start scan
-h, --help Show this help message
-l, --log <file> Write output to log file
-u, --update Update to the latest version
-d, --debug Enable debug output
-v, --version Show version
--podman-user <user> User whose Podman containers should be checked
Use 'auto' to detect the user automatically

Made by Knuspii
EOF
Expand Down Expand Up @@ -178,6 +180,14 @@ while [[ $# -gt 0 ]]; do
fi
exit 0
;;
--podman-user)
if [[ -z "${2:-}" ]]; then
echo "Missing argument for --podman-user"
exit 1
fi
PODMAN_USER="$2"
shift 2
;;
-d|--debug|--verbose)
DEBUG=true
shift
Expand All @@ -203,6 +213,16 @@ while [[ $# -gt 0 ]]; do
esac
done

# ---------------- PODMAN USER DETECT ----------------

if [[ "${PODMAN_USER}" == "auto" ]]; then
if [[ -n "${SUDO_USER:-}" && "${SUDO_USER}" != "root" ]]; then
PODMAN_USER="${SUDO_USER}"
else
PODMAN_USER="${USER}"
fi
fi

# ---------------- LOGGING ----------------

if [[ -n "${LOG_FILE}" ]]; then
Expand Down Expand Up @@ -528,17 +548,32 @@ fi

debug "Checking Podman..."

if command -v podman >/dev/null; then
if podman info >/dev/null 2>&1; then
running=$(podman ps -q 2>/dev/null | wc -l)
if command -v podman >/dev/null 2>&1; then

PODMAN_CMD=(podman)

if [[ "${PODMAN_USER}" != "${USER}" ]]; then
PODMAN_CMD=(sudo -u "${PODMAN_USER}" podman)
fi
if "${PODMAN_CMD[@]}" info >/dev/null 2>&1; then
running=$("${PODMAN_CMD[@]}" ps -q 2>/dev/null | wc -l)
unhealthy=$("${PODMAN_CMD[@]}" ps --filter health=unhealthy -q 2>/dev/null | wc -l)
ok "Podman is working"
ok "Podman containers running: ${running}"

if [[ "${running}" -eq 0 ]]; then
info "Podman found 0 running containers. Check with 'podman ps'"
else
ok "Podman containers running: ${running}"
fi

if [[ "${unhealthy}" -gt 0 ]]; then
warn "Podman unhealthy containers: ${unhealthy}"
fi
else
warn "podman installed but not working"
warn "Podman installed but not working"
fi
else
ignore "podman not installed"
ignore "Podman not installed"
fi

# ---------------- KUBERNETES ----------------
Expand Down
Loading