-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master keycloak:449 add keycloak as IdP for doil managed ILIAS Instances
* add keycloak commands (down/login/restart/up) * add saml states (enable-saml/disable-saml) * add keycloak state * add keycloak template * update CHANGELOG * update README * add an update script * tested so far on my local host * adjust tests
- Loading branch information
Showing
69 changed files
with
2,221 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php declare(strict_types=1); | ||
|
||
/* Copyright (c) 2022 - Daniel Weise <[email protected]> - Extended GPL, see LICENSE */ | ||
|
||
namespace CaT\Doil\Commands\Keycloak; | ||
|
||
use CaT\Doil\Lib\Docker\Docker; | ||
use CaT\Doil\Lib\ConsoleOutput\Writer; | ||
use CaT\Doil\Lib\FileSystem\Filesystem; | ||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
class DownCommand extends Command | ||
{ | ||
protected const KEYCLOAK_PATH = "/usr/local/lib/doil/server/keycloak"; | ||
|
||
protected static $defaultName = "keycloak:down"; | ||
protected static $defaultDescription = "Stops the keycloak server"; | ||
|
||
protected Docker $docker; | ||
protected Writer $writer; | ||
protected Filesystem $filesystem; | ||
|
||
public function __construct(Docker $docker, Writer $writer, Filesystem $filesystem) | ||
{ | ||
$this->docker = $docker; | ||
$this->writer = $writer; | ||
$this->filesystem = $filesystem; | ||
|
||
parent::__construct(); | ||
} | ||
|
||
protected function configure() : void | ||
{ | ||
if (!$this->filesystem->exists(self::KEYCLOAK_PATH)) { | ||
$this->setHidden(true); | ||
} | ||
} | ||
|
||
public function execute(InputInterface $input, OutputInterface $output) : int | ||
{ | ||
if (! $this->docker->isInstanceUp(self::KEYCLOAK_PATH)) { | ||
$output->writeln("Nothing to do. Keycloak is already down."); | ||
return Command::SUCCESS; | ||
} | ||
|
||
$this->writer->beginBlock($output, "Stop keycloak"); | ||
$this->docker->stopContainerByDockerCompose(self::KEYCLOAK_PATH); | ||
$this->writer->endBlock(); | ||
|
||
return Command::SUCCESS; | ||
} | ||
} |
Oops, something went wrong.