Update installation procedure

This commit is contained in:
2026-11-27 16:24:48 +00:00
parent b8d9ff0b35
commit 3dc7c25dc2
7 changed files with 78 additions and 47 deletions
+24 -12
View File
@@ -1,12 +1,24 @@
STAGE = production STAGE=production
BASE_URL = http://localhost:63000 BASE_URL=http://localhost:63000
database_driver = mysql
database_host = mysql DATABASE_DRIVER=mysql
database_database = plugi DATABASE_HOST=mysql
database_username = plugi DATABASE_DATABASE=plugi
database_password = plugi DATABASE_USERNAME=plugi
database_charset = utf8 DATABASE_PASSWORD=change-me
database_collation = utf8_unicode_ci DATABASE_CHARSET=utf8mb4
database_prefix = DATABASE_PREFIX=
USERNAME = admin MYSQL_ROOT_PASSWORD=change-me-root
PASSWORD = admin
USERNAME=admin
PASSWORD=
PASSWORD_HASH=
MAIL_HOST=
MAIL_PORT=587
MAIL_ENCRYPTION=tls
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_FROM_ADDRESS=
MAIL_FROM_NAME=
MAIL_TIMEOUT=10
+1 -1
View File
@@ -12,11 +12,11 @@ dist-ssr
*.local *.local
.env .env
/config.php
cache cache
uploads uploads
extensions/dev_* extensions/dev_*
docs
.agents .agents
skills-lock.json skills-lock.json
+2 -3
View File
@@ -2,9 +2,8 @@ FROM php:8.4-apache-bookworm
WORKDIR "/var/www/html" WORKDIR "/var/www/html"
RUN apt-get update; \ RUN apt-get update; \
docker-php-ext-install pdo pdo_mysql; \ docker-php-ext-install pdo_mysql; \
apt-get -y --no-install-recommends install \ apt-get -y --no-install-recommends install \
git \ git; \
php8.4-mysql; \
apt-get clean; \ apt-get clean; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
+13 -14
View File
@@ -2,24 +2,23 @@
> A fork of [PHPagebuilder](https://github.com/HansSchouten/PHPagebuilder) by [Hans Schouten](https://github.com/HansSchouten). > A fork of [PHPagebuilder](https://github.com/HansSchouten/PHPagebuilder) by [Hans Schouten](https://github.com/HansSchouten).
> Still a work-in-progress Plugi is a website boilerplate with a drag-and-drop page builder.
This boilerplate defines the project structure for quickly creating a website that can be managed with a drag and drop ## Quick installation
pagebuilder.
## Installation 1. Use PHP 8.4 with the PDO MySQL extension and a MySQL 8 database. The supplied Docker image is based on PHP 8.4.
2. Copy `.env.dist` to `.env` and `config.dist.php` to `config.php`; set the database connection, public `BASE_URL`, and a unique admin username and password hash in `.env`.
3. Create the database and a database user, deploy the project at the web root, and make `uploads/` writable by the web server.
4. Open the site, sign in at `/admin/auth`, and follow the Website Manager database update prompt to create/update the schema.
To setup your website download the latest version of Plugi and upload it to the webroot directory of your website. See [the installation guide](docs/installation.md) for manual deployment, Docker development, security, and troubleshooting details.
### Edit the config file ## Local Docker development
The file `config.php` holds all the basic configuration for your project. Edit as needed. Be sure to update the
login-credentials.
### Login The supplied Compose stack uses PHP 8.4 and MySQL 8.0 and is for local development only. Copy `.env.dist` to `.env` and `config.dist.php` to `config.php`, replace the sample database and MySQL root passwords, then run:
Now you should be able to log in to the admin panel by going to the `/admin` URL of your website using `admin` and
`admin` (you can change these in the config file). If you are able to login you can start building your website.
Note: make sure to disable error reporting in `index.php` once your website goes into production! ```sh
docker compose up --build -d
```
## Docker The app is available at `http://localhost:63000`; Adminer is bound to localhost at `http://localhost:63001`.
Simply run `docker-compose up -d` using the supplied `docker-compose.yml`. The image uses PHP 8.2
+9 -9
View File
@@ -20,7 +20,7 @@ return [
| Storage settings | Storage settings
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Database and file storage settings. | File storage settings.
| |
*/ */
'storage' => [ 'storage' => [
@@ -161,14 +161,14 @@ return [
'mail' => [ 'mail' => [
'class' => Plugi\Core\Mailer::class, 'class' => Plugi\Core\Mailer::class,
'transport' => 'smtp', 'transport' => 'smtp',
'host' => '', 'host' => $_ENV['MAIL_HOST'] ?? '',
'port' => 587, 'port' => (int) ($_ENV['MAIL_PORT'] ?? 587),
'encryption' => 'tls', 'encryption' => $_ENV['MAIL_ENCRYPTION'] ?? 'tls',
'username' => '', 'username' => $_ENV['MAIL_USERNAME'] ?? '',
'password' => '', 'password' => $_ENV['MAIL_PASSWORD'] ?? '',
'from_address' => '', 'from_address' => $_ENV['MAIL_FROM_ADDRESS'] ?? '',
'from_name' => '', 'from_name' => $_ENV['MAIL_FROM_NAME'] ?? '',
'timeout' => 10, 'timeout' => (int) ($_ENV['MAIL_TIMEOUT'] ?? 10),
], ],
/* /*
+28 -7
View File
@@ -1,3 +1,4 @@
# Development only. Do not use this Compose stack for production deployments.
services: services:
web: web:
build: . build: .
@@ -7,7 +8,28 @@ services:
depends_on: depends_on:
- mysql - mysql
ports: ports:
- '63000:80' - '127.0.0.1:63000:80'
environment:
STAGE: ${STAGE:-production}
BASE_URL: ${BASE_URL:-http://localhost:63000}
DATABASE_DRIVER: ${DATABASE_DRIVER:-mysql}
DATABASE_HOST: ${DATABASE_HOST:-mysql}
DATABASE_DATABASE: ${DATABASE_DATABASE:-plugi}
DATABASE_USERNAME: ${DATABASE_USERNAME:-plugi}
DATABASE_PASSWORD: ${DATABASE_PASSWORD:-change-me}
DATABASE_CHARSET: ${DATABASE_CHARSET:-utf8mb4}
DATABASE_PREFIX: ${DATABASE_PREFIX:-}
USERNAME: ${USERNAME:-admin}
PASSWORD: ${PASSWORD:-}
PASSWORD_HASH: ${PASSWORD_HASH:-}
MAIL_HOST: ${MAIL_HOST:-}
MAIL_PORT: ${MAIL_PORT:-587}
MAIL_ENCRYPTION: ${MAIL_ENCRYPTION:-tls}
MAIL_USERNAME: ${MAIL_USERNAME:-}
MAIL_PASSWORD: ${MAIL_PASSWORD:-}
MAIL_FROM_ADDRESS: ${MAIL_FROM_ADDRESS:-}
MAIL_FROM_NAME: ${MAIL_FROM_NAME:-}
MAIL_TIMEOUT: ${MAIL_TIMEOUT:-10}
links: links:
- mysql - mysql
networks: networks:
@@ -15,7 +37,7 @@ services:
adminer: adminer:
image: adminer image: adminer
ports: ports:
- 63001:8080 - '127.0.0.1:63001:8080'
links: links:
- mysql - mysql
networks: networks:
@@ -24,13 +46,12 @@ services:
image: "mysql:8.0" image: "mysql:8.0"
restart: 'always' restart: 'always'
volumes: volumes:
- '.:/application'
- db:/var/lib/mysql:cached - db:/var/lib/mysql:cached
environment: environment:
- MYSQL_ROOT_PASSWORD=root MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-change-me-root}
- MYSQL_DATABASE=plugi MYSQL_DATABASE: ${DATABASE_DATABASE:-plugi}
- MYSQL_USER=plugi MYSQL_USER: ${DATABASE_USERNAME:-plugi}
- MYSQL_PASSWORD=plugi MYSQL_PASSWORD: ${DATABASE_PASSWORD:-change-me}
# ports: # ports:
# - '63002:3306' # - '63002:3306'
networks: networks:
+1 -1
View File
@@ -1,7 +1,7 @@
<?php <?php
require_once __DIR__.'/plugi-core/src/Core/EnvLoader.php'; require_once __DIR__.'/plugi-core/src/Core/EnvLoader.php';
(new Plugi\Core\EnvLoader())->load(); (new Plugi\Core\EnvLoader(__DIR__ . '/.env'))->load();
if ($_ENV['STAGE'] !== 'production') { if ($_ENV['STAGE'] !== 'production') {
ini_set('display_errors', 1); ini_set('display_errors', 1);