Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 4 additions & 10 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ 7.4, 8.0 ]
php: [ 8.4 ]
steps:

- name: Checkout code
uses: actions/checkout@v2

Expand All @@ -34,17 +35,10 @@ jobs:
run: pip install yamllint

- name: Install doil
run: sudo ./setup/install.sh
env:
GHRUN: yes
run: sudo ./setup/install yes

- name: PHP Unit Test
run: CI/PHPUnit/run_tests.sh
env:
GHRUN: "yes"

- name: Setup Unit Tests
run: ./setup/tests/tstfy.sh setup/tests/tests

- name: SLS Tests
run: ./CI/validate-sls-files.sh setup/stack/states
run: ./CI/validate-sls-files.sh app/src/Setup/stack/states
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 20260122
## What's Changed
* a great part of the setup is handled by php now
* updates are now triggered via 'sudo doil system:update'
* base debian image is now 'Debian 13 - Trixie'

## 20251103
## What's Changed
* update Captainhook Hooks while running update_hook script
Expand Down
63 changes: 31 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,43 @@ all mails from your instances, so you can test the ILIAS emailing.

## Installation

1. download and unpack the [latest release](https://github.com/conceptsandtraining/doil/releases)
1. cd into the unpacked directory
1. if you run doil on a remote host ensure to change the host name in `setup/conf/doil.conf` to your host name
1. adjust your mail password in `setup/conf/doil.conf`
1. if you run global instances make sure to adjust 'global_instances_path' in `setup/conf/doil.conf` to specify
where to place them, default is '/srv/instances'. Attention, paths with 'home' are not allowed here.
1. execute `sudo ./setup/install.sh` in order to install **doil**
1. you can remove the downloaded folder afterwards
1. check `doil help` for available commands and further instructions
1. download and unpack the [latest release](https://github.com/conceptsandtraining/doil/releases)
Alternatively, you can simply clone the repo via Git.
```bash
git clone https://github.com/conceptsandtraining/doil.git <target dir>
```
1. cd into the directory
1. run the setup install script
```bash
sudo setup/install
```
1. doil will automatically pause and ask you to configure the doil config file at /etc/doil/doil.conf
Please adjust it to your needs. At least update the paths for the ssh files.
1. continue with 'y'
1. check `doil` for available commands and further instructions
1. you can safely delete the downloaded/cloned folder doil

## Update

If you use a **doil** version older than 20221110, we recommend completely removing an already installed
**doil** from the system. This includes already installed instances. After that, you can proceed to the
Installation section.
If you use a **doil** version from before the year 2026, we recommend completely removing an already installed
**doil** from the system. After that, you can proceed to the Installation section.

Removal Tips:

* `docker ps -a` shows all containers
* `docker rm <container_id>` removes container by id (ensure to delete all doil instances)
* `docker images` shows all images
* `docker rmi <image_id>` remove image by id (ensure to delete all doil images)
* `docker volume ls` shows all volumes
* `docker volume rm <volume_name>` remove volume by name (ensure to delete mail, proxy and salt)
* `docker network prune` removes all networks without dependencies
* `sudo rm -rf /etc/doil /usr/local/lib/doil /usr/local/share/doil /usr/local/bin/doil ~/.doil /var/log/doil`
* remove the instances folders or if you placed all instances in one folder remove the whole folder
1. download and unpack the [latest release](https://github.com/conceptsandtraining/doil/releases)
Alternatively, you can simply clone the repo via Git.
```bash
git clone https://github.com/conceptsandtraining/doil.git <target dir>
```
1. cd into the directory
1. run the uninstall script
```bash
sudo setup/uninstall
```

Otherwise, use the update script.
Otherwise, use the update command with sudo.

1. checkout the newest master branch or copy and extract the zip
2. cd into the unpacked directory
3. if you run global instances make sure to adjust 'global_instances_path' in `setup/conf/doil.conf` to specify
where to place them, default is '/srv/instances'. Attention, paths with 'home' are not allowed here. The update
will move all global instances to the set path.
4. execute sudo ./setup/update.sh in order to update **doil**
5. you can remove the downloaded folder afterward
* sudo doil system:update


## Dependencies
Expand All @@ -54,9 +54,8 @@ however **doil** needs [Docker](https://www.docker.com/) in order to work:

* docker (follow [this](https://docs.docker.com/engine/install/) instructions depending on your os to install docker), if you have installed docker by your package manager ensure that **docker-buildx-plugin** and **docker-compose-plugin** are available and installed and also executable by your user.
* git
* .ssh folder in your home directory. **doil** will mount it into the container. **doil** needs this to have access to any private git repositories that may be used.

Additional dependencies, but these are installed automatically during setup.
Additional dependencies, but these are installed automatically inside the containers during setup.

* php version => 7.4
* php*.*-zip
Expand Down Expand Up @@ -296,7 +295,7 @@ the folder easily clone it again from [doil](https://github.com/conceptsandtrain

Cd into the cloned folder and execute the script.

`sudo ./setup/uninstall.sh`
`sudo ./setup/uninstall`

The script will ask you if you want to remove **doil** completely from your system or if you
want to keep your instances, images ...
Expand Down
6 changes: 6 additions & 0 deletions Update/shell_update_steps_template.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Don't change this file manually.
# Make a copy and name the file shell_steps.sh for additional steps during update.

echo "no additional shell steps for this update"
2 changes: 2 additions & 0 deletions Update/update.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
full_update=true
php_container_update=false
12 changes: 6 additions & 6 deletions app/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
}
},
"require": {
"symfony/console": "^5.4",
"symfony/console": "^8",
"pimple/pimple": "^3.5",
"symfony/process": "^5.4",
"symfony/process": "^8",
"ext-posix": "*",
"ext-zip": "*",
"symfony/filesystem": "^5.4",
"symfony/filesystem": "^8",
"ext-openssl": "*",
"psr/log": "1.1.4",
"monolog/monolog": "2.8.0",
"psr/log": "^3",
"monolog/monolog": "^3",
"ext-pcntl": "*"
},
"require-dev": {
"phpunit/phpunit": "^9"
"phpunit/phpunit": "^12"
}
}
4 changes: 2 additions & 2 deletions app/src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

class App extends Application
{
const NAME = "Doil Version 20251125 - build 2025-11-25";
const NAME = "Doil Version 20260122 - build 2026-01-22";

public function __construct(Command ...$commands)
{
parent::__construct(self::NAME);

foreach ($commands as $command) {
$this->add($command);
$this->addCommand($command);
}
}
}
34 changes: 14 additions & 20 deletions app/src/Commands/Instances/ApplyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ChoiceQuestion;
use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Command\SignalableCommandInterface;

class ApplyCommand extends Command implements SignalableCommandInterface
#[AsCommand(
name: 'instances:apply|apply',
description: 'Apply state for the given instance. This is useful for re-applying singular state to your instance.'
)]
class ApplyCommand extends Command
{
protected const PATH_STATES = "/usr/local/share/doil/stack/states";

Expand All @@ -40,29 +44,18 @@ class ApplyCommand extends Command implements SignalableCommandInterface
"set-update-token"
];

protected static $defaultName = "instances:apply";
protected static $defaultDescription =
"Apply state for the given instance. This is useful for re-applying singular state to your instance.";

protected Docker $docker;
protected Posix $posix;
protected Filesystem $filesystem;
protected Writer $writer;

public function __construct(Docker $docker, Posix $posix, Filesystem $filesystem, Writer $writer)
{
public function __construct(
protected Docker $docker,
protected Posix $posix,
protected Filesystem $filesystem,
protected Writer $writer
) {
parent::__construct();

$this->docker = $docker;
$this->posix = $posix;
$this->filesystem = $filesystem;
$this->writer = $writer;
}

public function configure() : void
{
$this
->setAliases(["apply"])
->addArgument("instance", InputArgument::OPTIONAL, "name of the instance to apply state to")
->addArgument("state", InputArgument::OPTIONAL, "name of the state to apply")
->addOption("all", "a", InputOption::VALUE_NONE, "if is set apply state to all instances")
Expand Down Expand Up @@ -198,12 +191,13 @@ public function getSubscribedSignals(): array
return [SIGINT, SIGTERM];
}

public function handleSignal(int $signal) : void
public function handleSignal(int $signal, int|false $previousExitCode = 0): int|false
{
if (SIGINT === $signal || SIGTERM === $signal) {
echo "Aborted by User!\n";
exit(0);
}
return false;
}

protected function applyState(
Expand Down
29 changes: 11 additions & 18 deletions app/src/Commands/Instances/CSPCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,29 @@
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Exception\InvalidArgumentException;

#[AsCommand(
name: 'instances:csp|csp',
description: 'This command sets CSP rules for the given instance or all instances.'
)]
class CSPCommand extends Command
{
protected static $defaultName = "instances:csp";
protected static $defaultDescription =
"This command sets CSP rules for the given instance or all instances"
;

protected Docker $docker;
protected Posix $posix;
protected Filesystem $filesystem;
protected Writer $writer;

public function __construct(Docker $docker, Posix $posix, Filesystem $filesystem, Writer $writer)
{
public function __construct(
protected Docker $docker,
protected Posix $posix,
protected Filesystem $filesystem,
protected Writer $writer
) {
parent::__construct();

$this->docker = $docker;
$this->posix = $posix;
$this->filesystem = $filesystem;
$this->writer = $writer;
}

public function configure() : void
{
$this
->setAliases(["csp"])
->addArgument("instance", InputArgument::OPTIONAL, "Name of the instance to set csp for")
->addOption("rules", "r", InputOption::VALUE_REQUIRED, "CSP rules as string")
->addOption("global", "g", InputOption::VALUE_NONE, "Determines if an instance is global or not")
Expand Down
Loading