An open API service indexing awesome lists of open source software.

https://github.com/voltstro/verdaccio-az-storage

Azure Storage plugin for Verdaccio
https://github.com/voltstro/verdaccio-az-storage

azure blob plugin storage verdaccio

Last synced: 3 months ago
JSON representation

Azure Storage plugin for Verdaccio

Awesome Lists containing this project

README

          

# verdaccio-az-storage

[![License](https://img.shields.io/github/license/voltstro/verdaccio-az-storage.svg)](https://github.com/Voltstro/verdaccio-az-storage/blob/master/LICENSE.md)
[![NPM](https://img.shields.io/npm/v/verdaccio-az-storage)](https://www.npmjs.com/package/verdaccio-az-storage)
[![Discord](https://img.shields.io/badge/Discord-Voltstro-7289da.svg?logo=discord)](https://discord.voltstro.dev)
[![YouTube](https://img.shields.io/badge/Youtube-Voltstro-red.svg?logo=youtube)](https://www.youtube.com/Voltstro)

[Azure Storage](https://learn.microsoft.com/en-us/azure/storage/common/storage-introduction) plugin for [Verdaccio 6](https://verdaccio.org/).

## Features

- Stores packages and its data in an Azure Storage container
- Cache control settings
- Optionally, store verdaccio's database in Azure App Configuration

## Getting Started

### Prerequisites

- An Azure Storage account with a container
- Verdaccio 6

### Install

Install like any other verdaccio plugin.

```bash
npm install verdaccio-az-storage
```

### Configuration

To use this plugin, you will need to add the plugin to your verdaccio's config store option.

```yaml
store:
az-storage:
# (Required) Connection string for the Azure storage account, can also be set by AZ_STORAGE_CONNECTION_STRING environment variable
connectionString:

# (Required) Name of the container inside of the storage account
containerName: example

# (Optional, default 'packages') Directory in the container to store the packages in
packagesDir: packages

# (Optional) Cache control time (in seconds) for the package data (package.json file)
cachePackageDataTime:

# (Optional) Cache control time (in seconds) for the package it self (tar file)
cachePackageTime:

# (Optional) Connection string for the Azure app configuration, can also be set by AZ_STORAGE_APP_CONFIG_CONNECTION_STRING
appConfigConnectionString:

# (Optional, default 'verdaccio-db') Key name for the value store in app configuration
appConfigKeyName: verdaccio-db

```

### Development

To contribute to this project pull the repo.

#### Dev Containers

Make sure you have Docker / Podman installed. If you are wishing to use AZ CLI context for authentication, you have 2 options:

1) Configure ./devcontainers/.env with your development Azure Subscription ID as below and your local AZ CLI context will be copied into the devcontainer and made active.

```bash
expected_az_context="00000000-0000-0000-0000-000000000000"
```

2) Load devcontainer as per usual and login locally within the devcontainer.

#### Local

1) We use pnpm for package management. Install all packages using install.
```
pnpm install
```

2) Either build the project using the build script, or use VSCode's Run and Debug (which will build the project and have debugging support).

## Authors

* **Voltstro** - *Initial work* - [Voltstro](https://github.com/Voltstro)

## Thanks

- [verdaccio-aws-s3-storage](https://www.npmjs.com/package/verdaccio-aws-s3-storage) - Provided base example on developing a storage plugin for Verdaccio