feat: remove unused web_server_user config entry

- remove InstallStorageDirectory function

BREAKING CHANGE: The configuration schema has changed:
- The `general.web_server_user` configuration field is
not used anymore.
This commit is contained in:
jo 2022-01-31 12:36:40 +01:00 committed by Kyle Robbertze
parent 3f6438383f
commit 4d868fac00
4 changed files with 4 additions and 44 deletions

View File

@ -13,8 +13,6 @@ class Config
$CC_CONFIG = [];
// Name of the web server user
$CC_CONFIG['webServerUser'] = $values['general']['web_server_user'];
$CC_CONFIG['rabbitmq'] = $values['rabbitmq'];
$CC_CONFIG['baseDir'] = $values['general']['base_dir'];

View File

@ -19,9 +19,6 @@
# api_key: The API key for your Airtime installation.
# The value is generated the first time you use Airtime.
#
# web_server_user: The default webserver user.
# The default is www-data.
#
# base_url: The host name for your webserver.
# The default is localhost.
#
@ -59,7 +56,6 @@
#
[general]
api_key =
web_server_user = www-data
base_url = localhost
base_port = 80
base_dir = /

View File

@ -143,41 +143,6 @@ class AirtimeInstall
return true;
}
/* TODO: This function should be moved to the media-monitor
* install script. */
public static function InstallStorageDirectory()
{
$CC_CONFIG = Config::getConfig();
echo '* Storage directory setup' . PHP_EOL;
$ini = parse_ini_file(__DIR__ . '/airtime-install.ini');
$stor_dir = $ini['storage_dir'];
$dirs = [$stor_dir, $stor_dir . '/organize'];
foreach ($dirs as $dir) {
if (!file_exists($dir)) {
if (mkdir($dir, 02775, true)) {
$rp = realpath($dir);
echo "* Directory {$rp} created" . PHP_EOL;
} else {
echo "* Failed creating {$dir}" . PHP_EOL;
exit(1);
}
} elseif (is_writable($dir)) {
$rp = realpath($dir);
echo "* Skipping directory already exists: {$rp}" . PHP_EOL;
} else {
$rp = realpath($dir);
echo "* Error: Directory already exists, but is not writable: {$rp}" . PHP_EOL;
exit(1);
}
echo "* Giving Apache permission to access {$rp}" . PHP_EOL;
$success = chown($rp, $CC_CONFIG['webServerUser']);
$success = chgrp($rp, $CC_CONFIG['webServerUser']);
$success = chmod($rp, 0775);
}
}
public static function CreateDatabaseUser()
{
$CC_CONFIG = Config::getConfig();
@ -317,7 +282,8 @@ END;
public static function DirCheck()
{
echo 'Legend: "+" means the dir/file exists, "-" means that it does not.' . PHP_EOL;
$dirs = [AirtimeInstall::CONF_DIR_BINARIES,
$dirs = [
AirtimeInstall::CONF_DIR_BINARIES,
AirtimeInstall::CONF_DIR_WWW,
AirtimeIni::CONF_FILE_AIRTIME,
AirtimeIni::CONF_FILE_LIQUIDSOAP,
@ -326,7 +292,8 @@ END;
'/usr/lib/airtime/pypo',
'/var/log/airtime',
'/var/log/airtime/pypo',
'/var/tmp/airtime/pypo', ];
'/var/tmp/airtime/pypo',
];
foreach ($dirs as $f) {
if (file_exists($f)) {
echo "+ {$f}" . PHP_EOL;

View File

@ -15,7 +15,6 @@ vhost = /airtime_tests
[general]
dev_env = testing
api_key = H2NRICX6CM8F50CU123C
web_server_user = www-data
airtime_dir = /usr/share/airtime
base_url = localhost
base_port = 80