Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
jm committed Sep 6, 2024
1 parent fbcde18 commit e41c479
Show file tree
Hide file tree
Showing 423 changed files with 151,256 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*
!assets
!assets
!Remote-Handle-Resolver
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__tmp
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Remote-Handle-Resolver"]
path = Remote-Handle-Resolver
url = [email protected]/dataquest-dev/Remote-Handle-Resolver.git
28 changes: 20 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
FROM alpine:3.8
FROM maven:3.9.9-eclipse-temurin-22-alpine as builder
WORKDIR /build/
COPY Remote-Handle-Resolver /build
RUN ls -lah /build/ && \
cd /build/ && \
mvn clean install

WORKDIR /opt/src/
FROM alpine/java:22-jdk
WORKDIR /app/

RUN apk update && \
apk info cloc && \
apk add cloc
RUN cloc --version
COPY assets/handle-9.3.1 /app/hs/
COPY assets/config/* /app/config/
COPY --from=builder /build/target/dspace-remote-handle-resolver*.jar /app/hs/lib/

ENTRYPOINT [ "cloc" ]
CMD [ "--version" ]
RUN mkdir -p /app/logs && \
sed -i 's/net\.handle\.server\.Main "\$@"/ \$HANDLEJAVACMD net.handle.server.Main "\$@"/' /app/hs/bin/hdl

env HANDLEJAVACMD=" -Dlog4j.debug=true -Dlog4j.configuration=file:///app/config/log4j-handle-plugin.properties -Ddspace.handle.plugin.configuration=/app/config/handle-dspace-plugin.cfg"

RUN ls -lah /app && \
ls -lah /app/hs/

CMD [ "/app/hs/bin/hdl-server", "/app/config/" ]
6 changes: 6 additions & 0 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM maven:3.9.9-eclipse-temurin-22-alpine as builder
WORKDIR /build/
COPY Remote-Handle-Resolver /build
RUN ls -lah /build/ && \
cd /build/ && \
mvn clean install
15 changes: 15 additions & 0 deletions Dockerfile.fast
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM alpine/java:22-jdk
WORKDIR /app/

COPY assets/handle-9.3.1 /app/hs/
COPY assets/config/* /app/config/

RUN mkdir -p /app/logs && \
sed -i 's/net\.handle\.server\.Main "\$@"/ \$HANDLEJAVACMD net.handle.server.Main "\$@"/' /app/hs/bin/hdl

env HANDLEJAVACMD=" -Dlog4j.debug=true -Dlog4j.configuration=file:///app/config/log4j-handle-plugin.properties -Ddspace.handle.plugin.configuration=/app/config/handle-dspace-plugin.cfg"

RUN ls -lah /app && \
ls -lah /app/hs/

CMD [ "/app/hs/bin/hdl-server", "/app/config/" ]
29 changes: 28 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,31 @@

# Overview

Dockerized https://github.com/DSpace/Remote-Handle-Resolver
Dockerized https://github.com/DSpace/Remote-Handle-Resolver.

## Installation

1. Generate your own configuration by running:
```
docker run --rm -it -v %cd%:/app/ alpine/java:22-jdk /bin/sh /app/assets/handle-9.3.1/bin/hdl-setup-server /app/assets/config
```
or
```
docker run --rm -it -v $(pwd):/app/ alpine/java:22-jdk /bin/sh /app/bin/hdl-setup-server /app/assets/config
```

2. Update handle-dspace-plugin.cfg and/or other files in assets/config. Verify config.dct has correct prefix values.

3. Make sure that dspace backend is running with, see https://wiki.lyrasis.org/display/DSDOC7x/Handle.Net+Registry+Support

```
handle.remote-resolver.enabled = true
```
e.g., https://dev-5.pc:8443/server/listhandles/123456789 should work


# Structure

* Dockerfile - multi-stage build, builds plugin, creates handle server with provided configs,
* Dockerfile.fast - creates handle server with provided configs,
* Dockerfile.build - builds plugin, copies .jar to assets/lib/
1 change: 1 addition & 0 deletions Remote-Handle-Resolver
Submodule Remote-Handle-Resolver added at 66caf4
5 changes: 5 additions & 0 deletions assets/config-debug/log4j-handle-plugin.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
log4j.rootCategory=DEBUG, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d %-5p %c @ %m%n
log4j.logger.org.apache.axis.handlers.http.HTTPAuthHandler=DEBUG
Binary file added assets/config/admpriv.bin
Binary file not shown.
Binary file added assets/config/admpub.bin
Binary file not shown.
56 changes: 56 additions & 0 deletions assets/config/config.dct
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"hdl_http_config" = {
"bind_address" = "0.0.0.0"
"num_threads" = "15"
"bind_port" = "8000"
"log_accesses" = "yes"
}

"server_type" = "server"
"hdl_udp_config" = {
"bind_address" = "0.0.0.0"
"num_threads" = "15"
"bind_port" = "2641"
"log_accesses" = "yes"
}

"hdl_tcp_config" = {
"bind_address" = "0.0.0.0"
"num_threads" = "15"
"bind_port" = "2641"
"log_accesses" = "yes"
}

"log_save_config" = {
"log_save_directory" = "logs"
"log_save_interval" = "Monthly"
}

"no_udp_resolution" = "no"
"interfaces" = (
"hdl_udp"
"hdl_tcp"
"hdl_http"
)

"server_config" = {
"server_admins" = (
"300:0.NA/YOUR_PREFIX"
)

"replication_admins" = (
"300:0.NA/YOUR_PREFIX"
)

"max_session_time" = "86400000"
"this_server_id" = "1"
"max_auth_time" = "60000"
"server_admin_full_access" = "yes"
"case_sensitive" = "no"
"auto_homed_prefixes" = (
"0.NA/YOUR_PREFIX"
)

}

}
60 changes: 60 additions & 0 deletions assets/config/config.dct.before_setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"hdl_http_config" = {
"bind_address" = "0.0.0.0"
"num_threads" = "15"
"bind_port" = "8000"
"log_accesses" = "yes"
}

"server_type" = "server"
"hdl_udp_config" = {
"bind_address" = "0.0.0.0"
"num_threads" = "15"
"bind_port" = "2641"
"log_accesses" = "yes"
}

"hdl_tcp_config" = {
"bind_address" = "0.0.0.0"
"num_threads" = "15"
"bind_port" = "2641"
"log_accesses" = "yes"
}

"log_save_config" = {
"log_save_directory" = "logs"
"log_save_interval" = "Monthly"
}

"no_udp_resolution" = "no"
"interfaces" = (
"hdl_udp"
"hdl_tcp"
"hdl_http"
)

"server_config" = {

"storage_type" = "CUSTOM"
"storage_class" = "org.dspace.handle.MultiRemoteDSpaceRepositoryHandlePlugin"

"server_admins" = (
"300:0.NA/YOUR_PREFIX"
)

"replication_admins" = (
"300:0.NA/YOUR_PREFIX"
)

"max_session_time" = "86400000"
"this_server_id" = "1"
"max_auth_time" = "60000"
"server_admin_full_access" = "yes"
"case_sensitive" = "no"
"auto_homed_prefixes" = (
"0.NA/YOUR_PREFIX"
)

}

}
4 changes: 4 additions & 0 deletions assets/config/contactdata.dct
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"contact_email" = "[email protected]"
"org_name" = "ORG"
}
1 change: 1 addition & 0 deletions assets/config/handle-dspace-plugin.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dspace.handle.endpoint1 = http://dev-5.pc:88/server
7 changes: 7 additions & 0 deletions assets/config/log4j-handle-plugin.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
log4j.rootCategory=DEBUG, A1
log4j.appender.A1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A1.File=/app/logs/handle-plugin.log
log4j.appender.A1.DatePattern= '.' yyyy-MM-dd
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d %-5p %c @ %m%n
log4j.logger.org.apache.axis.handlers.http.HTTPAuthHandler=DEBUG
Binary file added assets/config/privkey.bin
Binary file not shown.
Binary file added assets/config/pubkey.bin
Binary file not shown.
Binary file added assets/config/sitebndl.zip
Binary file not shown.
47 changes: 47 additions & 0 deletions assets/config/siteinfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"version": 1,
"protocolVersion": "2.11",
"serialNumber": 1,
"primarySite": true,
"multiPrimary": false,
"attributes": [
{
"name": "desc",
"value": "Short description"
}
],
"servers": [
{
"serverId": 1,
"address": "172.17.0.2",
"publicKey": {
"format": "key",
"value": {
"kty": "RSA",
"n": "sA_kJbk5sKY_thNoi7gmfHe9pmvvFBIf_mho9Jl774c3bZYqKl6UMTgfN-gHOCZr1b3jjjL0SbAznm988KE6eaBQRsu7XhvjTImO2zdKlotjKvDVCprJCMgTpGh04CAAcf3UG4kmWfoSV_nWXpBj6wDb_HJL2gujsoTQh0XMCPjwNYMjI89SSTqiivaNEChoTUxnqRnWMe7VHtYLgJZp0DxKv3kghYQOuuxWL8JOGZ99CC7OEJJFCY1L_D-Vnp0kL4d_hPw2xTWKypcrNH_5brtGbPOcVVbUxCtbVOIahPV30iIBTEddIgRa3lqjPn92fv2Ip9MZCWGrSujFHHdYfQ",
"e": "AQAB"
}
},
"interfaces": [
{
"query": true,
"admin": true,
"protocol": "TCP",
"port": 2641
},
{
"query": true,
"admin": false,
"protocol": "UDP",
"port": 2641
},
{
"query": true,
"admin": true,
"protocol": "HTTP",
"port": 8000
}
]
}
]
}
Binary file added assets/config/webapps/admin.war
Binary file not shown.
Loading

0 comments on commit e41c479

Please sign in to comment.