Piminer4 Help
This page is the handoff manual for the Piminer4 Flask server.
Generated by the running app on 2026-08-02 23:29.
Quick Links
Media Server Budget Games Ollama Easy Diffusion AdminWhat This Server Does
- Runs a Flask/Gunicorn web app on port
8080. - Browses and streams media from the main
bmpsmedia tree. - Protects selected private media folders with the same server password used by Budget/Admin.
- Provides a Budget web UI for the Excel workbook, including entry editing, recurring entries, categories, dashboards, restore, and backups.
- Hosts local browser games, an Ollama prompt page, and a manually controlled Paper Minecraft server.
- Redirects Easy Diffusion access to the configured remote URL.
Addresses And Services
| Local service | piminer4-media.service |
|---|---|
| App folder | /home/dave_klenda/piminer4_server |
| Local URL | http://piminer4:8080/ or http://<pi-ip>:8080/ |
| Tailscale Funnel | Configured outside Flask for port 8080. Check with tailscale funnel status. |
| Easy Diffusion redirect | https://piminer4.tailf563cd.ts.net:8443/ |
| Ollama API | http://127.0.0.1:11434 |
| Minecraft | piminer4-minecraft.service on piminer4:25565, files at /mnt/pcie_nvme/minecraft/server |
Safe Restart Checklist
- Check the service:
systemctl status piminer4-media.service --no-pager - Check logs if needed:
journalctl -u piminer4-media.service -n 80 --no-pager - Restart only the web app:
sudo systemctl restart piminer4-media.service - Verify it answers:
curl -I http://127.0.0.1:8080/
If a media drive was unplugged, corrupted, or recently checked on a PC, confirm it is mounted before blaming Flask. Use
lsblk -f, findmnt, and check that /mnt/pcie_nvme/bmps exists.
Media Server Notes
- Main media root:
/mnt/pcie_nvme/bmps - Thumbnails are stored inside media folders in
_thumbs. - Hidden folders include
_thumbsandBudget. - Music Videos has playlist controls: Autoplay Next, Random Next, and Random Now.
- Italian subtitles are served only when subtitle files exist beside MP4 files and the folder is not protected or Music Videos.
- Some large folders may be bind-mounted into the main media tree. Check
findmntand/etc/fstabbefore moving or deleting media.
Budget Notes
- Workbook folder:
/mnt/pcie_nvme/bmps/Budget - Workbook file:
My Money - Fresh Start Budget.xlsx - The web UI edits the workbook directly. A lock file is used beside the workbook while changes are being written.
- Recent Entries can be edited if a date, amount, category, description, or note was entered incorrectly.
- Recurring entries are monthly. The Day field is the day of the month, from
1to31. - Budget backups can be restored from Admin. A safety copy is created before restore.
Reading The Monthly Income Vs Outflow Graph
- The graph is month-by-month. Each month compares that month's Money In against that month's Outflow.
- Outflow is calculated as
Money Out + Transfers. Transfers are shown separately in the budget, but the graph treats them as cash leaving checking for the month. - The number printed at the right side of a month is that month's net cash, rounded to the nearest dollar:
Money In - Money Out - Transfers. - Example from July 2026: Money In was
$4,517.62, Money Out was$3,715.27, and Transfers were$315.00. The graph used$4,517.62 - ($3,715.27 + $315.00) = $487.35, so it displayed+ $487. - The top Net Cash card is year-to-date for the selected year, not just the current month. In the July 2026 example, June was
-$551.56and July was+$487.35, so the year-to-date Net Cash card showed-$64.21. - If the graph and the top cards seem to disagree, check whether one value is monthly and the other is year-to-date, then check the year selector, Recent Entries, and Recurring rows.
Minecraft Notes
- Server type: Paper Minecraft, installed under
/mnt/pcie_nvme/minecraft/server. - Bedrock support is provided by Geyser-Spigot plus Floodgate, with ViaVersion installed for protocol compatibility.
- Systemd service:
piminer4-minecraft.service. - It is disabled by default and should be started from Admin only when people are playing.
- Villages/structures, animals, hostile mobs, and villagers are enabled.
- The whitelist is enabled. Add player names before expecting new players to connect.
- Current Pi limits are shown and editable from Admin under Minecraft Server then Server Limits.
max-playerscontrols how many players can join at once.view-distancecontrols how far players can see in chunks. Higher looks better but uses more RAM and network.simulation-distancecontrols how far the world actively runs around players. Higher values cost more CPU because mobs, farms, villagers, and redstone keep ticking farther away.- Pi-safe ranges in the web UI are players
1-20, view distance3-16, and simulation distance3-12. A good next step is8players, view8, simulation6. - Minecraft backups made from Admin are stored in
/mnt/pcie_nvme/minecraft/backups. - If the world becomes popular or busy, move Minecraft to a second Pi and point players to the new host while keeping Piminer4 for media/budget.
Getting Started With Minecraft
New User Setup
- Bedrock players can use the Minecraft Bedrock Edition they already have installed on Windows, phone, tablet, or console.
- On this Windows PC, open the Minecraft Launcher or Microsoft Store version and choose Minecraft for Windows, not Java Edition.
- If Minecraft is not installed yet, download it from
https://www.minecraft.net/downloador install Minecraft from the Microsoft Store. - Java players can still use Minecraft Java Edition and connect on the Java port.
Connecting From Bedrock
- Open
/adminand unlock Admin with the shared server password. - Open the Minecraft Server section and press
Start Minecraft. First startup can take about 30-90 seconds while Paper loads the world. - In Minecraft Bedrock, go to
Play, thenServers, thenAdd Server. - Use any server name such as
Piminer4. - For outside-the-house Bedrock players, use the split playit fields shown in the Admin Minecraft Server section.
- Current outside Server Address:
doing-boolean.gl.at.ply.gg. - Current outside Port:
62300. - At home/LAN, use
192.168.1.67with port19132. Outside the house, use the playit address and port shown above after public access is stable. - Because whitelist is on, new players must be added before they can join. In Admin, use Add Player To Whitelist, choose Bedrock or Java, enter the exact player name, and press Add Player.
- For Bedrock players, enter the Xbox gamertag without a Floodgate prefix. Floodgate handles the Bedrock whitelist with
fwhitelist. - For Java players, enter the exact Java username. Java names must be 3-16 letters, numbers, or underscores.
- When everyone is done playing, press
Stop Minecraftfrom Admin. It is intentionally not set to auto-start so the Pi stays free for media, budget, backups, and converters. - Use
Backup Worldbefore experimenting with settings, plugins, or major world changes. Backups go to/mnt/pcie_nvme/minecraft/backups.
Connecting From Java Edition
- In Minecraft Java Edition, choose
Multiplayer, thenAdd Server. - Use
piminer4:25565on the home network, or use the Java address shown in Admin.
Tailscale Funnel is for the web server and does not expose Bedrock UDP. Outside-the-house Bedrock access uses the playit.gg tunnel, which forwards public UDP traffic to Geyser on Piminer4.
Quake Arena Notes
- Server type: OpenArena / ioquake3 dedicated server. It is Quake 3-style deathmatch with free game data.
- Systemd service:
openarena-server.service. - Config file:
/etc/openarena-server/server.cfg. - Default port: UDP
27960. - Current home-network join address:
piminer4:27960. - Current server name:
Piminer4 Quake Arena. - Current defaults: Free-for-all deathmatch, map
oa_dm1, 8 players, frag limit 25, time limit 15 minutes. - The package is disabled at boot so it does not auto-start after a reboot. Start or stop it from Admin.
- Players need OpenArena or a compatible ioquake3/OpenArena client. On the home network, connect to
piminer4:27960. - Outside-the-house Quake access is not tunneled yet. It will need a UDP tunnel or router port forward for UDP
27960.
Backups And Recovery
| Budget backup target | dave.klenda@piminer3:/home/dave.klenda/shared/Piminer4BudgetBackups |
|---|---|
| Budget backup schedule | Managed under Admin. System helper: /usr/local/sbin/piminer4-budget-schedule-helper |
| Server recovery backups | piminer3:/home/dave.klenda/shared/Piminer4ServerBackups |
| Recovery restore script | restore_piminer4_server.sh is copied beside the recovery archives on Piminer3. |
Recovery backups contain the Flask app files, systemd service files, helper scripts, sudoers snippets, password files, and SSH key used for budget backups. They do not contain media files, Ollama models, or Easy Diffusion.
Admin Page
- Change the shared server password. This password is used for Admin, Budget, and protected folders.
- Restore a budget workbook from backup.
- Adjust the automatic budget backup schedule.
- Start, stop, restart, and back up the Minecraft server.
- Open the Activity Log from the Current Users area to see recent server activity by IP address, browser/device, area, action, path, and HTTP status.
- Run Pi OS update/upgrade. Watch the log shown on the Admin page after starting it.
Do not put plain-text passwords into this Help page. Password data is stored by the app in its configured password files. The Activity Log also redacts password fields, cast tokens, secret keys, and Ollama prompt text.
Password Lockout Security
- Admin, Budget, protected media folders, and Music Videos artist sorting use the same password lockout rules.
- After
3wrong password attempts, that page/folder is locked for that client for about15minutes. - A correct password clears the failed-attempt counter.
- Lockouts are tracked by area and client address, so one bad client should not lock everyone out of the entire server.
- Lockout state is stored in
/home/dave_klenda/piminer4_server/password_lockouts.json. Delete that file only if an accidental lockout must be cleared from SSH.
Important Files
| File | Purpose |
|---|---|
/home/dave_klenda/piminer4_server/app.py | Main Flask app, Hub, Admin, health monitor, safe command console, Ollama, Help, Easy Diffusion redirect, and backup/admin helper calls. |
/home/dave_klenda/piminer4_server/config.py | Central configuration: media root, budget workbook path, backup locations, Ollama URL, Easy Diffusion URL, and password file path. |
/home/dave_klenda/piminer4_server/auth.py | Password verification, password hash storage, and unlock/session helpers. |
/home/dave_klenda/piminer4_server/server_password.json | Stored server password hash. Do not edit by hand; use Admin to change the password. |
/home/dave_klenda/piminer4_server/server_access_log.jsonl | JSON-lines activity log showing recent server use: client IP, browser/device, area, action, path, and status. |
/home/dave_klenda/piminer4_server/password_lockouts.json | Password lockout state after repeated failed password attempts. |
/home/dave_klenda/piminer4_server/protected_passwords.json | Protected media folder password data, if present. The shared server password is also accepted. |
/home/dave_klenda/piminer4_server/media/routes.py | Media browse/play/cast/subtitle routes and Music Videos playlist behavior. |
/home/dave_klenda/piminer4_server/media/services.py | Media file scanning, protected folder definitions, thumbnails, and safe path handling. |
/home/dave_klenda/piminer4_server/media/templates/player.html | Video/image player, Chromecast controls, next/previous buttons, and Music Videos autoplay/random UI. |
/home/dave_klenda/piminer4_server/media/templates/media_dashboard.html | Folder and media thumbnail browser. |
/home/dave_klenda/piminer4_server/music_artist_genres.json | Saved Music Videos artist genre choices for sorting and future genre playback. |
/home/dave_klenda/piminer4_server/budget/routes.py | Budget page routes for add/edit entries, recurring rows, categories, workbook download, and password unlock. |
/home/dave_klenda/piminer4_server/budget/services.py | Excel workbook reader/writer, dashboard calculations, category budgets, recurring rows, and budget entry edits. |
/home/dave_klenda/piminer4_server/budget/templates/budget_home.html | Budget web interface, mobile layout, dashboards, workbook tabs, editors, and recent-entry edit forms. |
/home/dave_klenda/piminer4_server/games/routes.py | Game list and game page route. |
/home/dave_klenda/piminer4_server/games/templates/games_home.html | Games menu. |
/home/dave_klenda/piminer4_server/games/templates/game_play.html | Browser game UI and JavaScript game logic. |
/mnt/pcie_nvme/minecraft/server | Paper Minecraft server folder, including world data, server.properties, whitelist, and server jar. |
/mnt/pcie_nvme/minecraft/backups | Minecraft world backups created from Admin. |
/mnt/pcie_nvme/minecraft/server/plugins/Geyser-Spigot | Geyser Bedrock bridge config. Bedrock listens on UDP 19132. |
/mnt/pcie_nvme/minecraft/server/plugins/floodgate | Floodgate config and keys so Bedrock accounts can join without owning Java Edition. |
/mnt/pcie_nvme/minecraft/piminer4_geyser_floodgate.json | Piminer4 metadata for the installed Geyser/Floodgate/ViaVersion bridge. |
/etc/openarena-server/server.cfg | Quake Arena / OpenArena dedicated server settings: hostname, map, gametype, frag limit, time limit, bots, and max clients. |
/usr/lib/systemd/system/openarena-server.service | Systemd service for the Quake Arena / OpenArena dedicated server on UDP 27960. |
/usr/bin/jellyfin | Jellyfin media server executable. The service listens on port 8096. |
/home/dave_klenda/piminer4_server/tools/run_disc_ripper.py | Admin helper for optical-disc scan/rip status and background HandBrake/MakeMKV rip jobs. |
/bmps/Ripped Discs | Default output folder for DVD/Blu-ray rips created from Admin. |
/home/dave_klenda/disc_ripper.log | Disc ripper log showing scan, HandBrake, and MakeMKV output. |
HOME_NETWORK_DEVICES | Optional environment JSON list for Admin's Home Network Monitor. If unset, Piminer4 uses the built-in known-device list. |
/home/dave_klenda/piminer4_server/tools/update_budget_backup_schedule.py | Privileged helper used by Admin to edit the systemd budget backup timer. |
/home/dave_klenda/piminer4_server/tools/run_pi_os_update.py | Privileged helper used by Admin to run apt update/upgrade and report status. |
/home/dave_klenda/piminer4_server/tools/run_maintenance.py | Privileged helper used by Admin for server maintenance actions such as restarting the media service and starting budget backups. |
/home/dave_klenda/piminer4_server/tools/generate_music_mobile_videos.py | Admin-runnable converter that creates Music Videos mobile copies and full-size audio-normalized cache copies. |
/mnt/pcie_nvme/mobile_cache | Separate cache folder for Music Videos .mobile.mp4 files so the original Music Videos folder stays uncluttered. |
/mnt/pcie_nvme/normalized_cache | Separate cache folder for Music Videos full-size .normalized.mp4 files with steadier audio volume. |
/etc/systemd/system/piminer4-media.service | Systemd unit that starts Gunicorn for this Flask app on port 8080. |
/etc/systemd/system/piminer4-minecraft.service | Systemd unit for the manually controlled Paper Minecraft server. Disabled by default. |
/etc/systemd/system/piminer4-budget-backup.service | Systemd unit that creates budget workbook backups. |
/etc/systemd/system/piminer4-budget-backup.timer | Systemd timer for automatic budget workbook backups. |
/usr/local/sbin/piminer4-budget-schedule-helper | Root-owned wrapper for changing the budget backup schedule from Admin. |
/usr/local/sbin/piminer4-os-update-helper | Root-owned wrapper for starting/checking Pi OS update from Admin. |
/home/dave_klenda/.ssh/piminer4_budget_backup_ed25519 | SSH key used by Piminer4 to reach Piminer3 for budget backups and restores. |
Useful Commands
cd /home/dave_klenda/piminer4_server systemctl status piminer4-media.service --no-pager journalctl -u piminer4-media.service -n 80 --no-pager sudo systemctl restart piminer4-media.service sudo systemctl status piminer4-minecraft.service --no-pager sudo systemctl start piminer4-minecraft.service sudo systemctl stop piminer4-minecraft.service tailscale funnel status lsblk -f findmnt systemctl list-timers piminer4-budget-backup.timer --no-pager
When Things Break
- If the whole page is down, check
piminer4-media.serviceand its journal. - If Media opens but a folder is missing, check drive mounts and bind mounts first.
- If Budget totals look wrong, verify the workbook year selector, then check Recent Entries and Recurring rows.
- If Funnel works poorly but local Tailscale is fine, suspect Funnel bandwidth/latency before changing the app.
- If the Pi loses power and the NVMe acts strange, shut down cleanly and run a filesystem check from a PC if needed.
- Before reflashing the SD card, copy the newest server recovery archive and restore script from Piminer3.