diff --git a/Vagrantfile b/Vagrantfile index 2cfc039..2bca70d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -64,6 +64,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provision :shell, :path => "./scripts/drupal.sh", :args => home_dir config.vm.provision :shell, :path => "./scripts/fcrepo.sh", :args => home_dir config.vm.provision :shell, :path => "./scripts/blazegraph.sh", :args => home_dir + config.vm.provision :shell, :path => "./scripts/syn.sh", :args => home_dir config.vm.provision :shell, :path => "./scripts/karaf.sh", :args => home_dir config.vm.provision :shell, :path => "./scripts/alpaca.sh", :args => home_dir config.vm.provision :shell, :path => "./scripts/islandora-karaf-components.sh", :args => home_dir diff --git a/configs/Syn/syn-settings.xml b/configs/Syn/syn-settings.xml new file mode 100644 index 0000000..33dbf2a --- /dev/null +++ b/configs/Syn/syn-settings.xml @@ -0,0 +1,3 @@ + + + diff --git a/configs/Syn/web.xml b/configs/Syn/web.xml new file mode 100644 index 0000000..aa63f1e --- /dev/null +++ b/configs/Syn/web.xml @@ -0,0 +1,67 @@ + + + + + Fedora 4 + + + contextConfigLocation + WEB-INF/classes/spring/master.xml + + + + org.fcrepo.http.commons.FedoraContextLoaderListener + + + + jersey-servlet + org.glassfish.jersey.servlet.ServletContainer + + + javax.ws.rs.Application + org.fcrepo.http.commons.FedoraApplication + + + 1 + + + + jersey-servlet + /rest/* + + + + + ETagFilter + org.springframework.web.filter.ShallowEtagHeaderFilter + + + + ETagFilter + /static/* + + + + + Fedora4 + /* + + + * + + + NONE + + + + islandora + + + BASIC + fcrepo + + + diff --git a/configs/drupal/jwt.config.yml b/configs/drupal/jwt.config.yml new file mode 100644 index 0000000..49199f0 --- /dev/null +++ b/configs/drupal/jwt.config.yml @@ -0,0 +1,2 @@ +algorithm: RS256 +key_id: islandora_rsa_key diff --git a/configs/drupal/key.key.islandora_rsa_key.yml b/configs/drupal/key.key.islandora_rsa_key.yml new file mode 100644 index 0000000..8154ca8 --- /dev/null +++ b/configs/drupal/key.key.islandora_rsa_key.yml @@ -0,0 +1,18 @@ +uuid: 7f805322-14df-4eac-bfa1-d2f800fccbe3 +langcode: en +status: true +dependencies: + module: + - jwt +id: islandora_rsa_key +label: 'Islandora RSA Key' +description: '' +key_type: jwt_rs +key_type_settings: + algorithm: RS256 +key_provider: file +key_provider_settings: + file_location: /home/ubuntu/auth/private.key +key_input: none +key_input_settings: { } + diff --git a/scripts/drupal.sh b/scripts/drupal.sh index 2c4d132..a0b9345 100755 --- a/scripts/drupal.sh +++ b/scripts/drupal.sh @@ -124,3 +124,8 @@ chmod -R g+w "$DRUPAL_HOME" chmod -R 755 "$DRUPAL_HOME"/web/libraries usermod -a -G www-data ubuntu +# Add files and config for JWT Tokens +mkdir "$HOME_DIR/auth" +openssl genrsa -out "$HOME_DIR/auth/private.key" 2048 +openssl rsa -pubout -in "$HOME_DIR/auth/private.key" -out "$HOME_DIR/auth/public.key" +$DRUSH_CMD config-import -y --partial --source="$HOME_DIR/islandora/configs/drupal/" diff --git a/scripts/syn.sh b/scripts/syn.sh new file mode 100755 index 0000000..994f5bd --- /dev/null +++ b/scripts/syn.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# Syn +echo "Building Syn" + +HOME_DIR=$1 + +if [ -f "$HOME_DIR/islandora/configs/variables" ]; then + . "$HOME_DIR"/islandora/configs/variables +fi + +cd "$HOME_DIR" +git clone https://github.com/jonathangreen/Syn.git +cd Syn +chown -R ubuntu:ubuntu "$HOME_DIR/Syn" +sudo -u ubuntu ./gradlew build + +cp build/libs/islandora-syn-*-all.jar /var/lib/tomcat8/lib/ +sed -i 's|| \n|g' /var/lib/tomcat8/conf/context.xml +cp "$HOME_DIR/islandora/configs/Syn/web.xml" /var/lib/tomcat8/webapps/fcrepo/WEB-INF/web.xml +cp "$HOME_DIR/islandora/configs/Syn/syn-settings.xml" /var/lib/tomcat8/conf/syn-settings.xml + +service tomcat8 restart