Skip to content

Commit

Permalink
3.7.7
Browse files Browse the repository at this point in the history
  • Loading branch information
lbr38 committed Nov 19, 2023
1 parent d45b29b commit 38b7fb1
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 102 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<h1>REPOMANAGER</h1>

**Repomanager** is a web mirroring tool for RPM or DEB packages repositories.
**Repomanager** is a web mirroring tool for ``rpm`` or ``deb`` packages repositories.

Designed for an enterprise usage and to help deployment of packages updates on large Linux servers farms, it can create mirrors of public repositories (eg. Debian or CentOS official repos or third-party editors) and manage several snapshots versions and environments.

<h2>Main features</h2>

- Create deb or rpm mirror repositories
- Sign repo with GPG
- Create ``deb`` or ``rpm`` mirror repositories
- Sign packages/repositories with GPG
- Upload packages into repositories
- Create environments (eg. preprod, prod...) and make mirrors available only for specific envs.
- Create environments (eg. ``preprod``, ``prod``...) and make mirrors available only for specific envs.
- Manage hosts packages updates
- Plan tasks
- ...
Expand All @@ -30,7 +30,6 @@ Designed for an enterprise usage and to help deployment of packages updates on l
<h3>Software and configuration</h3>

- **docker** (service must be up and running)
- **docker-compose**
- **A fully qualified domain name** (FQDN) and a valid SSL certificate for this FQDN if you want to access the web interface through a secure connection (https)
- A least a **SPF record** configured for your FQDN, to be able to send emails from Repomanager

Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
args:
env: devel
fqdn: repomanager-dev.localhost
max_upload_size: 32M
max_upload_size: 64M
restart: always
ports:
- "8080:8080"
Expand Down
7 changes: 3 additions & 4 deletions www/controllers/Gpg.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class Gpg
private $length = 4096;
private $name = 'Repomanager';
private $description = 'Repomanager GPG signing key';
private $keyId = GPG_SIGNING_KEYID;
private $passphrase = '';

/**
Expand Down Expand Up @@ -175,7 +174,7 @@ private function generateSigningKey()
$template .= 'Key-Usage: sign' . PHP_EOL;
$template .= 'Name-Real: ' . $this->name . PHP_EOL;
$template .= 'Name-Comment: ' . $this->description . PHP_EOL;
$template .= 'Name-Email: ' . $this->keyId . PHP_EOL;
$template .= 'Name-Email: ' . GPG_SIGNING_KEYID . PHP_EOL;
$template .= 'Expire-Date: 0' . PHP_EOL;
$template .= 'Passphrase: ' . $this->passphrase . PHP_EOL;

Expand Down Expand Up @@ -209,7 +208,7 @@ private function generateSigningKey()
* Write passphrase to file
*/
if (!file_put_contents(PASSPHRASE_FILE, $this->passphrase)) {
throw new Exception('Cannot write to: ' . PASSPHRASE_FILE);
throw new Exception('Cannot write passphrase to: ' . PASSPHRASE_FILE);
}

unset($template, $myprocess);
Expand Down Expand Up @@ -263,7 +262,7 @@ private function generateRpmMacros()
if (!file_exists(MACROS_FILE)) {
$configuration = '%__gpg /usr/bin/gpg2' . PHP_EOL;
$configuration .= '%_gpg_path ' . GPGHOME . PHP_EOL;
$configuration .= '%_gpg_name ' . $this->keyId . PHP_EOL;
$configuration .= '%_gpg_name ' . GPG_SIGNING_KEYID . PHP_EOL;
$configuration .= '%_gpg_passphrase_file ' . PASSPHRASE_FILE . PHP_EOL;
$configuration .= '%__gpg_sign_cmd %{__gpg} gpg --no-verbose --no-armor --batch --pinentry-mode loopback --passphrase-file %{_gpg_passphrase_file} %{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}} --no-secmem-warning -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}';

Expand Down
6 changes: 3 additions & 3 deletions www/controllers/Layout/Container/vars/stats/list.vars.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
$dateCounter = date('Y-m-d', strtotime('-1 year', strtotime(DATE_YMD)));
}

$repoAccessChartLabels = '';
$repoAccessChartDates = '';
$repoAccessChartData = '';

/**
Expand All @@ -130,7 +130,7 @@
/**
* Add the current date to the labels
*/
$repoAccessChartLabels .= "'$dateCounter', ";
$repoAccessChartDates .= "'$dateCounter', ";

/**
* Increment by 1 day to be able to process the next date
Expand All @@ -141,7 +141,7 @@
/**
* Remove the last comma
*/
$repoAccessChartLabels = rtrim($repoAccessChartLabels, ', ');
$repoAccessChartDates = rtrim($repoAccessChartDates, ', ');
$repoAccessChartData = rtrim($repoAccessChartData, ', ');

/**
Expand Down
7 changes: 1 addition & 6 deletions www/controllers/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Process
{
private $workingDir = ROOT . '/.temp'; // Répertoire de travail pour php
private $command;
private $env;
private $env = array('HOME' => ROOT, 'PATH' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin');
private $process;
private $pipes;
private $pid;
Expand All @@ -21,11 +21,6 @@ public function __construct(string $command, array $env = null)
{
$this->command = $command;

/**
* Define minimal environment variables for this process
*/
$this->env = array('HOME' => ROOT);

/**
* If others env vars have been specified then add them
*/
Expand Down
7 changes: 1 addition & 6 deletions www/controllers/Repo/Mirror/Deb.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,7 @@ private function parseSourcesIndiceFile()
if (!empty($packageLocation) and !empty($packageMd5)) {
$packages[] = array('location' => $packageLocation, 'md5sum' => $packageMd5);
}
/**
* Add founded packages to the global array
*/
// if (!empty($directory) and !empty($packageLocation) and !empty($packageMd5)) {
// $this->sourcesPackagesLocation[] = array('location' => $directory . '/' . $packageLocation, 'md5sum' => $packageMd5);
// }

unset($packageLocation, $packageMd5);
}

Expand Down
4 changes: 2 additions & 2 deletions www/controllers/Repo/Operation/Metadata/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ private function createMetadata()
}
}

$distributionsFileContent = 'Origin: ' . $this->repo->getName() . ' repo on ' . WWW_HOSTNAME . PHP_EOL;
$distributionsFileContent = 'Origin: ' . $this->repo->getName() . ' repo on ' . WWW_HOSTNAME . PHP_EOL;
$distributionsFileContent .= 'Label: apt repository' . PHP_EOL;
$distributionsFileContent .= 'Codename: ' . $this->repo->getDist() . PHP_EOL;
$distributionsFileContent .= 'Suite: stable' . PHP_EOL;
Expand Down Expand Up @@ -391,7 +391,7 @@ private function createMetadata()
/**
* Then build the includeb command from the string generated
*/
$repreproIncludeParams = 'includedeb ' . $this->repo->getDist() . ' ' . $debFilesConcatenatePaths;
$repreproIncludeParams = '-S ' . $this->repo->getSection() . ' includedeb ' . $this->repo->getDist() . ' ' . $debFilesConcatenatePaths;

/**
* Proceed to import those 100 deb packages into the repo
Expand Down
8 changes: 0 additions & 8 deletions www/controllers/Stat.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ public function getLastAccess(string $name, string $dist = null, string $section
return $this->model->getLastAccess($name, $dist, $section, $env);
}

/**
* Retourne le détail des requêtes sur le repo/section spécifié, des 5 dernières minutes
*/
public function getLastMinutesAccess(string $name, string $dist = null, string $section = null, string $env)
{
return $this->model->getLastMinutesAccess($name, $dist, $section, $env);
}

/**
* Compte le nombre de requêtes d'accès au repo/section spécifié, sur une date donnée
*/
Expand Down
29 changes: 0 additions & 29 deletions www/models/Stat.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,35 +146,6 @@ public function getLastAccess(string $name, string $dist = null, string $section
return $datas;
}

/**
* Retourne le détail des requêtes sur le repo/section spécifié, des 5 dernières minutes
*/
public function getLastMinutesAccess(string $name, string $dist = null, string $section = null, string $env)
{
$timeEnd = date("H:i:s");
$timeStart = date('H:i:s', strtotime('-5 minutes', strtotime($timeEnd)));

try {
$stmt = $this->db->prepare("SELECT * FROM access WHERE Date = '" . DATE_YMD . "' AND Time BETWEEN '$timeStart' AND '$timeEnd' AND Request LIKE :request ORDER BY Date DESC LIMIT 30");
if (!empty($dist) and !empty($section)) {
$stmt->bindValue(':request', "%/${name}/${dist}/${section}_${env}/%");
} else {
$stmt->bindValue(':request', "%/${name}_${env}/%");
}
$result = $stmt->execute();
} catch (\Exception $e) {
\Controllers\Common::dbError($e);
}

$datas = array();

while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
$datas[] = $row;
}

return $datas;
}

/**
* Compte le nombre de requêtes d'accès au repo/section spécifié, sur une date donnée
*/
Expand Down
34 changes: 0 additions & 34 deletions www/public/resources/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -798,40 +798,6 @@ footer #github img { width: 25px; }
flex: 0 0 100%;
}

#maintenance-container, #update-log-container {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
overflow: auto;
background: #333333d3;
z-index: 1;
}

#maintenance, #update-log {
position: absolute;
top: 40%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
padding: 30px;
border-radius: 8px;
background-color: #112334;
-webkit-box-shadow: 0px 10px 13px -12px #000000, 0px 0px 10px 2px rgba(0,0,0,0.15);
box-shadow: 0px 10px 13px -12px #000000, 0px 0px 10px 2px rgb(0 0 0 / 15%);
}

#update-log-info {
max-width: 1000px;
max-height: 400px;
overflow: auto;
}

#maintenance p {
font-size: 14px;
text-align: center;
}

#loginDiv-container {
height: 90vh;
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion www/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.7.6
3.7.7
6 changes: 3 additions & 3 deletions www/views/includes/containers/stats/list.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<div id="repo-access-chart-div" class="div-generic-blue">
<?php
if (!empty($repoAccessChartLabels) and !empty($repoAccessChartData)) : ?>
if (!empty($repoAccessChartDates) and !empty($repoAccessChartData)) : ?>
<span class="btn-small-green repo-access-chart-filter-button" filter="1week">1 week</span>
<span class="btn-small-green repo-access-chart-filter-button" filter="1month">1 month</span>
<span class="btn-small-green repo-access-chart-filter-button" filter="3months">3 months</span>
Expand All @@ -55,7 +55,7 @@
* Utilisés par jqeury pour récupérer de nouvelles valeurs en fonction du filtre choisi par l'utilisateur (1week...)
*/ ?>
<canvas id="repo-access-chart">
<span id="repo-access-chart-labels" labels="<?= $repoAccessChartLabels ?>"></span>
<span id="repo-access-chart-labels" labels="<?= $repoAccessChartDates ?>"></span>
<span id="repo-access-chart-data" data="<?= $repoAccessChartData ?>"></span>
</canvas>

Expand All @@ -64,7 +64,7 @@
var myRepoAccessChart = new Chart(ctx, {
type: 'line',
data: {
labels: [<?= $repoAccessChartLabels ?>],
labels: [<?= $repoAccessChartDates ?>],
datasets: [{
data: [<?= $repoAccessChartData ?>],
label: "Total access",
Expand Down

0 comments on commit 38b7fb1

Please sign in to comment.