diff --git a/conf/config.proto b/conf/config.proto new file mode 100644 index 00000000..280c1e8d --- /dev/null +++ b/conf/config.proto @@ -0,0 +1,29 @@ +[database] +dsn_prefix = mysql +host = localhost +socket = /var/run/mysqld/mysqld.sock +name = AUR +user = aur +password = aur + +[paths] +storage = /srv/aur/unsupported/ + +[options] +username_min_len = 3 +username_max_len = 16 +passwd_min_len = 4 +default_lang = en +sql_debug = 0 +max_sessions_per_user = 8 +login_timeout = 7200 +persistent_cookie_timeout = 2592000 +max_filesize_uncompressed = 8388608 +disable_http_login = 1 +aur_location = http://localhost +package_url = /packages/ +use_virtual_urls = 1 +max_rpc_results = 5000 +aur_request_ml = aur-requests@archlinux.org +request_idle_time = 1209600 +auto_orphan_age = 15552000 diff --git a/scripts/aurblup/aurblup-wrapper b/scripts/aurblup/aurblup-wrapper index b056030d..c7b20afe 100755 --- a/scripts/aurblup/aurblup-wrapper +++ b/scripts/aurblup/aurblup-wrapper @@ -8,10 +8,14 @@ if (empty($dir)) { } set_include_path(get_include_path() . PATH_SEPARATOR . "$dir/lib"); -include("config.inc.php"); +include("confparser.inc.php"); + +$user = config_get('database', 'user'); +$password = config_get('database', 'password'); +$name = config_get('database', 'name'); exec($dir . "/../scripts/aurblup/aurblup " . "-S /var/run/mysqld/mysqld.sock " . - "-u " . escapeshellarg(AUR_db_user) . " " . - "-p " . escapeshellarg(AUR_db_pass) . " " . - "-D " . escapeshellarg(AUR_db_name)); + "-u " . escapeshellarg($user) . " " . + "-p " . escapeshellarg($password) . " " . + "-D " . escapeshellarg($name)); diff --git a/scripts/cleanup b/scripts/cleanup index 1fe63a27..0ccbe7df 100755 --- a/scripts/cleanup +++ b/scripts/cleanup @@ -16,24 +16,25 @@ if (empty($dir)) { } set_include_path(get_include_path() . PATH_SEPARATOR . "$dir/lib"); -include("config.inc.php"); +include("confparser.inc.php"); include("aur.inc.php"); include("pkgfuncs.inc.php"); $count = 0; -$buckets = scandir(INCOMING_DIR); +$incoming_dir = config_get('paths', 'storage'); +$buckets = scandir($incoming_dir); foreach ($buckets as $bucket) { - $bucketpath = INCOMING_DIR . $bucket; + $bucketpath = $incoming_dir . $bucket; if ($bucket == '.' || $bucket == '..' || !is_dir($bucketpath)) { continue; } - $files = scandir(INCOMING_DIR . $bucket); + $files = scandir($incoming_dir . $bucket); foreach ($files as $pkgname) { if ($pkgname == '.' || $pkgname == '..') { continue; } - $fullpath = INCOMING_DIR . $bucket . "/" . $pkgname; + $fullpath = $incoming_dir . $bucket . "/" . $pkgname; if (!pkg_from_name($pkgname) && is_dir($fullpath)) { echo 'Removing ' . $fullpath . "\n"; rm_tree($fullpath); diff --git a/upgrading/3.5.0.txt b/upgrading/3.5.0.txt index 1990c47a..e8af4af8 100644 --- a/upgrading/3.5.0.txt +++ b/upgrading/3.5.0.txt @@ -17,3 +17,7 @@ ALTER TABLE PackageVotes ADD COLUMN VoteTS BIGINT NULL DEFAULT NULL; ---- INSERT INTO PackageCategories (Category) VALUES ('wayland'); ---- + +4. The configuration file format has been changed. Make sure you convert +web/lib/config.inc.php to the new format (see conf/config.proto for an example +configuration) and put the resulting file in conf/config. diff --git a/web/html/login.php b/web/html/login.php index e458fec0..dba3af53 100644 --- a/web/html/login.php +++ b/web/html/login.php @@ -5,7 +5,8 @@ include_once("aur.inc.php"); set_lang(); check_sid(); -if (!$DISABLE_HTTP_LOGIN || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'])) { +$disable_http_login = config_get_bool('options', 'disable_http_login'); +if (!$disable_http_login || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'])) { $login = try_login(); $login_error = $login['error']; } @@ -19,7 +20,7 @@ html_header('AUR ' . __("Login")); = __("Logged-in as: %s", '' . username_from_sid($_COOKIE["AURSID"]) . ''); ?> [= __("Logout"); ?>]
- +