Skip to content
Snippets Groups Projects
Commit 7135a0c0 authored by Alexander König's avatar Alexander König
Browse files

handle doesn't need its own database

parent ac6d38da
No related branches found
No related tags found
No related merge requests found
......@@ -80,15 +80,12 @@ RUN make new_deploy
COPY commul-customization/hdl-setup.tmp /tmp/
RUN cat /tmp/hdl-setup.tmp | /opt/lindat-dspace/installation/bin/dspace make-handle-config /opt/lindat-dspace/installation/handle-server/
COPY commul-customization/config.dct /opt/lindat-dspace/installation/handle-server/config.dct
# RUN perl -pi -e 's/YOUR_NAMING_AUTHORITY/20.500.12124/' /opt/lindat-dspace/installation/handle-server/config.dct
# RUN perl -pi -e 's/case_sensitive" = "no/case_sensitive" = "yes/' /opt/lindat-dspace/installation/handle-server/config.dct
# RUN perl -i -plne 'print " \"storage_type\" = \"CUSTOM\"\n\ \"storage_class\" = \"org.dspace.handle.HandlePlugin\"" if(/max_session/);' /opt/lindat-dspace/installation/handle-server/config.dct
# RUN perl -pi -e 's/193.106.181.70/dspace/' /opt/lindat-dspace/installation/handle-server/config.dct
RUN cp /opt/repository/workspace/config/etc/default/handle-server /etc/default/
RUN cp /opt/repository/workspace/config/etc/init.d/handle-server /etc/init.d/
RUN chmod +x /etc/init.d/handle-server
RUN perl -pi -e 's#DSPACE_INSTALLATION_DIRECTORY=#DSPACE_INSTALLATION_DIRECTORY=/opt/lindat-dspace/installation#' /etc/default/handle-server
# copy entrypoint script and start
COPY commul-customization/entrypoint.sh /usr/bin/entrypoint.sh
RUN chmod u+x /usr/bin/entrypoint.sh
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
......
......@@ -2,19 +2,20 @@ FROM postgres:9.6
LABEL maintainer="Alexander König <Alexander.Koenig@eurac.edu>"
# install git
# RUN apt-get update &&\
# apt-get -y install git
RUN apt-get update && apt-get -y install git
# copy int db script
RUN mkdir -p /docker-entrypoint-initdb.d
COPY commul-customization/init-dspace-dbs.sh /docker-entrypoint-initdb.d/
COPY commul-customization/create_handle_db.sql /docker-entrypoint-initdb.d/
RUN chmod +x /docker-entrypoint-initdb.d/*
# copy over modified config file
#COPY commul-customization/postgresql.conf /tmp/
#COPY commul-customization/updateConfig.sh /docker-entrypoint-initdb.d/_updateConfig.sh
# copy utilities generating script
# copy script generating utilities db
RUN mkdir /tmp/sql/
COPY adapt_utilities_sql.sh /tmp/sql/
RUN /tmp/sql/adapt_utilities_sql.sh
......@@ -32,7 +32,6 @@
)
"server_config" = {
"storage_type" = "sql"
"server_admins" = (
"300:0.NA/20.500.12124"
)
......@@ -52,14 +51,6 @@
"case_sensitive" = "yes"
"sql_settings" = {
"sql_url" = "jdbc:postgresql://postgres:5432/${HANDLE_DBNAME}"
"sql_driver" = "org.postgresql.Driver"
"sql_login" = "${HANDLE_USER}"
"sql_passwd" = "${HANDLE_PASSWORD}"
"sql_read_only" = "no"
}
}
}
create user ${HANDLE_USER} with password '${HANDLE_PASSWORD}';
create database ${HANDLE_DBNAME} with owner ${HANDLE_USER};
create table nas (
na varchar(255) not null,
PRIMARY KEY(na)
);
create table handles (
handle varchar(255) not null,
idx int4 not null,
type blob,
data blob,
ttl_type int2,
ttl int4,
timestamp int4,
refs blob,
admin_read bool,
admin_write bool,
pub_read bool,
pub_write bool,
PRIMARY KEY(handle, idx)
);
create table nas (
na bytea not null,
primary key(na));
create table handles (
handle bytea not null,
idx int4 not null,
type bytea,
data bytea,
ttl_type int2,
ttl int4,
timestamp int4,
refs text,
admin_read bool,
admin_write bool,
pub_read bool,
pub_write bool,
primary key(handle, idx));
create index dataindex on handles ( data );
create index handleindex on handles ( handle );
grant all on nas,handles to ${HANDLE_USER};
grant select on nas,handles to public;
......@@ -2,12 +2,12 @@
set -e
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
CREATE USER dspace WITH PASSWORD 'dspace1234';
CREATE DATABASE "XXX-LR-DATABASE" OWNER dspace ENCODING "UTF-8" TEMPLATE template0;
CREATE DATABASE "XXX-UTILS-DATABASE" OWNER dspace ENCODING "UTF-8" TEMPLATE template0;
CREATE USER $DSPACE_USER WITH PASSWORD '$DSPACE_PASSWORD';
CREATE DATABASE "$DSPACE_DBNAME" OWNER $DSPACE_USER ENCODING "UTF-8" TEMPLATE template0;
CREATE DATABASE "$DSPACE_UTILSDBNAME" OWNER $DSPACE_USER ENCODING "UTF-8" TEMPLATE template0;
EOSQL
psql --username "$POSTGRES_USER" --set=utildir="/tmp/sql/" -p 5432 XXX-UTILS-DATABASE < /tmp/sql/utilities.sql
psql --username "$POSTGRES_USER" --set=utildir="/tmp/sql/" -p 5432 $DSPACE_UTILSDBNAME < /tmp/sql/utilities.sql
# this is a better version using kubernetes environment variables
##!/bin/bash
......
......@@ -50,22 +50,7 @@ spec:
secretKeyRef:
key: mail.pass
name: dspace-secrets
- name: HANDLE_USER
valueFrom:
secretKeyRef:
key: handle.user
name: dspace-secrets
- name: HANDLE_PASSWORD
valueFrom:
secretKeyRef:
key: handle.pass
name: dspace-secrets
- name: HANDLE_DBNAME
valueFrom:
secretKeyRef:
key: handle.db.name
name: dspace-secrets
image: gitlab.scientificnet.org:4567/commul/dspace/dspace-image:0.4
image: gitlab.scientificnet.org:4567/commul/dspace/dspace-image:0.4.6
name: clarin-dspace
imagePullPolicy: Always
ports:
......
......@@ -20,7 +20,7 @@ spec:
io.kompose.service: nginx
spec:
containers:
- image: gitlab.scientificnet.org:4567/commul/dspace/nginx-image:0.4
- image: gitlab.scientificnet.org:4567/commul/dspace/nginx-image:0.4.6
name: clarin-nginx
ports:
- containerPort: 80
......
......@@ -48,22 +48,7 @@ spec:
secretKeyRef:
key: dspace.utils.name
name: dspace-secrets
- name: HANDLE_PASSWORD
valueFrom:
secretKeyRef:
key: handle.pass
name: dspace-secrets
- name: HANDLE_DBNAME
valueFrom:
secretKeyRef:
key: handle.db.name
name: dspace-secrets
- name: HANDLE_USER
valueFrom:
secretKeyRef:
key: handle.user
name: dspace-secrets
image: gitlab.scientificnet.org:4567/commul/dspace/postgres-image:0.4
image: gitlab.scientificnet.org:4567/commul/dspace/postgres-image:0.4.6
imagePullPolicy: Always
name: clarin-postgres
resources: {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment