mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-17 11:10:22 +00:00
Compare commits
8 commits
e4c2f44d81
...
81e1bc1ef3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81e1bc1ef3 | ||
|
|
3251fa69d3 | ||
|
|
cfaf69fb58 | ||
|
|
f3104bd661 | ||
|
|
f87bd7ae45 | ||
|
|
29c093afae | ||
|
|
ee2f1fa262 | ||
|
|
bb342bc64a |
7 changed files with 22 additions and 31 deletions
|
|
@ -1,5 +1,5 @@
|
|||
# syntax=docker/dockerfile:latest
|
||||
FROM nats:2.11.8-scratch AS nats
|
||||
FROM nats:2.11.9-scratch AS nats
|
||||
FROM eturnal/eturnal:1.12.1 AS eturnal
|
||||
FROM strukturag/nextcloud-spreed-signaling:2.0.4 AS signaling
|
||||
FROM alpine:3.22.1 AS janus
|
||||
|
|
|
|||
|
|
@ -10,18 +10,21 @@
|
|||
"restart": "unless-stopped",
|
||||
"environment": [
|
||||
"TZ=%TIMEZONE%",
|
||||
"API_KEY=some-super-secret-api-key",
|
||||
"API_KEY=%FACERECOGNITION_API_KEY%",
|
||||
"FACE_MODEL=3"
|
||||
],
|
||||
"aio_variables": [
|
||||
"nextcloud_memory_limit=2048M"
|
||||
],
|
||||
"secrets": [
|
||||
"FACERECOGNITION_API_KEY"
|
||||
],
|
||||
"enable_nvidia_gpu": false,
|
||||
"nextcloud_exec_commands": [
|
||||
"php /var/www/html/occ app:install facerecognition",
|
||||
"php /var/www/html/occ app:enable facerecognition",
|
||||
"php /var/www/html/occ config:system:set facerecognition.external_model_url --value nextcloud-aio-facerecognition:5000",
|
||||
"php /var/www/html/occ config:system:set facerecognition.external_model_api_key --value some-super-secret-api-key",
|
||||
"php /var/www/html/occ config:system:set facerecognition.external_model_api_key --value %FACERECOGNITION_API_KEY%",
|
||||
"php /var/www/html/occ face:setup -m 5",
|
||||
"php /var/www/html/occ face:setup -M 1G",
|
||||
"php /var/www/html/occ config:app:set facerecognition analysis_image_area --value 4320000",
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ svg:not(:has(use)) .fallback-text {
|
|||
}
|
||||
|
||||
.login > .monospace {
|
||||
font-family: monospace;
|
||||
font-family: monospace, monospace, system-ui, -apple-system, 'Segoe UI', Roboto, Oxygen-Sans, Cantarell, Ubuntu, 'Helvetica Neue', 'Noto Sans', 'Liberation Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,6 @@ readonly class Container {
|
|||
private ContainerEnvironmentVariables $containerEnvironmentVariables,
|
||||
/** @var string[] */
|
||||
private array $dependsOn,
|
||||
/** @var string[] */
|
||||
private array $secrets,
|
||||
private string $uiSecret,
|
||||
/** @var string[] */
|
||||
private array $devices,
|
||||
|
|
@ -82,10 +80,6 @@ readonly class Container {
|
|||
return $this->maxShutdownTime;
|
||||
}
|
||||
|
||||
public function GetSecrets() : array {
|
||||
return $this->secrets;
|
||||
}
|
||||
|
||||
public function GetUiSecret() : string {
|
||||
return $this->dockerActionManager->GetAndGenerateSecretWrapper($this->uiSecret);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -239,9 +239,12 @@ readonly class ContainerDefinitionFetcher {
|
|||
$internalPort = $entry['internal_port'];
|
||||
}
|
||||
|
||||
$secrets = [];
|
||||
if (isset($entry['secrets'])) {
|
||||
$secrets = $entry['secrets'];
|
||||
// All secrets are registered with the configuration when they
|
||||
// are discovered so they can be later generated at time-of-use.
|
||||
foreach ($entry['secrets'] as $secret) {
|
||||
$this->configurationManager->RegisterSecret($secret);
|
||||
}
|
||||
}
|
||||
|
||||
$uiSecret = '';
|
||||
|
|
@ -320,7 +323,6 @@ readonly class ContainerDefinitionFetcher {
|
|||
$volumes,
|
||||
$variables,
|
||||
$dependsOn,
|
||||
$secrets,
|
||||
$uiSecret,
|
||||
$devices,
|
||||
$enableNvidiaGpu,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ use AIO\Controller\DockerController;
|
|||
|
||||
class ConfigurationManager
|
||||
{
|
||||
private array $secrets = [];
|
||||
|
||||
public function GetConfig() : array
|
||||
{
|
||||
if(file_exists(DataConst::GetConfigFile()))
|
||||
|
|
@ -50,13 +52,15 @@ class ConfigurationManager
|
|||
return $config['secrets'][$secretId];
|
||||
}
|
||||
|
||||
public function GetSecret(string $secretId) : string {
|
||||
$config = $this->GetConfig();
|
||||
if(!isset($config['secrets'][$secretId])) {
|
||||
$config['secrets'][$secretId] = "";
|
||||
public function GetRegisteredSecret(string $secretId) : string {
|
||||
if ($this->secrets[$secretId]) {
|
||||
return $this->GetAndGenerateSecret($secretId);
|
||||
}
|
||||
throw new \Exception("The secret " . $secretId . " was not registered. Please check if it is defined in secrets of containers.json.");
|
||||
}
|
||||
|
||||
return $config['secrets'][$secretId];
|
||||
public function RegisterSecret(string $secretId) : void {
|
||||
$this->secrets[$secretId] = true;
|
||||
}
|
||||
|
||||
private function DoubleSafeBackupSecret(string $borgBackupPassword) : void {
|
||||
|
|
|
|||
|
|
@ -221,10 +221,6 @@ readonly class DockerActionManager {
|
|||
$requestBody['HostConfig']['Binds'] = $volumes;
|
||||
}
|
||||
|
||||
foreach ($container->GetSecrets() as $secret) {
|
||||
$this->configurationManager->GetAndGenerateSecret($secret);
|
||||
}
|
||||
|
||||
$aioVariables = $container->GetAioVariables()->GetVariables();
|
||||
foreach ($aioVariables as $variable) {
|
||||
$config = $this->configurationManager->GetConfig();
|
||||
|
|
@ -566,18 +562,10 @@ readonly class DockerActionManager {
|
|||
// Allow to get local ip-address of caddy container and add it to trusted proxies automatically
|
||||
'CADDY_IP_ADDRESS' => in_array('caddy', $this->configurationManager->GetEnabledCommunityContainers(), true) ? gethostbyname('nextcloud-aio-caddy') : '',
|
||||
'WHITEBOARD_ENABLED' => $this->configurationManager->isWhiteboardEnabled() ? 'yes' : '',
|
||||
default => $this->getSecretOrThrow($placeholder),
|
||||
default => $this->configurationManager->GetRegisteredSecret($placeholder),
|
||||
};
|
||||
}
|
||||
|
||||
private function getSecretOrThrow(string $secretName): string {
|
||||
$secret = $this->configurationManager->GetSecret($secretName);
|
||||
if ($secret === "") {
|
||||
throw new \Exception("The secret " . $secretName . " is empty. Cannot substitute its value. Please check if it is defined in secrets of containers.json.");
|
||||
}
|
||||
return $secret;
|
||||
}
|
||||
|
||||
private function isContainerUpdateAvailable(string $id): string {
|
||||
$container = $this->containerDefinitionFetcher->GetContainerById($id);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue