| Server IP : 10.200.247.200 / Your IP : 216.73.217.19 Web Server : Apache System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : jeremy ( 1001) PHP Version : 8.4.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/development/callings.lvsaints.com/ |
Upload File : |
# Interim tool: upload a zip, version by folder
This is the simple version we're running **for now**, before the full
data-driven app in `PLAN.md` is built. It lets the boss upload a complete
site as a `.zip`; each upload becomes its own version, and switching the live
site is just re-pointing one link. No hand-editing of the server, no database
content — the folders *are* the version history.
## How it works
```
data/
releases/
v1__20260703-153000/ <- an unzipped upload (index.html + its assets)
v2__20260703-160000/ <- a later upload
current -> releases/v2__20260703-160000 <- symlink to the LIVE version
meta/ <- note / who / when for each version
.htaccess <- blocks direct web access to the raw folders
```
- **Upload** a `.zip` in `admin.php` → **Board**. We create `data/releases/vN__<timestamp>/`
and unzip into it. If the whole site is inside one wrapping folder, we flatten it
so `index.html` sits at the top.
- **Make live** re-points the `current` symlink at that folder (atomic — visitors
never see a half-switched site). **Rolling back** is the same button on an older version.
- **Preview** (editors only) shows any version to just you, without making it live.
- **Delete** removes an old version's folder. The live version can't be deleted.
## Viewing is still login-gated
`index.php` sends a signed-in user to `site.php/`, which streams files out of the
live folder **through PHP**, so the login check covers the whole site. The raw
`data/` folders are not served directly (`data/.htaccess` denies it).
## Zip requirements (tell the boss)
- Must contain an **`index.html`** — at the top level, or inside a single folder.
- Use **relative** links to assets (`css/style.css`, `img/logo.png`), not
root-absolute ones (`/css/style.css`), because the site is served under `/site.php/`.
- macOS `__MACOSX` / `.DS_Store` junk is ignored automatically.
- Zips containing `..` paths or symlinks are rejected for safety.
## Server requirements
1. **The web-server user must be able to write to `data/`** (create folders and
symlinks). On first upload the folder is created automatically.
2. **Zip support:** the PHP `zip` extension (`php-zip`) *or* the `unzip` program.
The code uses whichever is present.
3. **`PATH_INFO` must be enabled** so `site.php/css/style.css` reaches `site.php`.
- Apache + mod_php: on by default (`AcceptPathInfo` is `On`).
- nginx + php-fpm: ensure `fastcgi_split_path_info` and `PATH_INFO` are set in
the fastcgi config.
## What changed vs. the old flow
The previous "paste one HTML file into the database" publish flow was replaced by
this zip-upload flow. The `page_versions` table is no longer used (it's left in
`schema.sql` but unused). Users / login / roles are unchanged. Wards still exist
for the login system but no longer affect the single served site.