Automated nextcloud saml and new make all

darta 2021-05-28 13:52:45 +00:00
parent d5d3c57479
commit e7fb9d8c12
3 changed files with 35 additions and 11 deletions

View File

@ -12,6 +12,9 @@ export VERSION
CUSTOM_PATH=$(shell pwd)
.PHONY: all
all: add-plugins
.PHONY: environment
environment:
git submodule update --init --recursive
@ -86,7 +89,11 @@ remove: down
# Leaves haproxy folder with certificates. Remove manually to get new certificates.
.PHONY: add-plugins
add-plugins:
add-plugins: connect-saml
# Wordpress
## Multisite
docker exec -ti isard-apps-wordpress /bin/sh -c "/multisite.sh"
# Nextcloud
#cp -R $$BUILD_ROOT_PATH/isard-apps/docker/nextcloud/themes/* $$DATA_FOLDER/nextcloud/themes/
docker exec -u www-data isard-apps-nextcloud-app php occ --no-warnings config:system:set default_language --value="ca"
@ -136,10 +143,18 @@ add-plugins:
# Content-Security-Policy: font-src 'self' *.$$DOMAIN;
docker exec -ti isard-apps-nextcloud-app sed -ie "/protected \\\$$allowedFontDomains = \[/{n;s/\('\\\\\'self\\\\\'\)\('\)/\1 *.$$DOMAIN\2/}" /var/www/html/lib/public/AppFramework/Http/ContentSecurityPolicy.php
# Wordpress
## Multisite
docker exec -ti isard-apps-wordpress /bin/sh -c "/multisite.sh"
# SAML PLUGIN NEXTCLOUD
docker exec -ti isard-sso-admin /bin/sh -c "/admin/nextcloud_gencerts.sh"
docker exec -ti isard-sso-admin python3 /admin/nextcloud_saml.py
# SAML PLUGIN MOODLE
echo "To add SAML to moodle:"
echo "1.-Activate SAML plugin in moodle extensions, regenerate certificate, lock certificate"
echo "2.-Then run: docker exec -ti isard-sso-admin python3 /admin/nextcloud_saml.py"
echo "3.-"
.PHONY: connect-saml
connect-saml:
connect-saml: up
echo "Waiting for system to be fully up before personalizing... It can take some minutes..."
while [ "`docker inspect -f {{.State.Health.Status}} isard-apps-moodle`" != "healthy" ]; do sleep 2; done

View File

@ -48,14 +48,23 @@ cp -R custom.sample custom
Edit and replace files to personalize system.
```
make up
make all
```
Wait till apps come up and add plugins:
NOTE: The SAML Auth in plugin automation status now is:
- Moodle: Not fully automated.
1. Login to moodle as admin via: https://moodle.\<domain\>/login/index.php?saml=off
2. Go to authentication configuration: https://moodle.\<domain\>/admin/settings.php?section=manageauths
3. Enable SAML2 clicking the eye.
4. Clic on *configuration* on SAML2
5. Click on the *Regenerate certificate* button inside the form. After that go back to SAML2 configuration page.
6. Click on the *Lock certificate* button.
7. In the terminal execute the script to autoconfigure: docker exec isard-sso-admin python3 moodle_saml.py
8. The last thing is to purge moodle cache: [[missing docker exec php-fpm7 script, do it through moodle web ui]]
- Nextcloud: Fully automated. After finishing the *make all* should be ready
- Wordpress: Nothing automated. Refer to isard-sso/docs
```
make add-plugins
```
## Extended
You can start this project in any docker & docker-compose host (any OS should work). To install those packages in your distro refer to docker & docker-compose in this documentation and in the sysadm folder you have some scripts.

@ -1 +1 @@
Subproject commit 0a695041fc51c7149832316334a1589ac99dd141
Subproject commit 04319b9d0655d5d845f7d08afe2b64123ada60e3