Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class App extends Application
{
const NAME = "Doil Version 20260624 - build 2026-06-24";
const NAME = "Doil Version 20260707 - build 2026-07-07";

public function __construct(Command ...$commands)
{
Expand Down
19 changes: 12 additions & 7 deletions app/src/Commands/Instances/CreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,21 +354,21 @@ public function execute(InputInterface $input, OutputInterface $output) : int

if ($keycloak) {
$samlpass = $this->generatePassword(33);
$this->docker->setGrain($instance_salt_name, "samlpass", "$samlpass");
$this->docker->setGrain($instance_salt_name, "samlpass", "${samlpass}");
sleep(1);
$samlsalt = $this->generatePassword(33);
$this->docker->setGrain($instance_salt_name, "samlsalt", "$samlsalt");
$this->docker->setGrain($instance_salt_name, "samlsalt", "${samlsalt}");
sleep(1);
}

$this->docker->setGrain($instance_salt_name, "mpass", "$mysql_password");
$this->docker->setGrain($instance_salt_name, "mpass", "${mysql_password}");
sleep(1);
$this->docker->setGrain($instance_salt_name, "cpass", "$cron_password");
$this->docker->setGrain($instance_salt_name, "cpass", "${cron_password}");
sleep(1);
$this->docker->setGrain($instance_salt_name, "cron_path", "$cron_path");
$this->docker->setGrain($instance_salt_name, "cron_path", "${cron_path}");
sleep(1);
if ($update_token) {
$this->docker->setGrain($instance_salt_name, "update_token", "${$update_token}");
$this->docker->setGrain($instance_salt_name, "update_token", "${update_token}");
sleep(1);
}
$this->docker->setGrain($instance_salt_name, "doil_domain", $http_scheme . $host . "/" . $options["name"]);
Expand Down Expand Up @@ -747,8 +747,13 @@ protected function gatherOptionData(InputInterface $input, OutputInterface $outp
}
$options["skip_readme"] = $skip_readme;

$office = false;
if (array_key_exists("enable_office", $doil_conf)) {
$office = $doil_conf['enable_office'];
}

// Enable office support
if (!$enable_office && $one_option_missed && $doil_conf['enable_office']) {
if (!$enable_office && $one_option_missed && $office) {
$question = new ConfirmationQuestion(
"Enable office support? [yN]: ",
false
Expand Down
8 changes: 0 additions & 8 deletions app/src/Commands/Pack/ExportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,6 @@ public function execute(InputInterface $input, OutputInterface $output) : int
$this->filesystem->makeDirectoryRecursive($name . "/var/www/html/.git");
$this->filesystem->makeDirectoryRecursive($name . "/conf");

$idea_paths = $this->filesystem->find_dirs($path, ".idea", 3);
if (count($idea_paths) > 0) {
$idea_path = $idea_paths[0];
$idea_base_path = substr($idea_path, strlen($path));
$this->filesystem->makeDirectoryRecursive($name . "/conf" . $idea_base_path);
$this->filesystem->copyDirectory($idea_path, $name . "/conf" . $idea_base_path);
}

$this->docker->copy($instance . "_" . $suffix, "/var/ilias", $name . "/var/");
$this->docker->copy($instance . "_" . $suffix, "/var/www/html/.git/config", $name . "/var/www/html/.git/config");
if ($this->ilias_info->getIliasVersion($path) >= 10) {
Expand Down
10 changes: 0 additions & 10 deletions app/src/Commands/Pack/ImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,6 @@ public function execute(InputInterface $input, OutputInterface $output) : int
);
}

$idea_paths = $this->filesystem->find_dirs($unpacked . "/conf", ".idea", 3);
if (count($idea_paths) > 0) {
$idea_path = $idea_paths[0];
$idea_base_path = substr($idea_path, strlen($unpacked . "/conf"));
$this->filesystem->copyDirectory(
$idea_path,
$path . $idea_base_path)
;
}

if ($this->filesystem->exists($unpacked . "/var/www/html/data")) {
$this->filesystem->copyDirectory(
$unpacked . "/var/www/html/data",
Expand Down
8 changes: 4 additions & 4 deletions app/src/Commands/Pack/PackCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,17 +361,17 @@ public function execute(InputInterface $input, OutputInterface $output) : int
if ($keycloak) {
$samlpass = $this->generatePassword(33);
$samlsalt = $this->generatePassword(33);
$this->docker->setGrain($instance_salt_name, "samlpass", "$samlpass");
$this->docker->setGrain($instance_salt_name, "samlsalt", "$samlsalt");
$this->docker->setGrain($instance_salt_name, "samlpass", "${samlpass}");
$this->docker->setGrain($instance_salt_name, "samlsalt", "${samlsalt}");
sleep(1);
}

$this->docker->setGrain($instance_salt_name, "mpass", "${mysql_password}");

sleep(1);
$this->docker->setGrain($instance_salt_name, "cpass", "$cron_password");
$this->docker->setGrain($instance_salt_name, "cpass", "${cron_password}");
sleep(1);
$this->docker->setGrain($instance_salt_name, "cron_path", "$cron_path");
$this->docker->setGrain($instance_salt_name, "cron_path", "${cron_path}");
sleep(1);
if ($update_token) {
$this->docker->setGrain($instance_salt_name, "update_token", "${update_token}");
Expand Down
1 change: 0 additions & 1 deletion app/src/Lib/FileSystem/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@ public function grepMysqlPasswordFromFile(string $path) : string;
public function addToGitConfig(string $path, string $section, string $line) : void;
public function parseIniFile(string $path) : array;
public function getContent(string $path) : string;
public function find_dirs(string $path, string $name, int $depth = 0) : array;
}
8 changes: 0 additions & 8 deletions app/src/Lib/FileSystem/FilesystemShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,4 @@ public function getContent(string $path) : string
{
return file_get_contents($path);
}

public function find_dirs(string $path, string $name, int $depth = 0) : array
{
$output = [];
exec("find -L $path -maxdepth $depth -iname $name -type d", $output);

return $output;
}
}
2 changes: 1 addition & 1 deletion setup/stack/states/dev/devtools/install-sass.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

npm update -g npm
npm install -g sass
npm install -g sass@1.77.5
7 changes: 7 additions & 0 deletions setup/templates/mail/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ services:
container_name: doil_mail
hostname: doil
domainname: mail
healthcheck:
test: "doveadm service status || exit 1"
interval: 10s
timeout: 5s
retries: 3
start_period: 40s
start_interval: 5s
networks:
doil_proxy:
ipv4_address: 172.24.0.253
Expand Down
7 changes: 7 additions & 0 deletions setup/templates/minion/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ services:
- type: bind
source: ./conf/salt-minion.conf
target: /etc/supervisor/conf.d/salt-minion.conf
healthcheck:
test: "curl -f http://localhost && mysql -u root --execute \"SHOW DATABASES;\" || exit 1"
interval: 10s
timeout: 5s
retries: 3
start_period: 40s
start_interval: 5s
environment:
- ILIAS_INI_PATH=/var/www/html/ilias.ini.php
- TZ=Europe/Berlin
Expand Down
7 changes: 7 additions & 0 deletions setup/templates/proxy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ services:
container_name: doil_proxy
hostname: doil
domainname: proxy
healthcheck:
test: ["CMD", "service", "nginx", "status"]
interval: 10s
timeout: 5s
retries: 3
start_period: 40s
start_interval: 5s
networks:
doil_proxy:
ipv4_address: 172.24.0.254
Expand Down
7 changes: 7 additions & 0 deletions setup/templates/salt/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ services:
networks:
saltnet:
ipv4_address: 172.20.0.254
healthcheck:
test: "salt-master --version || exit 1"
interval: 10s
timeout: 5s
retries: 3
start_period: 40s
start_interval: 5s
networks:
saltnet:
ipam:
Expand Down
31 changes: 31 additions & 0 deletions setup/updates/update-20260707.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

doil_update_20260707() {
cp -r ${SCRIPT_DIR}/../app/src/* /usr/local/lib/doil/app/src/
cp -r ${SCRIPT_DIR}/../setup/stack/states/dev/* /usr/local/share/doil/stack/states/dev/
cp -r ${SCRIPT_DIR}/../setup/templates/salt/docker-compose.yml /usr/local/lib/doil/server/salt/
cp -r ${SCRIPT_DIR}/../setup/templates/mail/docker-compose.yml /usr/local/lib/doil/server/mail/
cp -r ${SCRIPT_DIR}/../setup/templates/proxy/docker-compose.yml /usr/local/lib/doil/server/proxy/

apt-get install yq -y >/var/log/doil/stream.log 2>&1

for DIR in /home/$SUDO_USER/.doil/instances/*
do
if [[ -d "$DIR" ]]
then
yq -S '.services.[].healthcheck |= . + {"test": "curl -f http://localhost && mysql -u root --execute \"SHOW DATABASES;\" || exit 1", "interval": "10s", "timeout": "5s", "retries": "3", "start_period": "40s", "start_interval": "5s"}' "${DIR}"/docker-compose.yml > "${DIR}"/tmp.yml && mv "${DIR}"/tmp.yml "${DIR}"/docker-compose.yml >/var/log/doil/stream.log 2>&1
fi
done

for DIR in $(doil_get_conf global_instances_path=)/*
do
if [[ -d "$DIR" ]]
then
yq -S '.services.[].healthcheck |= . + {"test": "curl -f http://localhost && mysql -u root --execute \"SHOW DATABASES;\" || exit 1", "interval": "10s", "timeout": "5s", "retries": "3", "start_period": "40s", "start_interval": "5s"}' "${DIR}"/docker-compose.yml > "${DIR}"/tmp.yml && mv "${DIR}"/tmp.yml "${DIR}"/docker-compose.yml >/var/log/doil/stream.log 2>&1
fi
done

apt-get remove yq -y >/var/log/doil/stream.log 2>&1

return $?
}
Loading