mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-07 00:24:18 +00:00
Merge pull request 'naiji-dev' (#91) from naiji-dev into develop
Reviewed-on: https://git.selfprivacy.org/kherel/selfprivacy.org.app/pulls/91
This commit is contained in:
commit
c4f62e012b
|
@ -259,6 +259,9 @@
|
|||
"1": "Connect a server",
|
||||
"2": "A place where your data and SelfPrivacy services will reside:",
|
||||
"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",
|
||||
"4": "To manage your domain's DNS",
|
||||
"5": "CloudFlare API Token",
|
||||
|
|
|
@ -260,6 +260,9 @@
|
|||
"1": "Подключите сервер",
|
||||
"2": "Здесь будут жить наши данные и SelfPrivacy-сервисы",
|
||||
"how": "Как получить API Token",
|
||||
"hetzner_bad_key_error": "Hetzner API ключ неверен",
|
||||
"cloudflare_bad_key_error": "Cloudflare API ключ неверен",
|
||||
"backblaze_bad_key_error": "Информация о Backblaze хранилище неверна",
|
||||
"3": "Подключите CloudFlare",
|
||||
"4": "Для управления DNS вашего домена",
|
||||
"5": "CloudFlare API Token",
|
||||
|
|
3
fastlane/metadata/android/en-US/changelogs/0.6.1.txt
Normal file
3
fastlane/metadata/android/en-US/changelogs/0.6.1.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
- Fixed routing errors and broken "back" buttons on recovery stages
|
||||
- Fixed broken validation on api token fields
|
||||
- Minor improvements
|
|
@ -55,10 +55,11 @@ class BackblazeFormCubit extends FormCubit {
|
|||
}
|
||||
|
||||
if (!isKeyValid) {
|
||||
keyId.setError('bad key');
|
||||
applicationKey.setError('bad key');
|
||||
keyId.setError('initializing.backblaze_bad_key_error'.tr());
|
||||
applicationKey.setError('initializing.backblaze_bad_key_error'.tr());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,12 +42,14 @@ class CloudFlareFormCubit extends FormCubit {
|
|||
isKeyValid = await apiClient.isValid(apiKey.state.value);
|
||||
} catch (e) {
|
||||
addError(e);
|
||||
isKeyValid = false;
|
||||
}
|
||||
|
||||
if (!isKeyValid) {
|
||||
apiKey.setError('bad key');
|
||||
apiKey.setError('initializing.cloudflare_bad_key_error'.tr());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,12 +42,14 @@ class HetznerFormCubit extends FormCubit {
|
|||
isKeyValid = await apiClient.isValid(apiKey.state.value);
|
||||
} catch (e) {
|
||||
addError(e);
|
||||
isKeyValid = false;
|
||||
}
|
||||
|
||||
if (!isKeyValid) {
|
||||
apiKey.setError('bad key');
|
||||
apiKey.setError('initializing.hetzner_bad_key_error'.tr());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -417,11 +417,11 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
|||
),
|
||||
);
|
||||
break;
|
||||
case RecoveryStep.serverSelection:
|
||||
repository.deleteHetznerKey();
|
||||
case RecoveryStep.cloudflareToken:
|
||||
repository.deleteServerDetails();
|
||||
emit(
|
||||
dataState.copyWith(
|
||||
currentStep: RecoveryStep.hetznerToken,
|
||||
currentStep: RecoveryStep.serverSelection,
|
||||
),
|
||||
);
|
||||
break;
|
||||
|
|
|
@ -242,13 +242,18 @@ class ServerInstallationRepository {
|
|||
domainName: domainName,
|
||||
);
|
||||
|
||||
final ServerHostingDetails? serverDetails =
|
||||
await hetznerApi.createServer(
|
||||
cloudFlareKey: cloudFlareKey,
|
||||
rootUser: rootUser,
|
||||
domainName: domainName,
|
||||
dataBase: dataBase,
|
||||
);
|
||||
ServerHostingDetails? serverDetails;
|
||||
try {
|
||||
serverDetails = await hetznerApi.createServer(
|
||||
cloudFlareKey: cloudFlareKey,
|
||||
rootUser: rootUser,
|
||||
domainName: domainName,
|
||||
dataBase: dataBase,
|
||||
);
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
|
||||
if (serverDetails == null) {
|
||||
print('Server is not initialized!');
|
||||
return;
|
||||
|
@ -598,6 +603,11 @@ class ServerInstallationRepository {
|
|||
await getIt<ApiConfigModel>().storeServerDetails(serverDetails);
|
||||
}
|
||||
|
||||
Future<void> deleteServerDetails() async {
|
||||
await box.delete(BNames.serverDetails);
|
||||
getIt<ApiConfigModel>().init();
|
||||
}
|
||||
|
||||
Future<void> saveHetznerKey(final String key) async {
|
||||
print('saved');
|
||||
await getIt<ApiConfigModel>().storeHetznerKey(key);
|
||||
|
@ -614,10 +624,20 @@ class ServerInstallationRepository {
|
|||
await getIt<ApiConfigModel>().storeBackblazeCredential(backblazeCredential);
|
||||
}
|
||||
|
||||
Future<void> deleteBackblazeKey() async {
|
||||
await box.delete(BNames.backblazeCredential);
|
||||
getIt<ApiConfigModel>().init();
|
||||
}
|
||||
|
||||
Future<void> saveCloudFlareKey(final String key) async {
|
||||
await getIt<ApiConfigModel>().storeCloudFlareKey(key);
|
||||
}
|
||||
|
||||
Future<void> deleteCloudFlareKey() async {
|
||||
await box.delete(BNames.cloudFlareKey);
|
||||
getIt<ApiConfigModel>().init();
|
||||
}
|
||||
|
||||
Future<void> saveDomain(final ServerDomain serverDomain) async {
|
||||
await getIt<ApiConfigModel>().storeServerDomain(serverDomain);
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@ class ApiConfigModel {
|
|||
|
||||
Future<void> storeBackblazeCredential(final BackblazeCredential value) async {
|
||||
await _box.put(BNames.backblazeCredential, value);
|
||||
|
||||
_backblazeCredential = value;
|
||||
}
|
||||
|
||||
|
@ -64,7 +63,6 @@ class ApiConfigModel {
|
|||
|
||||
void init() {
|
||||
_hetznerKey = _box.get(BNames.hetznerKey);
|
||||
|
||||
_cloudFlareKey = _box.get(BNames.cloudFlareKey);
|
||||
_backblazeCredential = _box.get(BNames.backblazeCredential);
|
||||
_serverDomain = _box.get(BNames.serverDomain);
|
||||
|
|
|
@ -28,6 +28,9 @@ class RecoveryConfirmBackblaze extends StatelessWidget {
|
|||
heroTitle: 'recovering.confirm_backblaze'.tr(),
|
||||
heroSubtitle: 'recovering.confirm_backblaze_description'.tr(),
|
||||
hasBackButton: true,
|
||||
onBackButtonPressed: () {
|
||||
Navigator.of(context).popUntil((final route) => route.isFirst);
|
||||
},
|
||||
hasFlashButton: false,
|
||||
children: [
|
||||
CubitFormTextField(
|
||||
|
|
|
@ -31,6 +31,8 @@ class RecoveryConfirmCloudflare extends StatelessWidget {
|
|||
),
|
||||
hasBackButton: true,
|
||||
hasFlashButton: false,
|
||||
onBackButtonPressed:
|
||||
context.read<ServerInstallationCubit>().revertRecoveryStep,
|
||||
children: [
|
||||
CubitFormTextField(
|
||||
formFieldCubit: context.read<CloudFlareFormCubit>().apiKey,
|
||||
|
|
|
@ -39,6 +39,9 @@ class _RecoveryConfirmServerState extends State<RecoveryConfirmServer> {
|
|||
? 'recovering.choose_server_description'.tr()
|
||||
: 'recovering.confirm_server_description'.tr(),
|
||||
hasBackButton: true,
|
||||
onBackButtonPressed: () {
|
||||
Navigator.of(context).popUntil((final route) => route.isFirst);
|
||||
},
|
||||
hasFlashButton: false,
|
||||
children: [
|
||||
FutureBuilder<List<ServerBasicInfoWithValidators>>(
|
||||
|
|
|
@ -32,6 +32,9 @@ class RecoveryHetznerConnected extends StatelessWidget {
|
|||
),
|
||||
hasBackButton: true,
|
||||
hasFlashButton: false,
|
||||
onBackButtonPressed: () {
|
||||
Navigator.of(context).popUntil((final route) => route.isFirst);
|
||||
},
|
||||
children: [
|
||||
CubitFormTextField(
|
||||
formFieldCubit: context.read<HetznerFormCubit>().apiKey,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
name: selfprivacy
|
||||
description: selfprivacy.org
|
||||
publish_to: 'none'
|
||||
version: 0.6.0+15
|
||||
version: 0.6.1+15
|
||||
|
||||
environment:
|
||||
sdk: '>=2.17.0 <3.0.0'
|
||||
|
|
Loading…
Reference in a new issue