From 521feae535d83166e620c3c28dfc3e7b0314a00e Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Mon, 20 Dec 2021 15:47:17 +0100 Subject: [PATCH] Apply Prettier (#1202) --- .gitattributes | 1 + .github/ISSUE_TEMPLATE/bug.yml | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 14 +- .github/workflows/build.yml | 12 +- .github/workflows/crowndin-pull.yml | 4 +- .github/workflows/release.yml | 58 +- .vscode/launch.json | 4 +- CONTRIBUTING.md | 23 +- README.md | 7 +- SECURITY.md | 2 +- package.json | 2 +- scripts/after-sign.js | 91 +- sign.js | 29 +- src/app/accounts/environment.component.html | 157 +- src/app/accounts/environment.component.ts | 25 +- src/app/accounts/hint.component.html | 47 +- src/app/accounts/hint.component.ts | 31 +- src/app/accounts/lock.component.html | 117 +- src/app/accounts/lock.component.ts | 173 ++- src/app/accounts/login.component.html | 138 +- src/app/accounts/login.component.ts | 207 +-- src/app/accounts/premium.component.html | 149 +- src/app/accounts/premium.component.ts | 32 +- src/app/accounts/register.component.html | 229 ++- src/app/accounts/register.component.ts | 111 +- .../accounts/remove-password.component.html | 40 +- src/app/accounts/remove-password.component.ts | 11 +- src/app/accounts/set-password.component.html | 254 +-- src/app/accounts/set-password.component.ts | 175 ++- src/app/accounts/settings.component.html | 470 +++--- src/app/accounts/settings.component.ts | 663 ++++---- src/app/accounts/sso.component.html | 12 +- src/app/accounts/sso.component.ts | 80 +- .../two-factor-options.component.html | 53 +- .../accounts/two-factor-options.component.ts | 30 +- src/app/accounts/two-factor.component.html | 218 ++- src/app/accounts/two-factor.component.ts | 122 +- .../update-temp-password.component.html | 192 ++- .../update-temp-password.component.ts | 124 +- .../vault-timeout-input.component.html | 56 +- .../accounts/vault-timeout-input.component.ts | 42 +- src/app/app-routing.module.ts | 123 +- src/app/app.component.ts | 990 ++++++------ src/app/app.module.ts | 482 +++--- .../password-reprompt.component.html | 87 +- .../components/password-reprompt.component.ts | 6 +- src/app/components/set-pin.component.html | 103 +- src/app/components/set-pin.component.ts | 8 +- .../verify-master-password.component.html | 61 +- .../verify-master-password.component.ts | 46 +- .../layout/account-switcher.component.html | 64 +- src/app/layout/account-switcher.component.ts | 137 +- src/app/layout/header.component.html | 4 +- src/app/layout/header.component.ts | 9 +- src/app/layout/nav.component.html | 6 +- src/app/layout/nav.component.ts | 34 +- src/app/layout/search/search-bar.service.ts | 51 +- src/app/layout/search/search.component.html | 11 +- src/app/layout/search/search.component.ts | 31 +- src/app/main.ts | 16 +- src/app/send/add-edit.component.html | 463 ++++-- src/app/send/add-edit.component.ts | 89 +- src/app/send/efflux-dates.component.html | 84 +- src/app/send/efflux-dates.component.ts | 57 +- src/app/send/send.component.html | 224 +-- src/app/send/send.component.ts | 228 +-- src/app/services.module.ts | 322 ++-- .../add-edit-custom-fields.component.html | 174 ++- .../vault/add-edit-custom-fields.component.ts | 20 +- src/app/vault/add-edit.component.html | 936 +++++++---- src/app/vault/add-edit.component.ts | 196 +-- src/app/vault/attachments.component.html | 121 +- src/app/vault/attachments.component.ts | 49 +- src/app/vault/ciphers.component.html | 88 +- src/app/vault/ciphers.component.ts | 35 +- src/app/vault/collections.component.html | 74 +- src/app/vault/collections.component.ts | 32 +- src/app/vault/export.component.html | 75 +- src/app/vault/export.component.ts | 111 +- src/app/vault/folder-add-edit.component.html | 97 +- src/app/vault/folder-add-edit.component.ts | 30 +- src/app/vault/groupings.component.html | 242 +-- src/app/vault/groupings.component.ts | 25 +- .../password-generator-history.component.html | 82 +- .../password-generator-history.component.ts | 27 +- .../vault/password-generator.component.html | 354 +++-- src/app/vault/password-generator.component.ts | 27 +- src/app/vault/password-history.component.html | 64 +- src/app/vault/password-history.component.ts | 27 +- src/app/vault/share.component.html | 121 +- src/app/vault/share.component.ts | 43 +- src/app/vault/vault.component.html | 97 +- src/app/vault/vault.component.ts | 1383 +++++++++-------- .../vault/view-custom-fields.component.html | 106 +- src/app/vault/view-custom-fields.component.ts | 20 +- src/app/vault/view.component.html | 659 +++++--- src/app/vault/view.component.ts | 183 ++- src/entry.ts | 48 +- src/global.d.ts | 2 +- src/index.html | 23 +- src/main.ts | 344 ++-- src/main/menu.about.ts | 156 +- src/main/menu.account.ts | 205 ++- src/main/menu.bitwarden.ts | 424 +++-- src/main/menu.edit.ts | 226 +-- src/main/menu.file.ts | 228 +-- src/main/menu.help.ts | 403 ++--- src/main/menu.main.ts | 82 +- src/main/menu.updater.ts | 14 +- src/main/menu.view.ts | 237 ++- src/main/menu.window.ts | 184 +-- src/main/menubar.ts | 169 +- src/main/messaging.main.ts | 253 +-- src/main/nativeMessaging.main.ts | 515 +++--- src/main/powerMonitor.main.ts | 103 +- src/proxy/ipc.ts | 70 +- src/proxy/native-messaging-proxy.ts | 26 +- src/proxy/nativemessage.ts | 144 +- src/scss/base.scss | 144 +- src/scss/box.scss | 816 +++++----- src/scss/buttons.scss | 169 +- src/scss/environment.scss | 94 +- src/scss/grid.scss | 10 +- src/scss/header.scss | 287 ++-- src/scss/list.scss | 251 +-- src/scss/misc.scss | 599 +++---- src/scss/modal.scss | 407 ++--- src/scss/pages.scss | 383 ++--- src/scss/plugins.scss | 352 ++--- src/scss/styles.scss | 2 +- src/scss/variables.scss | 347 +++-- src/scss/vault.scss | 811 +++++----- src/services/i18n.service.ts | 79 +- src/services/loginGuard.service.ts | 35 +- src/services/nativeMessaging.service.ts | 257 +-- src/services/passwordReprompt.service.ts | 8 +- tsconfig.json | 20 +- tsconfig.renderer.json | 8 +- tslint.json | 21 +- webpack.main.js | 142 +- webpack.renderer.js | 226 +-- 141 files changed, 12454 insertions(+), 10311 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..6313b56c57 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 360735f9ed..6754d6d6e5 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -6,7 +6,7 @@ body: attributes: value: | Thanks for taking the time to fill out this bug report! - + Please do not submit feature requests. The [Community Forums](https://community.bitwarden.com) has a section for submitting, voting for, and discussing product feature requests. - type: textarea id: reproduce diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ab2b575450..a4441bfaff 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,5 @@ ## Type of change + - [ ] Bug fix - [ ] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) @@ -6,27 +7,26 @@ - [ ] Other ## Objective + - - ## Code changes + -* **file.ext:** Description of what was changed and why +- **file.ext:** Description of what was changed and why ## Screenshots + - - ## Testing requirements + - - ## Before you submit + - [ ] I have checked for **linting** errors (`npm run lint`) (required) - [ ] This change requires a **documentation update** (notify the documentation team) - [ ] This change has particular **deployment requirements** (notify the DevOps team) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 91c57cf4cf..0b6e0865c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -128,8 +128,8 @@ jobs: - name: Install Node dependencies run: npm ci - # - name: Run linter - # run: npm run lint + - name: Run linter + run: npm run lint - name: Build application run: npm run dist:lin @@ -224,8 +224,8 @@ jobs: - name: Install Node dependencies run: npm ci - # - name: Run linter - # run: npm run lint + - name: Run linter + run: npm run lint - name: Build & Sign (dev) env: @@ -477,8 +477,8 @@ jobs: - name: Install Node dependencies run: npm ci - # - name: Run linter - # run: npm run lint + - name: Run linter + run: npm run lint - name: Build application (dev) run: npm run build diff --git a/.github/workflows/crowndin-pull.yml b/.github/workflows/crowndin-pull.yml index 55d0c8ee3e..623767ae49 100644 --- a/.github/workflows/crowndin-pull.yml +++ b/.github/workflows/crowndin-pull.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: inputs: {} schedule: - - cron: '0 0 * * 5' + - cron: "0 0 * * 5" jobs: crowdin-sync: @@ -15,7 +15,7 @@ jobs: _CROWDIN_PROJECT_ID: "299360" steps: - name: Checkout repo - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - name: Login to Azure uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 97897d9d7d..87265f7331 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: fi - name: Checkout repo - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - name: Get Package Version id: retrieve-version @@ -58,34 +58,34 @@ jobs: branch: ${{ steps.branch.outputs.branch-name }} - name: Create release - uses: ncipollo/release-action@95215a3cb6e6a1908b3c44e00b4fdb15548b1e09 # v2.8.5 + uses: ncipollo/release-action@95215a3cb6e6a1908b3c44e00b4fdb15548b1e09 # v2.8.5 env: PKG_VERSION: ${{ steps.retrieve-version.outputs.package_version }} with: artifacts: "Bitwarden-${{ env.PKG_VERSION }}-amd64.deb, - Bitwarden-${{ env.PKG_VERSION }}-x86_64.rpm, - Bitwarden-${{ env.PKG_VERSION }}-x64.freebsd, - bitwarden_${{ env.PKG_VERSION }}_amd64.snap, - Bitwarden-${{ env.PKG_VERSION }}-x86_64.AppImage, - latest-linux.yml, - Bitwarden-Portable-${{ env.PKG_VERSION }}.exe, - Bitwarden-Installer-${{ env.PKG_VERSION }}.exe, - Bitwarden-${{ env.PKG_VERSION }}-ia32-store.appx, - Bitwarden-${{ env.PKG_VERSION }}-ia32.appx, - Bitwarden-${{ env.PKG_VERSION }}-ia32.nsis.7z, - Bitwarden-${{ env.PKG_VERSION }}-x64-store.appx, - Bitwarden-${{ env.PKG_VERSION }}-x64.appx, - Bitwarden-${{ env.PKG_VERSION }}-x64.nsis.7z, - Bitwarden-${{ env.PKG_VERSION }}-arm64-store.appx, - Bitwarden-${{ env.PKG_VERSION }}-arm64.appx, - Bitwarden-${{ env.PKG_VERSION }}-arm64.nsis.7z, - bitwarden.${{ env.PKG_VERSION }}.nupkg, - latest.yml, - Bitwarden-${{ env.PKG_VERSION }}-universal-mac.zip, - Bitwarden-${{ env.PKG_VERSION }}-universal.dmg, - Bitwarden-${{ env.PKG_VERSION }}-universal.dmg.blockmap, - latest-mac.yml, - Bitwarden-${{ env.PKG_VERSION }}-universal.pkg" + Bitwarden-${{ env.PKG_VERSION }}-x86_64.rpm, + Bitwarden-${{ env.PKG_VERSION }}-x64.freebsd, + bitwarden_${{ env.PKG_VERSION }}_amd64.snap, + Bitwarden-${{ env.PKG_VERSION }}-x86_64.AppImage, + latest-linux.yml, + Bitwarden-Portable-${{ env.PKG_VERSION }}.exe, + Bitwarden-Installer-${{ env.PKG_VERSION }}.exe, + Bitwarden-${{ env.PKG_VERSION }}-ia32-store.appx, + Bitwarden-${{ env.PKG_VERSION }}-ia32.appx, + Bitwarden-${{ env.PKG_VERSION }}-ia32.nsis.7z, + Bitwarden-${{ env.PKG_VERSION }}-x64-store.appx, + Bitwarden-${{ env.PKG_VERSION }}-x64.appx, + Bitwarden-${{ env.PKG_VERSION }}-x64.nsis.7z, + Bitwarden-${{ env.PKG_VERSION }}-arm64-store.appx, + Bitwarden-${{ env.PKG_VERSION }}-arm64.appx, + Bitwarden-${{ env.PKG_VERSION }}-arm64.nsis.7z, + bitwarden.${{ env.PKG_VERSION }}.nupkg, + latest.yml, + Bitwarden-${{ env.PKG_VERSION }}-universal-mac.zip, + Bitwarden-${{ env.PKG_VERSION }}-universal.dmg, + Bitwarden-${{ env.PKG_VERSION }}-universal.dmg.blockmap, + latest-mac.yml, + Bitwarden-${{ env.PKG_VERSION }}-universal.pkg" commit: ${{ github.sha }} tag: v${{ env.PKG_VERSION }} name: Version ${{ env.PKG_VERSION }} @@ -93,7 +93,6 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} draft: true - snap: name: Deploy Snap runs-on: ubuntu-20.04 @@ -102,10 +101,10 @@ jobs: _PKG_VERSION: ${{ needs.setup.outputs.package_version }} steps: - name: Checkout Repo - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - name: Install Snap - uses: samuelmeuli/action-snapcraft@10d7d0a84d9d86098b19f872257df314b0bd8e2d # v1.2.0 + uses: samuelmeuli/action-snapcraft@10d7d0a84d9d86098b19f872257df314b0bd8e2d # v1.2.0 with: snapcraft_token: ${{ secrets.SNAP_TOKEN }} @@ -129,7 +128,6 @@ jobs: snapcraft upload dist/bitwarden_${{ env._PKG_VERSION }}_amd64.snap --release stable snapcraft logout - choco: name: Deploy Choco runs-on: windows-2019 @@ -138,7 +136,7 @@ jobs: _PKG_VERSION: ${{ needs.setup.outputs.package_version }} steps: - name: Checkout Repo - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - name: Setup Chocolatey run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/ diff --git a/.vscode/launch.json b/.vscode/launch.json index 1658421b4e..66c1161be4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,9 +10,7 @@ "windows": { "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd" }, - "args": [ - "." - ] + "args": ["."] } ] } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 068a2f5c6a..7dc1739c00 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,17 +6,12 @@ Please visit our [Community Forums](https://community.bitwarden.com/) for genera Here is how you can get involved: -* **Request a new feature:** Go to the [Feature Requests category](https://community.bitwarden.com/c/feature-requests/) of the Community Forums. Please search existing feature requests before making a new one - -* **Write code for a new feature:** Make a new post in the [Github Contributions category](https://community.bitwarden.com/c/github-contributions/) of the Community Forums. Include a description of your proposed contribution, screeshots, and links to any relevant feature requests. This helps get feedback from the community and Bitwarden team members before you start writing code - -* **Report a bug or submit a bugfix:** Use Github issues and pull requests - -* **Write documentation:** Submit a pull request to the [Bitwarden help repository](https://github.com/bitwarden/help) - -* **Help other users:** Go to the [User-to-User Support category](https://community.bitwarden.com/c/support/) on the Community Forums - -* **Translate:** See the localization (l10n) section below +- **Request a new feature:** Go to the [Feature Requests category](https://community.bitwarden.com/c/feature-requests/) of the Community Forums. Please search existing feature requests before making a new one +- **Write code for a new feature:** Make a new post in the [Github Contributions category](https://community.bitwarden.com/c/github-contributions/) of the Community Forums. Include a description of your proposed contribution, screeshots, and links to any relevant feature requests. This helps get feedback from the community and Bitwarden team members before you start writing code +- **Report a bug or submit a bugfix:** Use Github issues and pull requests +- **Write documentation:** Submit a pull request to the [Bitwarden help repository](https://github.com/bitwarden/help) +- **Help other users:** Go to the [User-to-User Support category](https://community.bitwarden.com/c/support/) on the Community Forums +- **Translate:** See the localization (l10n) section below ## Contributor Agreement @@ -24,9 +19,9 @@ Please sign the [Contributor Agreement](https://cla-assistant.io/bitwarden/deskt ## Pull Request Guidelines -* use `npm run lint` and fix any linting suggestions before submitting a pull request -* commit any pull requests against the `master` branch -* include a link to your Community Forums post +- use `npm run lint` and fix any linting suggestions before submitting a pull request +- commit any pull requests against the `master` branch +- include a link to your Community Forums post # Localization (l10n) diff --git a/README.md b/README.md index 74ffd4a518..554dd1b1b1 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,7 @@ The Bitwarden desktop app is written using Electron and Angular. The application - [Node.js](https://nodejs.org) v16.13.1 (LTS) or greater - NPM v8 -- Windows users: To compile the native node modules used in the app you will need the *Visual C++ toolset*, available through the standard Visual Studio installer. You will also need to install the *Microsoft Build Tools 2015* and *Windows 10 SDK 17134* as additional dependencies in the Visual Studio installer. - +- Windows users: To compile the native node modules used in the app you will need the _Visual C++ toolset_, available through the standard Visual Studio installer. You will also need to install the _Microsoft Build Tools 2015_ and _Windows 10 SDK 17134_ as additional dependencies in the Visual Studio installer. **Run the app** @@ -31,10 +30,10 @@ npm run electron Native Messaging (communication with the browser extension) works by having the browser start a lightweight proxy application baked into our desktop binary. To setup an environment which allows for easy debugging you will need to build the application for distribution, i.e. `npm run dist:`, start the dist version and enable desktop integration. This will write some manifests to disk, Consult the [native manifests](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_manifests#Manifest_location) documentation for more details of the manifest -format, and the exact locations for the different platforms. *Note* that disabling the desktop integration will delete the manifests, and the files will need to be updated again. +format, and the exact locations for the different platforms. _Note_ that disabling the desktop integration will delete the manifests, and the files will need to be updated again. The generated manifests are pre-configured with the production ID for the browser extensions. In order to use them with the development builds, the browser extension ID of the development build -needs to be added to the `allowed_extensions` section of the manifest. These IDs are generated by the browser, and can be found in the extension settings within the browser. +needs to be added to the `allowed_extensions` section of the manifest. These IDs are generated by the browser, and can be found in the extension settings within the browser. It will then be possible to run the desktop application as usual using `npm run electron` and communicate with the browser. diff --git a/SECURITY.md b/SECURITY.md index ef94f0b494..7a055501ad 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -7,7 +7,7 @@ notify us. We welcome working with you to resolve the issue promptly. Thanks in - Let us know as soon as possible upon discovery of a potential security issue, and we'll make every effort to quickly resolve the issue. - Provide us a reasonable amount of time to resolve the issue before any disclosure to the public or a - third-party. We may publicly disclose the issue before resolving it, if appropriate. + third-party. We may publicly disclose the issue before resolving it, if appropriate. - Make a good faith effort to avoid privacy violations, destruction of data, and interruption or degradation of our service. Only interact with accounts you own or with explicit permission of the account holder. diff --git a/package.json b/package.json index e4b42d3682..ab1f6a372f 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "symlink:win": "rm -rf ./jslib && cmd /c mklink /J .\\jslib ..\\jslib", "symlink:mac": "npm run symlink:lin", "symlink:lin": "rm -rf ./jslib && ln -s ../jslib ./jslib", - "lint": "tslint 'src/**/*.ts'", + "lint": "tslint 'src/**/*.ts' && prettier --check .", "lint:fix": "tslint 'src/**/*.ts' --fix", "build": "concurrently -n Main,Rend -c yellow,cyan \"npm run build:main\" \"npm run build:renderer\"", "build:dev": "concurrently -n Main,Rend -c yellow,cyan \"npm run build:main:dev\" \"npm run build:renderer:dev\"", diff --git a/scripts/after-sign.js b/scripts/after-sign.js index 92feb96219..4a8c1ef677 100644 --- a/scripts/after-sign.js +++ b/scripts/after-sign.js @@ -1,53 +1,60 @@ -require('dotenv').config(); -const path = require('path'); -const fse = require('fs-extra'); -const { notarize } = require('electron-notarize'); -const { deepAssign } = require('builder-util'); +require("dotenv").config(); +const path = require("path"); +const fse = require("fs-extra"); +const { notarize } = require("electron-notarize"); +const { deepAssign } = require("builder-util"); exports.default = run; async function run(context) { - console.log('## After sign'); - // console.log(context); + console.log("## After sign"); + // console.log(context); - const appName = context.packager.appInfo.productFilename; - const appPath = `${context.appOutDir}/${appName}.app`; - const macBuild = context.electronPlatformName === 'darwin'; - const copyPlugIn = ['darwin', 'mas'].includes(context.electronPlatformName); + const appName = context.packager.appInfo.productFilename; + const appPath = `${context.appOutDir}/${appName}.app`; + const macBuild = context.electronPlatformName === "darwin"; + const copyPlugIn = ["darwin", "mas"].includes(context.electronPlatformName); - if (copyPlugIn) { - // Copy Safari plugin to work-around https://github.com/electron-userland/electron-builder/issues/5552 - const plugIn = path.join(__dirname, '../PlugIns'); - if (fse.existsSync(plugIn)) { - fse.mkdirSync(path.join(appPath, 'Contents/PlugIns')); - fse.copySync(path.join(plugIn, 'safari.appex'), path.join(appPath, 'Contents/PlugIns/safari.appex')); + if (copyPlugIn) { + // Copy Safari plugin to work-around https://github.com/electron-userland/electron-builder/issues/5552 + const plugIn = path.join(__dirname, "../PlugIns"); + if (fse.existsSync(plugIn)) { + fse.mkdirSync(path.join(appPath, "Contents/PlugIns")); + fse.copySync( + path.join(plugIn, "safari.appex"), + path.join(appPath, "Contents/PlugIns/safari.appex") + ); - // Resign to sign safari extension - if (context.electronPlatformName === 'mas') { - const masBuildOptions = deepAssign({}, context.packager.platformSpecificBuildOptions, context.packager.config.mas); - if (context.targets.some(e => e.name === 'mas-dev')) { - deepAssign(masBuildOptions, { - type: 'development', - }); - } - if (context.packager.packagerOptions.prepackaged == null) { - await context.packager.sign(appPath, context.appOutDir, masBuildOptions, context.arch); - } - } else { - await context.packager.signApp(context, true); - } + // Resign to sign safari extension + if (context.electronPlatformName === "mas") { + const masBuildOptions = deepAssign( + {}, + context.packager.platformSpecificBuildOptions, + context.packager.config.mas + ); + if (context.targets.some((e) => e.name === "mas-dev")) { + deepAssign(masBuildOptions, { + type: "development", + }); } + if (context.packager.packagerOptions.prepackaged == null) { + await context.packager.sign(appPath, context.appOutDir, masBuildOptions, context.arch); + } + } else { + await context.packager.signApp(context, true); + } } + } - if (macBuild) { - console.log('### Notarizing ' + appPath); - const appleId = process.env.APPLE_ID_USERNAME || process.env.APPLEID; - const appleIdPassword = process.env.APPLE_ID_PASSWORD || `@keychain:AC_PASSWORD`; - return await notarize({ - appBundleId: 'com.bitwarden.desktop', - appPath: appPath, - appleId: appleId, - appleIdPassword: appleIdPassword, - }); - } + if (macBuild) { + console.log("### Notarizing " + appPath); + const appleId = process.env.APPLE_ID_USERNAME || process.env.APPLEID; + const appleIdPassword = process.env.APPLE_ID_PASSWORD || `@keychain:AC_PASSWORD`; + return await notarize({ + appBundleId: "com.bitwarden.desktop", + appPath: appPath, + appleId: appleId, + appleIdPassword: appleIdPassword, + }); + } } diff --git a/sign.js b/sign.js index 448ff70596..4d73515a67 100644 --- a/sign.js +++ b/sign.js @@ -1,22 +1,19 @@ -exports.default = async function(configuration) { - if ( - parseInt(process.env.ELECTRON_BUILDER_SIGN) === 1 && - configuration.path.slice(-4) == ".exe" - ) { - console.log(`[*] Signing file: ${configuration.path}`) +exports.default = async function (configuration) { + if (parseInt(process.env.ELECTRON_BUILDER_SIGN) === 1 && configuration.path.slice(-4) == ".exe") { + console.log(`[*] Signing file: ${configuration.path}`); require("child_process").execSync( `azuresigntool sign -v ` + - `-kvu ${process.env.SIGNING_VAULT_URL} ` + - `-kvi ${process.env.SIGNING_CLIENT_ID} ` + - `-kvt ${process.env.SIGNING_TENANT_ID} ` + - `-kvs ${process.env.SIGNING_CLIENT_SECRET} ` + - `-kvc ${process.env.SIGNING_CERT_NAME} ` + - `-fd ${configuration.hash} ` + - `-du ${configuration.site} ` + - `-tr http://timestamp.digicert.com ` + - `${configuration.path}`, + `-kvu ${process.env.SIGNING_VAULT_URL} ` + + `-kvi ${process.env.SIGNING_CLIENT_ID} ` + + `-kvt ${process.env.SIGNING_TENANT_ID} ` + + `-kvs ${process.env.SIGNING_CLIENT_SECRET} ` + + `-kvc ${process.env.SIGNING_CERT_NAME} ` + + `-fd ${configuration.hash} ` + + `-du ${configuration.site} ` + + `-tr http://timestamp.digicert.com ` + + `${configuration.path}`, { - stdio: "inherit" + stdio: "inherit", } ); } diff --git a/src/app/accounts/environment.component.html b/src/app/accounts/environment.component.html index 2327d69c83..87fde99deb 100644 --- a/src/app/accounts/environment.component.html +++ b/src/app/accounts/environment.component.html @@ -1,66 +1,97 @@ -