Code Monkey home page Code Monkey logo

alexandria's Introduction

alexandria

Build Status Coverage Black License: GPL-3.0-or-later

Our goal is to implement an external document management service to hold and provide uploaded documents. Documents can be uploaded and, depending on user access, managed by internal as well as external users.

The goal is NOT to re implement a complex DMS but rather to have a simple and user-friendly way of managing documents with different permissions.

All User Interface interactions should be as simple as possible and easily understandable.

Original RFC that led to alexandria

Getting started

Installation

Requirements

  • docker
  • docker-compose

After installing and configuring those, download docker-compose.yml and run the following commands:

# only needs to be run once
echo UID=$UID > .env

docker compose up -d

You can now access the api at http://localhost:8000/api/v1/.

Example data

To load a set of categories run the following command:

make load_example_data

Configuration

Alexandria is a 12factor app which means that configuration is stored in environment variables. Different environment variable types are explained at django-environ.

Additional authorization and validation of the models is handled by DGAP.

Common

A list of configuration options which you need

  • Django configuration
    • SECRET_KEY: A secret key used for cryptography. This needs to be a random string of a certain length. See more.
    • ALLOWED_HOSTS: A list of hosts/domains your service will be served from. See more.
    • DATABASE_ENGINE: Database backend to use. See more. (default: django.db.backends.postgresql)
    • DATABASE_HOST: Host to use when connecting to database (default: localhost)
    • DATABASE_PORT: Port to use when connecting to database (default: 5432)
    • DATABASE_NAME: Name of database to use (default: alexandria)
    • DATABASE_USER: Username to use when connecting to the database (default: alexandria)
    • DATABASE_PASSWORD: Password to use when connecting to database
  • Authentication configuration
    • OIDC_OP_USER_ENDPOINT: Userinfo endpoint for OIDC
    • OIDC_VERIFY_SSL: Set to false if you want to disable verifying SSL certs. Useful for development
    • OIDC_DRF_AUTH_BACKEND: Overwrite the default authentication backend with your own
    • ALEXANDRIA_OIDC_USER_FACTORY: Overwrite the default user with your own
    • ALEXANDRIA_CREATED_BY_USER_PROPERTY: Overwrite the default user property which is used for ..._by_user (default: username)
    • ALEXANDRIA_CREATED_BY_GROUP_PROPERTY: Overwrite the default group property which is used for ..._by_group (default: group)
  • Authorization configurations
    • ALEXANDRIA_VISIBILITY_CLASSES: Comma-separated list of DGAP classes that define visibility for all models
    • ALEXANDRIA_PERMISSION_CLASSES: Comma-separated list of DGAP classes that define permissions for all models
  • Data validation configuration
    • ALEXANDRIA_VALIDATION_CLASSES: Comma-separated list of DGAP classes that define custom validations
  • Thumbnail configuration (optional)
    • ALEXANDRIA_ENABLE_THUMBNAIL_GENERATION: Set to false to disable thumbnail generation
      • Check the docker-compose file for an example on how to set up generation with s3 hooks
    • ALEXANDRIA_THUMBNAIL_WIDTH: Width of generated thumbnails
    • ALEXANDRIA_THUMBNAIL_HEIGHT: Height of generated thumbnails
    • ALEXANDRIA_ENABLE_CHECKSUM: Set to false to disable file checksums. Checksums are calculated after upload to allow later verification (not implemented in Alexandria)

For development, you can also set the following environemnt variables to help you:

  • ALEXANDRIA_DEV_AUTH_BACKEND: Set this to "true" to enable a fake auth backend that simulates an authenticated user. Requires DEBUG to be set to True as well.
  • DEBUG: Set this to true for debugging during development. Never enable this in production, as it will leak information to the public if you do.

Contributing

Look at our contributing guidelines to start with your first contribution.

Maintainer's Handbook

Some notes for maintaining this project can be found in the maintainer's handbook.

alexandria's People

Contributors

dependabot[bot] avatar yelinz avatar open-dynamix avatar winged avatar anehx avatar dependabot-preview[bot] avatar czosel avatar trowik avatar velrest avatar stephanh90 avatar fugal-dy avatar hairmare avatar acortino 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.