Giter Club home page Giter Club logo

jupyteradmin's Introduction

Admin panel for jupyter.korpus.cz

In order for PAM authentication to work for local users, the user under which the admin app is running needs to be able to read /etc/shadow. Also, that user needs to be able to run some commands as root and/or any user. To ensure this, create a custom user (e.g. jupyteradmin), add them to the shadow group (on Debian: :command:`adduser --system --ingroup shadow jupyteradmin` and create the file /etc/sudoers.d/jupyteradmin (preferably using visudo) with the following contents:

jupyteradmin ALL = (root) NOPASSWD: /usr/sbin/chpasswd
jupyteradmin ALL = (root) NOPASSWD: /usr/sbin/adduser
jupyteradmin ALL = (root) NOPASSWD: /usr/sbin/usermod
jupyteradmin ALL = (root) NOPASSWD: /usr/bin/mkdir
jupyteradmin ALL = (root) NOPASSWD: /usr/bin/chown
jupyteradmin ALL = (root) NOPASSWD: /usr/bin/ln

(In case of issues, verify if the program paths above are correct using :command:`which <program_name>` or check :file:`sudo.py` for additional commands which are run with sudo and therefore need to be enabled in this way.)

The app is backed by a SQLite3 database, which can be initialized by running :command:`flask initdb` (with the FLASK_APP environment variable correctly set) in the application root. Remember to allow the jupyteradmin user to write to it (e.g. with :command:`chown jupyterhub:nogroup admin.db`) and its parent directory (required by SQLite and/or its Python integration).

Mail

flask-sendmail needs postfix to be installed and set up to run correctly, although confusingly, it somehow worked with some providers (GMail) even without postfix. With others, delivery failed with "Unroutable email address".

Migrations

Get inspiration from commits doing them, but basically just modify the app's models and then:

```sh source dev-env.sh

# if the production db should be migrated export FLASK_DEBUG= chmod 777 admin.db

flask db migrate -m "..." # inspect and tweak the migration file flask db upgrade ```

License

Copyright © 2016 ÚČNK/David Lukeš

Distributed under the GNU General Public License v3.

jupyteradmin's People

Contributors

dlukes avatar

Stargazers

Rajendra Agrawal avatar

Watchers

James Cloos avatar  avatar  avatar

jupyteradmin's Issues

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.