mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-16 16:23:41 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a35efc4dc | ||
|
|
653f2d4f0d | ||
|
|
508cf1541b | ||
|
|
5c4294b66a |
29
.github/scripts/decrypt-secret.ps1
vendored
Normal file
29
.github/scripts/decrypt-secret.ps1
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
param (
|
||||||
|
[Parameter(Mandatory=$true)]
|
||||||
|
[string] $filename,
|
||||||
|
[string] $output
|
||||||
|
)
|
||||||
|
|
||||||
|
$homePath = Resolve-Path "~" | Select-Object -ExpandProperty Path
|
||||||
|
$rootPath = $env:GITHUB_WORKSPACE
|
||||||
|
|
||||||
|
$secretInputPath = $rootPath + "/.github/secrets"
|
||||||
|
$input = $secretInputPath + "/" + $filename
|
||||||
|
|
||||||
|
$passphrase = $env:DECRYPT_FILE_PASSWORD
|
||||||
|
$secretOutputPath = $homePath + "/secrets"
|
||||||
|
|
||||||
|
if ([string]::IsNullOrEmpty($output)) {
|
||||||
|
if ($filename.EndsWith(".gpg")) {
|
||||||
|
$output = $secretOutputPath + "/" + $filename.TrimEnd(".gpg")
|
||||||
|
} else {
|
||||||
|
$output = $secretOutputPath + "/" + $filename + ".plaintext"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(Test-Path -Path $secretOutputPath))
|
||||||
|
{
|
||||||
|
New-Item -ItemType Directory -Path $secretOutputPath
|
||||||
|
}
|
||||||
|
|
||||||
|
gpg --quiet --batch --yes --decrypt --passphrase="$passphrase" --output $output $input
|
||||||
5
.github/scripts/load-version.ps1
vendored
Normal file
5
.github/scripts/load-version.ps1
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
$rootPath = $env:GITHUB_WORKSPACE;
|
||||||
|
$packageVersion = (Get-Content -Raw -Path $rootPath\src\package.json | ConvertFrom-Json).version;
|
||||||
|
|
||||||
|
Write-Output "Setting package version to $packageVersion";
|
||||||
|
Write-Output "PACKAGE_VERSION=$packageVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append;
|
||||||
7
.github/scripts/macos/decrypt-secrets.ps1
vendored
Normal file
7
.github/scripts/macos/decrypt-secrets.ps1
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
$rootPath = $env:GITHUB_WORKSPACE;
|
||||||
|
|
||||||
|
$decryptSecretPath = $($rootPath + "/.github/scripts/decrypt-secret.ps1");
|
||||||
|
|
||||||
|
Invoke-Expression "& `"$decryptSecretPath`" -filename devid-app-cert.p12.gpg"
|
||||||
|
Invoke-Expression "& `"$decryptSecretPath`" -filename devid-installer-cert.p12.gpg"
|
||||||
|
Invoke-Expression "& `"$decryptSecretPath`" -filename macdev-cert.p12.gpg"
|
||||||
15
.github/scripts/macos/setup-keychain.ps1
vendored
Normal file
15
.github/scripts/macos/setup-keychain.ps1
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
$homePath = Resolve-Path "~" | Select-Object -ExpandProperty Path;
|
||||||
|
$secretsPath = $homePath + "/secrets"
|
||||||
|
|
||||||
|
$devidAppCertPath = $($secretsPath + "/devid-app-cert.p12");
|
||||||
|
$devidInstallerCertPath = $($secretsPath + "/devid-installer-cert.p12");
|
||||||
|
$macdevCertPath = $($secretsPath + "/macdev-cert.p12");
|
||||||
|
|
||||||
|
security create-keychain -p $env:KEYCHAIN_PASSWORD build.keychain
|
||||||
|
security default-keychain -s build.keychain
|
||||||
|
security unlock-keychain -p $env:KEYCHAIN_PASSWORD build.keychain
|
||||||
|
security set-keychain-settings -lut 1200 build.keychain
|
||||||
|
security import $devidAppCertPath -k build.keychain -P $env:DEVID_CERT_PASSWORD -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
||||||
|
security import $devidInstallerCertPath -k build.keychain -P $env:DEVID_CERT_PASSWORD -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
||||||
|
security import $macdevCertPath -k build.keychain -P $env:MACDEV_CERT_PASSWORD -T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
||||||
|
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $env:KEYCHAIN_PASSWORD build.keychain
|
||||||
290
.github/workflows/build.yml
vendored
290
.github/workflows/build.yml
vendored
@@ -5,6 +5,8 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches-ignore:
|
||||||
- 'l10n_master'
|
- 'l10n_master'
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -13,13 +15,12 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
- name: Set up CLOC
|
- name: Set up cloc
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt -y install cloc
|
sudo apt -y install cloc
|
||||||
|
|
||||||
- name: Print lines of code
|
- name: Print lines of code
|
||||||
run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
|
run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
|
||||||
|
|
||||||
@@ -28,16 +29,17 @@ jobs:
|
|||||||
name: Setup
|
name: Setup
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
outputs:
|
outputs:
|
||||||
package_version: ${{ steps.retrieve-version.outputs.package_version }}
|
package_version: ${{ steps.get_version.outputs.package_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
- name: Get Package Version
|
- name: Get Package Version
|
||||||
id: retrieve-version
|
id: get_version
|
||||||
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
PKG_VERSION=$(jq -r .version src/package.json)
|
$env:pkgVersion = (Get-Content -Raw -Path ./src/package.json | ConvertFrom-Json).version
|
||||||
echo "::set-output name=package_version::$PKG_VERSION"
|
echo "::set-output name=package_version::$env:pkgVersion"
|
||||||
|
|
||||||
|
|
||||||
cli:
|
cli:
|
||||||
@@ -46,11 +48,11 @@ jobs:
|
|||||||
needs: setup
|
needs: setup
|
||||||
env:
|
env:
|
||||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
_WIN_PKG_FETCH_VERSION: 14.17.6
|
_WIN_PKG_FETCH_VERSION: 14.17.0
|
||||||
_WIN_PKG_VERSION: 3.2
|
_WIN_PKG_VERSION: 3.1
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
- name: Setup Windows builder
|
- name: Setup Windows builder
|
||||||
run: |
|
run: |
|
||||||
@@ -60,7 +62,7 @@ jobs:
|
|||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
with:
|
with:
|
||||||
node-version: '14'
|
node-version: '14.x'
|
||||||
|
|
||||||
- name: Update NPM
|
- name: Update NPM
|
||||||
run: |
|
run: |
|
||||||
@@ -68,13 +70,6 @@ jobs:
|
|||||||
npm install -g node-gyp
|
npm install -g node-gyp
|
||||||
node-gyp install $(node -v)
|
node-gyp install $(node -v)
|
||||||
|
|
||||||
- name: Setting WIN_PKG
|
|
||||||
run: |
|
|
||||||
echo "WIN_PKG=$env:WIN_PKG" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
||||||
echo "version: $env:pkgVersion"
|
|
||||||
env:
|
|
||||||
WIN_PKG: C:\Users\runneradmin\.pkg-cache\v3.0\fetched-v14.16.1-win-x64
|
|
||||||
|
|
||||||
- name: Get pkg-fetch
|
- name: Get pkg-fetch
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
@@ -83,8 +78,7 @@ jobs:
|
|||||||
|
|
||||||
New-Item -ItemType directory -Path ./.pkg-cache
|
New-Item -ItemType directory -Path ./.pkg-cache
|
||||||
New-Item -ItemType directory -Path ./.pkg-cache/v$env:_WIN_PKG_VERSION
|
New-Item -ItemType directory -Path ./.pkg-cache/v$env:_WIN_PKG_VERSION
|
||||||
Invoke-RestMethod -Uri $fetchedUrl `
|
Invoke-RestMethod -Uri $fetchedUrl -OutFile "./.pkg-cache/v$env:_WIN_PKG_VERSION/fetched-v$env:_WIN_PKG_FETCH_VERSION-win-x64"
|
||||||
-OutFile "./.pkg-cache/v$env:_WIN_PKG_VERSION/fetched-v$env:_WIN_PKG_FETCH_VERSION-win-x64"
|
|
||||||
|
|
||||||
- name: Keytar
|
- name: Keytar
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
@@ -113,40 +107,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Version Info
|
- name: Setup Version Info
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: ./scripts/make-versioninfo.ps1
|
||||||
$major, $minor, $patch = $env:_PACKAGE_VERSION.split('.')
|
|
||||||
|
|
||||||
$versionInfo = @"
|
|
||||||
|
|
||||||
1 VERSIONINFO
|
|
||||||
FILEVERSION $major,$minor,$patch,0
|
|
||||||
PRODUCTVERSION $major,$minor,$patch,0
|
|
||||||
FILEOS 0x40004
|
|
||||||
FILETYPE 0x1
|
|
||||||
{
|
|
||||||
BLOCK "StringFileInfo"
|
|
||||||
{
|
|
||||||
BLOCK "040904b0"
|
|
||||||
{
|
|
||||||
VALUE "CompanyName", "Bitwarden Inc."
|
|
||||||
VALUE "ProductName", "Bitwarden"
|
|
||||||
VALUE "FileDescription", "Bitwarden Directory Connector CLI"
|
|
||||||
VALUE "FileVersion", "$env:_PACKAGE_VERSION"
|
|
||||||
VALUE "ProductVersion", "$env:_PACKAGE_VERSION"
|
|
||||||
VALUE "OriginalFilename", "bwdc.exe"
|
|
||||||
VALUE "InternalName", "bwdc"
|
|
||||||
VALUE "LegalCopyright", "Copyright Bitwarden Inc."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BLOCK "VarFileInfo"
|
|
||||||
{
|
|
||||||
VALUE "Translation", 0x0409 0x04B0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"@
|
|
||||||
|
|
||||||
$versionInfo | Out-File ./version-info.rc
|
|
||||||
|
|
||||||
- name: Resource Hacker
|
- name: Resource Hacker
|
||||||
shell: cmd
|
shell: cmd
|
||||||
@@ -191,65 +152,54 @@ jobs:
|
|||||||
checksum -f="./dist-cli/bwdc-linux-${env:_PACKAGE_VERSION}.zip" `
|
checksum -f="./dist-cli/bwdc-linux-${env:_PACKAGE_VERSION}.zip" `
|
||||||
-t sha256 | Out-File ./dist-cli/bwdc-linux-sha256-${env:_PACKAGE_VERSION}.txt
|
-t sha256 | Out-File ./dist-cli/bwdc-linux-sha256-${env:_PACKAGE_VERSION}.txt
|
||||||
|
|
||||||
- name: Upload Windows Zip to GitHub
|
- name: Upload windows zip to GitHub
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: bwdc-windows-${{ env._PACKAGE_VERSION }}.zip
|
name: bwdc-windows-${{ env._PACKAGE_VERSION }}.zip
|
||||||
path: ./dist-cli/bwdc-windows-${{ env._PACKAGE_VERSION }}.zip
|
path: ./dist-cli/bwdc-windows-${{ env._PACKAGE_VERSION }}.zip
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
- name: Upload Mac Zip to GitHub
|
- name: Upload mac zip to GitHub
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: bwdc-macos-${{ env._PACKAGE_VERSION }}.zip
|
name: bwdc-macos-${{ env._PACKAGE_VERSION }}.zip
|
||||||
path: ./dist-cli/bwdc-macos-${{ env._PACKAGE_VERSION }}.zip
|
path: ./dist-cli/bwdc-macos-${{ env._PACKAGE_VERSION }}.zip
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
- name: Upload Linux Zip to GitHub
|
- name: Upload linux zip to GitHub
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: bwdc-linux-${{ env._PACKAGE_VERSION }}.zip
|
name: bwdc-linux-${{ env._PACKAGE_VERSION }}.zip
|
||||||
path: ./dist-cli/bwdc-linux-${{ env._PACKAGE_VERSION }}.zip
|
path: ./dist-cli/bwdc-linux-${{ env._PACKAGE_VERSION }}.zip
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
- name: Upload Windows checksum to GitHub
|
- name: Upload windows checksum to GitHub
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt
|
name: bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||||
path: ./dist-cli/bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt
|
path: ./dist-cli/bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
- name: Upload Mac checksum to GitHub
|
- name: Upload mac checksum to GitHub
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt
|
name: bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||||
path: ./dist-cli/bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt
|
path: ./dist-cli/bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
- name: Upload Linux checksum to GitHub
|
- name: Upload linux checksum to GitHub
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt
|
name: bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||||
path: ./dist-cli/bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt
|
path: ./dist-cli/bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
|
|
||||||
windows-gui:
|
windows_gui:
|
||||||
name: Windows GUI
|
name: Windows GUI
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
needs: setup
|
needs: setup
|
||||||
env:
|
env:
|
||||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Set up .NET
|
|
||||||
uses: actions/setup-dotnet@a71d1eb2c86af85faa8c772c03fb365e377e45ea
|
|
||||||
with:
|
|
||||||
dotnet-version: "3.1.x"
|
|
||||||
|
|
||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
with:
|
with:
|
||||||
node-version: '14'
|
node-version: '14.x'
|
||||||
|
|
||||||
- name: Update NPM
|
- name: Update NPM
|
||||||
run: |
|
run: |
|
||||||
@@ -271,7 +221,7 @@ jobs:
|
|||||||
uses: bitwarden/gh-actions/install-ast@f135c42c8596cb535c5bcb7523c0b2eef89709ac
|
uses: bitwarden/gh-actions/install-ast@f135c42c8596cb535c5bcb7523c0b2eef89709ac
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
- name: Install Node dependencies
|
- name: Install Node dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
@@ -292,26 +242,17 @@ jobs:
|
|||||||
- name: List Dist
|
- name: List Dist
|
||||||
run: dir ./dist
|
run: dir ./dist
|
||||||
|
|
||||||
- name: Upload Portable Executable to GitHub
|
- name: Publish Portable Exe to GitHub
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: Bitwarden-Connector-Portable-${{ env._PACKAGE_VERSION }}.exe
|
name: Bitwarden-Connector-Portable-${{ env._PACKAGE_VERSION }}.exe
|
||||||
path: ./dist/Bitwarden-Connector-Portable-${{ env._PACKAGE_VERSION }}.exe
|
path: ./dist/Bitwarden-Connector-Portable-${{ env._PACKAGE_VERSION }}.exe
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
- name: Upload Installer Executable to GitHub
|
- name: Publish Installer Exe to GitHub
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: Bitwarden-Connector-Installer-${{ env._PACKAGE_VERSION }}.exe
|
name: Bitwarden-Connector-Installer-${{ env._PACKAGE_VERSION }}.exe
|
||||||
path: ./dist/Bitwarden-Connector-Installer-${{ env._PACKAGE_VERSION }}.exe
|
path: ./dist/Bitwarden-Connector-Installer-${{ env._PACKAGE_VERSION }}.exe
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
- name: Upload latest auto-update artifact
|
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
|
||||||
with:
|
|
||||||
name: latest.yml
|
|
||||||
path: ./dist/latest.yml
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
@@ -324,7 +265,7 @@ jobs:
|
|||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
with:
|
with:
|
||||||
node-version: '14'
|
node-version: '14.x'
|
||||||
|
|
||||||
- name: Update NPM
|
- name: Update NPM
|
||||||
run: |
|
run: |
|
||||||
@@ -342,30 +283,22 @@ jobs:
|
|||||||
sudo apt-get -y install rpm
|
sudo apt-get -y install rpm
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
- name: NPM Install
|
- name: NPM install
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
- name: NPM Rebuild
|
- name: NPM rebuild
|
||||||
run: npm run rebuild
|
run: npm run rebuild
|
||||||
|
|
||||||
- name: NPM Package
|
- name: NPM package
|
||||||
run: npm run dist:lin
|
run: npm run dist:lin
|
||||||
|
|
||||||
- name: Upload AppImage
|
- name: Publish AppImage
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-x86_64.AppImage
|
name: Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-x86_64.AppImage
|
||||||
path: ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-x86_64.AppImage
|
path: ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-x86_64.AppImage
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
- name: Upload latest auto-update artifact
|
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
|
||||||
with:
|
|
||||||
name: latest-linux.yml
|
|
||||||
path: ./dist/latest-linux.yml
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
@@ -378,7 +311,7 @@ jobs:
|
|||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
with:
|
with:
|
||||||
node-version: '14'
|
node-version: '14.x'
|
||||||
|
|
||||||
- name: Update NPM
|
- name: Update NPM
|
||||||
run: |
|
run: |
|
||||||
@@ -393,58 +326,32 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
node --version
|
node --version
|
||||||
npm --version
|
npm --version
|
||||||
echo "GitHub ref: $GITHUB_REF"
|
Write-Output "GitHub ref: $env:GITHUB_REF"
|
||||||
echo "GitHub event: $GITHUB_EVENT"
|
Write-Output "GitHub event: $env:GITHUB_EVENT"
|
||||||
shell: bash
|
shell: pwsh
|
||||||
|
env:
|
||||||
|
GITHUB_REF: ${{ github.ref }}
|
||||||
|
GITHUB_EVENT: ${{ github.event_name }}
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
- name: Decrypt secrets
|
- name: Decrypt secrets
|
||||||
|
run: ./.github/scripts/macos/decrypt-secrets.ps1
|
||||||
|
shell: pwsh
|
||||||
env:
|
env:
|
||||||
DECRYPT_FILE_PASSWORD: ${{ secrets.DECRYPT_FILE_PASSWORD }}
|
DECRYPT_FILE_PASSWORD: ${{ secrets.DECRYPT_FILE_PASSWORD }}
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
mkdir -p $HOME/secrets
|
|
||||||
|
|
||||||
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
|
|
||||||
--output "$HOME/secrets/devid-app-cert.p12" \
|
|
||||||
"$GITHUB_WORKSPACE/.github/secrets/devid-app-cert.p12.gpg"
|
|
||||||
|
|
||||||
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
|
|
||||||
--output "$HOME/secrets/devid-installer-cert.p12" \
|
|
||||||
"$GITHUB_WORKSPACE/.github/secrets/devid-installer-cert.p12.gpg"
|
|
||||||
|
|
||||||
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
|
|
||||||
--output "$HOME/secrets/macdev-cert.p12" \
|
|
||||||
"$GITHUB_WORKSPACE/.github/secrets/macdev-cert.p12.gpg"
|
|
||||||
|
|
||||||
- name: Set up keychain
|
- name: Set up keychain
|
||||||
|
run: ./.github/scripts/macos/setup-keychain.ps1
|
||||||
|
shell: pwsh
|
||||||
env:
|
env:
|
||||||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
||||||
DEVID_CERT_PASSWORD: ${{ secrets.DEVID_CERT_PASSWORD }}
|
DEVID_CERT_PASSWORD: ${{ secrets.DEVID_CERT_PASSWORD }}
|
||||||
MACDEV_CERT_PASSWORD: ${{ secrets.MACDEV_CERT_PASSWORD }}
|
MACDEV_CERT_PASSWORD: ${{ secrets.MACDEV_CERT_PASSWORD }}
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
security create-keychain -p $KEYCHAIN_PASSWORD build.keychain
|
|
||||||
security default-keychain -s build.keychain
|
|
||||||
security unlock-keychain -p $KEYCHAIN_PASSWORD build.keychain
|
|
||||||
security set-keychain-settings -lut 1200 build.keychain
|
|
||||||
security import "$HOME/secrets/devid-app-cert.p12" -k build.keychain -P $DEVID_CERT_PASSWORD \
|
|
||||||
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
|
||||||
security import "$HOME/secrets/devid-installer-cert.p12" -k build.keychain -P $DEVID_CERT_PASSWORD \
|
|
||||||
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
|
||||||
security import "$HOME/secrets/macdev-cert.p12" -k build.keychain -P $MACDEV_CERT_PASSWORD \
|
|
||||||
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
|
||||||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PASSWORD build.keychain
|
|
||||||
|
|
||||||
- name: Load package version
|
- name: Load package version
|
||||||
run: |
|
run: ./.github/scripts/load-version.ps1
|
||||||
$rootPath = $env:GITHUB_WORKSPACE;
|
|
||||||
$packageVersion = (Get-Content -Raw -Path $rootPath\src\package.json | ConvertFrom-Json).version;
|
|
||||||
|
|
||||||
Write-Output "Setting package version to $packageVersion";
|
|
||||||
Write-Output "PACKAGE_VERSION=$packageVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append;
|
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|
||||||
- name: Install Node dependencies
|
- name: Install Node dependencies
|
||||||
@@ -453,94 +360,27 @@ jobs:
|
|||||||
- name: Run linter
|
- name: Run linter
|
||||||
run: npm run lint
|
run: npm run lint
|
||||||
|
|
||||||
- name: Build application
|
- name: Build application (dev)
|
||||||
|
if: github.ref != 'refs/heads/master'
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Build application (dist)
|
||||||
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
run: npm run dist:mac
|
run: npm run dist:mac
|
||||||
env:
|
env:
|
||||||
APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }}
|
APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }}
|
||||||
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
||||||
|
|
||||||
- name: Rename Zip Artifact
|
|
||||||
run: |
|
|
||||||
cd dist
|
|
||||||
mv "Bitwarden Directory Connector-${{ env._PACKAGE_VERSION }}-mac.zip" \
|
|
||||||
"Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-mac.zip"
|
|
||||||
|
|
||||||
- name: Upload .zip artifact
|
- name: Upload .zip artifact
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-mac.zip
|
name: Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-mac.zip
|
||||||
path: ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-mac.zip
|
path: ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-mac.zip
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
- name: Upload .dmg artifact
|
- name: Upload .dmg artifact
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
|
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
|
||||||
with:
|
with:
|
||||||
name: Bitwarden-Connector-${{ env._PACKAGE_VERSION }}.dmg
|
name: Bitwarden-Connector-${{ env._PACKAGE_VERSION }}.dmg
|
||||||
path: ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}.dmg
|
path: ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}.dmg
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
- name: Upload latest auto-update artifact
|
|
||||||
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3
|
|
||||||
with:
|
|
||||||
name: latest-mac.yml
|
|
||||||
path: ./dist/latest-mac.yml
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
|
|
||||||
check-failures:
|
|
||||||
name: Check for failures
|
|
||||||
if: always()
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
needs:
|
|
||||||
- cloc
|
|
||||||
- setup
|
|
||||||
- cli
|
|
||||||
- windows-gui
|
|
||||||
- linux
|
|
||||||
- macos
|
|
||||||
steps:
|
|
||||||
- name: Check if any job failed
|
|
||||||
if: ${{ (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/rc') }}
|
|
||||||
env:
|
|
||||||
CLOC_STATUS: ${{ needs.cloc.result }}
|
|
||||||
SETUP_STATUS: ${{ needs.setup.result }}
|
|
||||||
CLI_STATUS: ${{ needs.cli.result }}
|
|
||||||
WINDOWS_GUI_STATUS: ${{ needs.windows-gui.result }}
|
|
||||||
LINUX_STATUS: ${{ needs.linux.result }}
|
|
||||||
MACOS_STATUS: ${{ needs.macos.result }}
|
|
||||||
run: |
|
|
||||||
if [ "$CLOC_STATUS" = "failure" ]; then
|
|
||||||
exit 1
|
|
||||||
elif [ "$SETUP_STATUS" = "failure" ]; then
|
|
||||||
exit 1
|
|
||||||
elif [ "$CLI_STATUS" = "failure" ]; then
|
|
||||||
exit 1
|
|
||||||
elif [ "$WINDOWS_GUI_STATUS" = "failure" ]; then
|
|
||||||
exit 1
|
|
||||||
elif [ "$LINUX_STATUS" = "failure" ]; then
|
|
||||||
exit 1
|
|
||||||
elif [ "$MACOS_STATUS" = "failure" ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Login to Azure - Prod Subscription
|
|
||||||
uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
|
||||||
|
|
||||||
- name: Retrieve secrets
|
|
||||||
id: retrieve-secrets
|
|
||||||
uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
keyvault: "bitwarden-prod-kv"
|
|
||||||
secrets: "devops-alerts-slack-webhook-url"
|
|
||||||
|
|
||||||
- name: Notify Slack on failure
|
|
||||||
uses: act10ns/slack@e4e71685b9b239384b0f676a63c32367f59c2522 # v1.2.2
|
|
||||||
if: failure()
|
|
||||||
env:
|
|
||||||
SLACK_WEBHOOK_URL: ${{ steps.retrieve-secrets.outputs.devops-alerts-slack-webhook-url }}
|
|
||||||
with:
|
|
||||||
status: ${{ job.status }}
|
|
||||||
|
|||||||
329
.github/workflows/release.yml
vendored
329
.github/workflows/release.yml
vendored
@@ -3,76 +3,313 @@ name: Release
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
release_tag_name_input:
|
||||||
|
description: "Release Tag Name <X.X.X>"
|
||||||
|
required: true
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
setup:
|
||||||
name: Setup
|
name: Setup
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
outputs:
|
||||||
|
package_version: ${{ steps.create_tags.outputs.package_version }}
|
||||||
|
tag_version: ${{ steps.create_tags.outputs.tag_version }}
|
||||||
|
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
steps:
|
steps:
|
||||||
- name: Branch check
|
- name: Branch check
|
||||||
run: |
|
run: |
|
||||||
if [[ "$GITHUB_REF" != "refs/heads/release" ]]; then
|
if [[ "$GITHUB_REF" != "refs/heads/rc" ]]; then
|
||||||
echo "==================================="
|
echo "==================================="
|
||||||
echo "[!] Can only release from the 'release' branch"
|
echo "[!] Can only release from rc branch"
|
||||||
echo "==================================="
|
echo "==================================="
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
with:
|
|
||||||
ref: release
|
|
||||||
|
|
||||||
- name: Retrieve Directory Connector release version
|
- name: Create Release Vars
|
||||||
id: retrieve-version
|
id: create_tags
|
||||||
run: |
|
run: |
|
||||||
PKG_VERSION=$(jq -r .version src/package.json)
|
case "${RELEASE_TAG_NAME_INPUT:0:1}" in
|
||||||
echo "::set-output name=package_version::$PKG_VERSION"
|
v)
|
||||||
|
echo "RELEASE_NAME=${RELEASE_TAG_NAME_INPUT:1}" >> $GITHUB_ENV
|
||||||
|
echo "RELEASE_TAG_NAME=$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV
|
||||||
|
echo "::set-output name=package_version::${RELEASE_TAG_NAME_INPUT:1}"
|
||||||
|
echo "::set-output name=tag_version::$RELEASE_TAG_NAME_INPUT"
|
||||||
|
;;
|
||||||
|
[0-9])
|
||||||
|
echo "RELEASE_NAME=$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV
|
||||||
|
echo "RELEASE_TAG_NAME=v$RELEASE_TAG_NAME_INPUT" >> $GITHUB_ENV
|
||||||
|
echo "::set-output name=package_version::$RELEASE_TAG_NAME_INPUT"
|
||||||
|
echo "::set-output name=tag_version::v$RELEASE_TAG_NAME_INPUT"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
env:
|
||||||
|
RELEASE_TAG_NAME_INPUT: ${{ github.event.inputs.release_tag_name_input }}
|
||||||
|
|
||||||
- name: Check to make sure Mobile release version has been bumped
|
- name: Create Draft Release
|
||||||
|
id: create_release
|
||||||
|
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
with:
|
||||||
latest_ver=$(hub release -L 1 -f '%T')
|
tag_name: ${{ env.RELEASE_TAG_NAME }}
|
||||||
latest_ver=${latest_ver:1}
|
release_name: ${{ env.RELEASE_NAME }}
|
||||||
echo "Latest version: $latest_ver"
|
draft: true
|
||||||
ver=${{ steps.retrieve-version.outputs.package_version }}
|
prerelease: false
|
||||||
echo "Version: $ver"
|
|
||||||
if [ "$latest_ver" = "$ver" ]; then
|
|
||||||
echo "Version has not been bumped!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Download all artifacts
|
cli:
|
||||||
uses: bitwarden/gh-actions/download-artifacts@23433be15ed6fd046ce12b6889c5184a8d9c8783
|
name: CLI
|
||||||
|
runs-on: windows-2019
|
||||||
|
needs: setup
|
||||||
|
env:
|
||||||
|
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
|
- name: Download latest RC build artifacts
|
||||||
|
uses: dawidd6/action-download-artifact@b9571484721e8187f1fd08147b497129f8972c74 # v2.14.0
|
||||||
with:
|
with:
|
||||||
workflow: build.yml
|
workflow: build.yml
|
||||||
workflow_conclusion: success
|
workflow_conclusion: success
|
||||||
branch: release
|
branch: rc
|
||||||
|
path: ./dist-cli
|
||||||
|
|
||||||
- name: Create release
|
- name: Upload Windows zip release asset
|
||||||
uses: ncipollo/release-action@95215a3cb6e6a1908b3c44e00b4fdb15548b1e09 # v2.8.5
|
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
||||||
env:
|
env:
|
||||||
PKG_VERSION: ${{ steps.retrieve-version.outputs.package_version }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
artifacts: "./bwdc-windows-${{ env.PKG_VERSION }}.zip,
|
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
||||||
./bwdc-macos-${{ env.PKG_VERSION }}.zip,
|
asset_path: ./dist-cli/bwdc-windows-${{ env._PACKAGE_VERSION }}.zip/bwdc-windows-${{ env._PACKAGE_VERSION }}.zip
|
||||||
./bwdc-linux-${{ env.PKG_VERSION }}.zip,
|
asset_name: bwdc-windows-${{ env._PACKAGE_VERSION }}.zip
|
||||||
./bwdc-windows-sha256-${{ env.PKG_VERSION }}.txt,
|
asset_content_type: application/zip
|
||||||
./bwdc-macos-sha256-${{ env.PKG_VERSION }}.txt,
|
|
||||||
./bwdc-linux-sha256-${{ env.PKG_VERSION }}.txt,
|
- name: Upload MacOS zip release asset
|
||||||
./Bitwarden-Connector-Portable-${{ env.PKG_VERSION }}.exe,
|
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
||||||
./Bitwarden-Connector-Installer-${{ env.PKG_VERSION }}.exe,
|
env:
|
||||||
./Bitwarden-Connector-${{ env.PKG_VERSION }}-x86_64.AppImage,
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
./Bitwarden-Connector-${{ env.PKG_VERSION }}-mac.zip,
|
with:
|
||||||
./Bitwarden-Connector-${{ env.PKG_VERSION }}.dmg,
|
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
||||||
./latest-linux.yml,
|
asset_path: ./dist-cli/bwdc-macos-${{ env._PACKAGE_VERSION }}.zip/bwdc-macos-${{ env._PACKAGE_VERSION }}.zip
|
||||||
./latest-mac.yml,
|
asset_name: bwdc-macos-${{ env._PACKAGE_VERSION }}.zip
|
||||||
./latest.yml"
|
asset_content_type: application/zip
|
||||||
commit: ${{ github.sha }}
|
|
||||||
tag: v${{ env.PKG_VERSION }}
|
- name: Upload Linux zip release asset
|
||||||
name: Version ${{ env.PKG_VERSION }}
|
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
||||||
body: "<insert release notes here>"
|
env:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
draft: true
|
with:
|
||||||
|
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
||||||
|
asset_path: ./dist-cli/bwdc-linux-${{ env._PACKAGE_VERSION }}.zip/bwdc-linux-${{ env._PACKAGE_VERSION }}.zip
|
||||||
|
asset_name: bwdc-linux-${{ env._PACKAGE_VERSION }}.zip
|
||||||
|
asset_content_type: application/zip
|
||||||
|
|
||||||
|
- name: Upload Windows checksum release asset
|
||||||
|
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
||||||
|
asset_path: ./dist-cli/bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt/bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||||
|
asset_name: bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||||
|
asset_content_type: text/plain
|
||||||
|
|
||||||
|
- name: Upload MacOS checksum release asset
|
||||||
|
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
||||||
|
asset_path: ./dist-cli/bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt/bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||||
|
asset_name: bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||||
|
asset_content_type: text/plain
|
||||||
|
|
||||||
|
- name: Upload Linux checksum release asset
|
||||||
|
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ needs.setup.outputs.release_upload_url }}
|
||||||
|
asset_path: ./dist-cli/bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt/bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||||
|
asset_name: bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||||
|
asset_content_type: text/plain
|
||||||
|
|
||||||
|
|
||||||
|
windows-gui:
|
||||||
|
name: Windows GUI
|
||||||
|
runs-on: windows-2019
|
||||||
|
needs: setup
|
||||||
|
env:
|
||||||
|
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
|
steps:
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
|
with:
|
||||||
|
node-version: '14.x'
|
||||||
|
|
||||||
|
- name: Update NPM
|
||||||
|
run: |
|
||||||
|
npm install -g npm@7
|
||||||
|
npm install -g node-gyp
|
||||||
|
node-gyp install $(node -v)
|
||||||
|
|
||||||
|
- name: Set Node options
|
||||||
|
run: echo "NODE_OPTIONS=--max_old_space_size=4096" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
|
- name: Print environment
|
||||||
|
run: |
|
||||||
|
node --version
|
||||||
|
npm --version
|
||||||
|
dotnet --version
|
||||||
|
|
||||||
|
- name: Install AST
|
||||||
|
uses: bitwarden/gh-actions/install-ast@f135c42c8596cb535c5bcb7523c0b2eef89709ac
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
|
- name: Install Node dependencies
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Run linter
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: NPM rebuild
|
||||||
|
run: npm run rebuild
|
||||||
|
|
||||||
|
- name: Build & Sign
|
||||||
|
run: |
|
||||||
|
npm run publish:win
|
||||||
|
env:
|
||||||
|
ELECTRON_BUILDER_SIGN: 1
|
||||||
|
SIGNING_VAULT_URL: ${{ secrets.SIGNING_VAULT_URL }}
|
||||||
|
SIGNING_CLIENT_ID: ${{ secrets.SIGNING_CLIENT_ID }}
|
||||||
|
SIGNING_TENANT_ID: ${{ secrets.SIGNING_TENANT_ID }}
|
||||||
|
SIGNING_CLIENT_SECRET: ${{ secrets.SIGNING_CLIENT_SECRET }}
|
||||||
|
SIGNING_CERT_NAME: ${{ secrets.SIGNING_CERT_NAME }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|
||||||
|
linux:
|
||||||
|
name: Linux
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
needs: setup
|
||||||
|
env:
|
||||||
|
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
|
steps:
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
|
with:
|
||||||
|
node-version: '14.x'
|
||||||
|
|
||||||
|
- name: Update NPM
|
||||||
|
run: |
|
||||||
|
npm install -g npm@7
|
||||||
|
npm install -g node-gyp
|
||||||
|
node-gyp install $(node -v)
|
||||||
|
|
||||||
|
- name: Set Node options
|
||||||
|
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Set up environment
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get -y install pkg-config libxss-dev libsecret-1-dev
|
||||||
|
sudo apt-get -y install rpm
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
|
- name: Set Package version
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
$env:pkgVersion = (Get-Content -Raw -Path ./src/package.json | ConvertFrom-Json).version
|
||||||
|
echo "_PACKAGE_VERSION=$env:pkgVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
echo "version: $env:pkgVersion"
|
||||||
|
|
||||||
|
- name: NPM install
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: NPM rebuild
|
||||||
|
run: npm run rebuild
|
||||||
|
|
||||||
|
- name: NPM package
|
||||||
|
run: npm run publish:lin
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|
||||||
|
macos:
|
||||||
|
name: MacOS
|
||||||
|
runs-on: macos-11
|
||||||
|
needs: setup
|
||||||
|
env:
|
||||||
|
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
|
steps:
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
|
with:
|
||||||
|
node-version: '14.x'
|
||||||
|
|
||||||
|
- name: Update NPM
|
||||||
|
run: |
|
||||||
|
npm install -g npm@7
|
||||||
|
npm install -g node-gyp
|
||||||
|
node-gyp install $(node -v)
|
||||||
|
|
||||||
|
- name: Set Node options
|
||||||
|
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Print environment
|
||||||
|
run: |
|
||||||
|
node --version
|
||||||
|
npm --version
|
||||||
|
Write-Output "GitHub ref: $env:GITHUB_REF"
|
||||||
|
Write-Output "GitHub event: $env:GITHUB_EVENT"
|
||||||
|
shell: pwsh
|
||||||
|
env:
|
||||||
|
GITHUB_REF: ${{ github.ref }}
|
||||||
|
GITHUB_EVENT: ${{ github.event_name }}
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
|
- name: Decrypt secrets
|
||||||
|
run: ./.github/scripts/macos/decrypt-secrets.ps1
|
||||||
|
shell: pwsh
|
||||||
|
env:
|
||||||
|
DECRYPT_FILE_PASSWORD: ${{ secrets.DECRYPT_FILE_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Set up keychain
|
||||||
|
run: ./.github/scripts/macos/setup-keychain.ps1
|
||||||
|
shell: pwsh
|
||||||
|
env:
|
||||||
|
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
||||||
|
DEVID_CERT_PASSWORD: ${{ secrets.DEVID_CERT_PASSWORD }}
|
||||||
|
MACDEV_CERT_PASSWORD: ${{ secrets.MACDEV_CERT_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Load package version
|
||||||
|
run: ./.github/scripts/load-version.ps1
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
|
- name: Install Node dependencies
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Run linter
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: Build application (dist)
|
||||||
|
run: npm run publish:mac
|
||||||
|
env:
|
||||||
|
APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }}
|
||||||
|
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
25
gulpfile.js
Normal file
25
gulpfile.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
const gulp = require('gulp');
|
||||||
|
const googleWebFonts = require('gulp-google-webfonts');
|
||||||
|
const del = require('del');
|
||||||
|
|
||||||
|
const paths = {
|
||||||
|
cssDir: './src/css/',
|
||||||
|
};
|
||||||
|
|
||||||
|
function clean() {
|
||||||
|
return del([paths.cssDir]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function webfonts() {
|
||||||
|
return gulp.src('./webfonts.list')
|
||||||
|
.pipe(googleWebFonts({
|
||||||
|
fontsDir: 'webfonts',
|
||||||
|
cssFilename: 'webfonts.css',
|
||||||
|
format: 'woff',
|
||||||
|
}))
|
||||||
|
.pipe(gulp.dest(paths.cssDir));
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.clean = clean;
|
||||||
|
exports.webfonts = gulp.series(clean, webfonts);
|
||||||
|
exports['prebuild:renderer'] = webfonts;;
|
||||||
2
jslib
2
jslib
Submodule jslib updated: cb00604617...c70c8ecc24
13184
package-lock.json
generated
13184
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@@ -31,8 +31,8 @@
|
|||||||
"lint:fix": "tslint 'src/**/*.ts' --fix",
|
"lint:fix": "tslint 'src/**/*.ts' --fix",
|
||||||
"build": "concurrently -n Main,Rend -c yellow,cyan \"npm run build:main\" \"npm run build:renderer\"",
|
"build": "concurrently -n Main,Rend -c yellow,cyan \"npm run build:main\" \"npm run build:renderer\"",
|
||||||
"build:main": "webpack --config webpack.main.js",
|
"build:main": "webpack --config webpack.main.js",
|
||||||
"build:renderer": "webpack --config webpack.renderer.js",
|
"build:renderer": "gulp prebuild:renderer && webpack --config webpack.renderer.js",
|
||||||
"build:renderer:watch": "webpack --config webpack.renderer.js --watch",
|
"build:renderer:watch": "gulp prebuild:renderer && webpack --config webpack.renderer.js --watch",
|
||||||
"build:dist": "npm run reset && npm run rebuild && npm run build",
|
"build:dist": "npm run reset && npm run rebuild && npm run build",
|
||||||
"build:cli": "webpack --config webpack.cli.js",
|
"build:cli": "webpack --config webpack.cli.js",
|
||||||
"build:cli:watch": "webpack --config webpack.cli.js --watch",
|
"build:cli:watch": "webpack --config webpack.cli.js --watch",
|
||||||
@@ -144,12 +144,14 @@
|
|||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"css-loader": "^5.2.4",
|
"css-loader": "^5.2.4",
|
||||||
"del": "^6.0.0",
|
"del": "^6.0.0",
|
||||||
"electron-builder": "^22.11.7",
|
"electron-builder": "^22.10.5",
|
||||||
"electron-notarize": "^1.1.1",
|
"electron-notarize": "^1.0.0",
|
||||||
"electron-rebuild": "^3.2.3",
|
"electron-rebuild": "^2.3.5",
|
||||||
"electron-reload": "^1.5.0",
|
"electron-reload": "^1.5.0",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
"font-awesome": "4.7.0",
|
"font-awesome": "4.7.0",
|
||||||
|
"gulp": "^4.0.2",
|
||||||
|
"gulp-google-webfonts": "^4.0.0",
|
||||||
"html-loader": "^1.3.2",
|
"html-loader": "^1.3.2",
|
||||||
"html-webpack-plugin": "^4.5.1",
|
"html-webpack-plugin": "^4.5.1",
|
||||||
"mini-css-extract-plugin": "^1.5.0",
|
"mini-css-extract-plugin": "^1.5.0",
|
||||||
|
|||||||
33
scripts/make-versioninfo.ps1
Normal file
33
scripts/make-versioninfo.ps1
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
$major, $minor, $patch = $env:_PACKAGE_VERSION.split('.')
|
||||||
|
|
||||||
|
$versionInfo = @"
|
||||||
|
|
||||||
|
1 VERSIONINFO
|
||||||
|
FILEVERSION $major,$minor,$patch,0
|
||||||
|
PRODUCTVERSION $major,$minor,$patch,0
|
||||||
|
FILEOS 0x40004
|
||||||
|
FILETYPE 0x1
|
||||||
|
{
|
||||||
|
BLOCK "StringFileInfo"
|
||||||
|
{
|
||||||
|
BLOCK "040904b0"
|
||||||
|
{
|
||||||
|
VALUE "CompanyName", "Bitwarden Inc."
|
||||||
|
VALUE "ProductName", "Bitwarden"
|
||||||
|
VALUE "FileDescription", "Bitwarden Directory Connector CLI"
|
||||||
|
VALUE "FileVersion", "$env:_PACKAGE_VERSION"
|
||||||
|
VALUE "ProductVersion", "$env:_PACKAGE_VERSION"
|
||||||
|
VALUE "OriginalFilename", "bwdc.exe"
|
||||||
|
VALUE "InternalName", "bwdc"
|
||||||
|
VALUE "LegalCopyright", "Copyright Bitwarden Inc."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BLOCK "VarFileInfo"
|
||||||
|
{
|
||||||
|
VALUE "Translation", 0x0409 0x04B0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"@
|
||||||
|
|
||||||
|
$versionInfo | Out-File ./version-info.rc
|
||||||
@@ -14,8 +14,7 @@ import { AuthService } from 'jslib-common/abstractions/auth.service';
|
|||||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
|
|
||||||
import { ModalService } from 'jslib-angular/services/modal.service';
|
import { ModalComponent } from 'jslib-angular/components/modal.component';
|
||||||
|
|
||||||
import { Utils } from 'jslib-common/misc/utils';
|
import { Utils } from 'jslib-common/misc/utils';
|
||||||
import { ConfigurationService } from '../../services/configuration.service';
|
import { ConfigurationService } from '../../services/configuration.service';
|
||||||
|
|
||||||
@@ -34,8 +33,7 @@ export class ApiKeyComponent {
|
|||||||
|
|
||||||
constructor(private authService: AuthService, private apiKeyService: ApiKeyService, private router: Router,
|
constructor(private authService: AuthService, private apiKeyService: ApiKeyService, private router: Router,
|
||||||
private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,
|
private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,
|
||||||
private configurationService: ConfigurationService, private platformUtilsService: PlatformUtilsService,
|
private configurationService: ConfigurationService, private platformUtilsService: PlatformUtilsService) { }
|
||||||
private modalService: ModalService) { }
|
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
if (this.clientId == null || this.clientId === '') {
|
if (this.clientId == null || this.clientId === '') {
|
||||||
@@ -70,11 +68,14 @@ export class ApiKeyComponent {
|
|||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
async settings() {
|
settings() {
|
||||||
const [modalRef, childComponent] = await this.modalService.openViewRef(EnvironmentComponent, this.environmentModal);
|
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||||
|
const modal = this.environmentModal.createComponent(factory).instance;
|
||||||
|
const childComponent = modal.show<EnvironmentComponent>(EnvironmentComponent,
|
||||||
|
this.environmentModal);
|
||||||
|
|
||||||
childComponent.onSaved.subscribe(() => {
|
childComponent.onSaved.subscribe(() => {
|
||||||
modalRef.close();
|
modal.close();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
toggleSecret() {
|
toggleSecret() {
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import {
|
|||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
|
import { ModalComponent } from 'jslib-angular/components/modal.component';
|
||||||
|
|
||||||
import { BroadcasterService } from 'jslib-angular/services/broadcaster.service';
|
import { BroadcasterService } from 'jslib-angular/services/broadcaster.service';
|
||||||
|
|
||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
@@ -54,6 +56,7 @@ export class AppComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
private lastActivity: number = null;
|
private lastActivity: number = null;
|
||||||
|
private modal: ModalComponent = null;
|
||||||
|
|
||||||
constructor(private broadcasterService: BroadcasterService, private userService: UserService,
|
constructor(private broadcasterService: BroadcasterService, private userService: UserService,
|
||||||
private tokenService: TokenService, private storageService: StorageService,
|
private tokenService: TokenService, private storageService: StorageService,
|
||||||
@@ -143,6 +146,20 @@ export class AppComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private openModal<T>(type: Type<T>, ref: ViewContainerRef) {
|
||||||
|
if (this.modal != null) {
|
||||||
|
this.modal.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||||
|
this.modal = ref.createComponent(factory).instance;
|
||||||
|
const childComponent = this.modal.show<T>(type, ref);
|
||||||
|
|
||||||
|
this.modal.onClosed.subscribe(() => {
|
||||||
|
this.modal = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private showToast(msg: any) {
|
private showToast(msg: any) {
|
||||||
const toast: Toast = {
|
const toast: Toast = {
|
||||||
type: msg.type,
|
type: msg.type,
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { AppComponent } from './app.component';
|
|||||||
|
|
||||||
import { CalloutComponent } from 'jslib-angular/components/callout.component';
|
import { CalloutComponent } from 'jslib-angular/components/callout.component';
|
||||||
import { IconComponent } from 'jslib-angular/components/icon.component';
|
import { IconComponent } from 'jslib-angular/components/icon.component';
|
||||||
|
import { ModalComponent } from 'jslib-angular/components/modal.component';
|
||||||
|
|
||||||
import { ApiKeyComponent } from './accounts/apiKey.component';
|
import { ApiKeyComponent } from './accounts/apiKey.component';
|
||||||
import { EnvironmentComponent } from './accounts/environment.component';
|
import { EnvironmentComponent } from './accounts/environment.component';
|
||||||
@@ -58,6 +59,7 @@ import { SearchCiphersPipe } from 'jslib-angular/pipes/search-ciphers.pipe';
|
|||||||
FallbackSrcDirective,
|
FallbackSrcDirective,
|
||||||
I18nPipe,
|
I18nPipe,
|
||||||
IconComponent,
|
IconComponent,
|
||||||
|
ModalComponent,
|
||||||
MoreComponent,
|
MoreComponent,
|
||||||
SearchCiphersPipe,
|
SearchCiphersPipe,
|
||||||
SettingsComponent,
|
SettingsComponent,
|
||||||
@@ -65,6 +67,10 @@ import { SearchCiphersPipe } from 'jslib-angular/pipes/search-ciphers.pipe';
|
|||||||
StopPropDirective,
|
StopPropDirective,
|
||||||
TabsComponent,
|
TabsComponent,
|
||||||
],
|
],
|
||||||
|
entryComponents: [
|
||||||
|
EnvironmentComponent,
|
||||||
|
ModalComponent,
|
||||||
|
],
|
||||||
providers: [],
|
providers: [],
|
||||||
bootstrap: [AppComponent],
|
bootstrap: [AppComponent],
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import { I18nService } from '../../services/i18n.service';
|
|||||||
import { SyncService } from '../../services/sync.service';
|
import { SyncService } from '../../services/sync.service';
|
||||||
|
|
||||||
import { BroadcasterService } from 'jslib-angular/services/broadcaster.service';
|
import { BroadcasterService } from 'jslib-angular/services/broadcaster.service';
|
||||||
import { ModalService } from 'jslib-angular/services/modal.service';
|
|
||||||
import { ValidationService } from 'jslib-angular/services/validation.service';
|
import { ValidationService } from 'jslib-angular/services/validation.service';
|
||||||
|
|
||||||
import { ApiKeyService } from 'jslib-common/services/apiKey.service';
|
import { ApiKeyService } from 'jslib-common/services/apiKey.service';
|
||||||
@@ -132,7 +131,6 @@ export function initFactory(): Function {
|
|||||||
ValidationService,
|
ValidationService,
|
||||||
AuthGuardService,
|
AuthGuardService,
|
||||||
LaunchGuardService,
|
LaunchGuardService,
|
||||||
ModalService,
|
|
||||||
{ provide: AuthServiceAbstraction, useValue: authService },
|
{ provide: AuthServiceAbstraction, useValue: authService },
|
||||||
{ provide: EnvironmentServiceAbstraction, useValue: environmentService },
|
{ provide: EnvironmentServiceAbstraction, useValue: environmentService },
|
||||||
{ provide: TokenServiceAbstraction, useValue: tokenService },
|
{ provide: TokenServiceAbstraction, useValue: tokenService },
|
||||||
|
|||||||
@@ -93,10 +93,7 @@ export class Main {
|
|||||||
this.messagingService = new NoopMessagingService();
|
this.messagingService = new NoopMessagingService();
|
||||||
this.environmentService = new EnvironmentService(this.storageService);
|
this.environmentService = new EnvironmentService(this.storageService);
|
||||||
this.apiService = new NodeApiService(this.tokenService, this.platformUtilsService, this.environmentService,
|
this.apiService = new NodeApiService(this.tokenService, this.platformUtilsService, this.environmentService,
|
||||||
() => refreshToken(this.apiKeyService, this.authService), async (expired: boolean) => await this.logout(),
|
() => refreshToken(this.apiKeyService, this.authService), async (expired: boolean) => await this.logout());
|
||||||
'Bitwarden_DC/' + this.platformUtilsService.getApplicationVersion() +
|
|
||||||
' (' + this.platformUtilsService.getDeviceString().toUpperCase() + ')', (clientId, clientSecret) =>
|
|
||||||
this.authService.logInApiKey(clientId, clientSecret));
|
|
||||||
this.apiKeyService = new ApiKeyService(this.tokenService, this.storageService);
|
this.apiKeyService = new ApiKeyService(this.tokenService, this.storageService);
|
||||||
this.userService = new UserService(this.tokenService, this.storageService);
|
this.userService = new UserService(this.tokenService, this.storageService);
|
||||||
this.containerService = new ContainerService(this.cryptoService);
|
this.containerService = new ContainerService(this.cryptoService);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "bitwarden-directory-connector",
|
"name": "bitwarden-directory-connector",
|
||||||
"productName": "Bitwarden Directory Connector",
|
"productName": "Bitwarden Directory Connector",
|
||||||
"description": "Sync your user directory to your Bitwarden organization.",
|
"description": "Sync your user directory to your Bitwarden organization.",
|
||||||
"version": "2.9.7",
|
"version": "2.9.6",
|
||||||
"author": "Bitwarden Inc. <hello@bitwarden.com> (https://bitwarden.com)",
|
"author": "Bitwarden Inc. <hello@bitwarden.com> (https://bitwarden.com)",
|
||||||
"homepage": "https://bitwarden.com",
|
"homepage": "https://bitwarden.com",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@import "../../jslib/angular/src/scss/webfonts.css";
|
@import "../css/webfonts.css";
|
||||||
@import "bootstrap.scss";
|
@import "bootstrap.scss";
|
||||||
@import "pages.scss";
|
@import "pages.scss";
|
||||||
@import "misc.scss";
|
@import "misc.scss";
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { VaultTimeoutService } from 'jslib-common/abstractions/vaultTimeout.serv
|
|||||||
|
|
||||||
import { AuthService as AuthServiceBase } from 'jslib-common/services/auth.service';
|
import { AuthService as AuthServiceBase } from 'jslib-common/services/auth.service';
|
||||||
|
|
||||||
import { AuthResult } from 'jslib-common/models/domain/authResult';
|
import { AuthResult } from 'jslib-common/models/domain';
|
||||||
import { DeviceRequest } from 'jslib-common/models/request/deviceRequest';
|
import { DeviceRequest } from 'jslib-common/models/request/deviceRequest';
|
||||||
import { TokenRequest } from 'jslib-common/models/request/tokenRequest';
|
import { TokenRequest } from 'jslib-common/models/request/tokenRequest';
|
||||||
import { IdentityTokenResponse } from 'jslib-common/models/response/identityTokenResponse';
|
import { IdentityTokenResponse } from 'jslib-common/models/response/identityTokenResponse';
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ export class AzureDirectoryService extends BaseDirectoryService implements IDire
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const entry = this.buildUser(user);
|
const entry = this.buildUser(user);
|
||||||
if (!entry.deleted) {
|
if (!entry.disabled && !entry.deleted) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (await this.filterOutUserResult(setFilter, entry, false)) {
|
if (await this.filterOutUserResult(setFilter, entry, false)) {
|
||||||
@@ -427,7 +427,7 @@ export class AzureDirectoryService extends BaseDirectoryService implements IDire
|
|||||||
console.error(d.error_description);
|
console.error(d.error_description);
|
||||||
done(err, null);
|
done(err, null);
|
||||||
} else {
|
} else {
|
||||||
const err = new Error('Unknown error (' + res.statusCode + ').');
|
const err = new Error('Unknown error (' + res.statusCode + ').')
|
||||||
done(err, null);
|
done(err, null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import { NodeApiService as NodeApiServiceBase } from 'jslib-node/services/nodeAp
|
|||||||
export class NodeApiService extends NodeApiServiceBase {
|
export class NodeApiService extends NodeApiServiceBase {
|
||||||
constructor(tokenService: TokenService, platformUtilsService: PlatformUtilsService, environmentService: EnvironmentService,
|
constructor(tokenService: TokenService, platformUtilsService: PlatformUtilsService, environmentService: EnvironmentService,
|
||||||
private refreshTokenCallback: () => Promise<void>, logoutCallback: (expired: boolean) => Promise<void>,
|
private refreshTokenCallback: () => Promise<void>, logoutCallback: (expired: boolean) => Promise<void>,
|
||||||
customUserAgent: string = null, apiKeyRefresh: (clientId: string, clientSecret: string) => Promise<any>) {
|
customUserAgent: string = null) {
|
||||||
super(tokenService, platformUtilsService, environmentService, logoutCallback, customUserAgent, apiKeyRefresh);
|
super(tokenService, platformUtilsService, environmentService, logoutCallback, customUserAgent);
|
||||||
}
|
}
|
||||||
|
|
||||||
doRefreshToken(): Promise<void> {
|
doRefreshToken(): Promise<void> {
|
||||||
|
|||||||
@@ -57,7 +57,13 @@ export class SyncService {
|
|||||||
this.flattenUsersToGroups(groups, groups);
|
this.flattenUsersToGroups(groups, groups);
|
||||||
}
|
}
|
||||||
|
|
||||||
users = this.removeDuplicateUsers(users);
|
const duplicateEmails = this.findDuplicateUserEmails(users);
|
||||||
|
if (duplicateEmails.length > 0) {
|
||||||
|
const emailsMessage = duplicateEmails.length < 4 ?
|
||||||
|
duplicateEmails.join('\n') :
|
||||||
|
duplicateEmails.slice(0, 3).join('\n') + '\n' + this.i18nService.t('andMore', `${duplicateEmails.length - 3}`);
|
||||||
|
throw new Error(this.i18nService.t('duplicateEmails') + '\n' + emailsMessage);
|
||||||
|
}
|
||||||
|
|
||||||
if (test || (!syncConfig.overwriteExisting &&
|
if (test || (!syncConfig.overwriteExisting &&
|
||||||
(groups == null || groups.length === 0) && (users == null || users.length === 0))) {
|
(groups == null || groups.length === 0) && (users == null || users.length === 0))) {
|
||||||
@@ -112,32 +118,17 @@ export class SyncService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private removeDuplicateUsers(users: UserEntry[]) {
|
private findDuplicateUserEmails(users: UserEntry[]) {
|
||||||
const uniqueUsers = new Array<UserEntry>();
|
const duplicatedEmails = new Array<string>();
|
||||||
const processedUsers = new Map<string, string>();
|
users.reduce((agg, user) => {
|
||||||
const duplicateEmails = new Array<string>();
|
if (agg.includes(user.email) && !duplicatedEmails.includes(user.email)) {
|
||||||
|
duplicatedEmails.push(user.email);
|
||||||
// UserEntrys with the same email are ignored if their properties are the same
|
|
||||||
// UserEntrys with the same email but different properties will throw an error
|
|
||||||
users.forEach(u => {
|
|
||||||
if (processedUsers.has(u.email)) {
|
|
||||||
if (processedUsers.get(u.email) != JSON.stringify(u)) {
|
|
||||||
duplicateEmails.push(u.email);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
uniqueUsers.push(u);
|
agg.push(user.email);
|
||||||
processedUsers.set(u.email, JSON.stringify(u));
|
|
||||||
}
|
}
|
||||||
});
|
return agg;
|
||||||
|
}, new Array<string>());
|
||||||
if (duplicateEmails.length > 0) {
|
return duplicatedEmails;
|
||||||
const emailsMessage = duplicateEmails.length < 4 ?
|
|
||||||
duplicateEmails.join('\n') :
|
|
||||||
duplicateEmails.slice(0, 3).join('\n') + '\n' + this.i18nService.t('andMore', `${duplicateEmails.length - 3}`);
|
|
||||||
throw new Error(this.i18nService.t('duplicateEmails') + '\n' + emailsMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
return uniqueUsers;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private filterUnsupportedUsers(users: UserEntry[]): UserEntry[] {
|
private filterUnsupportedUsers(users: UserEntry[]): UserEntry[] {
|
||||||
|
|||||||
1
webfonts.list
Normal file
1
webfonts.list
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext
|
||||||
Reference in New Issue
Block a user