Skip to content
Back to search

qr

Tiny QR code generator and link tracker. Plain PHP + MariaDB, no framework.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/mandymozart--qr/badge.svg)](/listings/mandymozart--qr)

HTML

<a href="/listings/mandymozart--qr"><img src="/api/listings/mandymozart--qr/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 65 lines
  1. # qr
  2. Tiny QR code generator and link tracker. Plain PHP + MariaDB, no framework.
  3. - `https://qr.viennastruggle.at/?c=CODE` → logs the scan, redirects to the target
  4. - `https://qr.viennastruggle.at/app/` → the tool
  5. ## Routes
  6. | Route | What |
  7. |---|---|
  8. | `/` | Landing page: create a QR code without an account (guest tier) |
  9. | `/?c=CODE` | Public redirect (bots/link previews are logged but not counted); unknown codes get a "not found" page with a call to action |
  10. | `/manage.php?k=KEY` / `?id=` | Guest code: edit target, pause, delete, downloads, basic stats (secret edit link, or the browser that made it) |
  11. | `/app/register.php` | Sign up with email; guest codes from that browser move into the account on sign-in |
  12. | `/app/guests.php` | Admin: all guest codes, pause/delete abuse |
  13. | `/app/` | Your codes: list, search, campaign filter, 14-day sparklines |
  14. | `/app/edit.php[?id=]` | Create / edit a code |
  15. | `/app/code.php?id=` | Code detail: QR (SVG/PNG), pause, delete, scan stats |
  16. | `/app/campaigns.php` | Campaigns + bulk create (up to 500 codes at once) |
  17. | `/app/campaign.php?id=` | Campaign: QR grid, zip download (SVG + PNG + CSV), retarget all |
  18. | `/app/stats.php` | Overall stats: by campaign, top codes, hour of day, devices, recent scans, CSV export |
  19. | `/app/account.php` | Name, set/change/remove password |
  20. | `/app/users.php` | Admin: add users/admins, send sign-in link, block, delete |
  21. | `/app/login.php`, `/app/auth.php` | Password or secret-link sign-in, forgot password |
  22. ## Auth
  23. - Anyone can sign up at `/app/register.php` (secret link by mail). Admins can also add users and other admins under **Users**.
  24. - Guests (no account) can make up to 10 codes per browser, 5 per hour. Their codes are tied to a browser cookie `qr_g` and a secret edit link; signing in moves them into the account.
  25. - Sign in with a password (optional, set under Account) or a one-time secret link by mail (30 min).
  26. - "Forgot password?" mails a link that opens the Account page to set a new one.
  27. - **Master admin** = `ADMIN_USER` secret (an email). Created on first run, can't be blocked/demoted/deleted, and can always sign in with `ADMIN_PASSWORD`.
  28. - Mail goes through PHPMailer using PHP `mail()` by default. Set `SMTP_HOST` (+ `SMTP_PORT`, `SMTP_USER`, `SMTP_PASS`) to use SMTP. If a mail to a user fails, admins see the link to pass on manually.
  29. ## Deploy
  30. Push to `main` → `.github/workflows/deploy.yml` installs Composer deps, writes `lib/config.php` from the **production** environment and uploads via FTP. Tables are created automatically on the first request.
  31. Environment `production`:
  32. | Kind | Name | Notes |
  33. |---|---|---|
  34. | secret | `FTP_PASSWORD`, `DB_USERNAME`, `DB_PASS`, `ADMIN_USER`, `ADMIN_PASSWORD` | required |
  35. | var | `FTP_SERVER`, `FTP_USER`, `DB_NAME` | required |
  36. | var | `DB_HOST` | default `localhost` |
  37. | var | `BASE_URL` | default `https://qr.viennastruggle.at` |
  38. | var | `FTP_DIR` | default `./` (FTP user's root = web root of the subdomain) |
  39. | var/secret | `MAIL_FROM`, `SMTP_HOST`, `SMTP_PORT`, `SMTP_USER` / secret `SMTP_PASS` | optional |
  40. ## Local dev
  41. ```sh
  42. composer install
  43. cp lib/config.sample.php lib/config.php # point it at a MariaDB
  44. php -S localhost:8088 -t .
  45. ```
  46. `drafts/index.html` holds the design drafts (styles adapted from the akin dashboard). Not deployed.
  47. ## Credits
  48. - QR rendering and decoding: [chillerlan/php-qrcode](https://github.com/chillerlan/php-qrcode) (MIT)
  49. - Emoji in the middle of codes: [Twemoji](https://github.com/jdecked/twemoji) graphics, CC-BY 4.0 (`app/assets/emoji/`)
  50. - IP geolocation: [DB-IP](https://db-ip.com) Lite, CC-BY 4.0

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.