Skip to content

Commit

Permalink
Merge pull request #142 from lbr38/devel
Browse files Browse the repository at this point in the history
3.7.9-1
  • Loading branch information
lbr38 authored Dec 18, 2023
2 parents dc40e0a + 38a29f5 commit 06cb3cd
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
6 changes: 6 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ RUN apt-get update -y
# Install nginx and PHP 8.1
RUN apt-get install nginx php8.1-fpm php8.1-cli php8.1-sqlite3 php8.1-xml php8.1-curl sqlite3 -y

# Install syslog-ng
RUN if [ "$env" = "devel" ]; then \
apt-get install syslog-ng -y && \
sed -i 's/system()/system(exclude-kmsg(yes))/g' /etc/syslog-ng/syslog-ng.conf; \
fi

# Clone project in the container
RUN git clone https://github.com/lbr38/repomanager.git /tmp/repomanager
# For tests only
Expand Down
3 changes: 3 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ if [ ! -z "$MAX_UPLOAD_SIZE" ];then
fi

# Start services
if [ -f "/etc/init.d/syslog-ng" ];then
/usr/sbin/service syslog-ng start
fi
/usr/sbin/service php8.1-fpm start
/usr/sbin/service nginx start
/usr/sbin/service postfix start
Expand Down
6 changes: 6 additions & 0 deletions www/controllers/Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ public function __construct(string $to, string $subject, string $content, string
$mail->Subject = $subject;
$mail->Body = $template;

/**
* Charset and encoding
*/
$mail->CharSet = 'UTF-8';
$mail->Encoding = 'base64';

$mail->send();
} catch (Exception $e) {
throw new Exception('Error: mail could not be sent. Mailer Error: ' . $mail->ErrorInfo);
Expand Down
18 changes: 12 additions & 6 deletions www/models/Repo/Repo.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ public function getIdByName(string $name, string $dist = null, string $section =
* Cas où on a seulement spécifié le nom du repo
*/
if (empty($dist) or empty($section)) {
$stmt = $this->db->prepare("SELECT Id from repos WHERE Name = :name AND Dist IS NULL AND Section IS NULL");
$stmt = $this->db->prepare("SELECT Id from repos
WHERE Name = :name
AND (Dist IS NULL OR Dist = '')
AND (Section IS NULL OR Section = '')");

/**
* Cas où la distribution et la section ont été spécifié
Expand Down Expand Up @@ -217,8 +220,8 @@ public function getEnvIdFromRepoName(string $name, string|null $dist, string|nul
INNER JOIN repos
ON repos.Id = repos_snap.Id_repo
WHERE repos.Name = :name
AND repos.Dist IS NULL
AND repos.Section IS NULL
AND (repos.Dist IS NULL OR repos.Dist = '')
AND (repos.Section IS NULL OR repos.Section = '')
AND repos_env.Env = :env");
/**
* Case DEB (dist and section are specified)
Expand Down Expand Up @@ -717,7 +720,10 @@ public function exists(string $name, string $dist = '', string $section = '')
$stmt->bindValue(':dist', $dist);
$stmt->bindValue(':section', $section);
} else {
$stmt = $this->db->prepare("SELECT * FROM repos WHERE Name = :name AND Dist IS NULL AND Section IS NULL");
$stmt = $this->db->prepare("SELECT * FROM repos WHERE
Name = :name
AND (Dist IS NULL OR Dist = '')
AND (Section IS NULL OR Section = '')");
}
$stmt->bindValue(':name', $name);
$result = $stmt->execute();
Expand Down Expand Up @@ -858,8 +864,8 @@ public function isActive(string $name, string $dist = null, string $section = nu
INNER JOIN repos_snap
ON repos_snap.Id_repo = repos.Id
WHERE repos.Name = :name
AND repos.Dist IS NULL
AND repos.Section IS NULL
AND (repos.Dist IS NULL OR repos.Dist = '')
AND (repos.Section IS NULL OR repos.Section = '')
AND repos_snap.Status = 'active'");
} else {
$stmt = $this->db->prepare("SELECT repos.Id
Expand Down
2 changes: 1 addition & 1 deletion www/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.7.9
3.7.9-1

0 comments on commit 06cb3cd

Please sign in to comment.