mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-07-21 21:52:53 +00:00
f7987b26ac
Add the server-side deSEC (dedyn.io) free dynamic-DNS flow so users without a domain can obtain one from the AIO interface. - DesecManager drives the full flow against the deSEC API, matching its real semantics: account creation returns HTTP 202 + email verification (no token), a token is obtained via /auth/login/ only after the email is verified, domain registration handles 201/409, and a wildcard CNAME rrset is created for new accounts. Existing accounts can be used by supplying a password. - The "awaiting verification" step is derived from the stored credentials (email + generated password but no token and no domain yet), not a separate flag. register() returns false for that state so the controller can re-render the awaiting-verification UI instead of surfacing it as an error. - DesecController exposes POST /api/desec/register; DependencyInjection wires the manager; account credentials (email, generated password, token) are stored in the AIO configuration and DESEC_TOKEN is exposed to the caddy container. - The dynamic-DNS record is refreshed with the current public IP on container start (DockerController) and via the cron path (Cron/UpdateDesecIp, cron.sh). - Fix an undefined-variable bug in the desecToken/desecPassword config setters that prevented credentials from being persisted. Co-Authored-By: szaimen <42591237+szaimen@users.noreply.github.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Simon L. <szaimen@e.mail.de>
62 lines
1.8 KiB
PHP
62 lines
1.8 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace AIO;
|
|
|
|
use AIO\Docker\DockerHubManager;
|
|
use DI\Container;
|
|
use AIO\Docker\GitHubContainerRegistryManager;
|
|
|
|
class DependencyInjection
|
|
{
|
|
public static function GetContainer() : Container {
|
|
$container = new Container();
|
|
|
|
$container->set(
|
|
DockerHubManager::class,
|
|
new DockerHubManager()
|
|
);
|
|
|
|
$container->set(
|
|
GitHubContainerRegistryManager::class,
|
|
new GitHubContainerRegistryManager()
|
|
);
|
|
|
|
$container->set(
|
|
\AIO\Data\ConfigurationManager::class,
|
|
new \AIO\Data\ConfigurationManager()
|
|
);
|
|
$container->set(
|
|
\AIO\Docker\DockerActionManager::class,
|
|
new \AIO\Docker\DockerActionManager(
|
|
$container->get(\AIO\Data\ConfigurationManager::class),
|
|
$container->get(\AIO\ContainerDefinitionFetcher::class),
|
|
$container->get(DockerHubManager::class),
|
|
$container->get(GitHubContainerRegistryManager::class)
|
|
)
|
|
);
|
|
$container->set(
|
|
\AIO\Desec\DesecManager::class,
|
|
new \AIO\Desec\DesecManager(
|
|
$container->get(\AIO\Data\ConfigurationManager::class),
|
|
)
|
|
);
|
|
$container->set(
|
|
\AIO\Auth\PasswordGenerator::class,
|
|
new \AIO\Auth\PasswordGenerator()
|
|
);
|
|
$container->set(
|
|
\AIO\Auth\AuthManager::class,
|
|
new \AIO\Auth\AuthManager($container->get(\AIO\Data\ConfigurationManager::class))
|
|
);
|
|
$container->set(
|
|
\AIO\Data\Setup::class,
|
|
new \AIO\Data\Setup(
|
|
$container->get(\AIO\Auth\PasswordGenerator::class),
|
|
$container->get(\AIO\Data\ConfigurationManager::class)
|
|
)
|
|
);
|
|
|
|
return $container;
|
|
}
|
|
} |