diff --git a/.gitignore b/.gitignore index cb3bd75..225e4d8 100644 --- a/.gitignore +++ b/.gitignore @@ -12,5 +12,3 @@ coco/web/static/bower_components coco/web/static/css/main.css # mkdocs generated files coco/web/static/docs/user-guide/* -# migrations -**/migrations/* diff --git a/coco/core/conf.py b/coco/core/conf.py index a954752..d595150 100644 --- a/coco/core/conf.py +++ b/coco/core/conf.py @@ -53,7 +53,7 @@ description='The full class path of the user backend to use.') config.set('USER_BACKEND_ARGS', - default='{"server": "coco_ldap", "base_dn": "dc=coco,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"}).""") diff --git a/coco/core/migrations/__init__.py b/coco/core/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/coco/core/signals/notifications.py b/coco/core/signals/notifications.py index 28aa0d5..1eda5e4 100644 --- a/coco/core/signals/notifications.py +++ b/coco/core/signals/notifications.py @@ -1,6 +1,6 @@ -from coca.core.models import CollaborationGroup, Notification, \ +from coco.core.models import CollaborationGroup, Notification, \ NotificationLog -from coca.core.signals.signals import * +from coco.core.signals.signals import * from django.db.models.signals import m2m_changed, post_delete, post_save from django.dispatch import receiver diff --git a/coco/web/static/css/bootstrap-multiselect.css b/coco/web/static/css/bootstrap-multiselect.css deleted file mode 100644 index 13de57b..0000000 --- a/coco/web/static/css/bootstrap-multiselect.css +++ /dev/null @@ -1 +0,0 @@ -.multiselect-container{position:absolute;list-style-type:none;margin:0;padding:0}.multiselect-container .input-group{margin:5px}.multiselect-container>li{padding:0}.multiselect-container>li>a.multiselect-all label{font-weight:700}.multiselect-container>li.multiselect-group label{margin:0;padding:3px 20px 3px 20px;height:100%;font-weight:700}.multiselect-container>li.multiselect-group-clickable label{cursor:pointer}.multiselect-container>li>a{padding:0}.multiselect-container>li>a>label{margin:0;height:100%;cursor:pointer;font-weight:400;padding:3px 20px 3px 40px}.multiselect-container>li>a>label.radio,.multiselect-container>li>a>label.checkbox{margin:0}.multiselect-container>li>a>label>input[type=checkbox]{margin-bottom:5px}.btn-group>.btn-group:nth-child(2)>.multiselect.btn{border-top-left-radius:4px;border-bottom-left-radius:4px}.form-inline .multiselect-container label.checkbox,.form-inline .multiselect-container label.radio{padding:3px 20px 3px 40px}.form-inline .multiselect-container li a label.checkbox input[type=checkbox],.form-inline .multiselect-container li a label.radio input[type=radio]{margin-left:-20px;margin-right:0} \ No newline at end of file diff --git a/coco/web/static/css/components.css b/coco/web/static/css/components.css deleted file mode 100644 index 8b31d45..0000000 --- a/coco/web/static/css/components.css +++ /dev/null @@ -1,15 +0,0 @@ -.-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/coco/web/static/css/plugins.css b/coco/web/static/css/plugins.css deleted file mode 100644 index 6b4e0a5..0000000 --- a/coco/web/static/css/plugins.css +++ /dev/null @@ -1,23 +0,0 @@ -div.dataTables_filter label, -div.dataTables_length label { - font-weight: bold; -} -div.dataTables_filter label input, -div.dataTables_length label input, -div.dataTables_filter label select, -div.dataTables_length label select { - font-weight: normal; -} -.table > thead > tr > th { - border-bottom: 0; -} -table.dataTable thead th { - border-bottom: 0; -} -table.dataTable.no-footer { - border-bottom: 0; -} -.dataTables_wrapper .dataTables_paginate .paginate_button { - margin-left: -1px; - padding: 0; -} diff --git a/coco/web/static/less/components.less b/coco/web/static/less/components.less index b39829e..7d0e3f2 100644 --- a/coco/web/static/less/components.less +++ b/coco/web/static/less/components.less @@ -1,7 +1,7 @@ // // Navbar // -------------------------- -.-navbar +.coco-navbar { margin-bottom: 30px; background-color: #3465a4; @@ -34,4 +34,4 @@ border-radius: 50%; text-align: center; padding: 0; -} \ No newline at end of file +} diff --git a/docs/install/installation.md b/docs/install/installation.md index e86bc65..7c59cf7 100644 --- a/docs/install/installation.md +++ b/docs/install/installation.md @@ -327,7 +327,6 @@ As we are using `LESS` to produce `CSS` and `bower` to manage external dependenc ```bash $ cd coco/web/static $ bower install --allow-root # installs external dependencies -$ mkdir css $ lessc less/main.less css/main.css # compile LESS to CSS $ cd ../../.. ``` @@ -344,8 +343,10 @@ $ mkdocs build --clean Last but not least, finalize the whole setup by issueing: ```bash +cd /srv/coco/_repo python manage.py collectstatic python manage.py createsuperuser +ln -s /srv/coco/_repo /srv/coco/www ``` which will create a local superuser account (the admin account). diff --git a/lib/scripts/create_wui_container.sh b/lib/scripts/create_app_container.sh similarity index 93% rename from lib/scripts/create_wui_container.sh rename to lib/scripts/create_app_container.sh index 9dba1c6..ddd771f 100755 --- a/lib/scripts/create_wui_container.sh +++ b/lib/scripts/create_app_container.sh @@ -12,7 +12,7 @@ if [ "$EUID" -ne 0 ]; then exit 1 fi -CT_NAME="coco_wui" +CT_NAME="coco_app" CMD="/sbin/my_init -- /usr/bin/uwsgi_python --ini /srv/coco/_repo/lib/confs/uwsgi/coco.ini" echo "------------------------------------------------------------" @@ -32,7 +32,7 @@ echo "Committing the WUI container so we can create a new one from it..." echo "------------------------------------------------------------" sleep 2 -docker commit $CT_NAME coco/wui:install +docker commit $CT_NAME coco/app:install docker rm $CT_NAME echo "------------------------------------------------------------" @@ -43,8 +43,9 @@ sleep 2 # create the new container with mounted directories docker run \ --detach=true --interactive=false \ + --restart=always \ --name="${CT_NAME}" \ -p 80:80 \ --link coco_ldap:coco_ldap --link coco_postgresql:coco_postgresql \ -v /srv/coco/data:/srv/coco/data \ - coco/wui:init $CMD + coco/app:install $CMD diff --git a/lib/scripts/create_ldap_container.sh b/lib/scripts/create_ldap_container.sh index aeeb02c..abe4f15 100755 --- a/lib/scripts/create_ldap_container.sh +++ b/lib/scripts/create_ldap_container.sh @@ -33,9 +33,10 @@ echo "------------------------------------------------------------" sleep 2 docker run \ + --restart=always \ --name "${CT_NAME}" \ -v /srv/coco/ldap:/var/lib/ldap \ - -p 389:389 \ + -p 192.168.0.1:389:389 \ -e LDAP_DOMAIN="coco.ldap" \ -e LDAP_ORGANISATION="coco" \ -e LDAP_ROOTPASS="${PASSWORD}" \ diff --git a/lib/scripts/create_postgresql_container.sh b/lib/scripts/create_postgresql_container.sh index 15bb7cb..9f79c9b 100755 --- a/lib/scripts/create_postgresql_container.sh +++ b/lib/scripts/create_postgresql_container.sh @@ -34,11 +34,12 @@ echo "------------------------------------------------------------" sleep 2 docker run \ + --restart=always \ --name "${CT_NAME}" \ -v /srv/coco/postgresql:/var/lib/postgresql/data \ -e POSTGRES_USER="coco" \ -e POSTGRES_PASSWORD="${PASSWORD}" \ - -d postgres:9.4.0 + -d postgres echo "------------------------------------------------------------" echo "All done!" diff --git a/lib/scripts/setup_docker_host.sh b/lib/scripts/setup_docker_host.sh index e30a82e..448ce76 100755 --- a/lib/scripts/setup_docker_host.sh +++ b/lib/scripts/setup_docker_host.sh @@ -17,12 +17,6 @@ if [ "$EUID" -ne 0 ]; then exit 1 fi -echo "------------------------------------------------------------" -echo "Note: During installation, you'll be prompted with a dialog to configure the LDAP client." -echo "Make sure you enter 'ldap://127.0.0.1/' and 'dc=coco,dc=ldap'." -echo "------------------------------------------------------------" -sleep 2 - # detect the package manager if `which apt-get &> /dev/null`; then PS="deb" @@ -65,32 +59,13 @@ mkdir -p $DATA mkdir -p $DATA/ldap mkdir -p $DATA/postgresql # create the directories for the users and shares -mkdir -p $DATA/homes -mkdir -p $DATA/public -mkdir -p $DATA/shares +mkdir -p $DATA/data/homes +mkdir -p $DATA/data/public +mkdir -p $DATA/data/shares # ensure secure permissions. just in cast a custom umask is set chown -R root:root $DATA chmod -R 0755 $DATA -# install the LDAP client tools -# we need to know all LDAP users because the home/share directories will belong to them -echo "------------------------------------------------------------" -echo "Going to install the PAM LDAP package..." -echo "When asked for the nsswitch services to configure, choose 'group', 'passwd' and 'shadow'." -echo "------------------------------------------------------------" -sleep 2 -if [ $PS == "deb" ]; then - $INSTALL libpam-ldap -else - $INSTALL nss-pam-ldapd - authconfig-tui - # disable caching server, made problems - systemctl stop nslcd.service - systemctl disable nslcd.service -fi -# configure that we want to use LDAP for passwd etc. -sed -i 's/compat/compat ldap/' /etc/nsswitch.conf - echo "------------------------------------------------------------" echo "All done! You should now reboot the machine." echo "------------------------------------------------------------"