v2.6.1 (Lyra): Welcome page, 404 handling, installatie docs, opschoning
Nieuwe features: - Welkomstpagina bij lege content-map (nieuwe installatie detectie) - 404-afhandeling binnen actieve theme via admin/static/404.html - HTTP 404 status bij onbekende pagina's en missende taalprefix Opschoning: - Verwijderd: package.json, src/scss/, root .htaccess, themes/demo/ - Verwijderde vendor packages: php-mqtt/client, mustache/mustache - AGENTS.md samengevoegd naar root, development/AGENTS.md verwijderd - .gitignore opgeschoond (NPM/node_modules/.sass-cache verwijderd) Documentatie: - Installatie instructies toegevoegd aan README (Apache2/Nginx/PHP/composer) - README en guide versie referenties bijgewerkt naar 2.6.1 - Release notes: docs/release-notes/v2.6.1.md Tests: - Pentest: 30/30 geslaagd, 0 vulnerabilities - WCAG 2.1 AA: 25/25 geslaagd, 100% compliance - Test scripts gebruiken Apache-URL i.p.v. localhost:8080
This commit is contained in:
@@ -4,13 +4,13 @@
|
||||
|
||||
Een lichtgewicht, file-based content management systeem gebouwd met PHP (≥8.0).
|
||||
|
||||
**Versie:** 2.5.0 | **Licentie:** AGPL v3 / Commercial
|
||||
**Versie:** 2.6.1 | **Licentie:** AGPL v3 / Commercial
|
||||
|
||||
## ✨ Features
|
||||
|
||||
- 📝 **Multi-format Content** - Markdown, PHP en HTML bestanden
|
||||
- 🧭 **Dynamic Navigation** - Automatische menu generatie
|
||||
- 🌍 **Multi-language** - NL/EN/DE/FR ondersteuning
|
||||
- 🌍 **Multi-language** - NL/EN/DE ondersteuning
|
||||
- 🔍 **Search** - Volledige tekst zoekfunctie
|
||||
- 📱 **Responsive** - Bootstrap 5 thema's
|
||||
- 🔒 **Security** - 100/100 pentest score
|
||||
@@ -27,13 +27,141 @@ Een lichtgewicht, file-based content management systeem gebouwd met PHP (≥8.0)
|
||||
# Installeer dependencies
|
||||
composer install
|
||||
|
||||
# Start server met router voor schone URLs
|
||||
# Start server met router voor schone URLs (alleen lokaal)
|
||||
php -S localhost:8080 cms/router.php
|
||||
```
|
||||
|
||||
**Website:** `http://localhost:8080`
|
||||
**Admin:** `http://localhost:8080/admin` (login: `admin` / `admin`)
|
||||
|
||||
## 📦 Installatie
|
||||
|
||||
### Vereisten
|
||||
|
||||
- **PHP** ≥ 8.0 met extensies: `json`, `mbstring`
|
||||
- **Composer** (PHP dependency manager)
|
||||
- Webserver: **Apache 2.4+** met `mod_rewrite` of **Nginx** met PHP-FPM
|
||||
- Optioneel: `opcache` (aanbevolen voor performance), `git` (voor content versioning), `zip` extensie (voor ZIP backup/restore)
|
||||
|
||||
### Stap 1 — Code en dependencies
|
||||
|
||||
```bash
|
||||
git clone <repository-url> codepress
|
||||
cd codepress
|
||||
composer install
|
||||
```
|
||||
|
||||
### Stap 2 — Configuratie
|
||||
|
||||
```bash
|
||||
cp config.json.example config.json
|
||||
cp admin/config/admin.json.example admin/config/admin.json
|
||||
```
|
||||
|
||||
Pas `config.json` aan met je site titel, taal en plugins. Wijzig het admin wachtwoord in `admin/config/admin.json` (standaard `admin`/`admin`).
|
||||
|
||||
### Stap 3a — Apache 2.4+
|
||||
|
||||
De webroot is de `public/` map. Voorbeeld vhost (`/etc/apache2/sites-available/codepress.conf`):
|
||||
|
||||
```apache
|
||||
<VirtualHost *:80>
|
||||
ServerName example.com
|
||||
DocumentRoot /var/www/codepress/public
|
||||
|
||||
<Directory /var/www/codepress/public>
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/codepress_error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/codepress_access.log combined
|
||||
</VirtualHost>
|
||||
```
|
||||
|
||||
Benodigde Apache modules:
|
||||
|
||||
```bash
|
||||
sudo a2enmod rewrite headers
|
||||
sudo systemctl restart apache2
|
||||
```
|
||||
|
||||
- `mod_rewrite` — voor clean URLs (`/nl/pagina`) en asset-serving
|
||||
- `mod_headers` — voor security headers
|
||||
- `AllowOverride All` — zodat `.htaccess` in `public/` wordt toegepast
|
||||
|
||||
### Stap 3b — Nginx
|
||||
|
||||
Voorbeeld server block (`/etc/nginx/sites-available/codepress`):
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
root /var/www/codepress/public;
|
||||
index index.php;
|
||||
|
||||
# Clean URLs: taal-prefixed pagina's
|
||||
location ~ ^/(nl|en|de)(/(.+))?$ {
|
||||
try_files $uri /index.php?lang=$1&page=$2;
|
||||
}
|
||||
|
||||
# Admin routes
|
||||
location /admin {
|
||||
try_files $uri /admin.php?$args;
|
||||
}
|
||||
|
||||
# Asset-serving via asset.php (themes/plugins/admin buiten webroot)
|
||||
location ~ ^/(themes|plugins)/([^/]+)/assets/(.+)$ {
|
||||
try_files $uri /asset.php;
|
||||
}
|
||||
location ~ ^/admin/assets/(.+)$ {
|
||||
try_files $uri /asset.php;
|
||||
}
|
||||
|
||||
# PHP via FPM
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass unix:/run/php/php8.0-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
# Beveiliging: blokkeer toegang tot gevoelige mappen
|
||||
location ~ ^/(content|cms|admin/src|admin/config|admin/storage|var|vendor)/ {
|
||||
deny all;
|
||||
return 403;
|
||||
}
|
||||
|
||||
location ~ /\.(git|htaccess) {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Let op:** Nginx gebruikt geen `.htaccess`. De security headers moeten in de Nginx config worden gezet:
|
||||
|
||||
```nginx
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-Frame-Options SAMEORIGIN;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
add_header Referrer-Policy strict-origin-when-cross-origin;
|
||||
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self';";
|
||||
```
|
||||
|
||||
### Stap 4 — Mappen rechten
|
||||
|
||||
Zorg dat de webserver schrijfrechten heeft op de runtime mappen:
|
||||
|
||||
```bash
|
||||
chown -R www-data:www-data var/ admin/storage/ content/
|
||||
chmod -R 755 .
|
||||
```
|
||||
|
||||
### Stap 5 — Test
|
||||
|
||||
Open de website in je browser. Bij een lege content-map zie je een welkomstpagina. De admin console is bereikbaar via `/admin` (login `admin`/`admin`).
|
||||
|
||||
## 📚 Handleidingen
|
||||
|
||||
Zie **[guide/](guide/)** voor uitgebreide documentatie per rol:
|
||||
@@ -68,6 +196,7 @@ codepress/
|
||||
├── admin/ # Admin console
|
||||
│ ├── config/ # Admin configuratie (admin.json)
|
||||
│ ├── src/AdminAuth.php # Authenticatie, rollen, permissies
|
||||
│ ├── static/ # Statische bestanden (404.html)
|
||||
│ ├── storage/ # Logs, cache, geoip
|
||||
│ └── theme/default/ # Admin thema
|
||||
│ ├── assets/ # CSS, JS, fonts, codemirror
|
||||
@@ -80,7 +209,6 @@ codepress/
|
||||
│ │ ├── *.twig # Layout templates
|
||||
│ │ ├── partials/ # Header, navigation, footer
|
||||
│ │ └── assets/ # SCSS, CSS, JS, img
|
||||
│ └── demo/ # Demo thema
|
||||
├── plugins/ # Plugins
|
||||
│ ├── HTMLBlock/ # Voorbeeld sidebar plugin
|
||||
│ └── Navigation/ # Essentiële navigatie plugin (beschermd)
|
||||
|
||||
Reference in New Issue
Block a user