mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-17 08:16:06 +03:00
* refactor: remove serverConfig struct * refactor: add warnings for api v1 configs * refactor: moved the server type definition to a separate namespace * refactor: simplified gateway stacks * fix: fixed server description * fix: fixed postAsync reply usage * fix: fixed validateConfig call * fix: fixed server name in notifications * fix: fixed initPrepareConfigHandler for lagacy configs
40 lines
1.0 KiB
C++
40 lines
1.0 KiB
C++
#ifndef SELFHOSTEDUSERSERVERCONFIG_H
|
|
#define SELFHOSTEDUSERSERVERCONFIG_H
|
|
|
|
#include <QJsonObject>
|
|
#include <QMap>
|
|
#include <optional>
|
|
|
|
#include "core/utils/containerEnum.h"
|
|
#include "core/utils/containers/containerUtils.h"
|
|
#include "core/utils/protocolEnum.h"
|
|
#include "core/models/containerConfig.h"
|
|
#include "core/utils/commonStructs.h"
|
|
|
|
namespace amnezia
|
|
{
|
|
|
|
using namespace ContainerEnumNS;
|
|
|
|
struct SelfHostedUserServerConfig {
|
|
QString description;
|
|
QString displayName;
|
|
QString hostName;
|
|
QMap<DockerContainer, ContainerConfig> containers;
|
|
DockerContainer defaultContainer;
|
|
QString dns1;
|
|
QString dns2;
|
|
|
|
bool hasCredentials() const;
|
|
bool isReadOnly() const;
|
|
std::optional<ServerCredentials> credentials() const;
|
|
bool hasContainers() const;
|
|
ContainerConfig containerConfig(DockerContainer container) const;
|
|
QJsonObject toJson() const;
|
|
static SelfHostedUserServerConfig fromJson(const QJsonObject &json);
|
|
};
|
|
|
|
} // namespace amnezia
|
|
|
|
#endif // SELFHOSTEDUSERSERVERCONFIG_H
|