From 1de931497dd714e882ac9c7b59f239ba5bd487eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20Ka=CC=88ser?= Date: Wed, 7 Oct 2015 23:08:22 +0200 Subject: [PATCH] name changes for new project name (coco); added BSD 3-clause license$ --- .editorconfig | 14 ++++ .gitignore | 6 +- LICENSE | 27 +++++++ NOTES.txt | 4 +- {ipynbsrv => coco}/__init__.py | 0 {ipynbsrv => coco}/admin/__init__.py | 0 {ipynbsrv => coco}/admin/admin.py | 14 ++-- {ipynbsrv => coco}/admin/apps.py | 4 +- {ipynbsrv => coco}/admin/forms.py | 2 +- .../admin/static/admin/js/user_import.js | 0 .../admin/core/container/change_form.html | 0 .../core/containersnapshot/change_form.html | 0 .../admin/templates/admin/index.html | 0 {ipynbsrv => coco}/api/__init__.py | 0 {ipynbsrv => coco}/api/permissions.py | 2 +- {ipynbsrv => coco}/api/serializer.py | 4 +- {ipynbsrv => coco}/api/urls.py | 2 +- {ipynbsrv => coco}/api/views.py | 8 +- {ipynbsrv => coco}/core/__init__.py | 0 .../core/algorithms/__init__.py | 0 .../core/algorithms/server_selection.py | 0 {ipynbsrv => coco}/core/auth/__init__.py | 0 .../core/auth/authentication_backends.py | 10 +-- {ipynbsrv => coco}/core/auth/checks.py | 2 +- {ipynbsrv => coco}/core/conf.py | 18 ++--- {ipynbsrv => coco}/core/helpers.py | 2 +- .../core/management/__init__.py | 0 .../core/management/commands/__init__.py | 0 .../core/management/commands/import_users.py | 8 +- {ipynbsrv => coco}/core/models.py | 34 ++++----- {ipynbsrv => coco}/core/settings.py | 0 .../core/signals}/__init__.py | 0 .../core/signals/backend_groups.py | 14 ++-- .../core/signals/backend_users.py | 16 ++-- .../core/signals/collaboration_groups.py | 4 +- .../core/signals/container_images.py | 8 +- .../core/signals/container_snapshots.py | 10 +-- {ipynbsrv => coco}/core/signals/containers.py | 12 +-- {ipynbsrv => coco}/core/signals/groups.py | 4 +- .../core/signals/notifications.py | 6 +- {ipynbsrv => coco}/core/signals/shares.py | 10 +-- {ipynbsrv => coco}/core/signals/signals.py | 0 {ipynbsrv => coco}/core/signals/users.py | 6 +- {ipynbsrv => coco}/core/tests.py | 0 {ipynbsrv => coco}/core/validators.py | 0 {ipynbsrv => coco}/settings.py | 24 +++--- {ipynbsrv => coco}/urls.py | 10 +-- {ipynbsrv => coco}/web/__init__.py | 0 {ipynbsrv => coco}/web/api_client_proxy.py | 4 +- {ipynbsrv => coco}/web/settings.py | 0 {ipynbsrv => coco}/web/static/bower.json | 2 +- .../web/static/css/bootstrap-multiselect.css | 0 coco/web/static/css/components.css | 15 ++++ {ipynbsrv => coco}/web/static/css/plugins.css | 0 ...ootstrap-multiselect-collapsible-groups.js | 0 .../web/static/js/bootstrap-multiselect.js | 0 .../static/less/bootstrap-multiselect.less | 0 .../web/static/less/components.less | 2 +- {ipynbsrv => coco}/web/static/less/main.less | 0 .../web/static/less/plugins.less | 0 {ipynbsrv => coco}/web/static/main.css | 12 +-- .../web/templates/web/base.html | 0 .../web/templates/web/base_generic.html | 2 +- .../web/collaborationgroups/index.html | 0 .../web/collaborationgroups/manage.html | 0 .../collaborationgroups/modal_addusers.html | 0 .../web/collaborationgroups/modal_create.html | 0 .../web/container_snapshots/index.html | 0 .../web/container_snapshots/modal_create.html | 0 .../web/templates/web/containers/index.html | 0 .../web/containers/modal_create.html | 0 .../web/templates/web/dashboard.html | 0 .../web/templates/web/errors/404.html | 0 .../web/templates/web/errors/500.html | 0 .../web/templates/web/images/index.html | 0 .../web/templates/web/images/manage.html | 0 .../templates/web/images/modal_addgroups.html | 0 .../templates/web/images/modal_addusers.html | 0 .../templates/web/images/modal_create.html | 0 .../templates/web/notifications/index.html | 0 .../web/notifications/modal_create.html | 0 .../web/templates/web/shares/index.html | 0 .../web/templates/web/shares/manage.html | 0 .../templates/web/shares/modal_addgroups.html | 0 .../templates/web/shares/modal_addusers.html | 0 .../templates/web/shares/modal_create.html | 0 .../web/snippets/container_grid.html | 0 .../web/templates/web/snippets/messages.html | 0 .../web/templates/web/snippets/navbar.html | 4 +- .../web/templates/web/user/login.html | 0 .../web/templatetags}/__init__.py | 0 .../web/templatetags/settings.py | 2 +- {ipynbsrv => coco}/web/tests.py | 0 coco/web/urls.py | 74 +++++++++++++++++++ .../web/views}/__init__.py | 0 {ipynbsrv => coco}/web/views/_messages.py | 2 +- {ipynbsrv => coco}/web/views/accounts.py | 4 +- {ipynbsrv => coco}/web/views/auth.py | 4 +- .../web/views/collaborationgroups.py | 8 +- {ipynbsrv => coco}/web/views/common.py | 4 +- .../web/views/container_snapshots.py | 6 +- {ipynbsrv => coco}/web/views/containers.py | 6 +- {ipynbsrv => coco}/web/views/images.py | 6 +- {ipynbsrv => coco}/web/views/notifications.py | 12 +-- {ipynbsrv => coco}/web/views/shares.py | 12 +-- {ipynbsrv => coco}/web/views/system.py | 0 {ipynbsrv => coco}/wsgi.py | 4 +- docs/install/installation.md | 68 ++++++++--------- docs/install/networking/openvswitch.md | 10 +-- docs/user-guide/mkdocs.yml | 2 +- ipynbsrv/web/migrations/__init__.py | 1 - ipynbsrv/web/static/css/components.css | 15 ---- ipynbsrv/web/urls.py | 74 ------------------- ipynbsrv/web/views/__init__.py | 0 lib/confs/nginx/{ipynbsrv.conf => coco.conf} | 10 +-- lib/confs/slapd/init.ldif | 4 +- lib/confs/uwsgi/coco.ini | 15 ++++ lib/confs/uwsgi/ipynbsrv.ini | 15 ---- lib/scripts/create_ldap_container.sh | 16 ++-- lib/scripts/create_postgresql_container.sh | 8 +- lib/scripts/create_wui_container.sh | 18 ++--- lib/scripts/setup_docker_host.sh | 6 +- manage.py | 2 +- requirements.txt | 6 +- 124 files changed, 390 insertions(+), 350 deletions(-) create mode 100644 .editorconfig create mode 100644 LICENSE rename {ipynbsrv => coco}/__init__.py (100%) rename {ipynbsrv => coco}/admin/__init__.py (100%) rename {ipynbsrv => coco}/admin/admin.py (98%) rename {ipynbsrv => coco}/admin/apps.py (62%) rename {ipynbsrv => coco}/admin/forms.py (98%) rename {ipynbsrv => coco}/admin/static/admin/js/user_import.js (100%) rename {ipynbsrv => coco}/admin/templates/admin/core/container/change_form.html (100%) rename {ipynbsrv => coco}/admin/templates/admin/core/containersnapshot/change_form.html (100%) rename {ipynbsrv => coco}/admin/templates/admin/index.html (100%) rename {ipynbsrv => coco}/api/__init__.py (100%) rename {ipynbsrv => coco}/api/permissions.py (99%) rename {ipynbsrv => coco}/api/serializer.py (99%) rename {ipynbsrv => coco}/api/urls.py (99%) rename {ipynbsrv => coco}/api/views.py (99%) rename {ipynbsrv => coco}/core/__init__.py (100%) rename {ipynbsrv => coco}/core/algorithms/__init__.py (100%) rename {ipynbsrv => coco}/core/algorithms/server_selection.py (100%) rename {ipynbsrv => coco}/core/auth/__init__.py (100%) rename {ipynbsrv => coco}/core/auth/authentication_backends.py (94%) rename {ipynbsrv => coco}/core/auth/checks.py (97%) rename {ipynbsrv => coco}/core/conf.py (70%) rename {ipynbsrv => coco}/core/helpers.py (98%) rename {ipynbsrv => coco}/core/management/__init__.py (100%) rename {ipynbsrv => coco}/core/management/commands/__init__.py (100%) rename {ipynbsrv => coco}/core/management/commands/import_users.py (87%) rename {ipynbsrv => coco}/core/models.py (97%) rename {ipynbsrv => coco}/core/settings.py (100%) rename {ipynbsrv/core/migrations => coco/core/signals}/__init__.py (100%) rename {ipynbsrv => coco}/core/signals/backend_groups.py (92%) rename {ipynbsrv => coco}/core/signals/backend_users.py (94%) rename {ipynbsrv => coco}/core/signals/collaboration_groups.py (97%) rename {ipynbsrv => coco}/core/signals/container_images.py (93%) rename {ipynbsrv => coco}/core/signals/container_snapshots.py (90%) rename {ipynbsrv => coco}/core/signals/containers.py (96%) rename {ipynbsrv => coco}/core/signals/groups.py (98%) rename {ipynbsrv => coco}/core/signals/notifications.py (98%) rename {ipynbsrv => coco}/core/signals/shares.py (96%) rename {ipynbsrv => coco}/core/signals/signals.py (100%) rename {ipynbsrv => coco}/core/signals/users.py (92%) rename {ipynbsrv => coco}/core/tests.py (100%) rename {ipynbsrv => coco}/core/validators.py (100%) rename {ipynbsrv => coco}/settings.py (88%) rename {ipynbsrv => coco}/urls.py (77%) rename {ipynbsrv => coco}/web/__init__.py (100%) rename {ipynbsrv => coco}/web/api_client_proxy.py (78%) rename {ipynbsrv => coco}/web/settings.py (100%) rename {ipynbsrv => coco}/web/static/bower.json (91%) rename {ipynbsrv => coco}/web/static/css/bootstrap-multiselect.css (100%) create mode 100644 coco/web/static/css/components.css rename {ipynbsrv => coco}/web/static/css/plugins.css (100%) rename {ipynbsrv => coco}/web/static/js/bootstrap-multiselect-collapsible-groups.js (100%) rename {ipynbsrv => coco}/web/static/js/bootstrap-multiselect.js (100%) rename {ipynbsrv => coco}/web/static/less/bootstrap-multiselect.less (100%) rename {ipynbsrv => coco}/web/static/less/components.less (97%) rename {ipynbsrv => coco}/web/static/less/main.less (100%) rename {ipynbsrv => coco}/web/static/less/plugins.less (100%) rename {ipynbsrv => coco}/web/static/main.css (91%) rename {ipynbsrv => coco}/web/templates/web/base.html (100%) rename {ipynbsrv => coco}/web/templates/web/base_generic.html (95%) rename {ipynbsrv => coco}/web/templates/web/collaborationgroups/index.html (100%) rename {ipynbsrv => coco}/web/templates/web/collaborationgroups/manage.html (100%) rename {ipynbsrv => coco}/web/templates/web/collaborationgroups/modal_addusers.html (100%) rename {ipynbsrv => coco}/web/templates/web/collaborationgroups/modal_create.html (100%) rename {ipynbsrv => coco}/web/templates/web/container_snapshots/index.html (100%) rename {ipynbsrv => coco}/web/templates/web/container_snapshots/modal_create.html (100%) rename {ipynbsrv => coco}/web/templates/web/containers/index.html (100%) rename {ipynbsrv => coco}/web/templates/web/containers/modal_create.html (100%) rename {ipynbsrv => coco}/web/templates/web/dashboard.html (100%) rename {ipynbsrv => coco}/web/templates/web/errors/404.html (100%) rename {ipynbsrv => coco}/web/templates/web/errors/500.html (100%) rename {ipynbsrv => coco}/web/templates/web/images/index.html (100%) rename {ipynbsrv => coco}/web/templates/web/images/manage.html (100%) rename {ipynbsrv => coco}/web/templates/web/images/modal_addgroups.html (100%) rename {ipynbsrv => coco}/web/templates/web/images/modal_addusers.html (100%) rename {ipynbsrv => coco}/web/templates/web/images/modal_create.html (100%) rename {ipynbsrv => coco}/web/templates/web/notifications/index.html (100%) rename {ipynbsrv => coco}/web/templates/web/notifications/modal_create.html (100%) rename {ipynbsrv => coco}/web/templates/web/shares/index.html (100%) rename {ipynbsrv => coco}/web/templates/web/shares/manage.html (100%) rename {ipynbsrv => coco}/web/templates/web/shares/modal_addgroups.html (100%) rename {ipynbsrv => coco}/web/templates/web/shares/modal_addusers.html (100%) rename {ipynbsrv => coco}/web/templates/web/shares/modal_create.html (100%) rename {ipynbsrv => coco}/web/templates/web/snippets/container_grid.html (100%) rename {ipynbsrv => coco}/web/templates/web/snippets/messages.html (100%) rename {ipynbsrv => coco}/web/templates/web/snippets/navbar.html (95%) rename {ipynbsrv => coco}/web/templates/web/user/login.html (100%) rename {ipynbsrv/core/signals => coco/web/templatetags}/__init__.py (100%) rename {ipynbsrv => coco}/web/templatetags/settings.py (92%) rename {ipynbsrv => coco}/web/tests.py (100%) create mode 100644 coco/web/urls.py rename {ipynbsrv/web/templatetags => coco/web/views}/__init__.py (100%) rename {ipynbsrv => coco}/web/views/_messages.py (88%) rename {ipynbsrv => coco}/web/views/accounts.py (92%) rename {ipynbsrv => coco}/web/views/auth.py (71%) rename {ipynbsrv => coco}/web/views/collaborationgroups.py (97%) rename {ipynbsrv => coco}/web/views/common.py (83%) rename {ipynbsrv => coco}/web/views/container_snapshots.py (80%) rename {ipynbsrv => coco}/web/views/containers.py (98%) rename {ipynbsrv => coco}/web/views/images.py (96%) rename {ipynbsrv => coco}/web/views/notifications.py (93%) rename {ipynbsrv => coco}/web/views/shares.py (96%) rename {ipynbsrv => coco}/web/views/system.py (100%) rename {ipynbsrv => coco}/wsgi.py (72%) delete mode 100644 ipynbsrv/web/migrations/__init__.py delete mode 100644 ipynbsrv/web/static/css/components.css delete mode 100644 ipynbsrv/web/urls.py delete mode 100644 ipynbsrv/web/views/__init__.py rename lib/confs/nginx/{ipynbsrv.conf => coco.conf} (92%) create mode 100644 lib/confs/uwsgi/coco.ini delete mode 100644 lib/confs/uwsgi/ipynbsrv.ini diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..935b47a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# EditorConfig is awesome: http://EditorConfig.org + +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index 5e9db4e..cb3bd75 100644 --- a/.gitignore +++ b/.gitignore @@ -7,10 +7,10 @@ /static # Bower packages -ipynbsrv/web/static/bower_components +coco/web/static/bower_components # LESS generated CSS -ipynbsrv/web/static/css/main.css +coco/web/static/css/main.css # mkdocs generated files -ipynbsrv/web/static/docs/user-guide/* +coco/web/static/docs/user-guide/* # migrations **/migrations/* diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f6facc4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2015, University of Applied Sciences and Arts Northwestern Switzerland FHNW +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of coco nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/NOTES.txt b/NOTES.txt index 9ab6e58..e5ed8a8 100644 --- a/NOTES.txt +++ b/NOTES.txt @@ -8,8 +8,8 @@ CORE [ ] create core containers with "--restart=always" so they are auto started on restart (https://docs.docker.com/reference/run/#restart-policies-restart) [ ] define the Open vSwitch bridge as a regular interface (rather than through ovs-vsctl tool) [ ] create Dockerfiles for the core containers and push them to the registry - [ ] use a process supervisor like monit/supervisord to ensure the ipynbsrv_hostapi process is always running - [ ] (optional) put the ipynbsrv_hostapi behind a proxy (gevent, ...). flask debug server should not be used + [ ] use a process supervisor like monit/supervisord to ensure the coco_hostapi process is always running + [ ] (optional) put the coco_hostapi behind a proxy (gevent, ...). flask debug server should not be used [ ] (optional) run django application in app container as non-root user [ ] (optional) enable container resource limits so a container cannot eat all i.e. memory (https://docs.docker.com/reference/run/#runtime-constraints-on-resources) diff --git a/ipynbsrv/__init__.py b/coco/__init__.py similarity index 100% rename from ipynbsrv/__init__.py rename to coco/__init__.py diff --git a/ipynbsrv/admin/__init__.py b/coco/admin/__init__.py similarity index 100% rename from ipynbsrv/admin/__init__.py rename to coco/admin/__init__.py diff --git a/ipynbsrv/admin/admin.py b/coco/admin/admin.py similarity index 98% rename from ipynbsrv/admin/admin.py rename to coco/admin/admin.py index 9d3a18d..d60da57 100644 --- a/ipynbsrv/admin/admin.py +++ b/coco/admin/admin.py @@ -1,3 +1,6 @@ +from coco.admin.forms import CollaborationGroupAdminForm, ShareAdminForm +from coco.core.models import * +from coco.core.management.commands import import_users from django_admin_conf_vars.models import ConfigurationVariable from django.conf.urls import patterns from django.contrib import admin, messages @@ -5,19 +8,16 @@ from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect -from ipynbsrv.admin.forms import CollaborationGroupAdminForm, ShareAdminForm -from ipynbsrv.core.models import * -from ipynbsrv.core.management.commands import import_users class CoreAdminSite(admin.AdminSite): """ - ipynbsrv application admin site. + coco application admin site. """ - site_header = 'ipynbsrv Administration' - site_title = 'ipynbsrv - Administration' + site_header = 'coco Administration' + site_title = 'coco - Administration' index_title = 'Management' @@ -634,7 +634,7 @@ def import_users(self, request): # register the model admins with the site -admin_site = CoreAdminSite(name='ipynbsrv') +admin_site = CoreAdminSite(name='coco') admin_site.register(Backend, BackendAdmin) admin_site.register(CollaborationGroup, CollaborationGroupAdmin) admin_site.register(ConfigurationVariable, ConfigurationVariableAdmin) diff --git a/ipynbsrv/admin/apps.py b/coco/admin/apps.py similarity index 62% rename from ipynbsrv/admin/apps.py rename to coco/admin/apps.py index 65cd3da..36cd6ee 100644 --- a/ipynbsrv/admin/apps.py +++ b/coco/admin/apps.py @@ -7,5 +7,5 @@ class MyAdmin(AppConfig): :inherit. """ - name = 'ipynbsrv.admin' - label = 'ipynbsrv-admin' + name = 'coco.admin' + label = 'coco-admin' diff --git a/ipynbsrv/admin/forms.py b/coco/admin/forms.py similarity index 98% rename from ipynbsrv/admin/forms.py rename to coco/admin/forms.py index ac7b6c8..5e2e3f3 100644 --- a/ipynbsrv/admin/forms.py +++ b/coco/admin/forms.py @@ -1,6 +1,6 @@ +from coco.core.models import BackendUser, CollaborationGroup, Share from django import forms from django.contrib.admin.widgets import FilteredSelectMultiple -from ipynbsrv.core.models import BackendUser, CollaborationGroup, Share class CollaborationGroupAdminForm(forms.ModelForm): diff --git a/ipynbsrv/admin/static/admin/js/user_import.js b/coco/admin/static/admin/js/user_import.js similarity index 100% rename from ipynbsrv/admin/static/admin/js/user_import.js rename to coco/admin/static/admin/js/user_import.js diff --git a/ipynbsrv/admin/templates/admin/core/container/change_form.html b/coco/admin/templates/admin/core/container/change_form.html similarity index 100% rename from ipynbsrv/admin/templates/admin/core/container/change_form.html rename to coco/admin/templates/admin/core/container/change_form.html diff --git a/ipynbsrv/admin/templates/admin/core/containersnapshot/change_form.html b/coco/admin/templates/admin/core/containersnapshot/change_form.html similarity index 100% rename from ipynbsrv/admin/templates/admin/core/containersnapshot/change_form.html rename to coco/admin/templates/admin/core/containersnapshot/change_form.html diff --git a/ipynbsrv/admin/templates/admin/index.html b/coco/admin/templates/admin/index.html similarity index 100% rename from ipynbsrv/admin/templates/admin/index.html rename to coco/admin/templates/admin/index.html diff --git a/ipynbsrv/api/__init__.py b/coco/api/__init__.py similarity index 100% rename from ipynbsrv/api/__init__.py rename to coco/api/__init__.py diff --git a/ipynbsrv/api/permissions.py b/coco/api/permissions.py similarity index 99% rename from ipynbsrv/api/permissions.py rename to coco/api/permissions.py index d98d992..94b34c4 100644 --- a/ipynbsrv/api/permissions.py +++ b/coco/api/permissions.py @@ -1,5 +1,5 @@ +from coco.core.models import BackendUser from django.contrib.auth.models import User -from ipynbsrv.core.models import BackendUser from rest_framework import permissions from rest_framework.exceptions import PermissionDenied diff --git a/ipynbsrv/api/serializer.py b/coco/api/serializer.py similarity index 99% rename from ipynbsrv/api/serializer.py rename to coco/api/serializer.py index dc58473..c7743ab 100644 --- a/ipynbsrv/api/serializer.py +++ b/coco/api/serializer.py @@ -1,8 +1,8 @@ +from coco.core import settings +from coco.core.models import * from django.contrib.auth import get_user_model from django.contrib.auth.models import Group, User from django_admin_conf_vars.models import ConfigurationVariable -from ipynbsrv.core import settings -from ipynbsrv.core.models import * from rest_framework import serializers diff --git a/ipynbsrv/api/urls.py b/coco/api/urls.py similarity index 99% rename from ipynbsrv/api/urls.py rename to coco/api/urls.py index c5bfdd8..52e6b54 100644 --- a/ipynbsrv/api/urls.py +++ b/coco/api/urls.py @@ -1,5 +1,5 @@ +from coco.api import views from django.conf.urls import patterns, url -from ipynbsrv.api import views from rest_framework.urlpatterns import format_suffix_patterns urlpatterns = patterns('', diff --git a/ipynbsrv/api/views.py b/coco/api/views.py similarity index 99% rename from ipynbsrv/api/views.py rename to coco/api/views.py index 44cf685..c7c3819 100644 --- a/ipynbsrv/api/views.py +++ b/coco/api/views.py @@ -1,10 +1,10 @@ +from coco.api.permissions import * +from coco.core.helpers import get_server_selection_algorithm +from coco.core.models import * +from coco.api.serializer import * from django.contrib.auth.models import User, Group from django.db.models import Q from django_admin_conf_vars.models import ConfigurationVariable -from ipynbsrv.api.permissions import * -from ipynbsrv.core.helpers import get_server_selection_algorithm -from ipynbsrv.core.models import * -from ipynbsrv.api.serializer import * from rest_framework import generics, status from rest_framework.decorators import api_view from rest_framework.permissions import * diff --git a/ipynbsrv/core/__init__.py b/coco/core/__init__.py similarity index 100% rename from ipynbsrv/core/__init__.py rename to coco/core/__init__.py diff --git a/ipynbsrv/core/algorithms/__init__.py b/coco/core/algorithms/__init__.py similarity index 100% rename from ipynbsrv/core/algorithms/__init__.py rename to coco/core/algorithms/__init__.py diff --git a/ipynbsrv/core/algorithms/server_selection.py b/coco/core/algorithms/server_selection.py similarity index 100% rename from ipynbsrv/core/algorithms/server_selection.py rename to coco/core/algorithms/server_selection.py diff --git a/ipynbsrv/core/auth/__init__.py b/coco/core/auth/__init__.py similarity index 100% rename from ipynbsrv/core/auth/__init__.py rename to coco/core/auth/__init__.py diff --git a/ipynbsrv/core/auth/authentication_backends.py b/coco/core/auth/authentication_backends.py similarity index 94% rename from ipynbsrv/core/auth/authentication_backends.py rename to coco/core/auth/authentication_backends.py index 68a78d0..87aada4 100644 --- a/ipynbsrv/core/auth/authentication_backends.py +++ b/coco/core/auth/authentication_backends.py @@ -1,10 +1,10 @@ -from django.contrib.auth.models import User -from django.core.exceptions import PermissionDenied -from ipynbsrv.contract.errors import AuthenticationError, ConnectionError, \ +from coco.contract.errors import AuthenticationError, ConnectionError, \ UserNotFoundError -from ipynbsrv.core.helpers import get_internal_ldap_connected, get_user_backend_connected -from ipynbsrv.core.models import BackendGroup, BackendUser, \ +from coco.core.helpers import get_internal_ldap_connected, get_user_backend_connected +from coco.core.models import BackendGroup, BackendUser, \ CollaborationGroup +from django.contrib.auth.models import User +from django.core.exceptions import PermissionDenied import logging diff --git a/ipynbsrv/core/auth/checks.py b/coco/core/auth/checks.py similarity index 97% rename from ipynbsrv/core/auth/checks.py rename to coco/core/auth/checks.py index 255e5c0..e4ba0e7 100644 --- a/ipynbsrv/core/auth/checks.py +++ b/coco/core/auth/checks.py @@ -1,7 +1,7 @@ +from coco.core.models import PortMapping from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist from django.http.response import HttpResponse -from ipynbsrv.core.models import PortMapping COOKIE_NAME = 'username' diff --git a/ipynbsrv/core/conf.py b/coco/core/conf.py similarity index 70% rename from ipynbsrv/core/conf.py rename to coco/core/conf.py index 273b6be..a954752 100644 --- a/ipynbsrv/core/conf.py +++ b/coco/core/conf.py @@ -5,18 +5,18 @@ Global variable storing the arguments for the internal ldap backend """ config.set('INTERNAL_LDAP_CLASS', - default='ipynbsrv.backends.usergroup_backends.LdapBackend', + default='coco.backends.usergroup_backends.LdapBackend', editable=True, description='The full class path of the backend to use for the internal server.') config.set('INTERNAL_LDAP_ARGS', - default='{"server": "ipynbsrv_ldap", "base_dn": "dc=ipynbsrv,dc=ldap", "users_dn": "ou=users", "groups_dn": "ou=groups"}', + default='{"server": "coco_ldap", "base_dn": "dc=coco,dc=ldap", "users_dn": "ou=users", "groups_dn": "ou=groups"}', editable=True, description="""The arguments needed to instantiate the internal LDAP backend. Please provide in JSON format (i.e. {'arg1': "val1", 'arg2': "val2"}).""") config.set('INTERNAL_LDAP_CONNECT_CREDENTIALS', - default='{"dn": "cn=admin,dc=ipynbsrv,dc=ldap", "password": "123456"}', + default='{"dn": "cn=admin,dc=coco,dc=ldap", "password": "123456"}', editable=True, description='The credentials used to establish a connection to the user backend.') @@ -24,7 +24,7 @@ """ Global variable storing the class of the server selection algorithm to use. """ -config.set('SERVER_SELECTION_ALGORITHM_CLASS', default='ipynbsrv.core.algorithms.server_selection.RoundRobin', +config.set('SERVER_SELECTION_ALGORITHM_CLASS', default='coco.core.algorithms.server_selection.RoundRobin', editable=True, description='The full class path of the server selection algorithm class to use.') @@ -33,12 +33,12 @@ Storage backend related configuration options. """ config.set('STORAGE_BACKEND_CLASS', - default='ipynbsrv.backends.storage_backends.LocalFileSystem', + default='coco.backends.storage_backends.LocalFileSystem', editable=True, description='The full class path of the storage backend to use.') config.set('STORAGE_BACKEND_ARGS', - default='{"base_dir": "/srv/ipynbsrv/data"}', + default='{"base_dir": "/srv/coco/data"}', editable=True, description="""The arguments needed to instantiate the storage backend. Please provide in JSON format (i.e. {'arg1': "val1", 'arg2': "val2"}).""") @@ -48,17 +48,17 @@ User backend related configuration options. """ config.set('USER_BACKEND_CLASS', - default='ipynbsrv.backends.usergroup_backends.LdapBackend', + default='coco.backends.usergroup_backends.LdapBackend', editable=True, description='The full class path of the user backend to use.') config.set('USER_BACKEND_ARGS', - default='{"server": "ipynbsrv_ldap", "base_dn": "dc=ipynbsrv,dc=ldap", "users_dn": "ou=users"}', + default='{"server": "coco_ldap", "base_dn": "dc=coco,dc=ldap", "users_dn": "ou=users"}', editable=True, description="""The arguments needed to instantiate the provided user backend class. Please provide in json format (i.e. {'arg1': "val1", 'arg2': "val2"}).""") config.set('USER_BACKEND_CONNECT_CREDENTIALS', - default='{"dn": "cn=admin,dc=ipynbsrv,dc=ldap", "password": "123456"}', + default='{"dn": "cn=admin,dc=coco,dc=ldap", "password": "123456"}', editable=True, description='The credentials used to establish a connection to the user backend.') diff --git a/ipynbsrv/core/helpers.py b/coco/core/helpers.py similarity index 98% rename from ipynbsrv/core/helpers.py rename to coco/core/helpers.py index 8c54cc2..875e350 100644 --- a/ipynbsrv/core/helpers.py +++ b/coco/core/helpers.py @@ -1,5 +1,5 @@ +from coco.common.utils import ClassLoader from django_admin_conf_vars.global_vars import config -from ipynbsrv.common.utils import ClassLoader import json diff --git a/ipynbsrv/core/management/__init__.py b/coco/core/management/__init__.py similarity index 100% rename from ipynbsrv/core/management/__init__.py rename to coco/core/management/__init__.py diff --git a/ipynbsrv/core/management/commands/__init__.py b/coco/core/management/commands/__init__.py similarity index 100% rename from ipynbsrv/core/management/commands/__init__.py rename to coco/core/management/commands/__init__.py diff --git a/ipynbsrv/core/management/commands/import_users.py b/coco/core/management/commands/import_users.py similarity index 87% rename from ipynbsrv/core/management/commands/import_users.py rename to coco/core/management/commands/import_users.py index c9486e0..99a1532 100644 --- a/ipynbsrv/core/management/commands/import_users.py +++ b/coco/core/management/commands/import_users.py @@ -1,9 +1,9 @@ +from coco.core.auth.authentication_backends import BackendProxyAuthentication +from coco.core.helpers import get_user_backend_connected +from coco.core.models import * +from coco.contract.backends import UserBackend from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User -from ipynbsrv.core.auth.authentication_backends import BackendProxyAuthentication -from ipynbsrv.core.helpers import get_user_backend_connected -from ipynbsrv.core.models import * -from ipynbsrv.contract.backends import UserBackend def import_users(): diff --git a/ipynbsrv/core/models.py b/coco/core/models.py similarity index 97% rename from ipynbsrv/core/models.py rename to coco/core/models.py index 9b06316..1b9aafa 100644 --- a/ipynbsrv/core/models.py +++ b/coco/core/models.py @@ -1,19 +1,19 @@ +from coco.common.utils import ClassLoader +from coco.contract.backends import ContainerBackend +from coco.core import settings +from coco.core.validators import validate_json_format from django.contrib.auth.models import Group, User from django.core.exceptions import ValidationError from django.core.validators import RegexValidator from django.db import models from django.utils.encoding import smart_unicode -from ipynbsrv.common.utils import ClassLoader -from ipynbsrv.contract.backends import ContainerBackend -from ipynbsrv.core import settings -from ipynbsrv.core.validators import validate_json_format from random import randint class Backend(models.Model): """ - Model used to store references to backend implementations (as per ipynbsrv-contract package). + Model used to store references to backend implementations (as per coco-contract package). Attn: The module/class needs to be installed manually. There's no magic included for this. """ @@ -63,7 +63,7 @@ class Backend(models.Model): message='Not a valid Python module path.' ) ], - help_text='The full absolute module path (i.e. ipynbsrv.backends.container_backends).' + help_text='The full absolute module path (i.e. coco.backends.container_backends).' ) klass = models.CharField( max_length=255, @@ -566,7 +566,7 @@ def clone(self, name, description=None): ) clone.save() - from ipynbsrv.core.signals.signals import container_cloned + from coco.core.signals.signals import container_cloned container_cloned.send(sender=Container, container=self, clone=clone) return clone @@ -592,7 +592,7 @@ def commit(self, name, description=None, short_description=None, public=False): ) image.save() - from ipynbsrv.core.signals.signals import container_committed + from coco.core.signals.signals import container_committed container_committed.send(sender=Container, container=self, image=image) return image @@ -703,14 +703,14 @@ def restart(self): """ Restart the container. """ - from ipynbsrv.core.signals.signals import container_restarted + from coco.core.signals.signals import container_restarted container_restarted.send(sender=self, container=self) def resume(self): """ Resume the container. """ - from ipynbsrv.core.signals.signals import container_resumed + from coco.core.signals.signals import container_resumed container_resumed.send(sender=self, container=self) def save(self, *args, **kwargs): @@ -724,14 +724,14 @@ def start(self, *args): """ Start the container. """ - from ipynbsrv.core.signals.signals import container_started + from coco.core.signals.signals import container_started container_started.send(sender=self, container=self) def stop(self): """ Stop the container. """ - from ipynbsrv.core.signals.signals import container_stopped + from coco.core.signals.signals import container_stopped container_stopped.send(sender=self, container=self) def suspend(self): @@ -739,7 +739,7 @@ def suspend(self): Suspend the container. """ if self.is_running() and not self.is_suspended(): - from ipynbsrv.core.signals.signals import container_suspended + from coco.core.signals.signals import container_suspended container_suspended.send(sender=self, container=self) def __str__(self): @@ -809,7 +809,7 @@ class ContainerImage(models.Model): blank=True, null=True, help_text="""The image\'s protected internal port. - This port is only accessable through the ipynbsrv application for the container owner.""" + This port is only accessable through the coco application for the container owner.""" ) public_ports = models.CommaSeparatedIntegerField( default='22', @@ -917,7 +917,7 @@ def restore(self): """ TODO: write doc. """ - from ipynbsrv.core.signals.signals import container_snapshot_restored + from coco.core.signals.signals import container_snapshot_restored container_snapshot_restored.send(sender=self, snapshot=self) def save(self, *args, **kwargs): @@ -1249,7 +1249,7 @@ class Meta: class Server(models.Model): """ - Django model to represent an ipynbsrv setup node. + Django model to represent an coco setup node. """ id = models.AutoField(primary_key=True) @@ -1502,6 +1502,6 @@ def __unicode__(self): # make sure our signal receivers are loaded -from ipynbsrv.core.signals import backend_users, backend_groups, \ +from coco.core.signals import backend_users, backend_groups, \ collaboration_groups, container_images, container_snapshots, containers, \ groups, notifications, shares, users diff --git a/ipynbsrv/core/settings.py b/coco/core/settings.py similarity index 100% rename from ipynbsrv/core/settings.py rename to coco/core/settings.py diff --git a/ipynbsrv/core/migrations/__init__.py b/coco/core/signals/__init__.py similarity index 100% rename from ipynbsrv/core/migrations/__init__.py rename to coco/core/signals/__init__.py diff --git a/ipynbsrv/core/signals/backend_groups.py b/coco/core/signals/backend_groups.py similarity index 92% rename from ipynbsrv/core/signals/backend_groups.py rename to coco/core/signals/backend_groups.py index 9d10fde..4aa4bae 100644 --- a/ipynbsrv/core/signals/backend_groups.py +++ b/coco/core/signals/backend_groups.py @@ -1,12 +1,12 @@ -from django.dispatch import receiver -from django.db.models.signals import post_delete, post_save -from ipynbsrv.contract.backends import GroupBackend -from ipynbsrv.contract.errors import GroupBackendError, GroupNotFoundError -from ipynbsrv.core.helpers import get_internal_ldap_connected -from ipynbsrv.core.models import BackendGroup -from ipynbsrv.core.signals.signals import backend_group_created, \ +from coco.contract.backends import GroupBackend +from coco.contract.errors import GroupBackendError, GroupNotFoundError +from coco.core.helpers import get_internal_ldap_connected +from coco.core.models import BackendGroup +from coco.core.signals.signals import backend_group_created, \ backend_group_deleted, backend_group_member_added, \ backend_group_member_removed, backend_group_modified +from django.dispatch import receiver +from django.db.models.signals import post_delete, post_save @receiver(backend_group_member_added) diff --git a/ipynbsrv/core/signals/backend_users.py b/coco/core/signals/backend_users.py similarity index 94% rename from ipynbsrv/core/signals/backend_users.py rename to coco/core/signals/backend_users.py index f50f4f1..7ab3fc8 100644 --- a/ipynbsrv/core/signals/backend_users.py +++ b/coco/core/signals/backend_users.py @@ -1,13 +1,13 @@ -from django.dispatch import receiver -from django.db.models.signals import post_delete, post_save, pre_delete -from ipynbsrv.contract.backends import UserBackend -from ipynbsrv.contract.errors import DirectoryNotFoundError, StorageBackendError, \ +from coco.contract.backends import UserBackend +from coco.contract.errors import DirectoryNotFoundError, StorageBackendError, \ UserBackendError, UserNotFoundError -from ipynbsrv.core import settings -from ipynbsrv.core.helpers import get_internal_ldap_connected, get_storage_backend -from ipynbsrv.core.models import BackendUser -from ipynbsrv.core.signals.signals import backend_user_created, \ +from coco.core import settings +from coco.core.helpers import get_internal_ldap_connected, get_storage_backend +from coco.core.models import BackendUser +from coco.core.signals.signals import backend_user_created, \ backend_user_deleted, backend_user_modified +from django.dispatch import receiver +from django.db.models.signals import post_delete, post_save, pre_delete from os import path diff --git a/ipynbsrv/core/signals/collaboration_groups.py b/coco/core/signals/collaboration_groups.py similarity index 97% rename from ipynbsrv/core/signals/collaboration_groups.py rename to coco/core/signals/collaboration_groups.py index f9029c7..799a6d0 100644 --- a/ipynbsrv/core/signals/collaboration_groups.py +++ b/coco/core/signals/collaboration_groups.py @@ -1,7 +1,7 @@ +from coco.core.models import BackendUser, CollaborationGroup +from coco.core.signals.signals import * from django.dispatch import receiver from django.db.models.signals import m2m_changed, post_delete, post_save, pre_delete -from ipynbsrv.core.models import BackendUser, CollaborationGroup -from ipynbsrv.core.signals.signals import * @receiver(collaboration_group_deleted) diff --git a/ipynbsrv/core/signals/container_images.py b/coco/core/signals/container_images.py similarity index 93% rename from ipynbsrv/core/signals/container_images.py rename to coco/core/signals/container_images.py index 93dd8f2..06391af 100644 --- a/ipynbsrv/core/signals/container_images.py +++ b/coco/core/signals/container_images.py @@ -1,9 +1,9 @@ +from coco.contract.backends import ContainerBackend +from coco.contract.errors import ContainerBackendError, ContainerImageNotFoundError +from coco.core.models import CollaborationGroup, ContainerImage, Server +from coco.core.signals.signals import * from django.db.models.signals import m2m_changed, post_delete, post_save from django.dispatch import receiver -from ipynbsrv.contract.backends import ContainerBackend -from ipynbsrv.contract.errors import ContainerBackendError, ContainerImageNotFoundError -from ipynbsrv.core.models import CollaborationGroup, ContainerImage, Server -from ipynbsrv.core.signals.signals import * @receiver(container_committed) diff --git a/ipynbsrv/core/signals/container_snapshots.py b/coco/core/signals/container_snapshots.py similarity index 90% rename from ipynbsrv/core/signals/container_snapshots.py rename to coco/core/signals/container_snapshots.py index 3c9a329..67b41bf 100644 --- a/ipynbsrv/core/signals/container_snapshots.py +++ b/coco/core/signals/container_snapshots.py @@ -1,10 +1,10 @@ +from coco.contract.backends import ContainerBackend +from coco.contract.errors import ContainerBackendError, ContainerSnapshotNotFoundError +from coco.core.models import ContainerSnapshot +from coco.core.signals.signals import container_snapshot_created, \ + container_snapshot_deleted, container_snapshot_modified, container_snapshot_restored from django.db.models.signals import post_delete, post_save from django.dispatch import receiver -from ipynbsrv.contract.backends import ContainerBackend -from ipynbsrv.contract.errors import ContainerBackendError, ContainerSnapshotNotFoundError -from ipynbsrv.core.models import ContainerSnapshot -from ipynbsrv.core.signals.signals import container_snapshot_created, \ - container_snapshot_deleted, container_snapshot_modified, container_snapshot_restored @receiver(container_snapshot_created) diff --git a/ipynbsrv/core/signals/containers.py b/coco/core/signals/containers.py similarity index 96% rename from ipynbsrv/core/signals/containers.py rename to coco/core/signals/containers.py index b08ebf6..dc9d8f3 100644 --- a/ipynbsrv/core/signals/containers.py +++ b/coco/core/signals/containers.py @@ -1,11 +1,11 @@ +from coco.contract.backends import ContainerBackend +from coco.contract.errors import ContainerBackendError, ContainerNotFoundError +from coco.core import settings +from coco.core.helpers import get_storage_backend +from coco.core.models import Container, ContainerImage, PortMapping +from coco.core.signals.signals import * from django.db.models.signals import post_delete, post_save from django.dispatch import receiver -from ipynbsrv.contract.backends import ContainerBackend -from ipynbsrv.contract.errors import ContainerBackendError, ContainerNotFoundError -from ipynbsrv.core import settings -from ipynbsrv.core.helpers import get_storage_backend -from ipynbsrv.core.models import Container, ContainerImage, PortMapping -from ipynbsrv.core.signals.signals import * from os import path import time diff --git a/ipynbsrv/core/signals/groups.py b/coco/core/signals/groups.py similarity index 98% rename from ipynbsrv/core/signals/groups.py rename to coco/core/signals/groups.py index 29f2513..8e58c1d 100644 --- a/ipynbsrv/core/signals/groups.py +++ b/coco/core/signals/groups.py @@ -1,8 +1,8 @@ +from coco.core.models import BackendGroup, CollaborationGroup +from coco.core.signals.signals import * from django.contrib.auth.models import Group, User from django.dispatch import receiver from django.db.models.signals import m2m_changed, post_delete, post_save -from ipynbsrv.core.models import BackendGroup, CollaborationGroup -from ipynbsrv.core.signals.signals import * @receiver(group_member_added) diff --git a/ipynbsrv/core/signals/notifications.py b/coco/core/signals/notifications.py similarity index 98% rename from ipynbsrv/core/signals/notifications.py rename to coco/core/signals/notifications.py index 25ee776..28aa0d5 100644 --- a/ipynbsrv/core/signals/notifications.py +++ b/coco/core/signals/notifications.py @@ -1,8 +1,8 @@ +from coca.core.models import CollaborationGroup, Notification, \ + NotificationLog +from coca.core.signals.signals import * from django.db.models.signals import m2m_changed, post_delete, post_save from django.dispatch import receiver -from ipynbsrv.core.models import CollaborationGroup, Notification, \ - NotificationLog -from ipynbsrv.core.signals.signals import * @receiver(collaboration_group_member_added) diff --git a/ipynbsrv/core/signals/shares.py b/coco/core/signals/shares.py similarity index 96% rename from ipynbsrv/core/signals/shares.py rename to coco/core/signals/shares.py index 8d6543a..aef0a9b 100644 --- a/ipynbsrv/core/signals/shares.py +++ b/coco/core/signals/shares.py @@ -1,10 +1,10 @@ +from coco.contract.errors import DirectoryNotFoundError, StorageBackendError +from coco.core import settings +from coco.core.helpers import get_storage_backend +from coco.core.models import CollaborationGroup, Share +from coco.core.signals.signals import * from django.db.models.signals import m2m_changed, post_delete, post_save from django.dispatch import receiver -from ipynbsrv.contract.errors import DirectoryNotFoundError, StorageBackendError -from ipynbsrv.core import settings -from ipynbsrv.core.helpers import get_storage_backend -from ipynbsrv.core.models import CollaborationGroup, Share -from ipynbsrv.core.signals.signals import * from os import path diff --git a/ipynbsrv/core/signals/signals.py b/coco/core/signals/signals.py similarity index 100% rename from ipynbsrv/core/signals/signals.py rename to coco/core/signals/signals.py diff --git a/ipynbsrv/core/signals/users.py b/coco/core/signals/users.py similarity index 92% rename from ipynbsrv/core/signals/users.py rename to coco/core/signals/users.py index 526f34c..e22d968 100644 --- a/ipynbsrv/core/signals/users.py +++ b/coco/core/signals/users.py @@ -1,9 +1,9 @@ +from coco.core.models import BackendUser +from coco.core.signals.signals import backend_user_modified, \ + user_created, user_deleted, user_modified from django.contrib.auth.models import User from django.dispatch import receiver from django.db.models.signals import post_delete, post_save -from ipynbsrv.core.models import BackendUser -from ipynbsrv.core.signals.signals import backend_user_modified, \ - user_created, user_deleted, user_modified @receiver(user_modified) diff --git a/ipynbsrv/core/tests.py b/coco/core/tests.py similarity index 100% rename from ipynbsrv/core/tests.py rename to coco/core/tests.py diff --git a/ipynbsrv/core/validators.py b/coco/core/validators.py similarity index 100% rename from ipynbsrv/core/validators.py rename to coco/core/validators.py diff --git a/ipynbsrv/settings.py b/coco/settings.py similarity index 88% rename from ipynbsrv/settings.py rename to coco/settings.py index 7b144e8..b87120d 100644 --- a/ipynbsrv/settings.py +++ b/coco/settings.py @@ -28,18 +28,18 @@ # Application definition INSTALLED_APPS = ( # Core - 'ipynbsrv.core', + 'coco.core', 'django_admin_conf_vars', # API - 'ipynbsrv.api', + 'coco.api', 'rest_framework', # Admin - 'ipynbsrv.admin.apps.MyAdmin', + 'coco.admin.apps.MyAdmin', 'djangocms_admin_style', 'django.contrib.admin', 'django.contrib.admindocs', # Web - 'ipynbsrv.web', + 'coco.web', 'widget_tweaks', # Django 'django.contrib.auth', @@ -59,7 +59,7 @@ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) -ROOT_URLCONF = 'ipynbsrv.urls' +ROOT_URLCONF = 'coco.urls' TEMPLATES = [ { @@ -77,7 +77,7 @@ }, ] -WSGI_APPLICATION = 'ipynbsrv.wsgi.application' +WSGI_APPLICATION = 'coco.wsgi.application' # Database @@ -89,10 +89,10 @@ }, 'production': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'ipynbsrv', - 'USER': 'ipynbsrv', + 'NAME': 'coco', + 'USER': 'coco', 'PASSWORD': '123456', - 'HOST': 'ipynbsrv_postgresql', + 'HOST': 'coco_postgresql', 'PORT': '5432' } } @@ -118,17 +118,17 @@ } -# LEGACY SETTINGS FROM OLD IPYNBSRV. NEEDS REFACTORING +# LEGACY SETTINGS FROM OLD . NEEDS REFACTORING LOGIN_URL = '/accounts/login' LOGIN_REDIRECT_URL = '/accounts/flag' PUBLIC_URL = '/public/' USER_GUIDE_URL = '/docs/user-guide/' -VARS_MODULE_PATH = 'ipynbsrv.core.conf' +VARS_MODULE_PATH = 'coco.core.conf' AUTHENTICATION_BACKENDS = ( - 'ipynbsrv.core.auth.authentication_backends.BackendProxyAuthentication', + 'coco.core.auth.authentication_backends.BackendProxyAuthentication', 'django.contrib.auth.backends.ModelBackend', ) diff --git a/ipynbsrv/urls.py b/coco/urls.py similarity index 77% rename from ipynbsrv/urls.py rename to coco/urls.py index 3b9196c..ab09661 100644 --- a/ipynbsrv/urls.py +++ b/coco/urls.py @@ -15,20 +15,20 @@ 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) ''' +from coco.admin.admin import admin_site from django.conf.urls import include, url -from ipynbsrv.admin.admin import admin_site urlpatterns = [ url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin_site.urls)), - url(r'^api/', include('ipynbsrv.api.urls')), - url(r'^', include('ipynbsrv.web.urls')) + url(r'^api/', include('coco.api.urls')), + url(r'^', include('coco.web.urls')) ] ''' Registering custom error handlers. ''' -handler404 = 'ipynbsrv.web.views.system.error_404' -handler500 = 'ipynbsrv.web.views.system.error_500' +handler404 = 'coco.web.views.system.error_404' +handler500 = 'coco.web.views.system.error_500' diff --git a/ipynbsrv/web/__init__.py b/coco/web/__init__.py similarity index 100% rename from ipynbsrv/web/__init__.py rename to coco/web/__init__.py diff --git a/ipynbsrv/web/api_client_proxy.py b/coco/web/api_client_proxy.py similarity index 78% rename from ipynbsrv/web/api_client_proxy.py rename to coco/web/api_client_proxy.py index ddaf01a..3d5104e 100644 --- a/ipynbsrv/web/api_client_proxy.py +++ b/coco/web/api_client_proxy.py @@ -1,8 +1,8 @@ -from ipynbsrv.client.clients import HttpClient +from coco.client.clients import HttpClient def get_httpclient_instance(request): - base_url = "http://localhost:8000/api" + base_url = "http://localhost/api" username = request.user.username password = request.session.get('password') return HttpClient(base_url, auth=(username, password)) diff --git a/ipynbsrv/web/settings.py b/coco/web/settings.py similarity index 100% rename from ipynbsrv/web/settings.py rename to coco/web/settings.py diff --git a/ipynbsrv/web/static/bower.json b/coco/web/static/bower.json similarity index 91% rename from ipynbsrv/web/static/bower.json rename to coco/web/static/bower.json index fe59dd2..1f139b1 100644 --- a/ipynbsrv/web/static/bower.json +++ b/coco/web/static/bower.json @@ -1,5 +1,5 @@ { - "name": "ipynbsrv.wui", + "name": "coco-web", "version": "0.0.1", "dependencies": { "bootstrap": "~3.3.1", diff --git a/ipynbsrv/web/static/css/bootstrap-multiselect.css b/coco/web/static/css/bootstrap-multiselect.css similarity index 100% rename from ipynbsrv/web/static/css/bootstrap-multiselect.css rename to coco/web/static/css/bootstrap-multiselect.css diff --git a/coco/web/static/css/components.css b/coco/web/static/css/components.css new file mode 100644 index 0000000..8b31d45 --- /dev/null +++ b/coco/web/static/css/components.css @@ -0,0 +1,15 @@ +.-navbar { + margin-bottom: 30px; + background-color: #3465a4; +} +.-navbar a { + color: #fff; +} +.-navbar .nav > li.active > a, +.-navbar .nav > li > a:hover, +.-navbar .nav > li > a:focus { + background-color: #517DB7; +} +.-navbar .navbar-toggle .icon-bar { + background-color: #fff; +} diff --git a/ipynbsrv/web/static/css/plugins.css b/coco/web/static/css/plugins.css similarity index 100% rename from ipynbsrv/web/static/css/plugins.css rename to coco/web/static/css/plugins.css diff --git a/ipynbsrv/web/static/js/bootstrap-multiselect-collapsible-groups.js b/coco/web/static/js/bootstrap-multiselect-collapsible-groups.js similarity index 100% rename from ipynbsrv/web/static/js/bootstrap-multiselect-collapsible-groups.js rename to coco/web/static/js/bootstrap-multiselect-collapsible-groups.js diff --git a/ipynbsrv/web/static/js/bootstrap-multiselect.js b/coco/web/static/js/bootstrap-multiselect.js similarity index 100% rename from ipynbsrv/web/static/js/bootstrap-multiselect.js rename to coco/web/static/js/bootstrap-multiselect.js diff --git a/ipynbsrv/web/static/less/bootstrap-multiselect.less b/coco/web/static/less/bootstrap-multiselect.less similarity index 100% rename from ipynbsrv/web/static/less/bootstrap-multiselect.less rename to coco/web/static/less/bootstrap-multiselect.less diff --git a/ipynbsrv/web/static/less/components.less b/coco/web/static/less/components.less similarity index 97% rename from ipynbsrv/web/static/less/components.less rename to coco/web/static/less/components.less index 659fa87..b39829e 100644 --- a/ipynbsrv/web/static/less/components.less +++ b/coco/web/static/less/components.less @@ -1,7 +1,7 @@ // // Navbar // -------------------------- -.ipynbsrv-navbar +.-navbar { margin-bottom: 30px; background-color: #3465a4; diff --git a/ipynbsrv/web/static/less/main.less b/coco/web/static/less/main.less similarity index 100% rename from ipynbsrv/web/static/less/main.less rename to coco/web/static/less/main.less diff --git a/ipynbsrv/web/static/less/plugins.less b/coco/web/static/less/plugins.less similarity index 100% rename from ipynbsrv/web/static/less/plugins.less rename to coco/web/static/less/plugins.less diff --git a/ipynbsrv/web/static/main.css b/coco/web/static/main.css similarity index 91% rename from ipynbsrv/web/static/main.css rename to coco/web/static/main.css index c177541..518f513 100644 --- a/ipynbsrv/web/static/main.css +++ b/coco/web/static/main.css @@ -85,19 +85,19 @@ td > ul { #shares-table .label { cursor: pointer; } -.ipynbsrv-navbar { +.-navbar { margin-bottom: 30px; background-color: #3465a4; } -.ipynbsrv-navbar a { +.-navbar a { color: #fff; } -.ipynbsrv-navbar .nav > li.active > a, -.ipynbsrv-navbar .nav > li > a:hover, -.ipynbsrv-navbar .nav > li > a:focus { +.-navbar .nav > li.active > a, +.-navbar .nav > li > a:hover, +.-navbar .nav > li > a:focus { background-color: #517DB7; } -.ipynbsrv-navbar .navbar-toggle .icon-bar { +.-navbar .navbar-toggle .icon-bar { background-color: #fff; } div.dataTables_filter label, diff --git a/ipynbsrv/web/templates/web/base.html b/coco/web/templates/web/base.html similarity index 100% rename from ipynbsrv/web/templates/web/base.html rename to coco/web/templates/web/base.html diff --git a/ipynbsrv/web/templates/web/base_generic.html b/coco/web/templates/web/base_generic.html similarity index 95% rename from ipynbsrv/web/templates/web/base_generic.html rename to coco/web/templates/web/base_generic.html index b601ad1..2eaf465 100644 --- a/ipynbsrv/web/templates/web/base_generic.html +++ b/coco/web/templates/web/base_generic.html @@ -4,7 +4,7 @@ - ipynbsrv{% if title %} - {{ title }}{% endif %} + coco{% if title %} - {{ title }}{% endif %} {% block external_css %}{% endblock %} diff --git a/ipynbsrv/web/templates/web/collaborationgroups/index.html b/coco/web/templates/web/collaborationgroups/index.html similarity index 100% rename from ipynbsrv/web/templates/web/collaborationgroups/index.html rename to coco/web/templates/web/collaborationgroups/index.html diff --git a/ipynbsrv/web/templates/web/collaborationgroups/manage.html b/coco/web/templates/web/collaborationgroups/manage.html similarity index 100% rename from ipynbsrv/web/templates/web/collaborationgroups/manage.html rename to coco/web/templates/web/collaborationgroups/manage.html diff --git a/ipynbsrv/web/templates/web/collaborationgroups/modal_addusers.html b/coco/web/templates/web/collaborationgroups/modal_addusers.html similarity index 100% rename from ipynbsrv/web/templates/web/collaborationgroups/modal_addusers.html rename to coco/web/templates/web/collaborationgroups/modal_addusers.html diff --git a/ipynbsrv/web/templates/web/collaborationgroups/modal_create.html b/coco/web/templates/web/collaborationgroups/modal_create.html similarity index 100% rename from ipynbsrv/web/templates/web/collaborationgroups/modal_create.html rename to coco/web/templates/web/collaborationgroups/modal_create.html diff --git a/ipynbsrv/web/templates/web/container_snapshots/index.html b/coco/web/templates/web/container_snapshots/index.html similarity index 100% rename from ipynbsrv/web/templates/web/container_snapshots/index.html rename to coco/web/templates/web/container_snapshots/index.html diff --git a/ipynbsrv/web/templates/web/container_snapshots/modal_create.html b/coco/web/templates/web/container_snapshots/modal_create.html similarity index 100% rename from ipynbsrv/web/templates/web/container_snapshots/modal_create.html rename to coco/web/templates/web/container_snapshots/modal_create.html diff --git a/ipynbsrv/web/templates/web/containers/index.html b/coco/web/templates/web/containers/index.html similarity index 100% rename from ipynbsrv/web/templates/web/containers/index.html rename to coco/web/templates/web/containers/index.html diff --git a/ipynbsrv/web/templates/web/containers/modal_create.html b/coco/web/templates/web/containers/modal_create.html similarity index 100% rename from ipynbsrv/web/templates/web/containers/modal_create.html rename to coco/web/templates/web/containers/modal_create.html diff --git a/ipynbsrv/web/templates/web/dashboard.html b/coco/web/templates/web/dashboard.html similarity index 100% rename from ipynbsrv/web/templates/web/dashboard.html rename to coco/web/templates/web/dashboard.html diff --git a/ipynbsrv/web/templates/web/errors/404.html b/coco/web/templates/web/errors/404.html similarity index 100% rename from ipynbsrv/web/templates/web/errors/404.html rename to coco/web/templates/web/errors/404.html diff --git a/ipynbsrv/web/templates/web/errors/500.html b/coco/web/templates/web/errors/500.html similarity index 100% rename from ipynbsrv/web/templates/web/errors/500.html rename to coco/web/templates/web/errors/500.html diff --git a/ipynbsrv/web/templates/web/images/index.html b/coco/web/templates/web/images/index.html similarity index 100% rename from ipynbsrv/web/templates/web/images/index.html rename to coco/web/templates/web/images/index.html diff --git a/ipynbsrv/web/templates/web/images/manage.html b/coco/web/templates/web/images/manage.html similarity index 100% rename from ipynbsrv/web/templates/web/images/manage.html rename to coco/web/templates/web/images/manage.html diff --git a/ipynbsrv/web/templates/web/images/modal_addgroups.html b/coco/web/templates/web/images/modal_addgroups.html similarity index 100% rename from ipynbsrv/web/templates/web/images/modal_addgroups.html rename to coco/web/templates/web/images/modal_addgroups.html diff --git a/ipynbsrv/web/templates/web/images/modal_addusers.html b/coco/web/templates/web/images/modal_addusers.html similarity index 100% rename from ipynbsrv/web/templates/web/images/modal_addusers.html rename to coco/web/templates/web/images/modal_addusers.html diff --git a/ipynbsrv/web/templates/web/images/modal_create.html b/coco/web/templates/web/images/modal_create.html similarity index 100% rename from ipynbsrv/web/templates/web/images/modal_create.html rename to coco/web/templates/web/images/modal_create.html diff --git a/ipynbsrv/web/templates/web/notifications/index.html b/coco/web/templates/web/notifications/index.html similarity index 100% rename from ipynbsrv/web/templates/web/notifications/index.html rename to coco/web/templates/web/notifications/index.html diff --git a/ipynbsrv/web/templates/web/notifications/modal_create.html b/coco/web/templates/web/notifications/modal_create.html similarity index 100% rename from ipynbsrv/web/templates/web/notifications/modal_create.html rename to coco/web/templates/web/notifications/modal_create.html diff --git a/ipynbsrv/web/templates/web/shares/index.html b/coco/web/templates/web/shares/index.html similarity index 100% rename from ipynbsrv/web/templates/web/shares/index.html rename to coco/web/templates/web/shares/index.html diff --git a/ipynbsrv/web/templates/web/shares/manage.html b/coco/web/templates/web/shares/manage.html similarity index 100% rename from ipynbsrv/web/templates/web/shares/manage.html rename to coco/web/templates/web/shares/manage.html diff --git a/ipynbsrv/web/templates/web/shares/modal_addgroups.html b/coco/web/templates/web/shares/modal_addgroups.html similarity index 100% rename from ipynbsrv/web/templates/web/shares/modal_addgroups.html rename to coco/web/templates/web/shares/modal_addgroups.html diff --git a/ipynbsrv/web/templates/web/shares/modal_addusers.html b/coco/web/templates/web/shares/modal_addusers.html similarity index 100% rename from ipynbsrv/web/templates/web/shares/modal_addusers.html rename to coco/web/templates/web/shares/modal_addusers.html diff --git a/ipynbsrv/web/templates/web/shares/modal_create.html b/coco/web/templates/web/shares/modal_create.html similarity index 100% rename from ipynbsrv/web/templates/web/shares/modal_create.html rename to coco/web/templates/web/shares/modal_create.html diff --git a/ipynbsrv/web/templates/web/snippets/container_grid.html b/coco/web/templates/web/snippets/container_grid.html similarity index 100% rename from ipynbsrv/web/templates/web/snippets/container_grid.html rename to coco/web/templates/web/snippets/container_grid.html diff --git a/ipynbsrv/web/templates/web/snippets/messages.html b/coco/web/templates/web/snippets/messages.html similarity index 100% rename from ipynbsrv/web/templates/web/snippets/messages.html rename to coco/web/templates/web/snippets/messages.html diff --git a/ipynbsrv/web/templates/web/snippets/navbar.html b/coco/web/templates/web/snippets/navbar.html similarity index 95% rename from ipynbsrv/web/templates/web/snippets/navbar.html rename to coco/web/templates/web/snippets/navbar.html index b5427da..a88f9a6 100644 --- a/ipynbsrv/web/templates/web/snippets/navbar.html +++ b/coco/web/templates/web/snippets/navbar.html @@ -1,6 +1,6 @@ {% load settings %} -