mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-21 02:01:03 +07:00
06372c8fd7
* 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
54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
#ifndef SELFHOSTEDADMINSERVERCONFIG_H
|
|
#define SELFHOSTEDADMINSERVERCONFIG_H
|
|
|
|
#include <QJsonObject>
|
|
#include <QMap>
|
|
#include <QPair>
|
|
|
|
#include "core/utils/containerEnum.h"
|
|
#include "core/utils/containers/containerUtils.h"
|
|
#include "core/utils/protocolEnum.h"
|
|
#include "core/models/containerConfig.h"
|
|
#include "core/utils/errorCodes.h"
|
|
#include "core/utils/routeModes.h"
|
|
#include "core/utils/commonStructs.h"
|
|
|
|
namespace amnezia
|
|
{
|
|
|
|
using namespace ContainerEnumNS;
|
|
|
|
struct SelfHostedAdminServerConfig {
|
|
QString description;
|
|
QString displayName;
|
|
QString hostName;
|
|
QMap<DockerContainer, ContainerConfig> containers;
|
|
DockerContainer defaultContainer;
|
|
QString dns1;
|
|
QString dns2;
|
|
|
|
QString userName;
|
|
QString password;
|
|
int port = 0;
|
|
|
|
bool hasCredentials() const;
|
|
bool isReadOnly() const;
|
|
ServerCredentials credentials() const;
|
|
bool hasContainers() const;
|
|
ContainerConfig containerConfig(DockerContainer container) const;
|
|
|
|
void updateContainerConfig(DockerContainer container, const ContainerConfig &config);
|
|
|
|
void clearCachedClientProfile(DockerContainer container);
|
|
|
|
QPair<QString, QString> getDnsPair(bool isAmneziaDnsEnabled, const QString &primaryDns,
|
|
const QString &secondaryDns) const;
|
|
|
|
QJsonObject toJson() const;
|
|
static SelfHostedAdminServerConfig fromJson(const QJsonObject &json);
|
|
};
|
|
|
|
} // namespace amnezia
|
|
|
|
#endif // SELFHOSTEDADMINSERVERCONFIG_H
|