mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-08 17:11:14 +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",
|
"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",
|
||||||
|
|
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) {
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -417,11 +417,11 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case RecoveryStep.serverSelection:
|
case RecoveryStep.cloudflareToken:
|
||||||
repository.deleteHetznerKey();
|
repository.deleteServerDetails();
|
||||||
emit(
|
emit(
|
||||||
dataState.copyWith(
|
dataState.copyWith(
|
||||||
currentStep: RecoveryStep.hetznerToken,
|
currentStep: RecoveryStep.serverSelection,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -242,13 +242,18 @@ class ServerInstallationRepository {
|
||||||
domainName: domainName,
|
domainName: domainName,
|
||||||
);
|
);
|
||||||
|
|
||||||
final ServerHostingDetails? serverDetails =
|
ServerHostingDetails? serverDetails;
|
||||||
await hetznerApi.createServer(
|
try {
|
||||||
|
serverDetails = await hetznerApi.createServer(
|
||||||
cloudFlareKey: cloudFlareKey,
|
cloudFlareKey: cloudFlareKey,
|
||||||
rootUser: rootUser,
|
rootUser: rootUser,
|
||||||
domainName: domainName,
|
domainName: domainName,
|
||||||
dataBase: dataBase,
|
dataBase: dataBase,
|
||||||
);
|
);
|
||||||
|
} catch (e) {
|
||||||
|
print(e);
|
||||||
|
}
|
||||||
|
|
||||||
if (serverDetails == null) {
|
if (serverDetails == null) {
|
||||||
print('Server is not initialized!');
|
print('Server is not initialized!');
|
||||||
return;
|
return;
|
||||||
|
@ -598,6 +603,11 @@ class ServerInstallationRepository {
|
||||||
await getIt<ApiConfigModel>().storeServerDetails(serverDetails);
|
await getIt<ApiConfigModel>().storeServerDetails(serverDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> deleteServerDetails() async {
|
||||||
|
await box.delete(BNames.serverDetails);
|
||||||
|
getIt<ApiConfigModel>().init();
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> saveHetznerKey(final String key) async {
|
Future<void> saveHetznerKey(final String key) async {
|
||||||
print('saved');
|
print('saved');
|
||||||
await getIt<ApiConfigModel>().storeHetznerKey(key);
|
await getIt<ApiConfigModel>().storeHetznerKey(key);
|
||||||
|
@ -614,10 +624,20 @@ class ServerInstallationRepository {
|
||||||
await getIt<ApiConfigModel>().storeBackblazeCredential(backblazeCredential);
|
await getIt<ApiConfigModel>().storeBackblazeCredential(backblazeCredential);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> deleteBackblazeKey() async {
|
||||||
|
await box.delete(BNames.backblazeCredential);
|
||||||
|
getIt<ApiConfigModel>().init();
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> saveCloudFlareKey(final String key) async {
|
Future<void> saveCloudFlareKey(final String key) async {
|
||||||
await getIt<ApiConfigModel>().storeCloudFlareKey(key);
|
await getIt<ApiConfigModel>().storeCloudFlareKey(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> deleteCloudFlareKey() async {
|
||||||
|
await box.delete(BNames.cloudFlareKey);
|
||||||
|
getIt<ApiConfigModel>().init();
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> saveDomain(final ServerDomain serverDomain) async {
|
Future<void> saveDomain(final ServerDomain serverDomain) async {
|
||||||
await getIt<ApiConfigModel>().storeServerDomain(serverDomain);
|
await getIt<ApiConfigModel>().storeServerDomain(serverDomain);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,6 @@ class ApiConfigModel {
|
||||||
|
|
||||||
Future<void> storeBackblazeCredential(final BackblazeCredential value) async {
|
Future<void> storeBackblazeCredential(final BackblazeCredential value) async {
|
||||||
await _box.put(BNames.backblazeCredential, value);
|
await _box.put(BNames.backblazeCredential, value);
|
||||||
|
|
||||||
_backblazeCredential = value;
|
_backblazeCredential = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +63,6 @@ class ApiConfigModel {
|
||||||
|
|
||||||
void init() {
|
void init() {
|
||||||
_hetznerKey = _box.get(BNames.hetznerKey);
|
_hetznerKey = _box.get(BNames.hetznerKey);
|
||||||
|
|
||||||
_cloudFlareKey = _box.get(BNames.cloudFlareKey);
|
_cloudFlareKey = _box.get(BNames.cloudFlareKey);
|
||||||
_backblazeCredential = _box.get(BNames.backblazeCredential);
|
_backblazeCredential = _box.get(BNames.backblazeCredential);
|
||||||
_serverDomain = _box.get(BNames.serverDomain);
|
_serverDomain = _box.get(BNames.serverDomain);
|
||||||
|
|
|
@ -28,6 +28,9 @@ class RecoveryConfirmBackblaze extends StatelessWidget {
|
||||||
heroTitle: 'recovering.confirm_backblaze'.tr(),
|
heroTitle: 'recovering.confirm_backblaze'.tr(),
|
||||||
heroSubtitle: 'recovering.confirm_backblaze_description'.tr(),
|
heroSubtitle: 'recovering.confirm_backblaze_description'.tr(),
|
||||||
hasBackButton: true,
|
hasBackButton: true,
|
||||||
|
onBackButtonPressed: () {
|
||||||
|
Navigator.of(context).popUntil((final route) => route.isFirst);
|
||||||
|
},
|
||||||
hasFlashButton: false,
|
hasFlashButton: false,
|
||||||
children: [
|
children: [
|
||||||
CubitFormTextField(
|
CubitFormTextField(
|
||||||
|
|
|
@ -31,6 +31,8 @@ class RecoveryConfirmCloudflare extends StatelessWidget {
|
||||||
),
|
),
|
||||||
hasBackButton: true,
|
hasBackButton: true,
|
||||||
hasFlashButton: false,
|
hasFlashButton: false,
|
||||||
|
onBackButtonPressed:
|
||||||
|
context.read<ServerInstallationCubit>().revertRecoveryStep,
|
||||||
children: [
|
children: [
|
||||||
CubitFormTextField(
|
CubitFormTextField(
|
||||||
formFieldCubit: context.read<CloudFlareFormCubit>().apiKey,
|
formFieldCubit: context.read<CloudFlareFormCubit>().apiKey,
|
||||||
|
|
|
@ -39,6 +39,9 @@ class _RecoveryConfirmServerState extends State<RecoveryConfirmServer> {
|
||||||
? 'recovering.choose_server_description'.tr()
|
? 'recovering.choose_server_description'.tr()
|
||||||
: 'recovering.confirm_server_description'.tr(),
|
: 'recovering.confirm_server_description'.tr(),
|
||||||
hasBackButton: true,
|
hasBackButton: true,
|
||||||
|
onBackButtonPressed: () {
|
||||||
|
Navigator.of(context).popUntil((final route) => route.isFirst);
|
||||||
|
},
|
||||||
hasFlashButton: false,
|
hasFlashButton: false,
|
||||||
children: [
|
children: [
|
||||||
FutureBuilder<List<ServerBasicInfoWithValidators>>(
|
FutureBuilder<List<ServerBasicInfoWithValidators>>(
|
||||||
|
|
|
@ -32,6 +32,9 @@ class RecoveryHetznerConnected extends StatelessWidget {
|
||||||
),
|
),
|
||||||
hasBackButton: true,
|
hasBackButton: true,
|
||||||
hasFlashButton: false,
|
hasFlashButton: false,
|
||||||
|
onBackButtonPressed: () {
|
||||||
|
Navigator.of(context).popUntil((final route) => route.isFirst);
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
CubitFormTextField(
|
CubitFormTextField(
|
||||||
formFieldCubit: context.read<HetznerFormCubit>().apiKey,
|
formFieldCubit: context.read<HetznerFormCubit>().apiKey,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
name: selfprivacy
|
name: selfprivacy
|
||||||
description: selfprivacy.org
|
description: selfprivacy.org
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
version: 0.6.0+15
|
version: 0.6.1+15
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.17.0 <3.0.0'
|
sdk: '>=2.17.0 <3.0.0'
|
||||||
|
|
Loading…
Reference in a new issue