diff --git a/docs/images/_img/django_add_ipython_image.png b/docs/images/_img/django_add_ipython_image.png deleted file mode 100644 index f2df713..0000000 Binary files a/docs/images/_img/django_add_ipython_image.png and /dev/null differ diff --git a/docs/images/images.md b/docs/images/images.md deleted file mode 100644 index e2feeda..0000000 --- a/docs/images/images.md +++ /dev/null @@ -1,91 +0,0 @@ -# ipynbsrv - -> IPython Notebook Multi-User Server -> - https://git.rackster.ch/groups/ipynbsrv - -## Images - -### Building the images - -The following chapters will tell you how to build Docker images to be used in ipynbsrv. Through the currently available images aren't very generic, one should be able to create others as well by extracting some of the information found here. - -#### Base LDAP - -This is the base image for all images that will be made available to end users. It performs operations such as: - -- Initializing the LDAP client/configuration -- Disable root login -- Prevent non-authorized (in the sense of not owner) users from accessing the container -- etc. - -Other images should inherit from it by declaring: - - FROM ipynbsrv/base-ldap:latest - -at the very top of the corresponding `Dockerfile`. - -To build the image, execute the following commands on the Docker host: - -```bash -$ IMG_NAME=base-ldap -$ BRANCH=master -$ mkdir $IMG_NAME -$ cd $IMG_NAME -$ wget https://git.rackster.ch/ipynbsrv/dockerfiles/raw/$BRANCH/$IMG_NAME/Dockerfile -$ docker build -t ipynbsrv/$IMG_NAME . -``` - -#### IPython Notebook (Py2) - -The **ipynbsrv** stack was documented and developed as part of a school project. The main goal was the creation of a multi-user IPython notebook server, so it's not a surprise the only available image right now is an IPython one. - -Within the `Dockerfile` and startup script, those actions are performed: - -- Install the latest IPython version -- Create a working directory `/data` which contains the user's home directory, the shares and public dirs -- Initialize an IPython profile, set the `base_url` and start a new notebook instance -- some more... - -To build the image, issue the commands below: - -> Make sure you have already built the `base-ldap` image. It is the base image in use! - -```bash -$ IMG_NAME=ipython2-notebook -$ BRANCH=master -$ mkdir $IMG_NAME -$ cd $IMG_NAME -$ wget https://git.rackster.ch/ipynbsrv/dockerfiles/raw/$BRANCH/$IMG_NAME/Dockerfile -$ wget https://git.rackster.ch/ipynbsrv/dockerfiles/raw/$BRANCH/$IMG_NAME/$IMG_NAME.bin -$ docker build -t ipynbsrv/$IMG_NAME . -``` - -During the build process, some errors might show up. That is because some commands try to open an interactive dialog - and that is not possible. Just ignore them for now. - -#### IPython Notebook (Py3) - -To build the image, issue the commands below: - -> Make sure you have already built the `base-ldap` image. It is the base image in use! - -```bash -$ IMG_NAME=ipython3-notebook -$ BRANCH=master -$ mkdir $IMG_NAME -$ cd $IMG_NAME -$ wget https://git.rackster.ch/ipynbsrv/dockerfiles/raw/$BRANCH/$IMG_NAME/Dockerfile -$ wget https://git.rackster.ch/ipynbsrv/dockerfiles/raw/$BRANCH/$IMG_NAME/$IMG_NAME.bin -$ docker build -t ipynbsrv/$IMG_NAME . -``` - -During the build process, some errors might show up. That is because some commands try to open an interactive dialog - and that is not possible. Just ignore them for now. - -### Registering the images - -To make an image available to end users, you have to add the image to the application. - -Open the administration interface (`http://"dedicated node"/admin`) and login with the superuser account. Click on `Images` in the `IPython Notebook Server Web Interface` box and create a new entry like on the screen below: - -![Django Admin Interface: Adding the IPython Notebook image](https://git.rackster.ch/ipynbsrv/ipynbsrv/raw/master/docs/images/_img/django_add_ipython_image.png) - -> Make sure to adjust fields that are different for a given image! \ No newline at end of file diff --git a/ipynbsrv/core/auth/authentication_backends.py b/ipynbsrv/core/auth/authentication_backends.py index ac06b63..68a78d0 100644 --- a/ipynbsrv/core/auth/authentication_backends.py +++ b/ipynbsrv/core/auth/authentication_backends.py @@ -1,6 +1,5 @@ from django.contrib.auth.models import User from django.core.exceptions import PermissionDenied -from hashlib import md5 from ipynbsrv.contract.errors import AuthenticationError, ConnectionError, \ UserNotFoundError from ipynbsrv.core.helpers import get_internal_ldap_connected, get_user_backend_connected @@ -42,7 +41,7 @@ def authenticate(self, username=None, password=None): if user is not None: # existing user if not user.check_password(password): user.set_password(password) # XXX: not needed. should we leave it empty? - internal_ldap.set_user_password(username, md5(password).hexdigest()) + internal_ldap.set_user_password(username, password) user.save() else: # new user uid = BackendUser.generate_internal_uid() diff --git a/ipynbsrv/core/signals/backend_users.py b/ipynbsrv/core/signals/backend_users.py index 516f7d0..f50f4f1 100644 --- a/ipynbsrv/core/signals/backend_users.py +++ b/ipynbsrv/core/signals/backend_users.py @@ -78,8 +78,6 @@ def create_public_directory(sender, user, **kwargs): storage_backend.set_dir_mode(public_dir, 0755) except StorageBackendError as ex: raise ex - else: - logger.warn("Public directory for user %s already exists." % user.django_user.get_username()) @receiver(backend_user_deleted) diff --git a/lib/scripts/create_postgresql_container.sh b/lib/scripts/create_postgresql_container.sh index dacccdc..ab6a9fb 100755 --- a/lib/scripts/create_postgresql_container.sh +++ b/lib/scripts/create_postgresql_container.sh @@ -12,7 +12,7 @@ if [ "$EUID" -ne 0 ]; then exit 1 fi -CT_NAME="ipynbsrv.postgresql" +CT_NAME="ipynbsrv_postgresql" echo "------------------------------------------------------------" echo "Pulling the PostgreSQL server image..." diff --git a/lib/scripts/create_wui_container.sh b/lib/scripts/create_wui_container.sh index 8b60f93..d489ac4 100755 --- a/lib/scripts/create_wui_container.sh +++ b/lib/scripts/create_wui_container.sh @@ -25,14 +25,14 @@ docker run \ -t -i \ --name="${CT_NAME}" \ --link ipynbsrv_ldap:ipynbsrv_ldap --link ipynbsrv_postgresql:ipynbsrv_postgresql \ - phusion/baseimage:0.9.16 /bin/bash + phusion/baseimage:0.9.17 /bin/bash echo "------------------------------------------------------------" echo "Committing the WUI container so we can create a new one from it..." echo "------------------------------------------------------------" sleep 2 -docker commit $CT_NAME ipynbsrv/wui:init +docker commit $CT_NAME ipynbsrv/wui:install docker rm $CT_NAME echo "------------------------------------------------------------" @@ -46,6 +46,5 @@ docker run \ --name="${CT_NAME}" \ -p 80:80 \ --link ipynbsrv_ldap:ipynbsrv_ldap --link ipynbsrv_postgresql:ipynbsrv_postgresql \ - -v /srv/ipynbsrv/homes:/srv/ipynbsrv/data/homes -v /srv/ipynbsrv/public:/srv/ipynbsrv/data/public \ - -v /srv/ipynbsrv/shares:/srv/ipynbsrv/data/shares \ + -v /srv/ipynbsrv/data:/srv/ipynbsrv/data \ ipynbsrv/wui:init $CMD diff --git a/lib/scripts/setup_docker_host.sh b/lib/scripts/setup_docker_host.sh index 2f8a839..8a370d6 100755 --- a/lib/scripts/setup_docker_host.sh +++ b/lib/scripts/setup_docker_host.sh @@ -45,9 +45,6 @@ if [ $PS == "deb" ]; then # autostart on boot update-rc.d docker defaults update-rc.d docker enable - # enable memory and swap accounting (not used yet, --memory=limit) - sed -i 's/GRUB_CMDLINE_LINUX="find_preseed=\/preseed.cfg noprompt"/GRUB_CMDLINE_LINUX="find_preseed=\/preseed.cfg noprompt cgroup_enable=memory swapaccount=1"/' /etc/default/grub - update-grub else $INSTALL docker systemctl start docker.service @@ -60,9 +57,6 @@ curl --fail -L -O https://github.com/phusion/baseimage-docker/archive/master.tar tar xzf master.tar.gz ./baseimage-docker-master/install-tools.sh rm -rf master.tar.gz baseimage-docker-master -# pull the base image for our templates -docker pull phusion/baseimage:0.9.15 -docker pull phusion/baseimage:0.9.16 # create the data directories DATA="/srv/ipynbsrv"