mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
Merge pull request #5945 from nextcloud/enh/5938/show-secret-in-interface
containers-schema: allow to specify ui-secret and show in aio interface
This commit is contained in:
commit
1eebe6fd60
16 changed files with 42 additions and 4 deletions
|
|
@ -145,6 +145,10 @@
|
|||
"pattern": "^[A-Z_]+$"
|
||||
}
|
||||
},
|
||||
"ui_secret": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-Z_]+$"
|
||||
},
|
||||
"image_tag": {
|
||||
"type": "string",
|
||||
"pattern": "^([a-z0-9.-]+|%AIO_CHANNEL%)$"
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ readonly class Container {
|
|||
private array $dependsOn,
|
||||
/** @var string[] */
|
||||
private array $secrets,
|
||||
private string $uiSecret,
|
||||
/** @var string[] */
|
||||
private array $devices,
|
||||
private bool $enableNvidiaGpu,
|
||||
|
|
@ -85,6 +86,10 @@ readonly class Container {
|
|||
return $this->secrets;
|
||||
}
|
||||
|
||||
public function GetUiSecret() : string {
|
||||
return $this->dockerActionManager->GetAndGenerateSecretWrapper($this->uiSecret);
|
||||
}
|
||||
|
||||
public function GetTmpfs() : array {
|
||||
return $this->tmpfs;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -244,6 +244,11 @@ readonly class ContainerDefinitionFetcher {
|
|||
$secrets = $entry['secrets'];
|
||||
}
|
||||
|
||||
$uiSecret = '';
|
||||
if (isset($entry['ui_secret'])) {
|
||||
$uiSecret = $entry['ui_secret'];
|
||||
}
|
||||
|
||||
$devices = [];
|
||||
if (isset($entry['devices'])) {
|
||||
$devices = $entry['devices'];
|
||||
|
|
@ -316,6 +321,7 @@ readonly class ContainerDefinitionFetcher {
|
|||
$variables,
|
||||
$dependsOn,
|
||||
$secrets,
|
||||
$uiSecret,
|
||||
$devices,
|
||||
$enableNvidiaGpu,
|
||||
$capAdd,
|
||||
|
|
|
|||
|
|
@ -33,6 +33,10 @@ class ConfigurationManager
|
|||
}
|
||||
|
||||
public function GetAndGenerateSecret(string $secretId) : string {
|
||||
if ($secretId === '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
$config = $this->GetConfig();
|
||||
if(!isset($config['secrets'][$secretId])) {
|
||||
$config['secrets'][$secretId] = bin2hex(random_bytes(24));
|
||||
|
|
|
|||
|
|
@ -1032,6 +1032,10 @@ readonly class DockerActionManager {
|
|||
}
|
||||
}
|
||||
|
||||
public function GetAndGenerateSecretWrapper(string $secretId) : string {
|
||||
return $this->configurationManager->GetAndGenerateSecret($secretId);
|
||||
}
|
||||
|
||||
public function isNextcloudImageOutdated() : bool {
|
||||
$createdTime = $this->GetCreatedTimeOfNextcloudImage();
|
||||
|
||||
|
|
|
|||
|
|
@ -282,6 +282,9 @@
|
|||
{% if container.GetDocumentation() != '' %}
|
||||
(<a href="{{ container.GetDocumentation() }}">docs</a>)
|
||||
{% endif %}
|
||||
{% if container.GetUiSecret() != '' %}
|
||||
(password: {{ GetUiSecret.GetUiSecret() }} )
|
||||
{% endif %}
|
||||
</span>
|
||||
{% elseif container.GetRunningState().value == 'running' %}
|
||||
<span class="status success"></span>
|
||||
|
|
@ -289,6 +292,9 @@
|
|||
{% if container.GetDocumentation() != '' %}
|
||||
(<a href="{{ container.GetDocumentation() }}">docs</a>)
|
||||
{% endif %}
|
||||
{% if container.GetUiSecret() != '' %}
|
||||
(password: {{ GetUiSecret.GetUiSecret() }} )
|
||||
{% endif %}
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="status error"></span>
|
||||
|
|
@ -296,6 +302,9 @@
|
|||
{% if container.GetDocumentation() != '' %}
|
||||
(<a href="{{ container.GetDocumentation() }}">docs</a>)
|
||||
{% endif %}
|
||||
{% if container.GetUiSecret() != '' %}
|
||||
(password: {{ GetUiSecret.GetUiSecret() }} )
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</li>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue