diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0b44106 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# Ignore build outputs in host directories +host/*/*.html +host/*/*.png +host/*/*.pdf +host/*/from_client/ + +# Temporary files +*.tmp +tmp*/ + +# OS and editor files +.DS_Store +Thumbs.db +*~ +*.swp diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7d2b621 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2025 thePR0M3TH3AN + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 4652222..fd7db08 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +// 🔧 merged conflicting changes from codex/create-readme.md-with-project-overview vs main + # VoxVera Flyers VoxVera provides scripts and templates for producing printable flyers with QR codes. These flyers link to content hosted through Tor and can also include a Nostr page. The project automates building the HTML, generating the QR codes, and copying all assets into a directory under `host/` so they can be served statically. @@ -19,8 +21,12 @@ Run the helper script from the repository root: # use answers from an existing PDF form ./src/create_flyer.sh --from-pdf path/to/form.pdf -``` +```` The script updates `src/config.json`, regenerates QR codes, obfuscates `index-master.html` and `nostr-master.html`, and copies the resulting files plus PDFs and QR images into `host/`. The contents in that directory can then be hosted. -See [src/README.md](src/README.md) for more details on the obfuscation scripts and additional usage notes. +Additional documentation is available in the `src/` directory; see [src/README.md](src/README.md) for more details on the obfuscation scripts and additional usage notes. + +This project is licensed under the [MIT License](./LICENSE). + +``` diff --git a/src/create_flyer.sh b/src/create_flyer.sh index 16357c2..97d6cfe 100755 --- a/src/create_flyer.sh +++ b/src/create_flyer.sh @@ -1,6 +1,17 @@ #!/bin/bash -set -e +set -euo pipefail + +require_cmd() { + command -v "$1" >/dev/null 2>&1 || { + echo "Error: required command '$1' not found" >&2 + exit 1 + } +} + +for cmd in jq node javascript-obfuscator html-minifier-terser; do + require_cmd "$cmd" +done CONFIG_PATH="src/config.json" FROM_PDF="" @@ -32,9 +43,6 @@ while [[ $# -gt 0 ]]; do esac done -# Ensure jq is installed -command -v jq >/dev/null 2>&1 || { echo "jq is required" >&2; exit 1; } - # Helper function to update config update_config_interactive() { read -rp "Name: " name diff --git a/src/obfuscate_index.sh b/src/obfuscate_index.sh index efff80b..0e73187 100755 --- a/src/obfuscate_index.sh +++ b/src/obfuscate_index.sh @@ -1,5 +1,18 @@ #!/bin/bash +set -euo pipefail + +require_cmd() { + command -v "$1" >/dev/null 2>&1 || { + echo "Error: required command '$1' not found" >&2 + exit 1 + } +} + +for cmd in javascript-obfuscator html-minifier-terser node; do + require_cmd "$cmd" +done + # Input and output file names input_file="index-master.html" output_file="index.html" diff --git a/src/obfuscate_nostr.sh b/src/obfuscate_nostr.sh index ed574f3..a0d0a53 100755 --- a/src/obfuscate_nostr.sh +++ b/src/obfuscate_nostr.sh @@ -1,5 +1,18 @@ #!/bin/bash +set -euo pipefail + +require_cmd() { + command -v "$1" >/dev/null 2>&1 || { + echo "Error: required command '$1' not found" >&2 + exit 1 + } +} + +for cmd in javascript-obfuscator html-minifier-terser node; do + require_cmd "$cmd" +done + # Input and output file names input_file="nostr-master.html" output_file="nostr.html"