diff options
author | 2023-09-19 12:22:09 -0700 | |
---|---|---|
committer | 2023-09-19 13:31:31 -0700 | |
commit | ebc7b037ed6e44cd48e0771e446c2cbb5130d888 (patch) | |
tree | d9871b82c304d54906be43c3e38fc3e9a251e202 | |
parent | f4e7f6db7c854d19632a71f8f10027ba1e205e13 (diff) | |
download | bun-ebc7b037ed6e44cd48e0771e446c2cbb5130d888.tar.gz bun-ebc7b037ed6e44cd48e0771e446c2cbb5130d888.tar.zst bun-ebc7b037ed6e44cd48e0771e446c2cbb5130d888.zip |
Update azure guide
-rw-r--r-- | docs/guides/install/azure-artifacts.md | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/docs/guides/install/azure-artifacts.md b/docs/guides/install/azure-artifacts.md index d173c1f81..b1b3cae1d 100644 --- a/docs/guides/install/azure-artifacts.md +++ b/docs/guides/install/azure-artifacts.md @@ -2,6 +2,10 @@ name: Using bun install with an Azure Artifacts npm registry --- +{% callout %} +In [Azure Artifact's](https://learn.microsoft.com/en-us/azure/devops/artifacts/npm/npmrc?view=azure-devops&tabs=windows%2Cclassic) instructions for `.npmrc`, they say to base64 encode the password. Do not do this for `bun install`. Bun will automatically base64 encode the password for you if needed. +{% /callout %} + [Azure Artifacts](https://azure.microsoft.com/en-us/products/devops/artifacts) is a package management system for Azure DevOps. It allows you to host your own private npm registry, npm packages, and other types of packages as well. To use it with `bun install`, add a `bunfig.toml` file to your project with the following contents: @@ -12,6 +16,8 @@ To use it with `bun install`, add a `bunfig.toml` file to your project with the Make sure to replace `my-azure-artifacts-user` with your Azure Artifacts username, such as `jarred1234`. +Set the `$NPM_PASSWORD` environment variable to your Azure Artifacts npm registry password and Bun will automatically replace it with the correct value. You can also choose not to use an environment variable and instead hardcode your password in the `bunfig.toml` file, but be careful not to commit it to source control. + ```toml#bunfig.toml [install.registry] url = "https://pkgs.dev.azure.com/my-azure-artifacts-user/_packaging/my-azure-artifacts-user/npm/registry" @@ -20,44 +26,42 @@ username = "my-azure-artifacts-user" password = "$NPM_PASSWORD" ``` -Set the `$NPM_PASSWORD` environment variable to your Azure Artifacts npm registry password and Bun will automatically replace it with the correct value. You can also choose not to use an environment variable and instead hardcode your password in the `bunfig.toml` file, but be careful not to commit it to source control. - - --- ### Configure with environment variables -You can also use an environment variable to configure Azure Artifacts with bun install. +You can also use an environment variable to configure Azure Artifacts with `bun install`. -Like with the `npm` CLI, the environment variable to use is `NPM_CONFIG_REGISTRY`. - -The URL should include `:username` and `:_password` as query parameters. For example: +Like with the `npm` CLI, the environment variable to use is `NPM_CONFIG_REGISTRY`. The URL should include `:username` and `:_password` as query parameters. Replace `<USERNAME>` and `<PASSWORD>` with the apprropriate values. ```bash#shell -NPM_CONFIG_REGISTRY=https://pkgs.dev.azure.com/my-azure-artifacts-user/_packaging/my-azure-artifacts-user/npm/registry/:username=my-azure-artifacts-user:_password=my-azure-artifacts-password +NPM_CONFIG_REGISTRY=https://pkgs.dev.azure.com/my-azure-artifacts-user/_packaging/my-azure-artifacts-user/npm/registry/:username=<USERNAME>:_password=<PASSWORD> ``` -Make sure to: - -- Replace `my-azure-artifacts-user` with your Azure Artifacts username, such as `jarred1234` -- Replace `my-azure-artifacts-password` with the non-base64 encoded password for your Azure Artifacts npm registry - --- ### Don't base64 encode the password +--- + In [Azure Artifact's](https://learn.microsoft.com/en-us/azure/devops/artifacts/npm/npmrc?view=azure-devops&tabs=windows%2Cclassic) instructions for `.npmrc`, they say to base64 encode the password. Do not do this for `bun install`. Bun will automatically base64 encode the password for you if needed. -To un-base64 encode a password, you can open your browser console and run: +{% callout %} +**Tip** — If it ends with `==`, it probably is base64 encoded. +{% /callout %} + +--- + +To decode a base64-encoded password, open your browser console and run: ```js -atob("base64-encoded-password"); +atob("<base64-encoded password>"); ``` -You can also use the `base64` command line tool, but doing so means it may be saved in your terminal history which is not recommended: +--- + +Alternatively, use the `base64` command line tool, but doing so means it may be saved in your terminal history which is not recommended: ```bash echo "base64-encoded-password" | base64 --decode ``` - -If it ends with `==`, it probably is base64 encoded.
\ No newline at end of file |