first commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-lg-6 mx-auto text-center">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h1 class="display-1 text-muted">404</h1>
|
||||
<h2 class="mb-3">Page Not Found</h2>
|
||||
<p class="lead">
|
||||
Oops! The page you're looking for doesn't exist. It might have been moved, deleted, or you entered the wrong URL.
|
||||
</p>
|
||||
<hr class="my-4">
|
||||
<div class="d-grid gap-2 d-md-block">
|
||||
<a href="{{ url_for('index') }}" class="btn btn-primary">Go Home</a>
|
||||
<a href="javascript:history.back()" class="btn btn-outline-secondary">Go Back</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<h5>Popular Pages:</h5>
|
||||
<ul class="list-inline">
|
||||
<li class="list-inline-item">
|
||||
<a href="{{ url_for('index') }}" class="text-decoration-none">Home</a>
|
||||
</li>
|
||||
<li class="list-inline-item">•</li>
|
||||
<li class="list-inline-item"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,28 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-lg-6 mx-auto text-center">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h1 class="display-1 text-danger">500</h1>
|
||||
<h2 class="mb-3">Internal Server Error</h2>
|
||||
<p class="lead">
|
||||
Something went wrong on our end. We're working to fix the issue. Please try again later.
|
||||
</p>
|
||||
<hr class="my-4">
|
||||
<div class="d-grid gap-2 d-md-block">
|
||||
<a href="{{ url_for('index') }}" class="btn btn-primary">Go Home</a>
|
||||
<a href="javascript:location.reload()" class="btn btn-outline-secondary">Try Again</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<div class="alert alert-info" role="alert">
|
||||
<strong>Need help?</strong> If this problem persists, please <a href="{{ url_for('contact') }}" class="alert-link">contact us</a> and let us know what you were trying to do.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% if title %}{{ title }} - {% endif %}Finger Web App</title>
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
|
||||
<!-- Custom CSS -->
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<!-- Navigation -->
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="{{ url_for('index') }}">Finger Web</a>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('index') }}">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('finger') }}">Finger</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ url_for('api_hello') }}" target="_blank">API</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Flash Messages -->
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
<div class="container mt-3">
|
||||
{% for category, message in messages %}
|
||||
<div class="alert alert-{{ 'danger' if category == 'error' else 'success' }} alert-dismissible fade show" role="alert">
|
||||
{{ message }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<!-- Main Content -->
|
||||
<main class="container my-4">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="bg-light text-center text-muted py-3 mt-5">
|
||||
<div class="container">
|
||||
<p>© 2025 Finger Web App. Built with Flask and Bootstrap.</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<!-- Custom JS -->
|
||||
<script src="{{ url_for('static', filename='js/main.js') }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,115 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-lg-10 mx-auto">
|
||||
<h1 class="mb-4">🔍 Finger Command</h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">User Lookup</h5>
|
||||
<form method="POST" action="{{ url_for('finger') }}">
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label">Username (optional)</label>
|
||||
<input type="text" class="form-control" id="username" name="username"
|
||||
value="{{ username or '' }}"
|
||||
placeholder="Enter username or email (e.g., [email protected])"
|
||||
pattern="[a-zA-Z0-9.\-_@]*"
|
||||
title="Alphanumeric characters, dots, hyphens, underscores, and @ symbol allowed">
|
||||
<div class="form-text">
|
||||
Leave empty to show all logged-in users, or enter a username or email address.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-search"></i> Run Finger
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-secondary ms-2" onclick="clearForm()">
|
||||
Clear
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title">ℹ️ About Finger</h6>
|
||||
<p class="card-text small">
|
||||
The finger command displays information about users on the system, including:
|
||||
</p>
|
||||
<ul class="small">
|
||||
<li>Login name and real name</li>
|
||||
<li>Terminal and login time</li>
|
||||
<li>Idle time</li>
|
||||
<li>Home directory and shell</li>
|
||||
<li>Plan and project files (if available)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0">
|
||||
{% if username %}
|
||||
Results for "{{ username }}"
|
||||
{% else %}
|
||||
System Users
|
||||
{% endif %}
|
||||
</h5>
|
||||
{% if result or error %}
|
||||
<small class="text-muted">
|
||||
{{ moment().format('YYYY-MM-DD HH:mm:ss') if moment else '' }}
|
||||
</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if error %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<i class="fas fa-exclamation-triangle"></i>
|
||||
<strong>Error:</strong> {{ error }}
|
||||
</div>
|
||||
{% elif result %}
|
||||
<div class="alert alert-success mb-3" role="alert">
|
||||
<i class="fas fa-check-circle"></i>
|
||||
Command executed successfully
|
||||
</div>
|
||||
<div class="finger-output">
|
||||
<pre class="rounded"><code>{{ result }}</code></pre>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="text-center text-muted py-5">
|
||||
<i class="fas fa-terminal fa-3x mb-3"></i>
|
||||
<p>Enter a username and click "Run Finger" to see user information,<br>
|
||||
or leave username empty to see all logged-in users.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center mt-4">
|
||||
<a href="{{ url_for('index') }}" class="btn btn-outline-primary">
|
||||
<i class="fas fa-home"></i> Back to Home
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function clearForm() {
|
||||
document.getElementById('username').value = '';
|
||||
// Optionally reload the page to clear results
|
||||
window.location.href = "{{ url_for('finger') }}";
|
||||
}
|
||||
|
||||
// Auto-focus on username input when page loads
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.getElementById('username').focus();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,17 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-lg-8 mx-auto">
|
||||
<div class="jumbotron bg-light p-5 rounded">
|
||||
<h1 class="display-4">Welcome to Finger Web!</h1>
|
||||
<p class="lead">A simple web interface to the unix finger command.</p>
|
||||
<hr class="my-4">
|
||||
<p><a href="https://en.wikipedia.org/wiki/Finger_(protocol)">Finger</a> is a utility from 1971 written to discover user information on remote unix systems. While it's use has fallen off, you can sometimes still find active finger servers where users provide information about themselves.</p><p>See <a href="/finger/[email protected]">[email protected]</a> as an example :)</p>
|
||||
<hl>
|
||||
<p>This site was written by <a href="https://yttrx.com/@waffles">waffles</a> but inspired by <a href="https://benbrown.com">Ben Brown's</a> <a href="https://happynetbox.com/">happy net box</a> project.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user