summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.php114
-rw-r--r--mirror.php8
2 files changed, 85 insertions, 37 deletions
diff --git a/index.php b/index.php
index 44c56e4..ccac42f 100644
--- a/index.php
+++ b/index.php
@@ -122,39 +122,67 @@ if (!is_dir($root.'/'.$dirname)) {
<!DOCTYPE html>
<html lang="en">
<head>
- <meta charset="utf-8" />
- <title>Parabola GNU/Linux-libre - Index of <?php echo htmlentities($dirname); ?></title>
- <link rel="stylesheet" type="text/css" href="<?php echo $asseturl."/style.css"; ?>" />
- <link rel="icon" type="image/x-icon" href="https://www.parabola.nu/static/favicon.72ab042ac877.ico" />
- <link rel="shortcut icon" type="image/x-icon" href="https://www.parabola.nu/static/favicon.72ab042ac877.ico" />
- <link rel="apple-touch-icon" href="https://www.parabola.nu/static/logos/apple-touch-icon-57x57.6484c8e17e2f.png" />
- <link rel="apple-touch-icon" sizes="72x72" href="https://www.parabola.nu/static/logos/apple-touch-icon-72x72.f60f1458fe1c.png" />
- <link rel="apple-touch-icon" sizes="114x114" href="https://www.parabola.nu/static/logos/apple-touch-icon-114x114.e7845a2e4bab.png" />
- <link rel="apple-touch-icon" sizes="144x144" href="https://www.parabola.nu/static/logos/apple-touch-icon-144x144.97a164b5f85c.png" />
- <link rel="search" type="application/opensearchdescription+xml" href="https://www.parabola.nu/opensearch/packages/" title="Parabola GNU/Linux-libre Packages" />
+ <meta charset="utf-8" />
+ <title>Parabola GNU/Linux-libre - Index of <?php echo htmlentities($dirname); ?></title>
+ <link rel="stylesheet" type="text/css" href="<?php echo $asseturl."/style.css"; ?>" />
+ <link rel="icon" type="image/x-icon" href="https://www.parabola.nu/static/favicon.72ab042ac877.ico" />
+ <link rel="shortcut icon" type="image/x-icon" href="https://www.parabola.nu/static/favicon.72ab042ac877.ico" />
+ <link rel="apple-touch-icon" href="https://www.parabola.nu/static/logos/apple-touch-icon-57x57.6484c8e17e2f.png" />
+ <link rel="apple-touch-icon" sizes="72x72" href="https://www.parabola.nu/static/logos/apple-touch-icon-72x72.f60f1458fe1c.png" />
+ <link rel="apple-touch-icon" sizes="114x114" href="https://www.parabola.nu/static/logos/apple-touch-icon-114x114.e7845a2e4bab.png" />
+ <link rel="apple-touch-icon" sizes="144x144" href="https://www.parabola.nu/static/logos/apple-touch-icon-144x144.97a164b5f85c.png" />
+ <link rel="search" type="application/opensearchdescription+xml" href="https://www.parabola.nu/opensearch/packages/" title="Parabola GNU/Linux-libre Packages" />
+<!--
+ <style>
+ #inner-table-td { width: 32em ; height: 100% ; }
+ #content { }
+ #abox { width: 24em ; height: 100% ; position: absolute ; overflow: scroll ; }
+ #archdev-iframe { position: absolute ; left: 27em ; width: 100% ; height: 100% }
+ </style>
+-->
</head>
<body>
-
- <div id="archnavbar" class="anb-repo">
- <div id="archnavbarlogo"><h1><a href="/" title="Return to the main page">Parabola</a></h1></div>
- <div id="archnavbarmenu">
- <ul id="archnavbarlist">
- <li id="anb-home"><a href="https://www.parabola.nu/" title="Parabola news, packages, projects and more">Home</a></li>
- <li id="anb-packages"><a href="https://www.parabola.nu/packages/" title="Parabola Package Database">Packages</a></li>
- <li id="anb-wiki"><a href="https://wiki.parabola.nu/" title="Community documentation">Wiki</a></li>
- <li id="anb-bugs"><a href="https://labs.parabola.nu/" title="Issue Tracker">Bugs</a></li>
- <li id="anb-projects"><a href="https://projects.parabola.nu/" title="Our Code">Projects</a></li>
- <li id="anb-download"><a href="https://www.parabola.nu/download" title="Get Parabola">Download</a></li>
- </ul>
- </div>
- </div><!-- #archnavbar -->
-
- <div id="content">
-
- <div id="archdev-navbar"> </div>
-
+ <div id="archnavbar" class="anb-repo">
+ <div id="archnavbarlogo"><h1><a href="/" title="Return to the main page">Parabola</a></h1></div>
+ <div id="archnavbarmenu">
+ <ul id="archnavbarlist">
+ <li id="anb-home"><a href="https://www.parabola.nu/" title="Parabola news, packages, projects and more">Home</a></li>
+ <li id="anb-packages"><a href="https://www.parabola.nu/packages/" title="Parabola Package Database">Packages</a></li>
+ <!-- Free Culture or multimedia with mediagoblin -->
+ <!-- Social with GNU Social, Diaspora or another, it needs consensus -->
+ <li id="anb-wiki"><a href="https://wiki.parabola.nu/" title="Community documentation">Wiki</a></li>
+ <li id="anb-forum"><a href="https://labs.parabola.nu/projects/parabola-community-forum" title="Parabola Community Forum">Forum</a></li>
+ <li id="anb-bugs"><a href="https://labs.parabola.nu/" title="Report and track bugs">Issues</a></li>
+ <!-- security -->
+ <!-- PUR -->
+ <li id="anb-projects"><a href="https://projects.parabola.nu/" title="Our code">Projects</a></li>
+ <li id="anb-download"><a href="https://www.parabola.nu/download" title="Get Parabola">Download</a></li>
+ </ul>
+ </div>
+ </div><!-- #archnavbar -->
+<!--
+ <div id="archdev-navbar">archdev-navbar</div>
+-->
+ <div id="content" class="index-content">
+
+ <div id="downloads-div">All Downloads</h2>
+<!--
+<table id="inner-table"><tr><td id="inner-table-td">
+-->
+ <div id="abox" class="box">
+<!--
+ width="20%" height="100%">
+-->
+<!--
<div class="box">
+-->
<h2>Index of <?php echo htmlentities($dirname); ?></h2>
+
+
+ <tr><td>
+ <!--
+ <table id="index-table" width="300px" height="100%"><tbody><tr><td>
+ -->
<table><tbody>
<?php
if ($dh = opendir($root.'/'.$dirname)) {
@@ -174,7 +202,7 @@ if (!is_dir($root.'/'.$dirname)) {
// with a redirect
echo "<a href=\"".htmlentities($filename)."/\">".htmlentities($filename)."</a>";
} else {
- echo "<a href=\"".htmlentities($filename)."\">".htmlentities($filename)."</a>";
+ echo "<a href=\"./".htmlentities($filename)."\">".htmlentities($filename)."</a>";
}
if (stat_is_link($stat)) {
$target = readlink($root.'/'.$dirname.'/'.$filename);
@@ -197,8 +225,30 @@ if (!is_dir($root.'/'.$dirname)) {
}
?>
</tbody></table>
- </div>
+<!-- in box
+ </td><td>td</td></tr></table>
+-->
+ </div> <!-- box -->
+<!--
+ </td><td id="outter-td"> outer
+ </td></tr></ta
+-->
+<!--
+ <div id="archdev-inout">archdev-inout</div>
+-->
+<!--
+<iframe id="archdev-iframe" src="/download"></iframe>
+-->
+ </div> <!-- # content-div -->
+
+<!-- <div id="archdev-out">archdev-out</div> -->
+
+<!--
+ <iframe id="archdev-iframe" src="https://labs.parabola.nu/downloads" />
+-->
+<!--
+<iframe id="archdev-iframe" src="/download" />
+-->
- </div>
</body>
</html>
diff --git a/mirror.php b/mirror.php
index 9a6706f..866d66a 100644
--- a/mirror.php
+++ b/mirror.php
@@ -40,10 +40,8 @@ if (!file_exists($root.'/'.$filename)) {
$mirror = $tier0_url;
if (!should_force_tier0($filename)) {
$ctime = lstat($root.'/'.$filename)['ctime'];
- if ($ctime < $min_ctime) {
- $ctime = $min_ctime;
- }
- header('X-Repomirror-C-Time: '.$ctime);
+ header('X-Repomirror-File-C-Time: '.$ctime);
+ header('X-Repomirror-Min-C-Time: '.$min_ctime);
// TODO: weight by GeoIP or quality or something?
$mirrors = array();
foreach ($mirrors_urls as $mirrors_url) {
@@ -59,7 +57,7 @@ if (!file_exists($root.'/'.$filename)) {
}
foreach ($json['urls'] as $urldata) {
if (!in_array($urldata['protocol'], ['http', 'https', 'ftp'])) { continue; }
- if (strtotime($urldata['last_sync']) < $ctime) { continue; }
+ if (strtotime($urldata['last_sync']) < max($ctime, $min_ctime)) { continue; }
header('X-Repomirror-Mirror'.count($mirrors).': '.strtotime($urldata['last_sync']).' '.$urldata['url']);
$mirrors[] = $urldata['url'];
}