Coder Social home page Coder Social logo

opencdms-auth's Introduction

OpenCDMS

License: MIT License: CC BY-SA 4.0

Notices

๐Ÿ“Œ Version 1.0 of the OpenCDMS package is expected to be release by the end of 2024

๐Ÿ“Œ OpenCDMS is not a complete Climate Data Management System (CDMS) for users. Instead it is a reuable package/library for CDMS developers

๐Ÿ“Œ OpenCDMS is intentionally minimal, it includes the importable opencdms Python package and a Python web server based on pygeoapi. Other complete CDMS solutions may add extra capabilities that would be needed to use the software in production

๐Ÿ“Œ OpenCDMS supports the WMO Task Team on Climate Data Model (TT-CDM) by providing a Reference Implementation of the WMO Core Climate Data Model - Observations (WCCDM-OBS) and related standards

๐Ÿ“Œ OpenCDMS also aims to support the WMO Task Team on Information Management (ET-IM) by providing a Reference Implementation of standardised web APIs for interacting with WCCDM-OBS and related standards, built on OGC APIs including OGC API - Environmental Data Retrieval and OGC API - Processes.

๐Ÿ“š For more information, please see docs.opencdms.org.

Installation

Details will be added on:

a) Using OpenCDMS as a Python server implementation of WCCDM-OBS and related standards

b) Installing OpenCDMS as an importable Python package

opencdms-auth's People

Contributors

isedwards avatar

Watchers

 avatar

opencdms-auth's Issues

Multi-database/schema initialisation

Initialise multiple databases/schemas from docker compose with a script like: https://stackoverflow.com/a/46668342

Or, implement something along the lines of:

Modify the init.sql script and the Docker Compose file to use environment variables for the passwords:

CREATE USER user1 WITH PASSWORD :user1_password;
CREATE DATABASE db1;
GRANT ALL PRIVILEGES ON DATABASE db1 TO user1;

CREATE USER user2 WITH PASSWORD :user2_password;
CREATE DATABASE db2;
GRANT ALL PRIVILEGES ON DATABASE db2 TO user2;

In this script, :user1_password and :user2_password are placeholders for the actual passwords.

  1. Modify the Docker Compose file:
services:
  postgres:
    image: postgres:13
    volumes:
      - postgres-db-volume:/var/lib/postgresql/data
      - ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
    environment:
      POSTGRES_DB: keycloak
      POSTGRES_USER: keycloak
      POSTGRES_PASSWORD: initpassword
      USER1_PASSWORD: yourpassword1
      USER2_PASSWORD: yourpassword2

In the environment or env_file section, define the actual passwords for users.

Note: Unfortunately, PostgreSQL does not support using variables directly in the SQL scripts like above. To resolve this, we'd need to use a bash script to create the SQL command.

Create a bash script named init.sh in your docker-entrypoint-initdb.d folder with content like this:

#!/bin/bash

set -e

psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
    CREATE USER user1 WITH PASSWORD '$USER1_PASSWORD';
    CREATE DATABASE db1;
    GRANT ALL PRIVILEGES ON DATABASE db1 TO user1;

    CREATE USER user2 WITH PASSWORD '$USER2_PASSWORD';
    CREATE DATABASE db2;
    GRANT ALL PRIVILEGES ON DATABASE db2 TO user2;
EOSQL

The PostgreSQL Docker image runs .sh scripts that are found in /docker-entrypoint-initdb.d directory, as well as .sql scripts. Here, it replaces the USER1_PASSWORD and USER2_PASSWORD with the actual environment variables you set in the docker-compose.yml file.

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.