Metadata-Version: 2.1
Name: Opsy
Version: 0.3.1.0rc0
Summary: A multi-user/role inventory system
Home-page: https://github.com/testeddoughnut/opsy
Author: Opsy
License: MIT
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: Flask
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: System :: Systems Administration
Description-Content-Type: text/markdown
Requires-Dist: aiohttp (==3.5.1)
Requires-Dist: apispec (==2.0.2)
Requires-Dist: cheroot (==8.0.0)
Requires-Dist: Flask (==1.1.1)
Requires-Dist: flask-allows (==0.7.1)
Requires-Dist: flask-apispec (==0.8.4)
Requires-Dist: Flask-JSGlue (==0.3.1)
Requires-Dist: flask-ldap3-login (==0.9.16)
Requires-Dist: Flask-Login (==0.4.1)
Requires-Dist: flask-marshmallow (==0.10.1)
Requires-Dist: Flask-Migrate (==2.5.2)
Requires-Dist: Flask-SQLAlchemy (==2.4.0)
Requires-Dist: marshmallow (==3.2.1)
Requires-Dist: marshmallow-sqlalchemy (==0.17.0)
Requires-Dist: pbr (==5.1.1)
Requires-Dist: prometheus-flask-exporter (==0.12.1)
Requires-Dist: psycopg2-binary (==2.8.2)
Requires-Dist: pyOpenSSL (==19.0.0)
Requires-Dist: python-dateutil (==2.7.5)
Requires-Dist: stevedore (==1.30.0)
Requires-Dist: toml (==0.10.0)
Requires-Dist: webargs (==5.3.2)
Provides-Extra: test
Requires-Dist: coverage (==4.5.4) ; extra == 'test'
Requires-Dist: Faker (==2.0.0) ; extra == 'test'
Requires-Dist: pycodestyle (==2.4.0) ; extra == 'test'
Requires-Dist: pydocstyle (==3.0.0) ; extra == 'test'
Requires-Dist: pylint (==2.3.0) ; extra == 'test'
Requires-Dist: pylint-flask (==0.6) ; extra == 'test'
Requires-Dist: pytest (==5.0.1) ; extra == 'test'
Requires-Dist: pytest-cov (==2.7.1) ; extra == 'test'
Requires-Dist: pytest-flask (==0.15.0) ; extra == 'test'
Requires-Dist: pytest-flask-sqlalchemy (==1.0.2) ; extra == 'test'
Requires-Dist: pytest-mock (==1.11.0) ; extra == 'test'
Requires-Dist: requests (==2.22.0) ; extra == 'test'
Requires-Dist: tox (==3.13.2) ; extra == 'test'

# 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:testeddoughnut/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/`.

# 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



