util: move system config defaults to file

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/672/head
Varun Patil 2023-05-17 20:42:21 -07:00
parent 64faee08db
commit 8e410f73da
3 changed files with 66 additions and 126 deletions

View File

@ -6,69 +6,6 @@ description: Documentation for config.php options that Memories uses
This is a list of all options in `config.php` that memories uses This is a list of all options in `config.php` that memories uses
## General
```php ```php
<?php --8<-- "lib/SystemConfigDefault.php"
// Path to exiftool binary
'memories.exiftool' => '/var/www/html/apps/memories/exiftool-bin/exiftool-amd64-glibc',
// Do not use packaged binaries of exiftool
// This requires perl to be available
'memories.exiftool_no_local' => false,
// Makes the memories instance readonly
'memories.readonly' => false,
// Type of reverse geocoding planet database
// -1 => Unconfigured
// 0 => Disable
// 1 => MySQL / MariaDB
// 2 => PostgreSQL
'memories.gis_type' => -1,
```
## Transcoding
```php
<?php
// Disable transcoding
'memories.vod.disable' => false,
// Hardware support for transcoding
'memories.vod.vaapi' => false, // Transcode with VA-API
'memories.vod.vaapi.low_power' => false, // Use low_power mode for VA-API
'memories.vod.nvenc' => false, // Transcode with NVIDIA NVENC
'memories.vod.nvenc.temporal_aq' => false,
'memories.vod.nvenc.scale' => 'npp', // npp or cuda
// Paths to ffmpeg and ffprobe binaries
'memories.vod.ffmpeg' => '/usr/bin/ffmpeg',
'memories.vod.ffprobe' => '/usr/bin/ffprobe',
// Path to go-vod binary
'memories.vod.path' => '/var/www/html/apps/memories/exiftool-bin/go-vod-amd64',
// Path to use for transcoded files (/tmp/go-vod/instanceid)
// Make sure this has plenty of space
'memories.vod.tempdir' => '/tmp/my-dir',
// Bind address to use when starting the transcoding server
'memories.vod.bind' => '127.0.0.1:47788',
// Address used to connect to the transcoding server
// If not specified, the bind address above will be used
'memories.vod.connect' => '127.0.0.1:47788',
// Mark go-vod as external. If true, Memories will not attempt to
// start go-vod if it is not running already.
'memories.vod.external' => false,
// Set the default video quality for a first time user
// 0 => Auto (default)
// -1 => Original (max quality with transcoding)
// -2 => Direct (disable transcoding)
// 1080 => 1080p (and so on)
'memories.video_default_quality' => '0',
``` ```

View File

@ -0,0 +1,64 @@
<?php
return [
// Path to exiftool binary
'memories.exiftool' => '',
// Do not use packaged binaries of exiftool
// This requires perl to be available
'memories.exiftool_no_local' => false,
// How to index user directories
// 0 = auto-index disabled
// 1 = index everything
// 2 = index only user timelines
// 3 = index only configured path
'memories.index.mode' => '1',
// Path to index (only used if indexing mode is 3)
'memories.index.path' => '/',
// Places database type identifier
'memories.gis_type' => -1,
// Disable transcoding
'memories.vod.disable' => true,
// VA-API configuration options
'memories.vod.vaapi' => false, // Transcode with VA-API
'memories.vod.vaapi.low_power' => false, // Use low_power mode for VA-API
// NVENC configuration options
'memories.vod.nvenc' => false, // Transcode with NVIDIA NVENC
'memories.vod.nvenc.temporal_aq' => false,
'memories.vod.nvenc.scale' => 'npp', // npp or cuda
// Paths to ffmpeg and ffprobe binaries
'memories.vod.ffmpeg' => '',
'memories.vod.ffprobe' => '',
// Path to go-vod binary
'memories.vod.path' => '',
// Path to use for transcoded files (/tmp/go-vod/instanceid)
// Make sure this has plenty of space
'memories.vod.tempdir' => '',
// Bind address to use when starting the transcoding server
'memories.vod.bind' => '127.0.0.1:47788',
// Address used to connect to the transcoding server
// If not specified, the bind address above will be used
'memories.vod.connect' => '127.0.0.1:47788',
// Mark go-vod as external. If true, Memories will not attempt to
// start go-vod if it is not running already.
'memories.vod.external' => false,
// Set the default video quality for a first time user
// 0 => Auto (default)
// -1 => Original (max quality with transcoding)
// -2 => Direct (disable transcoding)
// 1080 => 1080p (and so on)
'memories.video_default_quality' => '0',
];

View File

@ -388,68 +388,7 @@ class Util
/** Get list of defaults for all system config keys. */ /** Get list of defaults for all system config keys. */
public static function systemConfigDefaults(): array public static function systemConfigDefaults(): array
{ {
return [ return require __DIR__.'/SystemConfigDefault.php';
// Path to exiftool binary
'memories.exiftool' => '',
// Do not use packaged binaries of exiftool
// This requires perl to be available
'memories.exiftool_no_local' => false,
// How to index user directories
// 0 = auto-index disabled
// 1 = index everything
// 2 = index only user timelines
// 3 = index only configured path
'memories.index.mode' => '1',
// Path to index (only used if indexing mode is 3)
'memories.index.path' => '/',
// Places database type identifier
'memories.gis_type' => -1,
// Disable transcoding
'memories.vod.disable' => true,
// VA-API configuration options
'memories.vod.vaapi' => false, // Transcode with VA-API
'memories.vod.vaapi.low_power' => false, // Use low_power mode for VA-API
// NVENC configuration options
'memories.vod.nvenc' => false, // Transcode with NVIDIA NVENC
'memories.vod.nvenc.temporal_aq' => false,
'memories.vod.nvenc.scale' => 'npp', // npp or cuda
// Paths to ffmpeg and ffprobe binaries
'memories.vod.ffmpeg' => '',
'memories.vod.ffprobe' => '',
// Path to go-vod binary
'memories.vod.path' => '',
// Path to use for transcoded files (/tmp/go-vod/instanceid)
// Make sure this has plenty of space
'memories.vod.tempdir' => '',
// Bind address to use when starting the transcoding server
'memories.vod.bind' => '127.0.0.1:47788',
// Address used to connect to the transcoding server
// If not specified, the bind address above will be used
'memories.vod.connect' => '127.0.0.1:47788',
// Mark go-vod as external. If true, Memories will not attempt to
// start go-vod if it is not running already.
'memories.vod.external' => false,
// Set the default video quality for a first time user
// 0 => Auto (default)
// -1 => Original (max quality with transcoding)
// -2 => Direct (disable transcoding)
// 1080 => 1080p (and so on)
'memories.video_default_quality' => '0',
];
} }
/** /**