Skip to content

Commit

Permalink
Merge pull request #150 from lbr38/devel
Browse files Browse the repository at this point in the history
3.7.14
  • Loading branch information
lbr38 authored Feb 11, 2024
2 parents 84d1d74 + f29fcae commit 3f15474
Show file tree
Hide file tree
Showing 93 changed files with 2,340 additions and 2,200 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/operations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ jobs:
curl -s -o /var/lib/repomanager/operations/pool/ci-deb-duplicate-repo.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-duplicate-repo.json 2> /dev/null
curl -s -o /var/lib/repomanager/operations/pool/ci-deb-create-env.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-create-env.json 2> /dev/null
curl -s -o /var/lib/repomanager/operations/pool/ci-deb-delete.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-delete.json 2> /dev/null
curl -s -o /var/lib/repomanager/operations/pool/ci-deb-reconstruct.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-reconstruct.json 2> /dev/null
curl -s -o /var/lib/repomanager/operations/pool/ci-deb-rebuild.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/deb/ci-rebuild.json 2> /dev/null
curl -s -o /var/lib/repomanager/operations/pool/ci-rpm-mirror-repo.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/rpm/ci-mirror-repo.json 2> /dev/null
curl -s -o /var/lib/repomanager/operations/pool/ci-rpm-update-repo.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/rpm/ci-update-repo.json 2> /dev/null
curl -s -o /var/lib/repomanager/operations/pool/ci-rpm-duplicate-repo.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/rpm/ci-duplicate-repo.json 2> /dev/null
curl -s -o /var/lib/repomanager/operations/pool/ci-rpm-create-env.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/rpm/ci-create-env.json 2> /dev/null
curl -s -o /var/lib/repomanager/operations/pool/ci-rpm-delete.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/rpm/ci-delete.json 2> /dev/null
curl -s -o /var/lib/repomanager/operations/pool/ci-rpm-reconstruct.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/rpm/ci-reconstruct.json 2> /dev/null
curl -s -o /var/lib/repomanager/operations/pool/ci-rpm-rebuild.json https://raw.githubusercontent.com/lbr38/resources/main/ci/repomanager/operations/rpm/ci-rebuild.json 2> /dev/null
- name: Set up permissions
run: chown -R www-data:repomanager /var/www/repomanager /var/lib/repomanager /home/repo
Expand Down Expand Up @@ -99,8 +99,8 @@ jobs:
- name: Run job - Create deb repo env
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-deb-create-env'" www-data

- name: Run job - Reconstruct deb repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-deb-reconstruct'" www-data
- name: Run job - Rebuild deb repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-deb-rebuild'" www-data

- name: Run job - Delete deb repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-deb-delete'" www-data
Expand All @@ -126,8 +126,8 @@ jobs:
- name: Run job - Create rpm repo env
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-rpm-create-env'" www-data

- name: Run job - Reconstruct rpm repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-rpm-reconstruct'" www-data
- name: Run job - Rebuild rpm repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-rpm-rebuild'" www-data

- name: Run job - Delete rpm repo
run: /bin/su -s /bin/bash -c "php /var/www/repomanager/operations/execute.php --id='ci-rpm-delete'" www-data
22 changes: 0 additions & 22 deletions Todolist
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,15 @@

- Update documentation

[ REPOS ]

- (DEB) Repository install: if the repository has 'src' packages, also add the 'deb-src' line to the installation command lines

[ BUGS ]

[ GENERAL ]


[ REPOS ]

- (KO) Mirror a debian repo with translations => translations are not included by reprepro
- (KO) Mirror a debian repo with multiple archs and translations => translations are not included by reprepro


[ OPERATIONS ]

- Regular planned tasks logs are all merged into the same Planification master log file


[ SERVICE ]


[ IMPROVEMENTS / FEATURES ]

[ GENERAL ]
Expand All @@ -39,19 +25,14 @@

- Add a search bar in the repos list
- Support Arch Linux packages https://blog.desdelinux.net/en/create-your-local-arch-linux-repository/
- Operations: replace 'reconstruct' with 'rebuild'
- Think about a way to publish debian repos in a more elegant way. Currently: https://<FQDN>/repo/debian/dists/buster/main_prod buster main_prod
- (RPM) See how to accelerate the rpm signing process by using multi-threading
- (DEB) Add a feature to be able to add distributions to the list of pre-defined distributions (and do the same for sections)


[ STATS ]


[ HOSTS / LINUPDATE ]

- Be able to ask a host to update one or more specific packages
- Improve host details page UI


[ CVE ]
Expand All @@ -65,9 +46,6 @@
- Support LDAP


[ API ]


[ MAIL ]

- Add an alternative way of sending mails via SMTP server: https://github.com/lbr38/repomanager/issues/139
Expand Down
4 changes: 2 additions & 2 deletions www/controllers/Api/Snapshot/Snapshot.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function execute()

if ($this->method == 'PUT') {
/**
* Reconstruct a snapshot
* Rebuild a snapshot
* https://repomanager.mydomain.net/api/v2/snapshot/$this->snapId/rebuild
*/
if ($this->action == 'rebuild' and !empty($this->data->gpgSign)) {
Expand All @@ -84,7 +84,7 @@ public function execute()
* Create a json file that defines the operation to execute
*/
$params = array();
$params['action'] = 'reconstruct';
$params['action'] = 'rebuild';
$params['snapId'] = $this->snapId;
$params['targetGpgResign'] = $this->data->gpgSign;

Expand Down
2 changes: 1 addition & 1 deletion www/controllers/App/Config/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public static function get()
}

/**
* Planifications settings
* Scheduled tasks settings
*/
if (!defined('PLANS_ENABLED')) {
if (!empty($settings['PLANS_ENABLED'])) {
Expand Down
49 changes: 3 additions & 46 deletions www/controllers/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,24 +203,6 @@ public static function envtag($env, $css = null)
return '<span class="' . $class . '">' . $env . '</span>';
}

/**
* Indique si un répertoire est vide ou non
*/
public static function dirIsEmpty($dir)
{
$handle = opendir($dir);
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
closedir($handle);
return false;
}
}

closedir($handle);

return true;
}

/**
* Génère un nombre aléatoire en 10000 et 99999
*/
Expand Down Expand Up @@ -487,29 +469,6 @@ public static function findAndCopyRecursive(string $directoryPath, string $targe
}
}

/**
* Delete specified directory recursively
*/
public static function deleteRecursive(string $directoryPath)
{
/**
* Return true if there is nothing to delete
*/
if (!is_dir($directoryPath)) {
return true;
}

$myprocess = new Process('rm -rf "' . $directoryPath . '"');
$myprocess->execute();
$myprocess->close();

if ($myprocess->getExitCode() != 0) {
return false;
}

return true;
}

/**
* Uncompress bzip2 file
*/
Expand All @@ -519,9 +478,9 @@ public static function bunzip2(string $filename, string $outputFilename = null)
* If a custom output filename has been specified
*/
if (!empty($outputFilename)) {
$myprocess = new Process('/usr/bin/bunzip2 --decompress -k -c ' . $filename . ' > ' . $outputFilename);
$myprocess = new \Controllers\Process('/usr/bin/bunzip2 --decompress -k -c ' . $filename . ' > ' . $outputFilename);
} else {
$myprocess = new Process('/usr/bin/bunzip2 --decompress -k ' . $filename);
$myprocess = new \Controllers\Process('/usr/bin/bunzip2 --decompress -k ' . $filename);
}

$myprocess->execute();
Expand Down Expand Up @@ -590,7 +549,7 @@ public static function gunzip(string $filename)
*/
public static function xzUncompress(string $filename)
{
$myprocess = new Process('/usr/bin/xz --decompress ' . $filename);
$myprocess = new \Controllers\Process('/usr/bin/xz --decompress ' . $filename);
$myprocess->execute();
$content = $myprocess->getOutput();
$myprocess->close();
Expand Down Expand Up @@ -744,8 +703,6 @@ public static function printProductIcon(string $product)
return '<img src="/assets/icons/products/filezilla.png" class="icon-np" />';
} elseif (preg_match('/^java/i', $product)) {
return '<img src="/assets/icons/products/java.png" class="icon-np" />';
} elseif (preg_match('/^fonts-/i', $product)) {
return '<img src="/assets/icons/products/fonts.png" class="icon-np" />';
} elseif (preg_match('/^teams$/i', $product)) {
return '<img src="/assets/icons/products/teams.png" class="icon-np" />';
} elseif (preg_match('/^teamviewer$/i', $product)) {
Expand Down
43 changes: 43 additions & 0 deletions www/controllers/Filesystem/Directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,29 @@ public static function copy(string $sourceDir, string $targetDir)
unset($iterator);
}

/**
* Delete specified directory recursively
*/
public static function deleteRecursive(string $directoryPath)
{
/**
* Return true if there is nothing to delete
*/
if (!is_dir($directoryPath)) {
return true;
}

$myprocess = new \Controllers\Process('/usr/bin/rm -rf "' . $directoryPath . '"');
$myprocess->execute();
$myprocess->close();

if ($myprocess->getExitCode() != 0) {
return false;
}

return true;
}

/**
* Get directory size in bytes
*/
Expand All @@ -53,4 +76,24 @@ public static function getSize(string $path)

return $bytestotal;
}

/**
* Return true if directory is empty
*/
public static function isEmpty($dir)
{
$handle = opendir($dir);

while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
closedir($handle);

return false;
}
}

closedir($handle);

return true;
}
}
Loading

0 comments on commit 3f15474

Please sign in to comment.