Skip to content

Commit 7a50ffb

Browse files
committed
4.15.0
1 parent 3927a0c commit 7a50ffb

File tree

170 files changed

+5393
-7281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+5393
-7281
lines changed

.github/workflows/phpcs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [ devel ]
66
pull_request:
77
push:
8-
branches: [ stable ]
8+
branches: [ main ]
99
jobs:
1010
phpcs:
1111
runs-on: ubuntu-latest

.github/workflows/tasks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [ devel ]
66
pull_request:
77
push:
8-
branches: [ stable ]
8+
branches: [ main ]
99

1010
jobs:
1111
run-deb-tasks:

.github/workflows/test-ansible-role.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [ devel ]
66
pull_request:
77
push:
8-
branches: [ stable ]
8+
branches: [ main ]
99
jobs:
1010
ansible:
1111
runs-on: ubuntu-latest

.github/workflows/test-database-update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [ devel ]
66
pull_request:
77
push:
8-
branches: [ stable ]
8+
branches: [ main ]
99
jobs:
1010
test-database-update:
1111
runs-on: ubuntu-latest

Todolist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[ REPOS ]
77

88
- 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
9+
- (Feature) Add a way to edit repository properties like its source repository
910
- (Feature) Support Arch Linux packages
1011
https://blog.desdelinux.net/en/create-your-local-arch-linux-repository/
1112
https://wiki.archlinux.org/title/Pacman#Repositories_and_mirrors

docker/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ RUN echo "deb https://packages.repomanager.net/repo/repomanager-php/bookworm/mai
3131
RUN apt-get update -y
3232

3333
# Install nginx and PHP 8.3
34-
RUN apt-get install nginx php8.3-fpm php8.3-cli php8.3-sqlite3 php8.3-xml php8.3-curl php8.3-yaml sqlite3 -y
34+
RUN apt-get install nginx php8.3-fpm php8.3-cli php8.3-sqlite3 php8.3-xml php8.3-curl php8.3-yaml php8.3-opcache sqlite3 -y
3535

3636
# Clone project in the container
3737
RUN git clone https://github.com/lbr38/repomanager.git /tmp/repomanager
@@ -51,6 +51,7 @@ RUN rm -rf /etc/nginx/sites-enabled/default /var/www/html
5151

5252
# Configure PHP
5353
RUN cp /tmp/repomanager/docker/config/php/www.conf /etc/php/8.3/fpm/pool.d/www.conf
54+
RUN cp /tmp/repomanager/docker/config/php/opcache.ini /etc/php/8.3/mods-available/opcache.ini
5455
RUN sed -i "s/^upload_max_filesize.*$/upload_max_filesize = $max_upload_size/g" /etc/php/8.3/fpm/php.ini
5556
RUN sed -i "s/^post_max_size.*$/post_max_size = $max_upload_size/g" /etc/php/8.3/fpm/php.ini
5657

docker/config/php/opcache.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
; configuration for php opcache module
2+
; priority=10
3+
zend_extension=opcache.so
4+
opcache.enable=1
5+
opcache.validate_timestamps=1
6+
opcache.max_accelerated_files=10000
7+
opcache.memory_consumption=128
8+
opcache.interned_strings_buffer=16
9+
opcache.jit=tracing
10+
opcache.jit_buffer_size=64

www/config/properties.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
$config = array(
33
'project_name' => 'Repomanager',
44
'project_dir_name' => 'repomanager',
5-
'project_logo' => 'https://github.com/lbr38/repomanager/raw/stable/www/public/assets/images/repomanager.png',
5+
'project_logo' => 'https://github.com/lbr38/repomanager/raw/main/www/public/assets/images/repomanager.png',
66
'project_git_repo' => 'https://github.com/lbr38/repomanager',
7-
'project_git_repo_raw' => 'https://raw.githubusercontent.com/lbr38/repomanager/stable',
7+
'project_git_repo_raw' => 'https://raw.githubusercontent.com/lbr38/repomanager/main',
88
'project_update_doc_url' => 'https://github.com/lbr38/repomanager/wiki/01.-Installation-and-update#update-repomanager',
99

1010
// RPM release versions default values

www/controllers/App/Config/Main.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ public static function get()
101101
if (!defined('CVE_IMPORT_HOSTS_DIR')) {
102102
define('CVE_IMPORT_HOSTS_DIR', TEMP_DIR . '/cve');
103103
}
104-
// Logbuilder
105-
if (!defined('LOGBUILDER')) {
106-
define('LOGBUILDER', ROOT . '/tasks/logbuilder.php');
107-
}
108104
// Actual release version and available version on github
109105
if (!defined('VERSION')) {
110106
define('VERSION', trim(file_get_contents(ROOT . '/version')));

www/controllers/App/Config/Notification.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public static function get()
3838
$message = '<span>A new release is available: ';
3939
}
4040

41-
$message .= '<a href="' . PROJECT_GIT_REPO . '/releases/latest" target="_blank" rel="noopener noreferrer" title="See changelog"><code>' . GIT_VERSION . '</code> <img src="/assets/icons/external-link.svg" class="icon" /></a>';
42-
$message .= '<br><br><span>Please update your docker image by following the steps documented <b><a href="' . PROJECT_UPDATE_DOC_URL . '" target="_blank" rel="noopener noreferrer"><code>here</code></b> <img src="/assets/icons/external-link.svg" class="icon" /></a></span>';
41+
$message .= '<a href="' . PROJECT_GIT_REPO . '/releases/latest" target="_blank" rel="noopener noreferrer" title="See changelog"><code>' . GIT_VERSION . '</code> <img src="/assets/icons/external-link.svg" class="icon-small" /></a>';
42+
$message .= '<br><br><span>Please update your docker image by following the steps documented <b><a href="' . PROJECT_UPDATE_DOC_URL . '" target="_blank" rel="noopener noreferrer"><code>here</code></b> <img src="/assets/icons/external-link.svg" class="icon-small" /></a></span>';
4343

4444
$NOTIFICATION_MESSAGES[] = array('Title' => 'Update available', 'Message' => $message);
4545
$NOTIFICATION++;

www/controllers/App/Config/Settings.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -304,15 +304,6 @@ public static function get()
304304
}
305305
}
306306

307-
if (!defined('MANAGE_PROFILES')) {
308-
if (!empty($settings['MANAGE_PROFILES'])) {
309-
define('MANAGE_PROFILES', $settings['MANAGE_PROFILES']);
310-
} else {
311-
define('MANAGE_PROFILES', '');
312-
$__LOAD_SETTINGS_MESSAGES[] = "<code>MANAGE PROFILES</code> setting is not defined.";
313-
}
314-
}
315-
316307
/**
317308
* CVE settings
318309
*/

www/controllers/Common.php

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public function randomColor()
219219
}
220220

221221
/**
222-
* Convertit une durée microtime au format HHhMMmSSs
222+
* Converts a microtime duration to a time format HHhMMmSSs
223223
*/
224224
public static function convertMicrotime(string $duration)
225225
{
@@ -239,9 +239,21 @@ public static function convertMicrotime(string $duration)
239239
$time .= $seconds . 's';
240240
}
241241

242+
if (empty($time)) {
243+
$time = '0s';
244+
}
245+
242246
return $time;
243247
}
244248

249+
/**
250+
* Converts a microtime to a time format
251+
*/
252+
public static function microtimeToTime(string $microtime)
253+
{
254+
return date('H:i:s', $microtime);
255+
}
256+
245257
/**
246258
* Tri un array par la valeur de clé spécifiée
247259
*/
@@ -658,33 +670,51 @@ public static function sizeFormat($bytes, $returnFormat = true)
658670
/**
659671
* Print OS icon image
660672
*/
661-
public static function printOsIcon(string $os = null, string $osFamily = null)
673+
public static function printOsIcon(string $os)
662674
{
663-
if (!empty($os)) {
664-
if (preg_match('/centos/i', $os)) {
665-
return '<img src="/assets/icons/products/centos.png" class="icon-np" title="' . $os . '" />';
666-
} elseif (preg_match('/debian|armbian/i', $os)) {
667-
return '<img src="/assets/icons/products/debian.png" class="icon-np" title="' . $os . '" />';
668-
} elseif (preg_match('/ubuntu|kubuntu|xubuntu|mint/i', $os)) {
669-
return '<img src="/assets/icons/products/ubuntu.png" class="icon-np" title="' . $os . '" />';
670-
}
675+
if (preg_match('/centos/i', $os)) {
676+
return '<img src="/assets/icons/products/centos.png" class="icon-np" title="' . $os . '" />';
677+
} elseif (preg_match('/rocky/i', $os)) {
678+
return '<img src="/assets/icons/products/rockylinux.png" class="icon-np" title="' . $os . '" />';
679+
} elseif (preg_match('/alma/i', $os)) {
680+
return '<img src="/assets/icons/products/almalinux.png" class="icon-np" title="' . $os . '" />';
681+
} elseif (preg_match('/oracle/i', $os)) {
682+
return '<img src="/assets/icons/products/oracle.png" class="icon-np" title="' . $os . '" />';
683+
} elseif (preg_match('/fedora/i', $os)) {
684+
return '<img src="/assets/icons/products/fedora.png" class="icon-np" title="' . $os . '" />';
685+
} elseif (preg_match('/redhat/i', $os)) {
686+
return '<img src="/assets/icons/products/redhat.png" class="icon-np" title="' . $os . '" />';
687+
} elseif (preg_match('/debian|armbian/i', $os)) {
688+
return '<img src="/assets/icons/products/debian.png" class="icon-np" title="' . $os . '" />';
689+
} elseif (preg_match('/ubuntu|kubuntu|xubuntu|mint/i', $os)) {
690+
return '<img src="/assets/icons/products/ubuntu.png" class="icon-np" title="' . $os . '" />';
671691
}
672692

673693
/**
674-
* If OS could not be found and OS family is specified
694+
* Else return generic icon
675695
*/
676-
if (!empty($osFamily)) {
677-
if (preg_match('/debian|ubuntu|kubuntu|xubuntu|armbian|mint/i', $osFamily)) {
678-
return '<img src="/assets/icons/products/debian.png" class="icon-np" title="' . $os . '" />';
679-
} elseif (preg_match('/rhel|centos|fedora/i', $osFamily)) {
680-
return '<img src="/assets/icons/products/redhat.png" class="icon-np" title="' . $os . '" />';
681-
}
696+
return '<img src="/assets/icons/products/tux.png" class="icon-np" title="' . $os . '" />';
697+
}
698+
699+
/**
700+
* Print type icon image
701+
*/
702+
public static function printTypeIcon(string $type)
703+
{
704+
$type = ucfirst($type);
705+
706+
if (preg_match('/kvm/i', $type)) {
707+
return '<img src="/assets/icons/products/kvm.png" class="icon-np" title="' . $type . '" />';
708+
} elseif (preg_match('/lxc/i', $type)) {
709+
return '<img src="/assets/icons/products/lxc.png" class="icon-np" title="' . $type . '" />';
710+
} elseif (preg_match('/docker/i', $type)) {
711+
return '<img src="/assets/icons/products/docker.png" class="icon-np" title="' . $type . '" />';
682712
}
683713

684714
/**
685715
* Else return generic icon
686716
*/
687-
return '<img src="/assets/icons/products/tux.png" class="icon-np" title="' . $os . '" />';
717+
return '<img src="/assets/icons/server.svg" class="icon-np" title="' . $type . '" />';
688718
}
689719

690720
/**

0 commit comments

Comments
 (0)