Skip to main content

A multi-user/role inventory system

Project description

Opsy

It's Opsy! A simple multi-user/role operations inventory system with aspirations.

Developing

It's recommended to use a virtual environment for development.

$ mkvirtualenv -p /usr/bin/python3.6 opsy

Clone down the opsy repo:

$ git clone git@github.com:objectrocket/opsy.git

Install opsy for development (ensure you are in your previously created virtualenv):

$ pip install --editable .

Create opsy.toml by copying the example config:

$ cp opsy.toml.example opsy.toml

Initialize the DB, the example config uses sqlite by default for development:

$ opsyctl db upgrade

You can now create your admin user and set its password, create a role, then add the user to the role:

$ opsyctl create-admin-user

Each route is protected by a permission for that route. You can get a full list of the permissions by running opsyctl permission-list. Permissions are granted to roles and users gain access to permissions by being in roles. The admin user and role created with the last command are automatically granted full permissions.

We are now ready to start opsy for the first time:

$ opsyctl run

By default it listens on http://127.0.0.1:5000/. You can access the auto generated swagger docs by navigating to http://127.0.0.1:5000/docs/.

Docker image

The included Dockerfile can be used to create a docker image for Opsy. The entrypoint script accepts environment variables to configure Opsy. A full mapping of the variables can be found in scripts/entrypoint.sh, here are the more important ones:

Variable Default Description
OPSY_CREATE_ADMIN_USER true Controls if the admin user should be created.
OPSY_ADMIN_PASSWORD none Password for the admin user. Required if OPSY_CREATE_ADMIN_USER is true.
OPSY_MIGRATE_DB true Controls if the DB schema should be migrated.
OPSY_RUN true Controls if the Opsy app should be started.
OPSY_DATABASE_URI none The connection string for the DB. Required.
OPSY_SECRET_KEY none The secret key. Required.

The Docker image can be built by running make.

Dealing with schema changes

If you are introducing a change that requires a schema change you must create a schema revision. This can be done like so:

$ opsyctl db migrate

This will autogenerate a new revision file under migrations/versions/. Please review the resulting file and make any changes necessary to account for changes that Alembic doesn't do a good job of detecting (things like table renames). Please review the following documentation for more information: https://alembic.sqlalchemy.org/en/latest/autogenerate.html#what-does-autogenerate-detect-and-what-does-it-not-detect

If you are upgrading Opsy and need to migrate to a newer version of the schema you can run the following:

$ opsyctl db upgrade

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Opsy-0.3.1.0rc3.tar.gz (66.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Opsy-0.3.1.0rc3-py3-none-any.whl (43.3 kB view details)

Uploaded Python 3

File details

Details for the file Opsy-0.3.1.0rc3.tar.gz.

File metadata

  • Download URL: Opsy-0.3.1.0rc3.tar.gz
  • Upload date:
  • Size: 66.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.10

File hashes

Hashes for Opsy-0.3.1.0rc3.tar.gz
Algorithm Hash digest
SHA256 5f32c9e2a302fe1eb8ecc275319e99cef1c14101458e550421872569ffcbdc11
MD5 032602d7f89b73dab01ef77c9957a5ab
BLAKE2b-256 62e1eec19e2dc9ae505acc8ed026222d36ee37ea20f27d9cb1d63a22a7608a0f

See more details on using hashes here.

File details

Details for the file Opsy-0.3.1.0rc3-py3-none-any.whl.

File metadata

  • Download URL: Opsy-0.3.1.0rc3-py3-none-any.whl
  • Upload date:
  • Size: 43.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.10

File hashes

Hashes for Opsy-0.3.1.0rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 5fa2f01b7cacac91455c1735fc0618acdceeb063e27b2ae1a639d1b549b8390f
MD5 e0bee82a0a5d3b97a7a025205f268531
BLAKE2b-256 03064468e419e24c5b9cf208e136b9430559121191e357b50a93465a7cfd431d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page