From 91fe4487822946b1d93bcd328a200eb4c17e8c1c Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Wed, 1 Mar 2023 16:34:52 +1000 Subject: [PATCH] UI test for change password Help docs --- .../20201013035839_initial_data.sql | 16 +++++++------- .../Navigation/NavigationHeader.tsx | 2 ++ frontend/src/index.scss | 1 + .../src/locale/src/HelpDoc/en/Certificates.md | 22 +++++++++++++++++-- .../src/locale/src/HelpDoc/en/DNSProviders.md | 13 ++++++++++- frontend/src/modals/ChangePasswordModal.tsx | 12 +++++++--- .../cypress/integration/ui/SetupLogin.spec.js | 12 +++++++--- 7 files changed, 61 insertions(+), 17 deletions(-) diff --git a/backend/embed/migrations/20201013035839_initial_data.sql b/backend/embed/migrations/20201013035839_initial_data.sql index 01c43c4..d4e81fa 100644 --- a/backend/embed/migrations/20201013035839_initial_data.sql +++ b/backend/embed/migrations/20201013035839_initial_data.sql @@ -87,6 +87,14 @@ INSERT INTO `certificate_authority` ( 0, 5, 1 +), ( + strftime('%s', 'now'), + strftime('%s', 'now'), + "SSL.com", + "ssl.com", + 0, + 10, + 1 ), ( strftime('%s', 'now'), strftime('%s', 'now'), @@ -103,14 +111,6 @@ INSERT INTO `certificate_authority` ( 0, 5, 1 -), ( - strftime('%s', 'now'), - strftime('%s', 'now'), - "SSL.com", - "ssl.com", - 0, - 10, - 1 ); -- System User diff --git a/frontend/src/components/Navigation/NavigationHeader.tsx b/frontend/src/components/Navigation/NavigationHeader.tsx index f01b3de..474396e 100644 --- a/frontend/src/components/Navigation/NavigationHeader.tsx +++ b/frontend/src/components/Navigation/NavigationHeader.tsx @@ -70,6 +70,7 @@ function NavigationHeader({ } onClick={passwordDisclosure.onOpen}> {intl.formatMessage({ id: "change-password" })} diff --git a/frontend/src/index.scss b/frontend/src/index.scss index fdebb7b..3d0c14c 100644 --- a/frontend/src/index.scss +++ b/frontend/src/index.scss @@ -72,5 +72,6 @@ pre { margin: 0; font-size: var(--chakra-fontSizes-lg); font-weight: var(--chakra-fontWeights-semibold); + color: var(--chakra-colors-teal-500) } } diff --git a/frontend/src/locale/src/HelpDoc/en/Certificates.md b/frontend/src/locale/src/HelpDoc/en/Certificates.md index 6beb55b..ffa7258 100644 --- a/frontend/src/locale/src/HelpDoc/en/Certificates.md +++ b/frontend/src/locale/src/HelpDoc/en/Certificates.md @@ -2,11 +2,25 @@ ## HTTP Certificate -todo +A HTTP validated certificate means that the Certificate Authority (CA) will +attempt to reach your domains over HTTP (not HTTPS!) and if successful, the CA +will issue your certificate. + +For this method, you will have to have a _Host_ created for your domains(s) that +is accessible with HTTP. After a certificate has been given, you can modify the +_Host_ to also use this certificate for HTTPS connections. However, the _Host_ +will still need to be configured for HTTP access in order for the certificate to +renew. ## DNS Certificate -todo +A DNS validated certificate requires you to create a DNS Provider. This DNS +Provider will be used to create temporary records on your domain and then the CA +will query those records to be sure you're the owner and if successful, the CA +will issue your certificate. + +You do not need a _Host_ to be created prior to requesting this type of +certificate. Nor do you need to have your _Host_ configured for HTTP access. ## Custom Certificate @@ -15,3 +29,7 @@ todo ## MKCert Certificate todo + +## Choosing a Certificate Authority + +If you're not sure, use **ZeroSSL.** diff --git a/frontend/src/locale/src/HelpDoc/en/DNSProviders.md b/frontend/src/locale/src/HelpDoc/en/DNSProviders.md index 2b5eef7..b293168 100644 --- a/frontend/src/locale/src/HelpDoc/en/DNSProviders.md +++ b/frontend/src/locale/src/HelpDoc/en/DNSProviders.md @@ -1,3 +1,14 @@ # DNS Providers Help -todo +A DNS Provider is a service that hosts your domain(s) and this will be +specifically used when requesting new _Certificates_ via DNS Validation. + +It is preferred to use DNS Validation, so check if your domain is hosted with +one of the supported Acme.sh providers: + +- [DNS Page 1](https://github.com/acmesh-official/acme.sh/wiki/dnsapi) +- [DNS Page 2](https://github.com/acmesh-official/acme.sh/wiki/dnsapi2) + +Should your DNS Provider be supported by Acme.sh and not available in this +project, please +[open an issue on Github](https://github.com/NginxProxyManager/nginx-proxy-manager/issues/new/choose). diff --git a/frontend/src/modals/ChangePasswordModal.tsx b/frontend/src/modals/ChangePasswordModal.tsx index 9e3fee5..235b47e 100644 --- a/frontend/src/modals/ChangePasswordModal.tsx +++ b/frontend/src/modals/ChangePasswordModal.tsx @@ -76,7 +76,7 @@ function ChangePasswordModal({ isOpen, onClose }: ChangePasswordModalProps) { return errors; }}> {({ isSubmitting, values }: any) => ( -
+ {intl.formatMessage({ id: "change-password" })} @@ -156,10 +156,16 @@ function ChangePasswordModal({ isOpen, onClose }: ChangePasswordModalProps) { - + {intl.formatMessage({ id: "form.save" })} - diff --git a/test/cypress/integration/ui/SetupLogin.spec.js b/test/cypress/integration/ui/SetupLogin.spec.js index e0db4aa..9545220 100644 --- a/test/cypress/integration/ui/SetupLogin.spec.js +++ b/test/cypress/integration/ui/SetupLogin.spec.js @@ -22,14 +22,20 @@ describe('UI Setup and Login', () => { cy.clearLocalStorage(); }); - it('Should be able to login', function() { + it('Should be able to login and change password', function() { cy.visit('/'); cy.get('input[name="email"]').type('cypress@example.com'); cy.get('input[name="password"]').type('changeme'); cy.get('form button:last').click(); - // To fix after chakra change: - // cy.get('.navbar-nav .avatar').should('be.visible'); + // change password + cy.get('button[data-testid="profile-menu"]').should('be.visible').click(); + cy.get('button[data-testid="profile-menu-change-password"]').should('be.visible').click(); + cy.get('input[name="current"]').type('changeme'); + cy.get('input[name="password"]').type('ihavebeenchanged'); + cy.get('input[name="password2"]').type('ihavebeenchanged'); + cy.get('form button[data-testid="save"]').click(); + cy.get('form[data-testid="change-password"]').should('not.exist'); // logout: cy.clearLocalStorage();