From 12de989df63d0f649db10fbd7dfd6c9b05028b0c Mon Sep 17 00:00:00 2001 From: NaiJi Date: Sat, 31 Dec 2022 10:01:27 +0400 Subject: [PATCH 1/2] docs: Add Digital Ocean how-to markdown --- assets/markdown/how_digital_ocean-en.md | 12 ++++++++++++ assets/markdown/how_digital_ocean-ru.md | 10 ++++++++++ assets/translations/en.json | 2 +- .../setup/initializing/server_provider_picker.dart | 4 ++-- 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 assets/markdown/how_digital_ocean-en.md create mode 100644 assets/markdown/how_digital_ocean-ru.md diff --git a/assets/markdown/how_digital_ocean-en.md b/assets/markdown/how_digital_ocean-en.md new file mode 100644 index 00000000..dc6355c2 --- /dev/null +++ b/assets/markdown/how_digital_ocean-en.md @@ -0,0 +1,12 @@ +### How to get Digital Ocean API Token +1. Visit the following [link](https://cloud.digitalocean.com/) and sign + into newly created account. +2. Enter into previously created project. If you haven't created one, + then please proceed. +3. Go to the "API" link on the left bar. +4. Click on the "Generate New Token". +5. Enter any name for the token. +6. Put expiration time to "No expiry". +7. Check the "Write (optional)" checkbox. +8. Now click on the "Generate Token" button. +9. After that, the token will be shown. Store it in any reliable place, preferably a password manager. \ No newline at end of file diff --git a/assets/markdown/how_digital_ocean-ru.md b/assets/markdown/how_digital_ocean-ru.md new file mode 100644 index 00000000..a4795811 --- /dev/null +++ b/assets/markdown/how_digital_ocean-ru.md @@ -0,0 +1,10 @@ +### How to get Digital Ocean API Token +1. Перейдите по [ссылке](https://cloud.digitalocean.com/) и войдите в ваш аккаунт. +2. Перейдите в новый проект, либо создайте проект, если ещё этого не сделали. +3. Перейдите в "API" раздел в меню слева. +4. Нажмите на "Generate New Token". +5. Введите какое-нибудь имя для токена. +6. Установите время истощения на "No expiry". +7. Проставьте галочку в пункте "Write (optional)". +8. Теперь нажмите на "Generate Token" кнопку внизу. +9. После этого появится ваш токен. Скопируйте его в надёжное место, лучше в ваш собственный менеджер паролей. \ No newline at end of file diff --git a/assets/translations/en.json b/assets/translations/en.json index 9c3d5e6a..6f23654b 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -289,7 +289,7 @@ "select_provider_payment_text_do": "Credit cards, Google Pay, PayPal", "select_provider_email_notice": "E-mail hosting won't be available for new clients. Nevertheless it will be unlocked as soon as you complete your first payment.", "select_provider_site_button": "Visit site", - "connect_to_server_provider": "Autorize in ", + "connect_to_server_provider": "Now log in ", "connect_to_server_provider_text": "With API token SelfPrivacy will be able to rent a machine and setup your server on it", "how": "How to obtain API token", "provider_bad_key_error": "Provider API key is invalid", diff --git a/lib/ui/pages/setup/initializing/server_provider_picker.dart b/lib/ui/pages/setup/initializing/server_provider_picker.dart index bf99863b..9775a945 100644 --- a/lib/ui/pages/setup/initializing/server_provider_picker.dart +++ b/lib/ui/pages/setup/initializing/server_provider_picker.dart @@ -51,7 +51,7 @@ class _ServerProviderPickerState extends State { providerCubit: widget.formCubit, providerInfo: ProviderPageInfo( providerType: ServerProvider.hetzner, - pathToHow: 'hetzner_how', + pathToHow: 'how_hetzner', image: Image.asset( 'assets/images/logos/hetzner.png', width: 150, @@ -64,7 +64,7 @@ class _ServerProviderPickerState extends State { providerCubit: widget.formCubit, providerInfo: ProviderPageInfo( providerType: ServerProvider.digitalOcean, - pathToHow: 'hetzner_how', + pathToHow: 'how_digital_ocean', image: Image.asset( 'assets/images/logos/digital_ocean.png', width: 150, From d1c4aa9fc6f02120082afd503c341306efe54169 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Sat, 31 Dec 2022 09:04:25 +0300 Subject: [PATCH 2/2] feat(about): Add privacy policy and licenses --- assets/translations/en.json | 3 ++- assets/translations/ru.json | 5 +++-- lib/ui/pages/more/about_application.dart | 21 +++++++++++++++++++ .../setup/initializing/initializing.dart | 3 ++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/assets/translations/en.json b/assets/translations/en.json index 6f23654b..0f5f1c99 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -54,7 +54,8 @@ "about_application_page": { "title": "About", "application_version_text": "Application version v.{}", - "api_version_text": "Server API version v.{}" + "api_version_text": "Server API version v.{}", + "privacy_policy": "Privacy policy" }, "application_settings": { "title": "Application settings", diff --git a/assets/translations/ru.json b/assets/translations/ru.json index 3ab94069..f960a85d 100644 --- a/assets/translations/ru.json +++ b/assets/translations/ru.json @@ -54,7 +54,8 @@ "about_application_page": { "title": "О приложении", "application_version_text": "Версия приложения v.{}", - "api_version_text": "Версия API сервера v.{}" + "api_version_text": "Версия API сервера v.{}", + "privacy_policy": "Политика конфиденциальности" }, "application_settings": { "title": "Настройки приложения", @@ -475,4 +476,4 @@ "length_not_equal": "Длина строки [], должно быть равно {}", "length_longer": "Длина строки [], должно быть меньше либо равно {}" } -} \ No newline at end of file +} diff --git a/lib/ui/pages/more/about_application.dart b/lib/ui/pages/more/about_application.dart index ceefd0c7..7a9dc11e 100644 --- a/lib/ui/pages/more/about_application.dart +++ b/lib/ui/pages/more/about_application.dart @@ -5,6 +5,7 @@ import 'package:selfprivacy/ui/components/brand_header/brand_header.dart'; import 'package:selfprivacy/ui/components/brand_text/brand_text.dart'; import 'package:package_info/package_info.dart'; import 'package:easy_localization/easy_localization.dart'; +import 'package:url_launcher/url_launcher.dart'; class AboutApplicationPage extends StatelessWidget { const AboutApplicationPage({super.key}); @@ -37,6 +38,26 @@ class AboutApplicationPage extends StatelessWidget { .tr(args: [snapshot.data.toString()]), ), ), + const SizedBox(height: 10), + // Button to call showAboutDialog + TextButton( + onPressed: () => showAboutDialog( + context: context, + applicationName: 'SelfPrivacy', + applicationLegalese: '© 2022 SelfPrivacy', + // Link to privacy policy + children: [ + TextButton( + onPressed: () => launchUrl( + Uri.parse('https://selfprivacy.ru/privacy-policy'), + mode: LaunchMode.externalApplication, + ), + child: Text('about_application_page.privacy_policy'.tr()), + ), + ], + ), + child: const Text('Show about dialog'), + ), ], ), ), diff --git a/lib/ui/pages/setup/initializing/initializing.dart b/lib/ui/pages/setup/initializing/initializing.dart index 36ddb8e9..72d82520 100644 --- a/lib/ui/pages/setup/initializing/initializing.dart +++ b/lib/ui/pages/setup/initializing/initializing.dart @@ -122,7 +122,8 @@ class InitializingPage extends StatelessWidget { }, ), ), - if (cubit.state is ServerInstallationEmpty) + if (cubit.state is ServerInstallationEmpty || + cubit.state is ServerInstallationNotFinished) Container( alignment: Alignment.center, child: BrandButton.text(