forked from GithubBackups/vichan
Merge branch 'deffcolony:master' into master
This commit is contained in:
commit
b30232f773
49
.env.example
49
.env.example
@ -10,19 +10,50 @@ INSTANCE=0
|
|||||||
# SSL_KEY_PATH=/path/to/key.pem
|
# SSL_KEY_PATH=/path/to/key.pem
|
||||||
|
|
||||||
# PHP Service Settings
|
# PHP Service Settings
|
||||||
VICHAN_MYSQL__HOST=db
|
## Database settings
|
||||||
VICHAN_MYSQL__USER=vichan
|
VICHAN_MYSQL_HOST=db
|
||||||
VICHAN_MYSQL__NAME=vichan
|
VICHAN_MYSQL_USER=vichan
|
||||||
VICHAN_MYSQL__PASSWORD=vichan!
|
VICHAN_MYSQL_NAME=vichan
|
||||||
|
VICHAN_MYSQL_PASSWORD=vichan!
|
||||||
|
|
||||||
|
## Security
|
||||||
VICHAN_SECURE_LOGIN_ONLY=0
|
VICHAN_SECURE_LOGIN_ONLY=0
|
||||||
|
|
||||||
# Redis Settings
|
## Cookies
|
||||||
VICHAN_REDIS_HOST=redis
|
VICHAN_COOKIES_MOD=mod
|
||||||
VICHAN_REDIS_PORT=6379
|
|
||||||
VICHAN_REDIS_PASSWORD=redis!
|
## Flood Control
|
||||||
|
VICHAN_FLOOD_TIME=30
|
||||||
|
VICHAN_FLOOD_TIME_IP=120
|
||||||
|
VICHAN_FLOOD_TIME_SAME=3600
|
||||||
|
VICHAN_MAX_BODY=1800
|
||||||
|
VICHAN_REPLY_LIMIT=250
|
||||||
|
VICHAN_MAX_LINKS=20
|
||||||
|
|
||||||
|
## Images
|
||||||
|
VICHAN_IMAGES_MAX_FILESIZE=10485760
|
||||||
|
VICHAN_IMAGES_THUMB_WIDTH=250
|
||||||
|
VICHAN_IMAGES_THUMB_HEIGHT=250
|
||||||
|
VICHAN_IMAGES_MAX_WIDTH=10000
|
||||||
|
VICHAN_IMAGES_MAX_HEIGHT=10000
|
||||||
|
|
||||||
|
## Display
|
||||||
|
VICHAN_DISPLAY_THREADS_PER_PAGE=10
|
||||||
|
VICHAN_DISPLAY_MAX_PAGES=11
|
||||||
|
VICHAN_DISPLAY_THREADS_PREVIEW=5
|
||||||
|
|
||||||
|
## Directories
|
||||||
|
VICHAN_DIRECTORIES_ROOT=/
|
||||||
|
|
||||||
|
|
||||||
# Database Service (MariaDB) Settings
|
# Database Service (MariaDB) Settings
|
||||||
MYSQL_DATABASE=vichan
|
MYSQL_DATABASE=vichan
|
||||||
MYSQL_USER=vichan
|
MYSQL_USER=vichan
|
||||||
MYSQL_PASSWORD=vichan!
|
MYSQL_PASSWORD=vichan!
|
||||||
MYSQL_ROOT_PASSWORD=vichan!!
|
MYSQL_ROOT_PASSWORD=vichan!!
|
||||||
|
|
||||||
|
|
||||||
|
# Redis
|
||||||
|
VICHAN_REDIS_HOST=redis
|
||||||
|
VICHAN_REDIS_PORT=6379
|
||||||
|
VICHAN_REDIS_PASSWORD=redis!
|
||||||
|
|||||||
34
compose.yml
34
compose.yml
@ -32,14 +32,38 @@ services:
|
|||||||
- ./docker/php/jit.ini:/usr/local/etc/php/conf.d/jit.ini
|
- ./docker/php/jit.ini:/usr/local/etc/php/conf.d/jit.ini
|
||||||
- ./docker/php/php.ini:/usr/local/etc/php/php.ini
|
- ./docker/php/php.ini:/usr/local/etc/php/php.ini
|
||||||
environment:
|
environment:
|
||||||
VICHAN_MYSQL__HOST: ${VICHAN_MYSQL__HOST}
|
# Database settings
|
||||||
VICHAN_MYSQL__USER: ${VICHAN_MYSQL__USER}
|
VICHAN_MYSQL_HOST: ${VICHAN_MYSQL_HOST}
|
||||||
VICHAN_MYSQL__NAME: ${VICHAN_MYSQL__NAME}
|
VICHAN_MYSQL_USER: ${VICHAN_MYSQL_USER}
|
||||||
VICHAN_MYSQL__PASSWORD: ${VICHAN_MYSQL__PASSWORD}
|
VICHAN_MYSQL_NAME: ${VICHAN_MYSQL_NAME}
|
||||||
|
VICHAN_MYSQL_PASSWORD: ${VICHAN_MYSQL_PASSWORD}
|
||||||
|
# Security
|
||||||
VICHAN_SECURE_LOGIN_ONLY: ${VICHAN_SECURE_LOGIN_ONLY}
|
VICHAN_SECURE_LOGIN_ONLY: ${VICHAN_SECURE_LOGIN_ONLY}
|
||||||
|
# Redis settings
|
||||||
VICHAN_REDIS_HOST: ${VICHAN_REDIS_HOST}
|
VICHAN_REDIS_HOST: ${VICHAN_REDIS_HOST}
|
||||||
VICHAN_REDIS_PORT: ${VICHAN_REDIS_PORT}
|
VICHAN_REDIS_PORT: ${VICHAN_REDIS_PORT}
|
||||||
VICHAN_REDIS_PASSWORD: ${VICHAN_REDIS_PASSWORD}
|
VICHAN_REDIS_PASSWORD: ${VICHAN_REDIS_PASSWORD}
|
||||||
|
# Cookies
|
||||||
|
VICHAN_COOKIES_MOD: ${VICHAN_COOKIES_MOD}
|
||||||
|
# Flood Control
|
||||||
|
VICHAN_FLOOD_TIME: ${VICHAN_FLOOD_TIME}
|
||||||
|
VICHAN_FLOOD_TIME_IP: ${VICHAN_FLOOD_TIME_IP}
|
||||||
|
VICHAN_FLOOD_TIME_SAME: ${VICHAN_FLOOD_TIME_SAME}
|
||||||
|
VICHAN_MAX_BODY: ${VICHAN_MAX_BODY}
|
||||||
|
VICHAN_REPLY_LIMIT: ${VICHAN_REPLY_LIMIT}
|
||||||
|
VICHAN_MAX_LINKS: ${VICHAN_MAX_LINKS}
|
||||||
|
# Images
|
||||||
|
VICHAN_IMAGES_MAX_FILESIZE: ${VICHAN_IMAGES_MAX_FILESIZE}
|
||||||
|
VICHAN_IMAGES_THUMB_WIDTH: ${VICHAN_IMAGES_THUMB_WIDTH}
|
||||||
|
VICHAN_IMAGES_THUMB_HEIGHT: ${VICHAN_IMAGES_THUMB_HEIGHT}
|
||||||
|
VICHAN_IMAGES_MAX_WIDTH: ${VICHAN_IMAGES_MAX_WIDTH}
|
||||||
|
VICHAN_IMAGES_MAX_HEIGHT: ${VICHAN_IMAGES_MAX_HEIGHT}
|
||||||
|
# Display
|
||||||
|
VICHAN_DISPLAY_THREADS_PER_PAGE: ${VICHAN_DISPLAY_THREADS_PER_PAGE}
|
||||||
|
VICHAN_DISPLAY_MAX_PAGES: ${VICHAN_DISPLAY_MAX_PAGES}
|
||||||
|
VICHAN_DISPLAY_THREADS_PREVIEW: ${VICHAN_DISPLAY_THREADS_PREVIEW}
|
||||||
|
# Directories
|
||||||
|
VICHAN_DIRECTORIES_ROOT: ${VICHAN_DIRECTORIES_ROOT}
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
|
|
||||||
@ -61,6 +85,8 @@ services:
|
|||||||
image: redis:latest
|
image: redis:latest
|
||||||
container_name: vichan_redis
|
container_name: vichan_redis
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
REDIS_PASSWORD: ${VICHAN_REDIS_PASSWORD}
|
||||||
volumes:
|
volumes:
|
||||||
- ./local-instances/${INSTANCE:-0}/redis:/data
|
- ./local-instances/${INSTANCE:-0}/redis:/data
|
||||||
command: redis-server --requirepass ${VICHAN_REDIS_PASSWORD}
|
command: redis-server --requirepass ${VICHAN_REDIS_PASSWORD}
|
||||||
|
|||||||
@ -1,20 +1,63 @@
|
|||||||
The `php-fpm` process runs containerized.
|
# Vichan Docker Setup
|
||||||
The php application always uses `/var/www` as it's work directory and home folder, and if `/var/www` is bind mounted it
|
|
||||||
is necessary to adjust the path passed via FastCGI to `php-fpm` by changing the root directory to `/var/www`.
|
|
||||||
This can achieved in nginx by setting the `fastcgi_param SCRIPT_FILENAME` to `/var/www/$fastcgi_script_name;`
|
|
||||||
|
|
||||||
The default docker compose settings are intended for development and testing purposes.
|
The `php-fpm` process runs containerized.
|
||||||
The folder structure expected by compose is as follows
|
The PHP application always uses `/var/www` as its work directory and home folder. If `/var/www` is bind mounted, you must adjust the path passed via FastCGI to `php-fpm`.
|
||||||
|
|
||||||
|
To fix this:
|
||||||
|
1. **Adjust the root path**: Set `fastcgi_param SCRIPT_FILENAME` to `/var/www/$fastcgi_script_name;` in your nginx config.
|
||||||
|
|
||||||
|
The default Docker Compose settings are meant for development and testing.
|
||||||
|
|
||||||
|
Expected folder structure:
|
||||||
```
|
```
|
||||||
<vichan-project>
|
<vichan-project>
|
||||||
└── local-instances
|
└── local-instances
|
||||||
└── 1
|
└── 1
|
||||||
├── mysql
|
├── db
|
||||||
└── www
|
└── www
|
||||||
```
|
```
|
||||||
The vichan container is by itself much less rigid.
|
|
||||||
|
|
||||||
|
To run the app:
|
||||||
|
1. **Start all containers**: Run `docker compose up -d --build` at the root of vichan directory
|
||||||
|
2. **Rebuild just the PHP container**: Run `docker compose up -d --build php` (useful during development)
|
||||||
|
|
||||||
Use `docker compose up --build` to start the docker compose.
|
---
|
||||||
Use `docker compose up --build -d php` to rebuild just the vichan container while the compose is running. Useful for development.
|
|
||||||
|
## PHP File Size Limit
|
||||||
|
|
||||||
|
To upload larger files, increase the default PHP file size limit (2MB). Since this setup uses Docker, follow these steps:
|
||||||
|
|
||||||
|
1. **Open the config file**: Edit `./docker/php/php.ini` in your project directory.
|
||||||
|
2. **Add or update these lines** to increase the file size limit to 10MB:
|
||||||
|
```ini
|
||||||
|
upload_max_filesize = 10M
|
||||||
|
post_max_size = 10M
|
||||||
|
```
|
||||||
|
3. **Restart your containers** to apply the changes:
|
||||||
|
```bash
|
||||||
|
docker compose restart
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
By default, PHP limits file uploads to **2MB** — so increasing this is often required when uploading images or documents.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Using the `.env` File
|
||||||
|
|
||||||
|
Environment variables for the Docker Compose setup can be managed easily using a `.env` file.
|
||||||
|
|
||||||
|
### Steps to Use It:
|
||||||
|
1. **Copy the example**: Start by copying `.env.example` to `.env`
|
||||||
|
```bash
|
||||||
|
cp .env.example .env
|
||||||
|
```
|
||||||
|
2. **Edit `.env`**: Please make sure to change the default passwords for your setup.
|
||||||
|
|
||||||
|
### What It Controls:
|
||||||
|
- Instance folder reference (e.g. `local-instances/0`)
|
||||||
|
- Database credentials
|
||||||
|
- Redis connection details
|
||||||
|
- Secure login
|
||||||
|
- Optional SSL certificate paths for nginx
|
||||||
|
|||||||
@ -137,44 +137,43 @@
|
|||||||
* ====================
|
* ====================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
// Determine if Redis is configured via environment variables
|
||||||
* On top of the static file caching system, you can enable the additional caching system which is
|
$redis_enabled = getenv('VICHAN_REDIS_HOST') !== false && getenv('VICHAN_REDIS_PORT') !== false;
|
||||||
* designed to minimize request processing can significantly increase speed when posting or using
|
|
||||||
* the moderator interface.
|
|
||||||
*
|
|
||||||
* https://github.com/vichan-devel/vichan/wiki/cache
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Uses a PHP array. MUST NOT be used in multiprocess environments.
|
// Configure cache
|
||||||
$config['cache']['enabled'] = 'php';
|
if ($redis_enabled) {
|
||||||
// The recommended in-memory method of caching. Requires the extension. Due to how APCu works, this should be
|
$config['cache']['enabled'] = 'redis';
|
||||||
// disabled when you run tools from the cli.
|
$config['cache']['redis'] = [
|
||||||
// $config['cache']['enabled'] = 'apcu';
|
'host' => getenv('VICHAN_REDIS_HOST') ?: 'localhost',
|
||||||
// The Memcache server. Requires the memcached extension, with a final D.
|
'port' => (int)(getenv('VICHAN_REDIS_PORT') ?: 6379),
|
||||||
// $config['cache']['enabled'] = 'memcached';
|
'password' => getenv('VICHAN_REDIS_PASSWORD') ?: '',
|
||||||
// The Redis server. Requires the extension.
|
'database' => 1,
|
||||||
// $config['cache']['enabled'] = 'redis';
|
];
|
||||||
// Use the local cache folder. Slower than native but available out of the box and compatible with multiprocess
|
} else {
|
||||||
// environments. You can mount a ram-based filesystem in the cache directory to improve performance.
|
$config['cache']['enabled'] = 'php';
|
||||||
// $config['cache']['enabled'] = 'fs';
|
}
|
||||||
// Technically available, offers a no-op fake cache. Don't use this outside of testing or debugging.
|
|
||||||
// $config['cache']['enabled'] = 'none';
|
|
||||||
|
|
||||||
// Timeout for cached objects such as posts and HTML.
|
// Configure sessions to use Redis if enabled
|
||||||
|
if ($redis_enabled) {
|
||||||
|
$config['session']['enabled'] = 'redis';
|
||||||
|
$config['session']['redis'] = [
|
||||||
|
'host' => getenv('VICHAN_REDIS_HOST') ?: 'localhost',
|
||||||
|
'port' => (int)(getenv('VICHAN_REDIS_PORT') ?: 6379),
|
||||||
|
'password' => getenv('VICHAN_REDIS_PASSWORD') ?: '',
|
||||||
|
'database' => 1,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cache timeout for cached objects
|
||||||
$config['cache']['timeout'] = 60 * 60 * 48; // 48 hours
|
$config['cache']['timeout'] = 60 * 60 * 48; // 48 hours
|
||||||
|
|
||||||
// Optional prefix if you're running multiple vichan instances on the same machine.
|
// Optional prefix for multiple vichan instances
|
||||||
$config['cache']['prefix'] = '';
|
$config['cache']['prefix'] = '';
|
||||||
|
|
||||||
// Memcached servers to use. Read more: http://www.php.net/manual/en/memcached.addservers.php
|
// Memcached servers (not used)
|
||||||
$config['cache']['memcached'] = array(
|
$config['cache']['memcached'] = [
|
||||||
array('localhost', 11211)
|
['localhost', 11211]
|
||||||
);
|
];
|
||||||
|
|
||||||
// Redis server to use. Location, port, password, database id.
|
|
||||||
// Note that vichan may clear the database at times, so you may want to pick a database id just for
|
|
||||||
// vichan to use.
|
|
||||||
$config['cache']['redis'] = array('localhost', 6379, '', 1);
|
|
||||||
|
|
||||||
// EXPERIMENTAL: Should we cache configs? Warning: this changes board behaviour, i'd say, a lot.
|
// EXPERIMENTAL: Should we cache configs? Warning: this changes board behaviour, i'd say, a lot.
|
||||||
// If you have any lambdas/includes present in your config, you should move them to instance-functions.php
|
// If you have any lambdas/includes present in your config, you should move them to instance-functions.php
|
||||||
|
|||||||
78
install.php
78
install.php
@ -916,30 +916,62 @@ if ($step == 0) {
|
|||||||
} elseif ($step == 2) {
|
} elseif ($step == 2) {
|
||||||
$page['title'] = 'Configuration';
|
$page['title'] = 'Configuration';
|
||||||
$sg = new SaltGen();
|
$sg = new SaltGen();
|
||||||
$config['cookies']['salt'] = $sg->generate();
|
|
||||||
|
// Initialize configuration with defaults and override with environment variables
|
||||||
|
$config['cookies'] = array(
|
||||||
|
'mod' => getenv('VICHAN_COOKIES_MOD') !== false ? getenv('VICHAN_COOKIES_MOD') : 'mod',
|
||||||
|
'salt' => $sg->generate(),
|
||||||
|
);
|
||||||
|
|
||||||
|
$config['flood_time'] = getenv('VICHAN_FLOOD_TIME') !== false ? (int)getenv('VICHAN_FLOOD_TIME') : 30;
|
||||||
|
$config['flood_time_ip'] = getenv('VICHAN_FLOOD_TIME_IP') !== false ? (int)getenv('VICHAN_FLOOD_TIME_IP') : 120;
|
||||||
|
$config['flood_time_same'] = getenv('VICHAN_FLOOD_TIME_SAME') !== false ? (int)getenv('VICHAN_FLOOD_TIME_SAME') : 3600;
|
||||||
|
$config['max_body'] = getenv('VICHAN_MAX_BODY') !== false ? (int)getenv('VICHAN_MAX_BODY') : 1800;
|
||||||
|
$config['reply_limit'] = getenv('VICHAN_REPLY_LIMIT') !== false ? (int)getenv('VICHAN_REPLY_LIMIT') : 250;
|
||||||
|
$config['max_links'] = getenv('VICHAN_MAX_LINKS') !== false ? (int)getenv('VICHAN_MAX_LINKS') : 20;
|
||||||
|
|
||||||
|
$config['max_filesize'] = getenv('VICHAN_IMAGES_MAX_FILESIZE') !== false ? (int)getenv('VICHAN_IMAGES_MAX_FILESIZE') : 10485760; // This is 10MB
|
||||||
|
$config['thumb_width'] = getenv('VICHAN_IMAGES_THUMB_WIDTH') !== false ? (int)getenv('VICHAN_IMAGES_THUMB_WIDTH') : 250;
|
||||||
|
$config['thumb_height'] = getenv('VICHAN_IMAGES_THUMB_HEIGHT') !== false ? (int)getenv('VICHAN_IMAGES_THUMB_HEIGHT') : 250;
|
||||||
|
$config['max_width'] = getenv('VICHAN_IMAGES_MAX_WIDTH') !== false ? (int)getenv('VICHAN_IMAGES_MAX_WIDTH') : 10000;
|
||||||
|
$config['max_height'] = getenv('VICHAN_IMAGES_MAX_HEIGHT') !== false ? (int)getenv('VICHAN_IMAGES_MAX_HEIGHT') : 10000;
|
||||||
|
|
||||||
|
$config['threads_per_page'] = getenv('VICHAN_DISPLAY_THREADS_PER_PAGE') !== false ? (int)getenv('VICHAN_DISPLAY_THREADS_PER_PAGE') : 10;
|
||||||
|
$config['max_pages'] = getenv('VICHAN_DISPLAY_MAX_PAGES') !== false ? (int)getenv('VICHAN_DISPLAY_MAX_PAGES') : 11;
|
||||||
|
$config['threads_preview'] = getenv('VICHAN_DISPLAY_THREADS_PREVIEW') !== false ? (int)getenv('VICHAN_DISPLAY_THREADS_PREVIEW') : 5;
|
||||||
|
|
||||||
|
$config['root'] = getenv('VICHAN_DIRECTORIES_ROOT') !== false ? getenv('VICHAN_DIRECTORIES_ROOT') : '/';
|
||||||
|
|
||||||
$config['secure_trip_salt'] = $sg->generate();
|
$config['secure_trip_salt'] = $sg->generate();
|
||||||
$config['secure_password_salt'] = $sg->generate();
|
$config['secure_password_salt'] = $sg->generate();
|
||||||
|
|
||||||
// Set database configuration from Docker environment variables, leave empty if not found
|
// Set database configuration from Docker environment variables, leave empty if not found
|
||||||
$config['db'] = array(
|
$config['db'] = array(
|
||||||
'type' => 'mysql', // Default, required for MySQL
|
'type' => 'mysql', // Default, required for MySQL
|
||||||
'server' => getenv('VICHAN_MYSQL__HOST') !== false ? getenv('VICHAN_MYSQL__HOST') : '',
|
'server' => getenv('VICHAN_MYSQL_HOST') !== false ? getenv('VICHAN_MYSQL_HOST') : '',
|
||||||
'database' => getenv('VICHAN_MYSQL__NAME') !== false ? getenv('VICHAN_MYSQL__NAME') : '',
|
'database' => getenv('VICHAN_MYSQL_NAME') !== false ? getenv('VICHAN_MYSQL_NAME') : '',
|
||||||
'user' => getenv('VICHAN_MYSQL__USER') !== false ? getenv('VICHAN_MYSQL__USER') : '',
|
'user' => getenv('VICHAN_MYSQL_USER') !== false ? getenv('VICHAN_MYSQL_USER') : '',
|
||||||
'password' => getenv('VICHAN_MYSQL__PASSWORD') !== false ? getenv('VICHAN_MYSQL__PASSWORD') : '',
|
'password' => getenv('VICHAN_MYSQL_PASSWORD') !== false ? getenv('VICHAN_MYSQL_PASSWORD') : '',
|
||||||
);
|
);
|
||||||
|
|
||||||
// Append secure_login_only to $_SESSION['more'] if VICHAN_SECURE_LOGIN_ONLY is set from Docker environment variables
|
// Append secure_login_only to $_SESSION['more'] if VICHAN_SECURE_LOGIN_ONLY is set
|
||||||
if (getenv('VICHAN_SECURE_LOGIN_ONLY') !== false) {
|
if (getenv('VICHAN_SECURE_LOGIN_ONLY') !== false) {
|
||||||
$secure_login_only = (int)getenv('VICHAN_SECURE_LOGIN_ONLY');
|
$secure_login_only = (int)getenv('VICHAN_SECURE_LOGIN_ONLY');
|
||||||
$_SESSION['more'] .= "\n\$config['cookies']['secure_login_only'] = $secure_login_only;";
|
$_SESSION['more'] .= "\n\$config['cookies']['secure_login_only'] = $secure_login_only;";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Configuration notice at the top
|
||||||
|
$page['body'] = '<div class="ban"><h2>Configuration Note</h2>' .
|
||||||
|
'<p style="text-align:center;">The following settings can still be configured later. For more customization options, <a href="https://github.com/vichan-devel/vichan/wiki/config" target="_blank" rel="noopener noreferrer">check the Vichan configuration wiki.</a></p></div>';
|
||||||
|
|
||||||
|
// Append the configuration form
|
||||||
|
$page['body'] .= Element('installer/config.html', array(
|
||||||
|
'config' => $config,
|
||||||
|
'more' => $_SESSION['more'],
|
||||||
|
));
|
||||||
|
|
||||||
echo Element('page.html', array(
|
echo Element('page.html', array(
|
||||||
'body' => Element('installer/config.html', array(
|
'body' => $page['body'],
|
||||||
'config' => $config,
|
|
||||||
'more' => $_SESSION['more'],
|
|
||||||
)),
|
|
||||||
'title' => 'Configuration',
|
'title' => 'Configuration',
|
||||||
'config' => $config
|
'config' => $config
|
||||||
));
|
));
|
||||||
@ -1014,14 +1046,18 @@ if ($step == 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$page['title'] = 'Installation complete';
|
$page['title'] = 'Installation complete';
|
||||||
$page['body'] = '<p style="text-align:center">Thank you for installing vichan. Please report any bugs you discover. <a href="https://github.com/vichan-devel/vichan/wiki/Configuration-Basics">How do I edit the config files?</a></p>';
|
$page['body'] = '<p style="text-align:center">Thank you for using vichan. <a href="https://github.com/vichan-devel/vichan/issues/new/choose" target="_blank" rel="noopener noreferrer">Please report any bugs you discover.</a></p>' .
|
||||||
|
'<p style="text-align:center">If you are new to vichan, <a href="https://github.com/vichan-devel/vichan/wiki" target="_blank" rel="noopener noreferrer">please check out the documentation.</a></p>';
|
||||||
|
|
||||||
// notice and button
|
// Admin panel notice
|
||||||
$page['body'] .= '<div class="ban"><h2>Next Steps</h2>' .
|
$page['body'] .= '<div class="ban"><h2>Next Steps</h2>' .
|
||||||
'<p>You can now log in to the admin panel at <strong>/mod.php</strong> using the default credentials: <strong>Username: admin</strong>, <strong>Password: password</strong>.</p>' .
|
'<p>You can now log in to the admin panel at <strong>/mod.php</strong> using the default credentials:</p>' .
|
||||||
|
'<p><strong>Username:</strong> admin</p>' .
|
||||||
|
'<p><strong>Password:</strong> password</p>' .
|
||||||
'<p><strong>Important:</strong> For security, please change the administrator password immediately after logging in.</p>' .
|
'<p><strong>Important:</strong> For security, please change the administrator password immediately after logging in.</p>' .
|
||||||
'<p style="text-align:center"><button onclick="window.location.href=\'/mod.php\'">Go to Admin Panel</button></p></div>';
|
'<p style="text-align:center"><button onclick="window.location.href=\'/mod.php\'">Go to Admin Panel</button></p></div>';
|
||||||
|
|
||||||
|
|
||||||
if (!empty($sql_errors)) {
|
if (!empty($sql_errors)) {
|
||||||
$page['body'] .= '<div class="ban"><h2>SQL errors</h2><p>SQL errors were encountered when trying to install the database. This may be the result of using a database which is already occupied with a vichan installation; if so, you can probably ignore this.</p><p>The errors encountered were:</p><ul>' . $sql_errors . '</ul>' .
|
$page['body'] .= '<div class="ban"><h2>SQL errors</h2><p>SQL errors were encountered when trying to install the database. This may be the result of using a database which is already occupied with a vichan installation; if so, you can probably ignore this.</p><p>The errors encountered were:</p><ul>' . $sql_errors . '</ul>' .
|
||||||
'<p style="text-align:center;color:#d00"><strong>Warning:</strong> Ignoring errors is not recommended and may cause installation issues.</p>' .
|
'<p style="text-align:center;color:#d00"><strong>Warning:</strong> Ignoring errors is not recommended and may cause installation issues.</p>' .
|
||||||
@ -1042,18 +1078,18 @@ if ($step == 0) {
|
|||||||
echo Element('page.html', $page);
|
echo Element('page.html', $page);
|
||||||
} elseif ($step == 5) {
|
} elseif ($step == 5) {
|
||||||
$page['title'] = 'Installation complete';
|
$page['title'] = 'Installation complete';
|
||||||
$page['body'] = '<p style="text-align:center">Thank you for installing vichan. Please report any bugs you discover.</p>';
|
$page['body'] = '<p style="text-align:center">Thank you for using vichan. Please report any bugs you discover.</p>' .
|
||||||
|
'<p style="text-align:center">If you are new to vichan, <a href="https://github.com/vichan-devel/vichan/wiki">please check out the documentation</a>.</p>';
|
||||||
|
|
||||||
// onboarding notice and button to mod.php
|
// Admin panel notice
|
||||||
$page['body'] .= '<div class="ban"><h2>Next Steps</h2>' .
|
$page['body'] .= '<div class="ban"><h2>Next Steps</h2>' .
|
||||||
'<p>You can now log in to the admin panel at <strong>/mod.php</strong> using the default credentials:</p>' .
|
'<p>You can now log in to the admin panel at <strong>/mod.php</strong> using the default credentials:</p>' .
|
||||||
'<ul>' .
|
'<p><strong>Username:</strong> admin</p>' .
|
||||||
'<li><strong>Username:</strong> admin</li>' .
|
'<p><strong>Password:</strong> password</p>' .
|
||||||
'<li><strong>Password:</strong> password</li>' .
|
|
||||||
'</ul>' .
|
|
||||||
'<p><strong>Important:</strong> For security, please change the administrator password immediately after logging in.</p>' .
|
'<p><strong>Important:</strong> For security, please change the administrator password immediately after logging in.</p>' .
|
||||||
'<p style="text-align:center"><button onclick="window.location.href=\'/mod.php\'">Go to Admin Panel</button></p></div>';
|
'<p style="text-align:center"><button onclick="window.location.href=\'/mod.php\'">Go to Admin Panel</button></p></div>';
|
||||||
|
|
||||||
|
|
||||||
$boards = listBoards();
|
$boards = listBoards();
|
||||||
foreach ($boards as &$_board) {
|
foreach ($boards as &$_board) {
|
||||||
setupBoard($_board);
|
setupBoard($_board);
|
||||||
|
|||||||
@ -15,9 +15,6 @@
|
|||||||
|
|
||||||
<label for="db_pass">Password:</label>
|
<label for="db_pass">Password:</label>
|
||||||
<input type="password" id="db_pass" name="db[password]" value="{{ config.db.password }}">
|
<input type="password" id="db_pass" name="db[password]" value="{{ config.db.password }}">
|
||||||
</fieldset>
|
|
||||||
<p style="text-align:center" class="unimportant">The following is all later configurable. For more options, <a href="http://tinyboard.org/docs/?p=Config">edit your configuration files</a> after installing.</p>
|
|
||||||
<fieldset>
|
|
||||||
<legend>Cookies</legend>
|
<legend>Cookies</legend>
|
||||||
<label for="cookies_mod">Moderator cookie:</label>
|
<label for="cookies_mod">Moderator cookie:</label>
|
||||||
<input type="text" id="cookies_mod" name="cookies[mod]" value="{{ config.cookies.mod }}">
|
<input type="text" id="cookies_mod" name="cookies[mod]" value="{{ config.cookies.mod }}">
|
||||||
@ -52,34 +49,35 @@
|
|||||||
<label for="max_filesize">Maximum image filesize (bytes):</label>
|
<label for="max_filesize">Maximum image filesize (bytes):</label>
|
||||||
<input type="text" id="max_filesize" name="max_filesize" value="{{ config.max_filesize }}">
|
<input type="text" id="max_filesize" name="max_filesize" value="{{ config.max_filesize }}">
|
||||||
<div class="expandable">
|
<div class="expandable">
|
||||||
<legend>PHP file size limit</legend>
|
<legend>PHP File Size Limit</legend>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<p>The php file size limit can be configured in php.ini ( /usr/local/etc/php/php.ini )</p>
|
<p>Configure the PHP file size limit in the <code>php.ini</code> file. If it doesn't exist, create one.</p>
|
||||||
<div class="expandable">
|
<div class="expandable">
|
||||||
<legend>Using docker</legend>
|
<legend>Using Docker</legend>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<p>if you have pulled this from <a href="https://github.com/vichan-devel/vichan">GitHub</a></p>
|
<p>Edit or create <code>./vichan/docker/php/php.ini</code> in the project root.</p>
|
||||||
<p>Then you can set the file size limit at ./docker/php/php.ini</p>
|
<p>To set the limit to 10MB, add:</p>
|
||||||
<p>For example, to set the limit to 10MB, add the following lines:</p>
|
|
||||||
<pre>
|
<pre>
|
||||||
upload_max_filesize = 10M
|
upload_max_filesize = 10M
|
||||||
post_max_size = 10M</pre>
|
post_max_size = 10M
|
||||||
|
</pre>
|
||||||
<p>Then restart the containers.</p>
|
<p>Then restart the containers.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="expandable">
|
<div class="expandable">
|
||||||
<legend>Manual Configuration</legend>
|
<legend>Manual Configuration</legend>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<p>If you are not using docker, you can set the file size limit in the php.ini file:</p>
|
<p>Edit or create <code>/usr/local/etc/php/php.ini</code>.</p>
|
||||||
<p>For example, to set the limit to 10MB, add the following lines:</p>
|
<p>To set the limit to 10MB, add:</p>
|
||||||
<pre>
|
<pre>
|
||||||
upload_max_filesize = 10M
|
upload_max_filesize = 10M
|
||||||
post_max_size = 10M</pre>
|
post_max_size = 10M
|
||||||
|
</pre>
|
||||||
<p>Then restart the PHP server.</p>
|
<p>Then restart the PHP server.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<p>If this is not set, the default value is 2MB.</p>
|
<p>Default limit is 2MB if not set.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<label for="thumb_width">Thumbnail width:</label>
|
<label for="thumb_width">Thumbnail width:</label>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user