mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-03-18 12:34:54 +00:00
Bug fix error processing for installation cubits
This commit is contained in:
parent
3024016fe2
commit
313cfc7187
6 changed files with 27 additions and 11 deletions
|
@ -259,6 +259,9 @@
|
||||||
"1": "Connect a server",
|
"1": "Connect a server",
|
||||||
"2": "A place where your data and SelfPrivacy services will reside:",
|
"2": "A place where your data and SelfPrivacy services will reside:",
|
||||||
"how": "How to obtain API token",
|
"how": "How to obtain API token",
|
||||||
|
"hetzner_bad_key_error": "Hetzner API key is invalid",
|
||||||
|
"cloudflare_bad_key_error": "Cloudflare API key is invalid",
|
||||||
|
"backblaze_bad_key_error": "Backblaze storage information is invalid",
|
||||||
"3": "Connect CloudFlare",
|
"3": "Connect CloudFlare",
|
||||||
"4": "To manage your domain's DNS",
|
"4": "To manage your domain's DNS",
|
||||||
"5": "CloudFlare API Token",
|
"5": "CloudFlare API Token",
|
||||||
|
|
|
@ -260,6 +260,9 @@
|
||||||
"1": "Подключите сервер",
|
"1": "Подключите сервер",
|
||||||
"2": "Здесь будут жить наши данные и SelfPrivacy-сервисы",
|
"2": "Здесь будут жить наши данные и SelfPrivacy-сервисы",
|
||||||
"how": "Как получить API Token",
|
"how": "Как получить API Token",
|
||||||
|
"hetzner_bad_key_error": "Hetzner API ключ неверен",
|
||||||
|
"cloudflare_bad_key_error": "Cloudflare API ключ неверен",
|
||||||
|
"backblaze_bad_key_error": "Информация о Backblaze хранилище неверна",
|
||||||
"3": "Подключите CloudFlare",
|
"3": "Подключите CloudFlare",
|
||||||
"4": "Для управления DNS вашего домена",
|
"4": "Для управления DNS вашего домена",
|
||||||
"5": "CloudFlare API Token",
|
"5": "CloudFlare API Token",
|
||||||
|
|
|
@ -55,10 +55,11 @@ class BackblazeFormCubit extends FormCubit {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isKeyValid) {
|
if (!isKeyValid) {
|
||||||
keyId.setError('bad key');
|
keyId.setError('initializing.backblaze_bad_key_error'.tr());
|
||||||
applicationKey.setError('bad key');
|
applicationKey.setError('initializing.backblaze_bad_key_error'.tr());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,12 +42,14 @@ class CloudFlareFormCubit extends FormCubit {
|
||||||
isKeyValid = await apiClient.isValid(apiKey.state.value);
|
isKeyValid = await apiClient.isValid(apiKey.state.value);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
addError(e);
|
addError(e);
|
||||||
|
isKeyValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isKeyValid) {
|
if (!isKeyValid) {
|
||||||
apiKey.setError('bad key');
|
apiKey.setError('initializing.cloudflare_bad_key_error'.tr());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,12 +42,14 @@ class HetznerFormCubit extends FormCubit {
|
||||||
isKeyValid = await apiClient.isValid(apiKey.state.value);
|
isKeyValid = await apiClient.isValid(apiKey.state.value);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
addError(e);
|
addError(e);
|
||||||
|
isKeyValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isKeyValid) {
|
if (!isKeyValid) {
|
||||||
apiKey.setError('bad key');
|
apiKey.setError('initializing.hetzner_bad_key_error'.tr());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,13 +242,18 @@ class ServerInstallationRepository {
|
||||||
domainName: domainName,
|
domainName: domainName,
|
||||||
);
|
);
|
||||||
|
|
||||||
final ServerHostingDetails? serverDetails =
|
ServerHostingDetails? serverDetails;
|
||||||
await hetznerApi.createServer(
|
try {
|
||||||
cloudFlareKey: cloudFlareKey,
|
serverDetails = await hetznerApi.createServer(
|
||||||
rootUser: rootUser,
|
cloudFlareKey: cloudFlareKey,
|
||||||
domainName: domainName,
|
rootUser: rootUser,
|
||||||
dataBase: dataBase,
|
domainName: domainName,
|
||||||
);
|
dataBase: dataBase,
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
print(e);
|
||||||
|
}
|
||||||
|
|
||||||
if (serverDetails == null) {
|
if (serverDetails == null) {
|
||||||
print('Server is not initialized!');
|
print('Server is not initialized!');
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue