Skip to content

Commit

Permalink
4.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lbr38 committed Jan 5, 2025
1 parent 3927a0c commit 4c291b5
Show file tree
Hide file tree
Showing 170 changed files with 5,393 additions and 7,281 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ devel ]
pull_request:
push:
branches: [ stable ]
branches: [ main ]
jobs:
phpcs:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ devel ]
pull_request:
push:
branches: [ stable ]
branches: [ main ]

jobs:
run-deb-tasks:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-ansible-role.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ devel ]
pull_request:
push:
branches: [ stable ]
branches: [ main ]
jobs:
ansible:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-database-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ devel ]
pull_request:
push:
branches: [ stable ]
branches: [ main ]
jobs:
test-database-update:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions Todolist
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[ REPOS ]

- 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
- (Feature) Add a way to edit repository properties like its source repository
- (Feature) Support Arch Linux packages
https://blog.desdelinux.net/en/create-your-local-arch-linux-repository/
https://wiki.archlinux.org/title/Pacman#Repositories_and_mirrors
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN echo "deb https://packages.repomanager.net/repo/repomanager-php/bookworm/mai
RUN apt-get update -y

# Install nginx and PHP 8.3
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
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

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

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

Expand Down
10 changes: 10 additions & 0 deletions docker/config/php/opcache.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
; configuration for php opcache module
; priority=10
zend_extension=opcache.so
opcache.enable=1
opcache.validate_timestamps=1
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.interned_strings_buffer=16
opcache.jit=tracing
opcache.jit_buffer_size=64
4 changes: 2 additions & 2 deletions www/config/properties.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
$config = array(
'project_name' => 'Repomanager',
'project_dir_name' => 'repomanager',
'project_logo' => 'https://github.com/lbr38/repomanager/raw/stable/www/public/assets/images/repomanager.png',
'project_logo' => 'https://github.com/lbr38/repomanager/raw/main/www/public/assets/images/repomanager.png',
'project_git_repo' => 'https://github.com/lbr38/repomanager',
'project_git_repo_raw' => 'https://raw.githubusercontent.com/lbr38/repomanager/stable',
'project_git_repo_raw' => 'https://raw.githubusercontent.com/lbr38/repomanager/main',
'project_update_doc_url' => 'https://github.com/lbr38/repomanager/wiki/01.-Installation-and-update#update-repomanager',

// RPM release versions default values
Expand Down
4 changes: 0 additions & 4 deletions www/controllers/App/Config/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ public static function get()
if (!defined('CVE_IMPORT_HOSTS_DIR')) {
define('CVE_IMPORT_HOSTS_DIR', TEMP_DIR . '/cve');
}
// Logbuilder
if (!defined('LOGBUILDER')) {
define('LOGBUILDER', ROOT . '/tasks/logbuilder.php');
}
// Actual release version and available version on github
if (!defined('VERSION')) {
define('VERSION', trim(file_get_contents(ROOT . '/version')));
Expand Down
4 changes: 2 additions & 2 deletions www/controllers/App/Config/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public static function get()
$message = '<span>A new release is available: ';
}

$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>';
$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>';
$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>';
$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>';

$NOTIFICATION_MESSAGES[] = array('Title' => 'Update available', 'Message' => $message);
$NOTIFICATION++;
Expand Down
9 changes: 0 additions & 9 deletions www/controllers/App/Config/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,6 @@ public static function get()
}
}

if (!defined('MANAGE_PROFILES')) {
if (!empty($settings['MANAGE_PROFILES'])) {
define('MANAGE_PROFILES', $settings['MANAGE_PROFILES']);
} else {
define('MANAGE_PROFILES', '');
$__LOAD_SETTINGS_MESSAGES[] = "<code>MANAGE PROFILES</code> setting is not defined.";
}
}

/**
* CVE settings
*/
Expand Down
66 changes: 48 additions & 18 deletions www/controllers/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public function randomColor()
}

/**
* Convertit une durée microtime au format HHhMMmSSs
* Converts a microtime duration to a time format HHhMMmSSs
*/
public static function convertMicrotime(string $duration)
{
Expand All @@ -239,9 +239,21 @@ public static function convertMicrotime(string $duration)
$time .= $seconds . 's';
}

if (empty($time)) {
$time = '0s';
}

return $time;
}

/**
* Converts a microtime to a time format
*/
public static function microtimeToTime(string $microtime)
{
return date('H:i:s', $microtime);
}

/**
* Tri un array par la valeur de clé spécifiée
*/
Expand Down Expand Up @@ -658,33 +670,51 @@ public static function sizeFormat($bytes, $returnFormat = true)
/**
* Print OS icon image
*/
public static function printOsIcon(string $os = null, string $osFamily = null)
public static function printOsIcon(string $os)
{
if (!empty($os)) {
if (preg_match('/centos/i', $os)) {
return '<img src="/assets/icons/products/centos.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/debian|armbian/i', $os)) {
return '<img src="/assets/icons/products/debian.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/ubuntu|kubuntu|xubuntu|mint/i', $os)) {
return '<img src="/assets/icons/products/ubuntu.png" class="icon-np" title="' . $os . '" />';
}
if (preg_match('/centos/i', $os)) {
return '<img src="/assets/icons/products/centos.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/rocky/i', $os)) {
return '<img src="/assets/icons/products/rockylinux.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/alma/i', $os)) {
return '<img src="/assets/icons/products/almalinux.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/oracle/i', $os)) {
return '<img src="/assets/icons/products/oracle.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/fedora/i', $os)) {
return '<img src="/assets/icons/products/fedora.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/redhat/i', $os)) {
return '<img src="/assets/icons/products/redhat.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/debian|armbian/i', $os)) {
return '<img src="/assets/icons/products/debian.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/ubuntu|kubuntu|xubuntu|mint/i', $os)) {
return '<img src="/assets/icons/products/ubuntu.png" class="icon-np" title="' . $os . '" />';
}

/**
* If OS could not be found and OS family is specified
* Else return generic icon
*/
if (!empty($osFamily)) {
if (preg_match('/debian|ubuntu|kubuntu|xubuntu|armbian|mint/i', $osFamily)) {
return '<img src="/assets/icons/products/debian.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/rhel|centos|fedora/i', $osFamily)) {
return '<img src="/assets/icons/products/redhat.png" class="icon-np" title="' . $os . '" />';
}
return '<img src="/assets/icons/products/tux.png" class="icon-np" title="' . $os . '" />';
}

/**
* Print type icon image
*/
public static function printTypeIcon(string $type)
{
$type = ucfirst($type);

if (preg_match('/kvm/i', $type)) {
return '<img src="/assets/icons/products/kvm.png" class="icon-np" title="' . $type . '" />';
} elseif (preg_match('/lxc/i', $type)) {
return '<img src="/assets/icons/products/lxc.png" class="icon-np" title="' . $type . '" />';
} elseif (preg_match('/docker/i', $type)) {
return '<img src="/assets/icons/products/docker.png" class="icon-np" title="' . $type . '" />';
}

/**
* Else return generic icon
*/
return '<img src="/assets/icons/products/tux.png" class="icon-np" title="' . $os . '" />';
return '<img src="/assets/icons/server.svg" class="icon-np" title="' . $type . '" />';
}

/**
Expand Down
Loading

0 comments on commit 4c291b5

Please sign in to comment.