|
|
@@ -5,24 +5,28 @@ webhosting where the only deployment tool is FTP.
|
|
|
|
|
|
## Layout
|
|
|
|
|
|
+The document root is the project folder itself — `index.php` is the home page.
|
|
|
+Application internals sit in the same tree but are blocked from the web by
|
|
|
+`.htaccess`.
|
|
|
+
|
|
|
```
|
|
|
-public/ web root — the only web-accessible directory
|
|
|
- index.php landing page (hero + intro)
|
|
|
- showreel.php fullscreen portfolio, scroll-snap
|
|
|
- gallery.php client gallery: password gate, expiry, grid + lightbox
|
|
|
- admin/ backoffice (session-protected)
|
|
|
- api.php JSON API for the uploader (presign / register)
|
|
|
- assets/ site.css, site.js (nav + lightbox), admin.js (uploader)
|
|
|
- media/ local images: hero + showreel (full resolution)
|
|
|
-app/ library code, not web-accessible
|
|
|
+index.php landing page (hero + intro) ← document root
|
|
|
+showreel.php fullscreen portfolio, scroll-snap
|
|
|
+gallery.php client gallery: password gate, expiry, grid + lightbox
|
|
|
+admin/ backoffice (session-protected)
|
|
|
+ api.php JSON API for the uploader (presign / register)
|
|
|
+assets/ site.css, site.js (nav + lightbox), admin.js (uploader)
|
|
|
+media/ local images: hero + showreel (full resolution)
|
|
|
+app/ library code — blocked by .htaccess
|
|
|
bootstrap.php config loading, session, helpers
|
|
|
storage.php JSON flat-file store, slugs, local media handling
|
|
|
auth.php login, throttling, online password change
|
|
|
s3.php AWS Signature v4 (presign GET/PUT, signed DELETE)
|
|
|
csrf.php CSRF tokens
|
|
|
partials.php shared HTML header/footer for public + admin pages
|
|
|
-config/ static config (S3, site) + admin credentials
|
|
|
-data/ flat-file content: site.json, galleries/<slug>.json
|
|
|
+config/ static config (S3, site) + admin credentials — blocked
|
|
|
+data/ flat-file content: site.json, galleries/<slug>.json — blocked
|
|
|
+router.php local dev only: applies the .htaccess rules under php -S
|
|
|
```
|
|
|
|
|
|
## Flat-file storage
|
|
|
@@ -55,7 +59,7 @@ in a filesystem path.
|
|
|
|
|
|
| What | Where | Why |
|
|
|
| --- | --- | --- |
|
|
|
-| Hero + showreel | `public/media/` on the webhost | Few images, served directly, no S3 round-trip for the portfolio |
|
|
|
+| Hero + showreel | `media/` on the webhost | Few images, served directly, no S3 round-trip for the portfolio |
|
|
|
| Gallery images | Hetzner S3, **private** bucket | Hundreds of full-res files per event; webspace stays small; traffic goes to S3 |
|
|
|
|
|
|
Originals are **never modified** anywhere in the pipeline — no resize, no
|
|
|
@@ -112,10 +116,13 @@ can go straight to S3.
|
|
|
- **Gallery access**: bcrypt-hashed gallery passwords; unlock state is
|
|
|
per-gallery in the session. Expiry is a pure server-side date check —
|
|
|
expired and nonexistent galleries return the identical 404 page.
|
|
|
-- **Web exposure**: only `public/` is served. If the docroot can't be moved,
|
|
|
- the root `.htaccess` rewrites into `public/` and deny-all `.htaccess` files
|
|
|
- protect `app/`, `config/`, `data/`. `public/media/.htaccess` serves images
|
|
|
- only and disables PHP execution.
|
|
|
+- **Web exposure**: the document root is the project folder. The root
|
|
|
+ `.htaccess` blocks `app/`, `config/`, `data/`, `docs/` (via `mod_rewrite`)
|
|
|
+ and denies dotfiles, `*.json`, `*.md` and config templates (via
|
|
|
+ `FilesMatch`); each of `app/`, `config/`, `data/` also carries a deny-all
|
|
|
+ `.htaccess` as a fallback for hosts without `mod_rewrite`. `media/.htaccess`
|
|
|
+ serves images only and disables PHP execution. `router.php` reproduces these
|
|
|
+ rules for the PHP built-in server during local development.
|
|
|
- **Input hygiene**: slugs validated by regex before touching the filesystem;
|
|
|
upload filenames sanitized; `register` keys must lie under the gallery's own
|
|
|
S3 prefix; all output HTML-escaped via `e()`.
|