Skip to content

Commit

Permalink
added REAME, and fixed ci
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Jul 17, 2024
1 parent 889aa47 commit 7079e2c
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 52 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc

- name: Publish
run: npm publish --access restricted
run: npm publish

github_publish:
needs: build
Expand All @@ -74,4 +74,4 @@ jobs:
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
- name: Publish to GitHub registry
run: npm publish --access restricted
run: npm publish
47 changes: 47 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Contributing to Fleetbase
We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:

- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer

## We Develop with Github
We use github to host code, to track issues and feature requests, as well as accept pull requests.

## We Use [Github Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests
Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests:

1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
6. Issue that pull request!

## Any contributions you make will be under the AGPL v3 Software License
In short, when you submit code changes, your submissions are understood to be under the same [AGPL v3](https://choosealicense.com/licenses/agpl-3.0/) that covers the project. Feel free to contact the maintainers if that's a concern.

## Report bugs using Github's [issues](https://github.com/fleetbase/fleetbase/issues)
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/fleetbase/fleetbase/issues), it's that easy!

## Write bug reports with detail, background, and sample code

**Great Bug Reports** tend to have:

- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can.
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)

People *love* thorough bug reports. I'm not even kidding.

## License
By contributing, you agree that your contributions will be licensed under its AGPL v3 Software License.

## References
This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md)
75 changes: 25 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,60 @@
# Fleetbase Verdaccio S3 Storage Plugin
# Fleetbase Verdaccio Authentication Plugin

The Fleetbase Verdaccio S3 Storage Plugin enables the storage of registry files on AWS S3 or similar providers. It is designed to enhance the Verdaccio package registry by providing robust, scalable storage solutions. Additionally, this plugin supports manual uplinks to ensure reliability and accessibility, even when direct downloads from the S3-backed registry encounter issues.
The Fleetbase Verdaccio Authentication Plugin provides robust authentication management for the Fleetbase registry, leveraging the Fleetbase API to authenticate users. This plugin is an essential component of the official Fleetbase registry ([https://registry.fleetbase.io](https://registry.fleetbase.io)), which supports both npm and composer protocols and includes specific enhancements for the Fleetbase ecosystem.

This plugin is integral to the official Fleetbase registry ([https://registry.fleetbase.io](https://registry.fleetbase.io)), a customized Verdaccio instance that supports both npm and composer protocols. It includes specific modifications to serve the unique needs of the Fleetbase ecosystem, particularly for handling Fleetbase extensions.
## Key Features

## Features

- **S3 Storage**: Seamlessly integrates with AWS S3 to store Verdaccio registry files, ensuring scalable and reliable package management.
- **Fallback Uplink Management**: Provides manual uplinks for package retrieval to maintain uptime and access even if the primary S3 connection fails.
- **API-based Authentication**: Integrates directly with the Fleetbase API to authenticate users, ensuring secure access to the registry.
- **Support for Multiple Protocols**: Compatible with both npm and composer protocols, enabling flexible usage across different project types within the Fleetbase ecosystem.

## Installation

To install the plugin, use the following npm command:
To install the plugin, execute the following command in your terminal:

```bash
npm install @fleetbase/verdaccio-fleetbase-s3-storage
npm install @fleetbase/verdaccio-fleetbase-auth
```

## Configuration

After installation, configure the plugin in Verdaccio's `config.yaml` file. Below is a sample configuration snippet:
Configure the plugin by adding the following settings to your Verdaccio server's `config.yaml` file:

```yaml
store:
'@fleetbase/verdaccio-fleetbase-s3-storage':
bucket: fleetbase-registry
keyPrefix: flb
region: ap-southeast-1
endpoint: http://minio:9000
accessKeyId: foobar
secretAccessKey: 1234567e
s3ForcePathStyle: true
auth:
'@fleetbase/verdaccio-fleetbase-auth':
fleetbaseHost: https://api.fleetbase.io
fleetbaseApiKey: 1234567e
```
Replace the placeholder values with your actual S3 bucket details and AWS credentials.
## Environment Variables Configuration
The Fleetbase Verdaccio S3 Storage Plugin can also be configured using environment variables, providing a flexible way to manage configuration without hard-coding sensitive information directly into the `config.yaml` file. Below are the environment variables supported by the plugin:
Ensure that the `fleetbaseHost` and `fleetbaseApiKey` are set to your Fleetbase API host and your specific API key respectively.

- **AWS_BUCKET**: Specifies the S3 bucket name where registry files are stored.
- **AWS_KEY_PREFIX**: Allows specifying a prefix to be added to all keys stored in the bucket, useful for namespacing within the bucket.
- **AWS_ENDPOINT**: Sets the endpoint URL for the S3 API, useful for using S3-compatible services like MinIO.
- **AWS_REGION**: Defines the AWS region where your S3 bucket is located.
- **AWS_ACCESS_KEY_ID**: Your AWS access key ID for authentication.
- **AWS_SECRET_ACCESS_KEY**: Your AWS secret access key for authentication.
- **AWS_SESSION_TOKEN**: The session token for AWS access, necessary if using temporary credentials provided by AWS Security Token Service (STS).
## Environment Variables

These environment variables can be set in your system's environment settings or included in a `.env` file, depending on your deployment setup. Make sure to keep your AWS access keys and session tokens secure and do not expose them in public code repositories.
For additional security and flexibility, you can also configure the plugin using environment variables. Set the following variables in your environment:

Here is an example of how you might set these variables in a `.env` file:

\```plaintext
AWS_BUCKET=fleetbase-registry
AWS_KEY_PREFIX=flb
AWS_ENDPOINT=http://minio:9000
AWS_REGION=ap-southeast-1
AWS_ACCESS_KEY_ID=foobar
AWS_SECRET_ACCESS_KEY=1234567e
AWS_SESSION_TOKEN=your-session-token-here
\```
```plaintext
FLEETBASE_HOST=https://api.fleetbase.io
FLEETBASE_API_KEY=your_fleetbase_api_key_here
```

Ensure that the environment variables are loaded into your environment where Verdaccio runs so that they can be appropriately used by the plugin.
These variables allow you to manage sensitive information outside of the repository, enhancing security.

## Usage

Once configured, Verdaccio will automatically begin using the configured S3 bucket for storing and retrieving package data. Ensure that your AWS credentials and bucket permissions are set correctly to avoid any access issues.
After installation and configuration, the plugin will automatically handle authentication for the Fleetbase registry using the specified API credentials. This process is transparent to end users but requires valid credentials for access.

## Contributing

Contributions to the Fleetbase Verdaccio S3 Storage Plugin are welcome! Please refer to the project's [CONTRIBUTING.md](#) for guidelines on how to make contributions.
Contributions are welcome! If you have suggestions or improvements, please fork the repository and submit a pull request. For detailed instructions, refer to our [CONTRIBUTING.md](CONTRIBUTING.md) file.

## License

This project is licensed under the AGPL v3 License - see the [LICENSE](LICENSE) file for details.
This project is licensed under the AGPL v3 License. See the [LICENSE.md](LICENSE.md) file for more details.

## Support

For support, feature requests, or any queries, please visit the [issues section](https://github.com/fleetbase/verdaccio-fleetbase-s3-storage/issues) of our GitHub repository.
If you encounter any issues or require assistance, please open an issue on our GitHub repository at [https://github.com/fleetbase/verdaccio-fleetbase-auth/issues](https://github.com/fleetbase/verdaccio-fleetbase-auth/issues).

## Acknowledgments

- Thanks to the Verdaccio community for the extensive support and plugins ecosystem.
- Special thanks to the contributors who help maintain and improve this plugin.
- Thanks to the Verdaccio community for providing the foundation for this plugin.

0 comments on commit 7079e2c

Please sign in to comment.