Moved docker default passwords to .env

This commit is contained in:
Roman 2024-04-23 21:51:07 +02:00
parent 7f0290ba05
commit c13516c085
5 changed files with 10 additions and 10 deletions

1
.gitignore vendored Normal file

@ -0,0 +1 @@
.env

@ -121,14 +121,13 @@ class Settings {
// rate limiting // rate limiting
$settings->redisPort = 6379; $settings->redisPort = 6379;
$settings->redisPassword = "";
if (isDocker()) { if (isDocker()) {
$settings->rateLimitingEnabled = true; $settings->rateLimitingEnabled = true;
$settings->redisHost = "webbase-redis"; $settings->redisHost = "webbase-redis";
$settings->redisPassword = "webbase-redis";
} else { } else {
$settings->rateLimitingEnabled = false; $settings->rateLimitingEnabled = false;
$settings->redisHost = ""; $settings->redisHost = "";
$settings->redisPassword = "";
} }
return $settings; return $settings;

@ -710,14 +710,13 @@ namespace Documents\Install {
if (isDocker()) { if (isDocker()) {
$defaultHost = "db"; $defaultHost = "db";
$defaultUsername = "root"; $defaultUsername = "root";
$defaultPassword = "webbasedb";
$defaultDatabase = "webbase"; $defaultDatabase = "webbase";
} else { } else {
$defaultHost = "localhost"; $defaultHost = "localhost";
$defaultUsername = ""; $defaultUsername = "";
$defaultPassword = "";
$defaultDatabase = ""; $defaultDatabase = "";
} }
$defaultPassword = "";
$views = array( $views = array(
self::CHECKING_REQUIREMENTS => array( self::CHECKING_REQUIREMENTS => array(

@ -31,9 +31,10 @@ I actually don't know what i want to implement here. There are quite to many CMS
3. Open the webapp in your browser and follow the installation guide 3. Open the webapp in your browser and follow the installation guide
### Docker Installation ### Docker Installation
1. `docker-compose build` 1. Create an `.env` file with `MYSQL_ROOT_PASSWORD` AND `REDIS_PASSWORD`
2. `docker-compose up` 2. `docker-compose build`
3. Open the webapp in your browser and follow the installation guide 3. `docker-compose up`
4Open the webapp in your browser and follow the installation guide
3a. Since the docker runs as user www-data (33), the following permissions are recommended and at least necessary for the installation process: 3a. Since the docker runs as user www-data (33), the following permissions are recommended and at least necessary for the installation process:
``` ```
chown -R :33 . chown -R :33 .

@ -18,8 +18,8 @@ services:
ports: ports:
- '3306:3306' - '3306:3306'
environment: environment:
- "MYSQL_ROOT_PASSWORD=webbasedb" MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
- "MYSQL_DATABASE=webbase" MYSQL_DATABASE: webbase
php: php:
container_name: webbase-php container_name: webbase-php
volumes: volumes:
@ -35,7 +35,7 @@ services:
image: redis:latest image: redis:latest
ports: ports:
- '6379:6379' - '6379:6379'
command: redis-server --save 20 1 --loglevel warning --requirepass webbase-redis command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
volumes: volumes:
- cache:/data - cache:/data
volumes: volumes: