mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Create your own off-grid library
https://wrolpi.org
* Move One-Time Pad encryption to the browser; delete backend OTP module OTP encryption/decryption is now performed entirely in the browser so messages, keys, and generated pads never leave the originating device. - Add app/src/components/otp.js: a JS port of the former modules/otp/lib.py (encrypt/decrypt, message formatting, validation, and secure pad generation via crypto.getRandomValues with rejection sampling). - Encrypt/Decrypt now run live as the user types or pastes, with inline error messages instead of submit buttons. - Generate New Pad builds the printable HTML locally (blob URL) instead of hitting /api/otp/html. - Migrate all backend OTP tests to app/src/components/otp.test.js with identical data. - Delete the modules/otp backend module and its blueprint registration. * Revoke the One-Time Pad blob URL after the new tab loads Addresses a minor blob-handle leak: handleGenerateNewPad created an object URL on every click but never released it. * Let users choose the One-Time Pad character set Add an "Advanced" accordion under the buttons with three options: A-Z, A-Z/0-9 (default, unchanged), and a custom character set. The chosen set is shared by encrypt, decrypt, and pad generation. - otp.js: parameterize encrypt/decrypt/generate on the alphabet (default OTP_CHARS for back-compat); add OTP_CHARS_ALPHA and validateCharset; input is auto-uppercased only when the set is all-uppercase, so custom sets with lowercase are case-sensitive; the printable pad is labeled with its set. - Apps.js: lift charset state into OTP(); gate encrypt/decrypt/generate on a valid set with inline validation errors. - otp.test.js: add A-Z, custom round-trip, auto-uppercase, validateCharset, and pad-label tests. * Scope inverted-accordion dark background to direct children The rule forcing #171616 on .ui.inverted.accordion .title/.content used a descendant selector, so it leaked onto any nested element using the `content` class — e.g. an ErrorMessage's Message.Content rendered inside SimpleAccordion got a dark band behind its text. Scope to direct children so the accordion still styles its own title/content but not nested components. * Add optional error-detection checksum to the One-Time Pad Adapts the position-weighted checksum from otp-checksum.md to the frontend-only OTP. checksum = sum(position * value) mod N, parameterized on the selected character set (N = chars.length), so it follows whichever pad alphabet is chosen. Position weighting catches transposition errors. - otp.js: add calculateChecksum/appendChecksum/verifyChecksum. - Apps.js: opt-in "Append error-detection checksum" toggle in Advanced (default off). When on, encrypt appends a checksum char; decrypt verifies it, warns on mismatch, and still shows the decrypted text. - otp.test.js: checksum unit tests, charset-variation, and end-to-end vectors. * Show compact checksum status instead of a large warning box Replace the bulky semantic-ui WarningMessage on decrypt with a small inline status line: a green check + "Checksum is valid" or a red x + "Checksum is invalid", shown whenever the checksum option is on and a message is being decrypted. * Fix checksum-mode decrypt truncating messages without a checksum When the "Append error-detection checksum" option was on, Decrypt always stripped the last ciphertext character before decrypting, so a message that carried no trailing checksum (wrong sender setting, body pasted alone, etc.) lost its final character and decrypted to garbage. Add stripChecksum(received, chars), which removes the trailing character only when it actually verifies as the checksum of the preceding characters; a message without a valid checksum is returned intact and flagged invalid. The decrypt UI now uses it. Also broaden test coverage: - stripChecksum tests, including a regression for the truncation bug. - validation error classes (InvalidOTP/Plaintext/Ciphertext) and the longer-than-OTP length guards. - deterministic encrypt/decrypt roundtrip fuzz across several character sets. - generateMessage character-count and charset-membership checks. - end-to-end checksummed encrypt -> format -> strip -> decrypt flow. Use a dedicated InvalidMessage error for the checksum helpers instead of the misleading InvalidPlaintext. Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .circleci | ||
| .github | ||
| .run | ||
| alembic | ||
| app | ||
| controller | ||
| debian-live-config | ||
| docker | ||
| etc | ||
| modules | ||
| pi-gen | ||
| release | ||
| scripts | ||
| test | ||
| wrolpi | ||
| .coveragerc | ||
| .dockerignore | ||
| .gitignore | ||
| .gitmodules | ||
| .gitpod.yml | ||
| .mcp.json.example | ||
| alembic.ini | ||
| conftest.py | ||
| demo_link.jpg | ||
| docker-compose.yml | ||
| help.sh | ||
| icon.ico | ||
| icon.png | ||
| INSTALL.md | ||
| install.sh | ||
| join_discord.png | ||
| LICENSE | ||
| main.py | ||
| pytest.ini | ||
| README.md | ||
| repair.sh | ||
| requirements.txt | ||
| test_all.sh | ||
| UPGRADE.md | ||
| upgrade.sh | ||
WROLPi
Create your own off-grid library.
WROLPi is a self-contained collection of software to help you survive the world Without Rule of Law.
WROLPi is intended to be run on a Raspberry Pi with an optional external drive attached. It serves up it's own Wi-Fi network so that any user with a laptop/tablet/phone can connect and use the library created by the maintainer.
Table of Contents
Features
- Videos
- Web Archives
- Maps
- Wikipedia
- File search
- eBooks (EPUB / PDFs)
- Wi-Fi Hotspot
- Universal search
- Food Inventory management
- One-Time pad generator, encrypter/decrypter
- Synchronizer/duplicator
- Food storage calculator
Module features matrix
| Module | View | Search | Download | Project |
|---|---|---|---|---|
| Videos | yes | yes | yes | yt-dlp |
| Web Archives | yes | yes | yes | Singlefile |
| Wikipedia | yes | yes | yes | Kiwix |
| eBooks | yes | yes | planned | EPUB/PDF |
| Map | yes | yes | yes | Protomaps |
| Podcasts/Audio | yes | planned | planned |
Demo
Download
Images are available at wrolpi.org
Try WROLPi!
You can try out WROLPi by running the docker containers.
- Install docker-ce and docker-compose
- Copy the latest WROLPi code.
git clone https://github.com/lrnselfreliance/wrolpi.git
- Change directory into the code base.
cd wrolpi
- Initialize git submodules
git submodule update --init
- Build the containers.
docker-compose build --parallel
- Create volumes.
docker volume create --name=openstreetmap-datadocker volume create --name=openstreetmap-rendered-tiles
- Start the database.
docker-compose up -d db
- Initialize the database.
docker-compose run --rm api db upgrade
- Start the docker containers.
docker-compose up
- Browse to WROLPi.
More Docker documentation is available in docker/README.md
Install WROLPi
Full installation instructions are in INSTALL.md. Pick the option that matches your hardware:
- WROLPi Portable (Live USB) — boot a complete WROLPi from a USB stick on any x86 PC or laptop. Nothing is installed to the computer; the first boot creates a persistence partition on the USB so your library, database, and configuration survive reboots.
- Debian 12 — install WROLPi onto an x86 PC or laptop.
- Raspberry Pi — install WROLPi onto a Raspberry Pi with an external drive.
- Docker — run the WROLPi containers on an existing Linux host.
Charter
Guiding Principals
- Storage is cheaper than power.
- Two is one, one is none.
- Run silently.
- Primary, secondary, tertiary.
- Secure as a bookshelf in your home.
Physical properties
- A WROLPi instance should be capable of running with a minimal of hardware:
- Raspberry Pi
- SD card
- External USB hard drive
- Power supply and cables
- Wi-Fi USER device such as a phone, tablet, or laptop.
- A WROLPi instance should consume a minimal amount of electricity during WROL event. It is expected power will be scarce when WROLPi is needed most.
User expectations
- A WROLPi instance should be run and maintained by a person (MAINTAINER) with a moderate amount of Linux and Raspberry Pi experience. It is expected that they should be able to do this using only the documentation on their WROLPi.
Software properties and capabilities
- A WROLPi instance should be able to "factory-reset" itself without any outside services.
- WROLPi should function completely without any internet services.
- A user should have easy access to their data if WROLPi fails:
- For example, a user can watch their videos by navigating a short and intuitive directory structure and opening the video in their preferred video player.
- WROLPi should be self-documented. The UI should contain a tutorial for USERS as well as the MAINTAINER.
- If the UI isn't functional, the code should be documented such that a user can restore functionality.
- WROLPi should favor pre-processing, rather than processing during a WROL event. Such as re-encoding a video, or processing captions. This is to ensure that when a user adds content during non-WROL time, the processing for optimum performance is already done for a WROL event.
Join!
