npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

addax

v1.3.0

Published

Proxy to serve presigned s3 downloads to authenticated users

Downloads

11

Readme

Addax

Simple HTTP proxy to serve private S3 files to authenticated clients.

Installation

npm install -g addax

Getting started

addax exposes the contents of a (configurable) s3 (or MinIO) bucket to HTTP clients. The clients trying to access the files must authenticate themselves providing a token parameter in the url. Each token grants (recursive) access to one (and only one) directory in the bucket. If the request does not have a token or if the provided token does not match the directory in the requested path, the request is denied. If the authentication is successful, addax will generate the corresponding presigned s3 url for the requested file and answer with a redirection.

The commands addax adduser <s3-user-directory> and addax rmuser <s3-user-directory> are used to generate or remove a token for the given directory. is the name of the directory stored in the root of the S3 bucket. It should not contain slashes.

addax adduser user1

To generate a shareable url use addax sign <s3-user-directory> <filepath>. Keep in mind that <filepath> should be relative to <s3-user-directory>.

addax sign user1 some/path/file.txt

To start the server use addax start <port>.

Requirements

addax uses the aws command line interface utilities to generate the presigned urls. For that reason, the aws command must be installed on the system and configured with the correct user account and region. The command aws configure provides an interactive wizard to set up this configuration.

Configuration

In addition to aws, addax need some configuration of its own. The host used for the generated signed urls and the s3 bucket must be specified in the file named config.json inside addax's directory. This file is expected to have the following structure:

{
  "rootPath": "s3-bucket",
  "endpoint": "http://user:pass@localhost:9000",
  "host": "localhost:3000"
}

The property rootPath can take just the name of the s3 bucket("public-files"), or a bucket and a path inside that bucket ("files/shared/public").

The property endpoint must be only included when pointing to a MinIO server. AWS S3 will be used as default if no endpoint is specified.

The property host is used by the addax sign command to generate signed urls. It should be the public domain or IP of the server running addax.

Docker

If you want to run the app with docker just run docker run addax -e AWS_ACCESS_KEY_ID=youraccesskey -e AWS_SECRET_ACCESS_KEY=yoursecretaccesskey. Remember to have auth.json and config.json when you run, either way it will fail.

Also if you dont want to build the container locally you can dowload addax from DockerHub https://hub.docker.com/r/seetransparent/addax