Browse Source

[PIQ-41] Update README and add development helpers (#20)

* Add dev folder, gitignore and user secrets

* Update README and CONTRIBUTING

Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
pull/26/head
Thomas Rittson 4 years ago committed by GitHub
parent
commit
394cbfd82a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      CONTRIBUTING.md
  2. 39
      README.md
  3. 7
      dev/.gitignore
  4. 16
      dev/secrets.json.example
  5. 29
      dev/setup_secrets.ps1

3
CONTRIBUTING.md

@ -0,0 +1,3 @@
# How to Contribute
Our [Contributing Guidelines](https://contributing.bitwarden.com/contributing/) are located in our [Contributing Documentation](https://contributing.bitwarden.com/). The documentation also includes recommended tooling, code style tips, and lots of other great information to get you started.

39
README.md

@ -218,41 +218,6 @@ keyConnectorSettings__certificate__vaultSecretDataKey={SecretDataKey}
keyConnectorSettings__certificate__vaultSecretFilePassword={SecretFilePassword} keyConnectorSettings__certificate__vaultSecretFilePassword={SecretFilePassword}
``` ```
## Build/Run ## Developer Documentation
### Requirements Please refer to the [Key Connector section](https://contributing.bitwarden.com/enterprise/key-connector/) of the [Contributing Documentation](https://contributing.bitwarden.com/) for build instructions, recommended tooling, code style tips, and lots of other great information to get you started.
- [.NET Core 5.0 SDK](https://www.microsoft.com/net/download/core)
*These dependencies are free to use.*
### Format
We use dotnet-format to apply our code style.
```powershell
dotnet tool restore
dotnet tool run dotnet-format
```
### MacOS
MacOS requires updated SSL libraries, otherwise you will receive the error "No usable version of libssl was found".
1. Install [Homebrew](https://brew.sh/)
2. Install the OpenSSL package:
```bash
brew install openssl
```
3. Set the required environment variables to point to the OpenSSL libraries:
```bash
echo 'DYLD_LIBRARY_PATH="/usr/local/opt/openssl@1.1/lib"' >> ~/.zshrc
```
4. If you are running the Key Connector from a terminal, restart your terminal to make sure the updated `.zshrc` settings are applied
### Recommended Development Tooling
- [Visual Studio](https://www.visualstudio.com/vs/) (Windows and macOS)
- [Visual Studio Code](https://code.visualstudio.com/) (other)
*These tools are free to use.*

7
dev/.gitignore vendored

@ -0,0 +1,7 @@
secrets.json
database.json
# Development keys
*.key
*.crt
*.pfx

16
dev/secrets.json.example

@ -0,0 +1,16 @@
{
"keyConnectorSettings": {
"database": {
"provider": "json",
"jsonFilePath": "{pathToThisRepository}/dev/database.json"
},
"rsaKey": {
"provider": "certificate"
},
"certificate": {
"provider": "filesystem",
"filesystemPath": "{pathToThisRepository}/dev/bwkc.pfx",
"filesystemPassword": "{Password}"
}
}
}

29
dev/setup_secrets.ps1

@ -0,0 +1,29 @@
#!/usr/bin/env pwsh
# Helper script for applying the same user secrets to each project
# Duplicated from the server repo
param (
[bool]$clear,
[Parameter(ValueFromRemainingArguments = $true, Position=1)]
$cmdArgs
)
if (!(Test-Path "secrets.json")) {
Write-Warning "No secrets.json file found, please copy and modify the provided example";
exit;
}
if ($clear -eq $true) {
Write-Output "Deleting all existing user secrets"
}
$projects = @{
KeyConnector = "../src/KeyConnector"
}
foreach ($key in $projects.keys) {
if ($clear -eq $true) {
dotnet user-secrets clear -p $projects[$key]
}
$output = Get-Content secrets.json | & dotnet user-secrets set -p $projects[$key]
Write-Output "$output - $key"
}
Loading…
Cancel
Save