This patch adds a new $mirror option to the configuration file which
will cause Pakfire to only use this one to download any files.
This feature is disabled by default but useful for development.
Fixes: #12706
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
use HTTP::Message;
use HTTP::Request;
use Net::Ping;
use HTTP::Message;
use HTTP::Request;
use Net::Ping;
+ if (defined ${Conf::mirror}) {
+ my $uri = URI->new("${Conf::mirror}");
+
+ # Only accept HTTPS mirrors
+ if ($uri->scheme eq "https") {
+ return ("HTTPS", $uri->host, $uri->path . "/" . ${Conf::version});
+ } else {
+ message("MIRROR ERROR: Unsupported mirror: " . ${Conf::mirror});
+ }
+ }
+
### Check if there is a current server list and read it.
# If there is no list try to get one.
my $count = 0;
### Check if there is a current server list and read it.
# If there is no list try to get one.
my $count = 0;
$mainserver = "pakfire.ipfire.org";
$mainserver = "pakfire.ipfire.org";
+# Only use this mirror
+#$mirror = "https://mirror1.ipfire.org/pakfire2";
+
$cachedir = "/opt/pakfire/cache";
$dbdir = "/opt/pakfire/db";
$coredir = "/opt/pakfire/db/core";
$cachedir = "/opt/pakfire/cache";
$dbdir = "/opt/pakfire/db";
$coredir = "/opt/pakfire/db/core";