Code Monkey home page Code Monkey logo

opendata-portal-tools's Introduction

bbnavi open data portal

We run MinIO instance under opendata.bbnavi.de, which serves files with an AWS S3-compatible API.

This MinIO instance can be managed both the Web UI at console.opendata.bbnavi.de and via any S3-compatible command-line tool, e.g. the official mc MinIO Client or the AWS CLI's s3 subcommand.

Note: At least one user's credentials should be stored in our shared password manager; They can be used both via the UI and from the command line.

The MinIO instance itself, as well as its infrastructure, is configured in our shared infrastructure repo.

Usage

The following sections assume that you have installed the official mc MinIO Client. Download mc as documented in their "Quickstart" section and make sure it's in the $PATH.

As an example, we're going to set up the Linux 64-bit binary:

curl https://dl.min.io/client/mc/release/linux-amd64/mc --create-dirs -o bin/mc
export PATH="$PWD/bin:$PATH"
mc --help
# NAME:
#   mc - MinIO Client for cloud storage and filesystems.
#

They also assume that you have admin access to the MinIO instance. Make sure to set $MINIO_ACCESS_KEY and $MINIO_SECRET_KEY appropriately:

read -p 'username/access key of a MinIO user with admin permissions: ' MINIO_ACCESS_KEY
read -p "admin user's password/secret key: " MINIO_SECRET_KEY

# make $MINIO_ACCESS_KEY & $MINIO_SECRET_KEY available to child processes
export MINIO_ACCESS_KEY MINIO_SECRET_KEY

publicly readable buckets

We use one bucket for each organisation that we provide/host data for.

By default, a bucket newly created via the Web UI is private, meaning that only authenticated clients can read its content. To make it readable for everyone, you need to

  • either run mc anonymous set download <alias>/<bucket> manually after creating it, or
  • use the create-minio-public-bucket.sh script, which creates a bucket and allows anonymous downloads.

Configure access to the MinIO instance (see above) and run the script:

./create-minio-public-bucket.sh my-new-bucket

service account for automated publishing

From several data sources' continuous deployment runs, we publish data onto opendata.bbnavi.de in an automated way, using a service account. This section explains how to set up such a service account once on a new MinIO instance.

Note: Once set up, the service account's credentials should be stored in our shared password manager as well, so that team members can set up additional publishing processes.

Configure access to the MinIO instance (see above) and run the create-minio-service-account.sh script:

./create-minio-service-account.sh

The script will

  1. create a policy list-read-upload-delete that allows
    • listing buckets
    • listing & reading all files in every bucket
    • uploading new & overwriting existing files in every bucket
    • deleting files in every bucket
  2. create a user data-uploader with the list-read-upload-delete policy, printing its credentials
  3. create a service account for the data-uploader user, to be used for scripts, printing its credentials

This means that the generated service account will have write access to every bucket.

opendata-portal-tools's People

Contributors

derhuerst avatar

Watchers

Marco Metz avatar Holger Bruch avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.