amnezia-vpn / amnezia-client

Amnezia VPN Client (Desktop+Mobile)
https://amnezia.org
GNU General Public License v3.0
4.43k stars 285 forks source link

Feature request: Add support expiration time for Telegram API config #1063

Open kolsys opened 1 week ago

kolsys commented 1 week ago

We are making in-house authentication server based on AmneziaVPN and config API. Currently the expiration API key is sets to +1 day and API config reloads only 1 time per day. We want to add possibility to provide expiration time of API config.

$config = [
    'dns1' => $dns1,
    'dns2' => $dns2,
    'hostName' => $vpnHost,
    'defaultContainer' => 'amnezia-awg',
    'api_config' => [
        'public_key'=> [
            'end_date' => $expiresAt,
        ],
    ],
    'containers' => [
        $awgContainer,
    ],
];

https://github.com/amnezia-vpn/amnezia-client/blob/fff15fffe2b8f98cd2e11e452ba9a546eed4620c/client/core/controllers/apiController.cpp#L121

Something like this

    if (apiConfig.value(config_key::configVersion).toInt() == ApiConfigSources::Telegram) {
            serverConfig["api_config"] = apiConfig.value("api_config");
    }
Nethius commented 4 days ago

I don't understand what you want

kolsys commented 1 day ago

I don't understand what you want

I want allow to setting up config expiration time via Telegram API and not only via server API. It's required for the forcing reload config on a next connect.