mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-10-11 14:37:13 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f67f76eef | ||
|
|
002ed4bc77 | ||
|
|
9d48e79c64 | ||
|
|
ba7db26157 | ||
|
|
fc6129261b | ||
|
|
7702d98766 | ||
|
|
04ed016175 | ||
|
|
1aaaf95950 | ||
|
|
1e334ca7d5 | ||
|
|
74df4b6a9c | ||
|
|
f63463e654 | ||
|
|
a24b633ccb | ||
|
|
5b8cd8cdcc | ||
|
|
c35c85e9b5 | ||
|
|
2ffc1641a0 | ||
|
|
9d67dceff3 | ||
|
|
c449a31b37 | ||
|
|
efd3427fc0 | ||
|
|
88ed017ca7 | ||
|
|
30ba3a4b78 | ||
|
|
c8380daee5 | ||
|
|
8afb1651fd | ||
|
|
9560903c80 | ||
|
|
e94f6608d2 | ||
|
|
949faf1620 | ||
|
|
5b3259b1ef | ||
|
|
485d7b0612 | ||
|
|
94b037428e | ||
|
|
b401873298 | ||
|
|
1c9bbee3b3 | ||
|
|
5fa33c7813 | ||
|
|
581d5fde1d | ||
|
|
382336d39d | ||
|
|
5bd3a818a3 | ||
|
|
97874f3481 | ||
|
|
135bafefeb | ||
|
|
15b8c5a7e7 | ||
|
|
15990071d4 | ||
|
|
d00f9d3609 | ||
|
|
5ad745de75 | ||
|
|
b67580af2c | ||
|
|
2900062df5 | ||
|
|
67fe8931dd | ||
|
|
e6f593e8c4 | ||
|
|
8924740cfe | ||
|
|
34d4ae0b59 | ||
|
|
62a4541df5 | ||
|
|
401958c0d6 | ||
|
|
8859d223bf | ||
|
|
621962ad9c | ||
|
|
5c238af3df | ||
|
|
8e148095f0 | ||
|
|
3c55a05b1c | ||
|
|
d293a65f5e | ||
|
|
e6bfa01db5 | ||
|
|
4e122a67d3 | ||
|
|
b11863d3b2 | ||
|
|
93197ffb77 | ||
|
|
f02baa8761 | ||
|
|
19e39b84ec | ||
|
|
53800e460f | ||
|
|
e061cc7163 | ||
|
|
e61942f33e | ||
|
|
f8b97bf909 | ||
|
|
ed272da302 | ||
|
|
e8b7975295 | ||
|
|
cae1a20973 | ||
|
|
165150a852 | ||
|
|
ad2674bf8e | ||
|
|
b72266f7bf | ||
|
|
79c864ae19 | ||
|
|
451eec4db5 | ||
|
|
539f7ada70 | ||
|
|
c60156d245 | ||
|
|
281bd3660f |
No files matched your search
@@ -2,13 +2,13 @@ version: 2
|
|||||||
jobs:
|
jobs:
|
||||||
minecraft_server:
|
minecraft_server:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/buildpack-deps:18.04
|
- image: circleci/buildpack-deps:19.10
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- setup_remote_docker
|
- setup_remote_docker
|
||||||
- run:
|
- run:
|
||||||
name: Build image
|
name: Build image
|
||||||
command: docker build -t mc:$CIRCLE_BUILD_NUM minecraft-server
|
command: docker build -t mc:$CIRCLE_BUILD_NUM .
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
data
|
||||||
|
examples
|
||||||
|
k8s-examples
|
||||||
|
.idea
|
||||||
+2
-5
@@ -1,5 +1,2 @@
|
|||||||
root = true
|
[start-*]
|
||||||
|
indent_size = 2
|
||||||
[*]
|
|
||||||
end_of_line = lf
|
|
||||||
indent_style = space
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
daysUntilClose: 14
|
||||||
|
responseRequiredLabel: "status/waiting on feedback"
|
||||||
|
closeComment: >
|
||||||
|
This issue has been automatically closed because there has been no response
|
||||||
|
after requesting feedback. Please feel free to re-open this issue if the
|
||||||
|
scenario still exists and provide a comment with more information.
|
||||||
+2
-1
@@ -1,2 +1,3 @@
|
|||||||
|
/data/
|
||||||
|
/.idea/
|
||||||
*.iml
|
*.iml
|
||||||
.idea
|
|
||||||
+77
@@ -0,0 +1,77 @@
|
|||||||
|
FROM openjdk:8u212-jre-alpine
|
||||||
|
|
||||||
|
LABEL maintainer "itzg"
|
||||||
|
|
||||||
|
RUN apk add --no-cache -U \
|
||||||
|
openssl \
|
||||||
|
imagemagick \
|
||||||
|
lsof \
|
||||||
|
su-exec \
|
||||||
|
shadow \
|
||||||
|
bash \
|
||||||
|
curl iputils wget \
|
||||||
|
git \
|
||||||
|
jq \
|
||||||
|
mysql-client \
|
||||||
|
tzdata \
|
||||||
|
rsync \
|
||||||
|
nano
|
||||||
|
|
||||||
|
HEALTHCHECK --start-period=1m CMD mc-monitor status --host localhost --port $SERVER_PORT
|
||||||
|
|
||||||
|
RUN addgroup -g 1000 minecraft \
|
||||||
|
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
|
||||||
|
&& mkdir -m 777 /data /mods /config /plugins \
|
||||||
|
&& chown minecraft:minecraft /data /config /mods /plugins /home/minecraft
|
||||||
|
|
||||||
|
EXPOSE 25565 25575
|
||||||
|
|
||||||
|
# hook into docker BuildKit --platform support
|
||||||
|
# see https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
|
||||||
|
ARG TARGETOS=linux
|
||||||
|
ARG TARGETARCH=amd64
|
||||||
|
ARG TARGETVARIANT=""
|
||||||
|
|
||||||
|
ARG EASY_ADD_VER=0.7.1
|
||||||
|
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VER}/easy-add_${TARGETOS}_${TARGETARCH}${TARGETVARIANT} /usr/bin/easy-add
|
||||||
|
RUN chmod +x /usr/bin/easy-add
|
||||||
|
|
||||||
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
|
--var version=1.2.0 --var app=restify --file {{.app}} \
|
||||||
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
|
--var version=1.4.7 --var app=rcon-cli --file {{.app}} \
|
||||||
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
|
--var version=0.1.7 --var app=mc-monitor --file {{.app}} \
|
||||||
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
|
--var version=1.3.3 --var app=mc-server-runner --file {{.app}} \
|
||||||
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
|
RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
||||||
|
--var version=0.1.1 --var app=maven-metadata-release --file {{.app}} \
|
||||||
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
|
COPY mcstatus /usr/local/bin
|
||||||
|
|
||||||
|
VOLUME ["/data","/mods","/config"]
|
||||||
|
COPY server.properties /tmp/server.properties
|
||||||
|
COPY log4j2.xml /tmp/log4j2.xml
|
||||||
|
WORKDIR /data
|
||||||
|
|
||||||
|
ENTRYPOINT [ "/start" ]
|
||||||
|
|
||||||
|
ENV UID=1000 GID=1000 \
|
||||||
|
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
||||||
|
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
|
||||||
|
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||||
|
RESOURCE_PACK= RESOURCE_PACK_SHA1= \
|
||||||
|
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= MODS= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true SERVER_NAME="Dedicated Server" \
|
||||||
|
REPLACE_ENV_VARIABLES="FALSE" ENV_VARIABLE_PREFIX="CFG_"
|
||||||
|
|
||||||
|
COPY start* /
|
||||||
|
RUN dos2unix /start* && chmod +x /start*
|
||||||
File renamed without changes.
@@ -1,10 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
pkgs=ubuntu-openjdk-7
|
|
||||||
pkgs="$pkgs minecraft-server"
|
|
||||||
pkgs="$pkgs titan-gremlin"
|
|
||||||
|
|
||||||
for p in $pkgs
|
|
||||||
do
|
|
||||||
docker build -t itzg/$p $p
|
|
||||||
done
|
|
||||||
-11
@@ -1,11 +0,0 @@
|
|||||||
machine:
|
|
||||||
services:
|
|
||||||
- docker
|
|
||||||
|
|
||||||
test:
|
|
||||||
override:
|
|
||||||
- ./build
|
|
||||||
|
|
||||||
notify:
|
|
||||||
webhooks:
|
|
||||||
- url: https://webhooks.gitter.im/e/4726bb683d8aed018486
|
|
||||||
Executable
+18
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
manifest="itzg/minecraft-server:multiarch"
|
||||||
|
|
||||||
|
for t in latest rpi3 aarch64; do
|
||||||
|
docker pull itzg/minecraft-server:$t
|
||||||
|
done
|
||||||
|
|
||||||
|
docker manifest create --amend ${manifest} \
|
||||||
|
itzg/minecraft-server:aarch64 \
|
||||||
|
itzg/minecraft-server:latest \
|
||||||
|
itzg/minecraft-server:rpi3
|
||||||
|
|
||||||
|
docker manifest annotate --os linux --arch amd64 ${manifest} itzg/minecraft-server:latest
|
||||||
|
docker manifest annotate --os linux --arch arm64 ${manifest} itzg/minecraft-server:aarch64
|
||||||
|
docker manifest annotate --os linux --arch arm --variant v7 ${manifest} itzg/minecraft-server:rpi3
|
||||||
|
|
||||||
|
docker manifest push ${manifest}
|
||||||
File renamed without changes.
Executable
+98
@@ -0,0 +1,98 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#set -x
|
||||||
|
# Use this variable to indicate a list of branches that docker hub is watching
|
||||||
|
branches_list=('openj9' 'openj9-nightly' 'adopt11' 'multiarch' 'armv7')
|
||||||
|
|
||||||
|
. /start-utils
|
||||||
|
|
||||||
|
function TrapExit {
|
||||||
|
log "Checking out back in master"
|
||||||
|
git checkout master
|
||||||
|
}
|
||||||
|
|
||||||
|
batchMode=false
|
||||||
|
|
||||||
|
while getopts "b" arg
|
||||||
|
do
|
||||||
|
case $arg in
|
||||||
|
b)
|
||||||
|
batchMode=true
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
log "Unsupported arg $arg"
|
||||||
|
exit 2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
${batchMode} && log "Using batch mode"
|
||||||
|
|
||||||
|
trap TrapExit EXIT SIGTERM
|
||||||
|
|
||||||
|
test -d ./.git || { log ".git folder was not found. Please start this script from root directory of the project!";
|
||||||
|
exit 1; }
|
||||||
|
|
||||||
|
# Making sure we are in master
|
||||||
|
git checkout master
|
||||||
|
git pull --all || { log "Can't pull the repo!"; \
|
||||||
|
exit 1; }
|
||||||
|
|
||||||
|
git_branches=$(git branch -a)
|
||||||
|
|
||||||
|
for branch in "${branches_list[@]}"; do
|
||||||
|
if [[ "$git_branches" != *"$branch"* ]]; then
|
||||||
|
log "Can't update $branch because I can't find it in the list of branches."
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
log "Branch $branch found. Working with it."
|
||||||
|
git checkout "$branch" || { log "Can't checkout into the branch. Don't know the cause."; \
|
||||||
|
exit 1; }
|
||||||
|
proceed='False'
|
||||||
|
while [[ "$proceed" == "False" ]]; do
|
||||||
|
# Ensure local branch is aligned with remote since docker-versions-create may have been run elsewhere
|
||||||
|
git pull
|
||||||
|
|
||||||
|
if git merge -m 'Auto-merging via docker-versions-create' master; then
|
||||||
|
proceed="True"
|
||||||
|
log "Branch $branch updated to current master successfully"
|
||||||
|
# pushing changes to remote for this branch
|
||||||
|
git commit -m "Auto merge branch with master" -a
|
||||||
|
# push may fail if remote doesn't have this branch yet. In this case - sending branch
|
||||||
|
git push || git push -u origin "$branch" || { log "Can't push changes to the origin."; exit 1; }
|
||||||
|
elif ${batchMode}; then
|
||||||
|
status=$?
|
||||||
|
log "Git merge failed in batch mode"
|
||||||
|
exit ${status}
|
||||||
|
# and trap exit gets us back to master
|
||||||
|
else
|
||||||
|
cat<<EOL
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
Master merge in the branch $branch encountered an error!
|
||||||
|
You may try to fix the error and merge again. (Commit changes)
|
||||||
|
Or skip this branch merge completely.
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
EOL
|
||||||
|
printf "Should we try again? (y):"
|
||||||
|
read -r answer
|
||||||
|
if [[ "$answer" == '' ]] || [[ "$answer" == 'y' ]] || [[ "$answer" == 'Y' ]]; then
|
||||||
|
# If you use non-local editor or files are changed in repo
|
||||||
|
cat <<EOL
|
||||||
|
|
||||||
|
The following commands may encounter an error!
|
||||||
|
This is completely fine if the changes were made locally and remote branch doesn't know about them.
|
||||||
|
|
||||||
|
EOL
|
||||||
|
# Updating branch from remote before trying again
|
||||||
|
git checkout master
|
||||||
|
git fetch --all
|
||||||
|
git pull -a
|
||||||
|
git checkout "$branch"
|
||||||
|
continue
|
||||||
|
else
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Deployment Examples
|
||||||
|
|
||||||
|
This directory contains various deployment examples of the [itzg/minecraft-server](https://hub.docker.com/r/itzg/minecraft-server/) Docker image.
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,50 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: example
|
||||||
|
name: example
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
serviceName: example
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: example
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: example
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: mc
|
||||||
|
image: itzg/minecraft-server
|
||||||
|
env:
|
||||||
|
- name: EULA
|
||||||
|
value: "TRUE"
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /data
|
||||||
|
name: data
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: data
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
service: example
|
||||||
|
name: example
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 25565
|
||||||
|
targetPort: 25565
|
||||||
|
selector:
|
||||||
|
app: example
|
||||||
|
type: LoadBalancer
|
||||||
+16
@@ -33,6 +33,22 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 25565
|
- containerPort: 25565
|
||||||
name: main
|
name: main
|
||||||
|
readinessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- mcstatus
|
||||||
|
- localhost
|
||||||
|
- ping
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 5
|
||||||
|
livenessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- mcstatus
|
||||||
|
- localhost
|
||||||
|
- ping
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 5
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: mc-data
|
- name: mc-data
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
FROM java:8
|
|
||||||
|
|
||||||
LABEL maintainer "itzg"
|
|
||||||
|
|
||||||
ENV GITBLIT_VERSION 1.7.1
|
|
||||||
|
|
||||||
RUN wget -qO /tmp/gitblit.tgz http://dl.bintray.com/gitblit/releases/gitblit-$GITBLIT_VERSION.tar.gz
|
|
||||||
|
|
||||||
RUN tar -C /opt -xvf /tmp/gitblit.tgz && \
|
|
||||||
rm /tmp/gitblit.tgz
|
|
||||||
|
|
||||||
VOLUME ["/data"]
|
|
||||||
|
|
||||||
ADD start.sh /start
|
|
||||||
|
|
||||||
ENV GITBLIT_PATH=/opt/gitblit-${GITBLIT_VERSION} \
|
|
||||||
GITBLIT_HTTPS_PORT=443 \
|
|
||||||
GITBLIT_HTTP_PORT=80 \
|
|
||||||
GITBLIT_BASE_FOLDER=/data \
|
|
||||||
GITBLIT_ADMIN_USER=admin \
|
|
||||||
GITBLIT_INITIAL_REPO=
|
|
||||||
WORKDIR $GITBLIT_PATH
|
|
||||||
|
|
||||||
EXPOSE 80 443
|
|
||||||
|
|
||||||
ENTRYPOINT ["/start"]
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
Provides a ready-to-use instance of [GitBlit](http://gitblit.com/).
|
|
||||||
|
|
||||||
## Basic usage
|
|
||||||
|
|
||||||
Start the GitBlit container using
|
|
||||||
|
|
||||||
docker run -d -p 80:80 -p 443:443 --name gitblit itzg/gitblit
|
|
||||||
|
|
||||||
Access its web interface at the mapped HTTP (80) or HTTPS (443) port of the
|
|
||||||
Docker host. Login with the default credentials __admin__ / __admin__ .
|
|
||||||
|
|
||||||
|
|
||||||
## Data volume
|
|
||||||
|
|
||||||
In order to allow for future upgrades, run the container with a volume mount of `/data`, such as:
|
|
||||||
|
|
||||||
-v /tmp/gitblit-data:/data
|
|
||||||
|
|
||||||
## Initial repository creation
|
|
||||||
|
|
||||||
As a convenience for cluster configuration management with git
|
|
||||||
(such as with [Spring Cloud Config](https://cloud.spring.io/spring-cloud-config/)),
|
|
||||||
you may specify the name of an initial repository to be owned by the 'admin' user.
|
|
||||||
This can be enabled by passing the name of that repository via the environment
|
|
||||||
variable `GITBLIT_INITIAL_REPO`, such as
|
|
||||||
|
|
||||||
-e GITBLIT_INITIAL_REPO=default
|
|
||||||
|
|
||||||
## Create repositories with content
|
|
||||||
|
|
||||||
In addition to the approach above, you can push repostories with existing
|
|
||||||
content by attaching them to sub-directories of `/repos`, such as
|
|
||||||
|
|
||||||
docker run -v $HOME/git/example:/repos/example ...
|
|
||||||
|
|
||||||
## Custom configuration
|
|
||||||
|
|
||||||
You can add or override any of the `*.properties` files for configuring GitBlit,
|
|
||||||
typically `gitblit.properties`, by placing those files in a volume attached at
|
|
||||||
`/config`, such as
|
|
||||||
|
|
||||||
-v $(pwd)/extra-config:/config
|
|
||||||
|
|
||||||
The property files in that configuration directory will be renamed with the
|
|
||||||
suffix `.applied` to avoid overwriting manually modified configuration on
|
|
||||||
the next container startup.
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
apply_base_data() {
|
|
||||||
contents=`ls $GITBLIT_BASE_FOLDER|wc -l`
|
|
||||||
|
|
||||||
if [ $contents = "0" ]; then
|
|
||||||
cp -r $GITBLIT_PATH/data/* $GITBLIT_BASE_FOLDER
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
apply_config() {
|
|
||||||
cp -rf /config/* $GITBLIT_BASE_FOLDER
|
|
||||||
}
|
|
||||||
|
|
||||||
create_repo() {
|
|
||||||
local repo_dir=$GITBLIT_BASE_FOLDER/git/$1.git
|
|
||||||
mkdir -p $repo_dir
|
|
||||||
cd $repo_dir
|
|
||||||
|
|
||||||
git init --bare
|
|
||||||
|
|
||||||
echo "
|
|
||||||
[gitblit]
|
|
||||||
description =
|
|
||||||
originRepository =
|
|
||||||
owner = $GITBLIT_ADMIN_USER
|
|
||||||
acceptNewPatchsets = true
|
|
||||||
acceptNewTickets = true
|
|
||||||
mergeTo = master
|
|
||||||
useIncrementalPushTags = false
|
|
||||||
allowForks = true
|
|
||||||
accessRestriction = PUSH
|
|
||||||
authorizationControl = AUTHENTICATED
|
|
||||||
verifyCommitter = false
|
|
||||||
showRemoteBranches = false
|
|
||||||
isFrozen = false
|
|
||||||
skipSizeCalculation = false
|
|
||||||
skipSummaryMetrics = false
|
|
||||||
federationStrategy = FEDERATE_THIS
|
|
||||||
isFederated = false
|
|
||||||
gcThreshold =
|
|
||||||
gcPeriod = 0
|
|
||||||
" >> config
|
|
||||||
|
|
||||||
git config --replace-all core.logallrefupdates false
|
|
||||||
|
|
||||||
echo "
|
|
||||||
CREATING repository '$1' with:
|
|
||||||
* read/clone access for all
|
|
||||||
* push access for authenticated users"
|
|
||||||
|
|
||||||
RET="file://$repo_dir"
|
|
||||||
}
|
|
||||||
|
|
||||||
apply_repos() {
|
|
||||||
for rdir in /repos/*; do
|
|
||||||
if [ -e $rdir/.git ]; then
|
|
||||||
r=$(basename $rdir)
|
|
||||||
create_repo $r
|
|
||||||
local url=$RET
|
|
||||||
cd $rdir
|
|
||||||
echo "* pushed existing content"
|
|
||||||
git push --all $url
|
|
||||||
fi
|
|
||||||
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
create_initial_repo() {
|
|
||||||
if [ -d $GITBLIT_INITIAL_REPO ]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
create_repo $GITBLIT_INITIAL_REPO
|
|
||||||
}
|
|
||||||
|
|
||||||
shopt -s nullglob
|
|
||||||
if [ ! -f /var/local/gitblit_firststart ]; then
|
|
||||||
FIRSTSTART=1
|
|
||||||
else
|
|
||||||
FIRSTSTART=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $FIRSTSTART = 1 ]; then
|
|
||||||
apply_base_data
|
|
||||||
|
|
||||||
echo "
|
|
||||||
Applying configuration from /config
|
|
||||||
"
|
|
||||||
apply_config
|
|
||||||
touch /var/local/gitblit_firststart
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [[ -n $GITBLIT_INITIAL_REPO ]]; then
|
|
||||||
create_initial_repo
|
|
||||||
fi
|
|
||||||
apply_repos
|
|
||||||
|
|
||||||
cd $GITBLIT_PATH
|
|
||||||
$JAVA_HOME/bin/java -jar $GITBLIT_PATH/gitblit.jar \
|
|
||||||
--httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT \
|
|
||||||
--baseFolder $GITBLIT_BASE_FOLDER
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/site
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
FROM ubuntu:trusty
|
|
||||||
|
|
||||||
LABEL maintainer "itzg"
|
|
||||||
|
|
||||||
ENV APT_GET_UPDATE 2014-09-18
|
|
||||||
|
|
||||||
RUN apt-get update
|
|
||||||
RUN apt-get -y upgrade
|
|
||||||
|
|
||||||
RUN apt-get -y install ruby ruby-dev make patch nodejs
|
|
||||||
RUN gem install bundler
|
|
||||||
|
|
||||||
ADD Gemfile /tmp/Gemfile
|
|
||||||
WORKDIR /tmp
|
|
||||||
RUN bundle install
|
|
||||||
|
|
||||||
ADD template /site-template
|
|
||||||
|
|
||||||
VOLUME ["/site"]
|
|
||||||
EXPOSE 4000
|
|
||||||
|
|
||||||
ADD start.sh /start
|
|
||||||
CMD ["/start"]
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
source 'https://rubygems.org'
|
|
||||||
gem 'github-pages'
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
This container is pre-configured according to the
|
|
||||||
[GitHub Pages use of Jekyll](https://help.github.com/articles/using-jekyll-with-pages).
|
|
||||||
|
|
||||||
It serves up the generated content on port 4000 and the site is generated from
|
|
||||||
the container's `/site` volume. You can either bring your own site content or
|
|
||||||
let it generate some VERY simple content along with the standard Jekyll directory
|
|
||||||
layout.
|
|
||||||
|
|
||||||
A typical way to run this:
|
|
||||||
|
|
||||||
docker run -it -p 4000:4000 -v $(pwd)/site:/site itzg/jekyll-github-pages
|
|
||||||
|
|
||||||
where either it will load your content or initialize the content under
|
|
||||||
`site` in your current working directory.
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [ `ls /site/index.* 2> /dev/null | wc -l` = 0 ]; then
|
|
||||||
echo "Preparing /site with default content..."
|
|
||||||
cp -r /site-template/* /site
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e /site/Gemfile ]; then
|
|
||||||
cp /tmp/Gemfile /site/Gemfile
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd /site
|
|
||||||
bundle exec jekyll serve
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
highlighter: pygments
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<footer>
|
|
||||||
<i>Goodbye</i>
|
|
||||||
</footer>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<header>
|
|
||||||
<h1>{{ page.title }}</h1>
|
|
||||||
</header>
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en-US">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
|
|
||||||
<title>{{ page.title }}</title>
|
|
||||||
|
|
||||||
<!-- Latest compiled and minified CSS -->
|
|
||||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
|
||||||
|
|
||||||
<!-- Optional theme -->
|
|
||||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
|
|
||||||
|
|
||||||
<!-- Latest compiled and minified JavaScript -->
|
|
||||||
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
|
||||||
</head>
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{% include top.html %}
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
{% include header.html %}
|
|
||||||
|
|
||||||
{{ content }}
|
|
||||||
|
|
||||||
{% include footer.html %}
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
---
|
|
||||||
layout: default
|
|
||||||
title: Powered by Jekyll
|
|
||||||
overview: true
|
|
||||||
---
|
|
||||||
This is where the content goes.
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
FROM java:openjdk-8u102-jdk
|
|
||||||
|
|
||||||
LABEL maintainer "itzg"
|
|
||||||
|
|
||||||
RUN apt-get update && \
|
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
|
||||||
graphviz \
|
|
||||||
&& apt-get clean
|
|
||||||
|
|
||||||
ENV JENKINS_HOME=/data
|
|
||||||
|
|
||||||
VOLUME ["/data", "/root", "/opt/jenkins"]
|
|
||||||
EXPOSE 8080 38252
|
|
||||||
|
|
||||||
COPY download-and-start.sh /opt/download-and-start
|
|
||||||
|
|
||||||
CMD ["/opt/download-and-start"]
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
A self-upgrading [Jenkins CI](http://jenkins-ci.org/) server
|
|
||||||
|
|
||||||
# Basic Usage
|
|
||||||
|
|
||||||
To start Jenkins with the latest version:
|
|
||||||
|
|
||||||
ID=$(docker run -d -p 8080:8080 itzg/jenkins)
|
|
||||||
|
|
||||||
At a later time, you can upgrade by restarting the container:
|
|
||||||
|
|
||||||
docker stop $ID
|
|
||||||
docker start $ID
|
|
||||||
|
|
||||||
# Attaching host directory to Jenkins home directory
|
|
||||||
|
|
||||||
The Jenkins home directory is attachable at `/data`, so attaching to a host volume
|
|
||||||
would be:
|
|
||||||
|
|
||||||
ID=$(docker run -d -p 8080:8080 -v /SOME_HOST_DIR:/data itzg/jenkins
|
|
||||||
|
|
||||||
# Enabling Jenkins slave agents
|
|
||||||
|
|
||||||
By default, Jenkins will pick a random port to allow slave nodes launched
|
|
||||||
by JNLP. Since Docker networking is basically a firewall, a random port
|
|
||||||
won't work for us. Instead the fixed port **38252** was chosen (arbitrarily)
|
|
||||||
to be exposed by the container.
|
|
||||||
|
|
||||||
Launch your Jenkins container using
|
|
||||||
|
|
||||||
ID=$(docker run -d -p 8080:8080 -p 38252:38252 itzg/jenkins)
|
|
||||||
|
|
||||||
and configure the port in the Global Security settings:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
# Image Parameters
|
|
||||||
|
|
||||||
## Volumes
|
|
||||||
|
|
||||||
* `/data` - a majority of the Jenkins content is maintained here, such as workspaces
|
|
||||||
* `/root` - some tools, such as Maven, utilize the home directory for default repository storage
|
|
||||||
* `/opt/jenkins` - the installed distribution is expanded here
|
|
||||||
|
|
||||||
## Ports
|
|
||||||
|
|
||||||
* `8080` - for the web UI
|
|
||||||
* `38252` - for slave incoming JMX access
|
|
||||||
|
|
||||||
## Environment Variables
|
|
||||||
|
|
||||||
* `JENKINS_OPTS` - passed to the initial Java invocation of Jenkins
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
mirrorUrl=http://mirrors.jenkins-ci.org/war/latest/jenkins.war
|
|
||||||
url=$(curl -s --head $mirrorUrl|awk -F': ' '$1 == "Location" { print $2 }' | sed 's/[[:space:]]*$//')
|
|
||||||
version=$(echo $url | sed 's#.*/war/\(.*\)/jenkins.war#\1#')
|
|
||||||
|
|
||||||
mkdir -p /opt/jenkins
|
|
||||||
trackingFile=/opt/jenkins/INSTALLED
|
|
||||||
|
|
||||||
installed=
|
|
||||||
if [ -f $trackingFile ]; then
|
|
||||||
installed=$(cat $trackingFile)
|
|
||||||
echo "Version installed is $installed"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $version != "$installed" ]; then
|
|
||||||
echo "Downloading $version from '$url'"
|
|
||||||
while ! curl -s -o /opt/jenkins/jenkins.war "$url"
|
|
||||||
do
|
|
||||||
echo "Trying again in 5 seconds"
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
|
|
||||||
echo $version > $trackingFile
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
cd /opt/jenkins
|
|
||||||
exec java $JENKINS_OPTS -jar jenkins.war
|
|
||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Configuration status="WARN" packages="com.mojang.util">
|
||||||
|
<Appenders>
|
||||||
|
<Console name="SysOut" target="SYSTEM_OUT">
|
||||||
|
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
|
||||||
|
</Console>
|
||||||
|
<Queue name="ServerGuiConsole">
|
||||||
|
<PatternLayout pattern="[%d{HH:mm:ss} %level]: %msg%n" />
|
||||||
|
</Queue>
|
||||||
|
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
|
||||||
|
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
|
||||||
|
<Policies>
|
||||||
|
<TimeBasedTriggeringPolicy />
|
||||||
|
<OnStartupTriggeringPolicy />
|
||||||
|
</Policies>
|
||||||
|
<DefaultRolloverStrategy>
|
||||||
|
<Delete basePath="logs">
|
||||||
|
<IfFileName glob="*.log.gz" />
|
||||||
|
<IfLastModified age="7d" />
|
||||||
|
</Delete>
|
||||||
|
</DefaultRolloverStrategy>
|
||||||
|
</RollingRandomAccessFile>
|
||||||
|
</Appenders>
|
||||||
|
<Loggers>
|
||||||
|
<Root level="info">
|
||||||
|
<filters>
|
||||||
|
<MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY" onMismatch="NEUTRAL" />
|
||||||
|
</filters>
|
||||||
|
<AppenderRef ref="SysOut"/>
|
||||||
|
<AppenderRef ref="File"/>
|
||||||
|
<AppenderRef ref="ServerGuiConsole"/>
|
||||||
|
</Root>
|
||||||
|
</Loggers>
|
||||||
|
</Configuration>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
##### mcstatus shim for mc-monitor
|
||||||
|
# handles translating calls to
|
||||||
|
# mcstatus (host:port) (command)
|
||||||
|
# where the actual command is ignore, but is typically ping or status
|
||||||
|
|
||||||
|
addr="$1"
|
||||||
|
|
||||||
|
IFS=':'
|
||||||
|
read -a parts <<< "${addr}"
|
||||||
|
if [[ ${#parts[*]} -gt 1 ]]; then
|
||||||
|
exec mc-monitor status --host ${parts[0]} --port ${parts[1]}
|
||||||
|
else
|
||||||
|
exec mc-monitor status --host ${parts[0]}
|
||||||
|
fi
|
||||||
@@ -1 +0,0 @@
|
|||||||
data
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
[start-*]
|
|
||||||
indent_size = 2
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/data/
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
FROM openjdk:8u212-jre-alpine
|
|
||||||
|
|
||||||
LABEL maintainer "itzg"
|
|
||||||
|
|
||||||
RUN apk add --no-cache -U \
|
|
||||||
openssl \
|
|
||||||
imagemagick \
|
|
||||||
lsof \
|
|
||||||
su-exec \
|
|
||||||
shadow \
|
|
||||||
bash \
|
|
||||||
curl iputils wget \
|
|
||||||
git \
|
|
||||||
jq \
|
|
||||||
mysql-client \
|
|
||||||
tzdata \
|
|
||||||
rsync \
|
|
||||||
nano \
|
|
||||||
python python-dev py2-pip
|
|
||||||
|
|
||||||
RUN pip install mcstatus yq
|
|
||||||
|
|
||||||
HEALTHCHECK CMD mcstatus localhost:$SERVER_PORT ping
|
|
||||||
|
|
||||||
RUN addgroup -g 1000 minecraft \
|
|
||||||
&& adduser -Ss /bin/false -u 1000 -G minecraft -h /home/minecraft minecraft \
|
|
||||||
&& mkdir -m 777 /data /mods /config /plugins \
|
|
||||||
&& chown minecraft:minecraft /data /config /mods /plugins /home/minecraft
|
|
||||||
|
|
||||||
EXPOSE 25565 25575
|
|
||||||
|
|
||||||
RUN echo 'hosts: files dns' > /etc/nsswitch.conf
|
|
||||||
|
|
||||||
ARG RESTIFY_VER=1.1.6
|
|
||||||
ARG RCON_CLI_VER=1.4.6
|
|
||||||
ARG MC_SERVER_RUNNER_VER=1.3.2
|
|
||||||
ARG TOF_BUILDTOOLS_VER=1.2.0
|
|
||||||
ARG ARCH=amd64
|
|
||||||
|
|
||||||
ADD https://github.com/itzg/restify/releases/download/${RESTIFY_VER}/restify_${RESTIFY_VER}_linux_${ARCH}.tar.gz /tmp/restify.tgz
|
|
||||||
RUN tar -x -C /usr/local/bin -f /tmp/restify.tgz restify && \
|
|
||||||
rm /tmp/restify.tgz
|
|
||||||
|
|
||||||
ADD https://github.com/itzg/rcon-cli/releases/download/${RCON_CLI_VER}/rcon-cli_${RCON_CLI_VER}_linux_${ARCH}.tar.gz /tmp/rcon-cli.tgz
|
|
||||||
RUN tar -x -C /usr/local/bin -f /tmp/rcon-cli.tgz rcon-cli && \
|
|
||||||
rm /tmp/rcon-cli.tgz
|
|
||||||
|
|
||||||
ADD https://github.com/itzg/mc-server-runner/releases/download/${MC_SERVER_RUNNER_VER}/mc-server-runner_${MC_SERVER_RUNNER_VER}_linux_${ARCH}.tar.gz /tmp/mc-server-runner.tgz
|
|
||||||
RUN tar -x -C /usr/local/bin -f /tmp/mc-server-runner.tgz mc-server-runner && \
|
|
||||||
rm /tmp/mc-server-runner.tgz
|
|
||||||
|
|
||||||
ADD https://git.faldoria.de/tof/server/build-tools/-/jobs/artifacts/buildtools-${TOF_BUILDTOOLS_VER}/raw/target/ToF-BuildTools.jar?job=release-artifact /tmp/tof-buildtools/BuildTools.jar
|
|
||||||
|
|
||||||
ONBUILD ARG BUILDTOOLS_OUTPUT=/plugins
|
|
||||||
ONBUILD COPY *Dockerfile* *plugins.yml /tmp/tof-buildtools/
|
|
||||||
ONBUILD RUN \
|
|
||||||
[ -d /tmp/tof-buildtools ] && \
|
|
||||||
[ $(find /tmp/tof-buildtools -type f -name plugins.yml | wc -l) -gt 0 ] && \
|
|
||||||
java -jar /tmp/tof-buildtools/BuildTools.jar \
|
|
||||||
--config "/tmp/tof-buildtools/plugins.yml" \
|
|
||||||
--configs "plugins.yml" \
|
|
||||||
--dir "/tmp/tof-buildtools/" \
|
|
||||||
--output ${BUILDTOOLS_OUTPUT} && \
|
|
||||||
chown -R minecraft:minecraft ${BUILDTOOLS_OUTPUT} && \
|
|
||||||
rm -fR /tmp/tof-buildtools/ || \
|
|
||||||
true
|
|
||||||
|
|
||||||
COPY mcadmin.jq /usr/share
|
|
||||||
RUN chmod +x /usr/local/bin/*
|
|
||||||
|
|
||||||
VOLUME ["/data","/mods","/config"]
|
|
||||||
COPY server.properties /tmp/server.properties
|
|
||||||
WORKDIR /data
|
|
||||||
|
|
||||||
ENTRYPOINT [ "/start" ]
|
|
||||||
|
|
||||||
ENV UID=1000 GID=1000 \
|
|
||||||
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
|
||||||
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
|
|
||||||
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
|
||||||
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= MODS= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true SERVER_NAME="Dedicated Server" \
|
|
||||||
REPLACE_ENV_VARIABLES="FALSE" ENV_VARIABLE_PREFIX="CFG_"
|
|
||||||
|
|
||||||
COPY start* /
|
|
||||||
RUN dos2unix /start* && chmod +x /start*
|
|
||||||
+3
-1023
File diff suppressed because it is too large.
Load diff
@@ -1,7 +0,0 @@
|
|||||||
.[] |
|
|
||||||
select(.elements | length > 1) |
|
|
||||||
select(.elements[].elements[] | select(.class == "version" and .text == $version)) |
|
|
||||||
.elements[].elements[] |
|
|
||||||
select(.class|contains("server-jar")) |
|
|
||||||
.elements[] | select(.name="a") |
|
|
||||||
.href
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
umask 0002
|
|
||||||
chmod g+w /data
|
|
||||||
|
|
||||||
if [ $(id -u) = 0 ]; then
|
|
||||||
if [[ -v UID && $UID != $(id -u) ]]; then
|
|
||||||
usermod -u $UID minecraft
|
|
||||||
fi
|
|
||||||
if [[ -v GID ]]; then
|
|
||||||
groupmod -o -g $GID minecraft
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $(stat -c "%u" /data) != $UID ]]; then
|
|
||||||
echo "Changing ownership of /data to $UID ..."
|
|
||||||
chown -R minecraft:minecraft /data
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec su-exec minecraft:minecraft /start-configuration $@
|
|
||||||
else
|
|
||||||
exec /start-configuration $@
|
|
||||||
fi
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
export SERVER=paper_server.jar
|
|
||||||
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
|
||||||
downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/latest/download}
|
|
||||||
echo "Downloading Paper $VANILLA_VERSION from $downloadUrl ..."
|
|
||||||
curl -fsSL -o $SERVER "$downloadUrl"
|
|
||||||
if [ ! -f $SERVER ]; then
|
|
||||||
echo "ERROR: failed to download from $downloadUrl (status=$?)"
|
|
||||||
exit 3
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Normalize on Spigot for operations below
|
|
||||||
export TYPE=SPIGOT
|
|
||||||
|
|
||||||
# Continue to Final Setup
|
|
||||||
exec /start-finalSetup01World $@
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# CURSE_URL_BASE used in manifest downloads below
|
|
||||||
CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
|
|
||||||
|
|
||||||
# Remove old mods/plugins
|
|
||||||
if [ "$REMOVE_OLD_MODS" = "TRUE" ]; then
|
|
||||||
if [ "$TYPE" = "SPIGOT" ]; then
|
|
||||||
rm -rf /data/plugins/*
|
|
||||||
else
|
|
||||||
rm -rf /data/mods/*
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
|
|
||||||
if [[ "$MODPACK" ]]; then
|
|
||||||
EFFECTIVE_MODPACK_URL=$(curl -Ls -o /dev/null -w %{url_effective} $MODPACK)
|
|
||||||
case "X$EFFECTIVE_MODPACK_URL" in
|
|
||||||
X[Hh][Tt][Tt][Pp]*.zip)
|
|
||||||
echo "Downloading mod/plugin pack via HTTP"
|
|
||||||
echo " from $EFFECTIVE_MODPACK_URL ..."
|
|
||||||
if ! curl -sSL -o /tmp/modpack.zip "$EFFECTIVE_MODPACK_URL"; then
|
|
||||||
echo "ERROR: failed to download from $EFFECTIVE_MODPACK_URL"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$TYPE" = "SPIGOT" ]; then
|
|
||||||
mkdir -p /data/plugins
|
|
||||||
if ! unzip -o -d /data/plugins /tmp/modpack.zip; then
|
|
||||||
echo "ERROR: failed to unzip the modpack from $EFFECTIVE_MODPACK_URL"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
mkdir -p /data/mods
|
|
||||||
if ! unzip -o -d /data/mods /tmp/modpack.zip; then
|
|
||||||
echo "ERROR: failed to unzip the modpack from $EFFECTIVE_MODPACK_URL"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
rm -f /tmp/modpack.zip
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Invalid URL given for modpack: Must be HTTP or HTTPS and a ZIP file"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If supplied with a URL for a plugin download it.
|
|
||||||
if [[ "$MODS" ]]; then
|
|
||||||
for i in ${MODS//,/ }
|
|
||||||
do
|
|
||||||
EFFECTIVE_MOD_URL=$(curl -Ls -o /dev/null -w %{url_effective} $i)
|
|
||||||
case "X$EFFECTIVE_MOD_URL" in
|
|
||||||
X[Hh][Tt][Tt][Pp]*.jar)
|
|
||||||
echo "Downloading mod/plugin via HTTP"
|
|
||||||
echo " from $EFFECTIVE_MOD_URL ..."
|
|
||||||
if ! curl -sSL -o /tmp/${EFFECTIVE_MOD_URL##*/} $EFFECTIVE_MOD_URL; then
|
|
||||||
echo "ERROR: failed to download from $EFFECTIVE_MOD_URL to /tmp/${EFFECTIVE_MOD_URL##*/}"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$TYPE" = "SPIGOT" ]; then
|
|
||||||
mkdir -p /data/plugins
|
|
||||||
mv /tmp/${EFFECTIVE_MOD_URL##*/} /data/plugins/${EFFECTIVE_MOD_URL##*/}
|
|
||||||
else
|
|
||||||
mkdir -p /data/mods
|
|
||||||
mv /tmp/${EFFECTIVE_MOD_URL##*/} /data/mods/${EFFECTIVE_MOD_URL##*/}
|
|
||||||
fi
|
|
||||||
rm -f /tmp/${EFFECTIVE_MOD_URL##*/}
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Invalid URL given for modpack: Must be HTTP or HTTPS and a JAR file"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$MANIFEST" ]]; then
|
|
||||||
EFFECTIVE_MANIFEST_URL=$(curl -Ls -o /dev/null -w %{url_effective} $MANIFEST)
|
|
||||||
case "X$EFFECTIVE_MANIFEST_URL" in
|
|
||||||
X*.json)
|
|
||||||
if [ -f "${EFFECTIVE_MANIFEST_URL}" ]; then
|
|
||||||
MOD_DIR=${FTB_BASE_DIR:-/data}/mods
|
|
||||||
if [ ! -d "$MOD_DIR" ]
|
|
||||||
then
|
|
||||||
echo "Creating mods dir $MOD_DIR"
|
|
||||||
mkdir -p "$MOD_DIR"
|
|
||||||
fi
|
|
||||||
echo "Starting manifest download..."
|
|
||||||
cat "${EFFECTIVE_MANIFEST_URL}" | jq -r '.files[] | (.projectID|tostring) + " " + (.fileID|tostring)'| while read -r p f
|
|
||||||
do
|
|
||||||
if [ ! -f $MOD_DIR/${p}_${f}.jar ]
|
|
||||||
then
|
|
||||||
url="${CURSE_URL_BASE}/${p}/files/${f}/download"
|
|
||||||
echo Downloading curseforge mod $url
|
|
||||||
# Manifest usually doesn't have mod names. Using id should be fine, tho
|
|
||||||
curl -sSL "${url}" -o $MOD_DIR/${p}_${f}.jar
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
else
|
|
||||||
echo "Could not find manifest file, unsufficient privs, or malformed path."
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Invalid manifest file for modpack. Please make sure it is a .json file."
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec /start-finalSetup03Modconfig $@
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [ "$REPLACE_ENV_VARIABLES" = "TRUE" ]; then
|
|
||||||
echo "Replacing env variables in configs that match the prefix $ENV_VARIABLE_PREFIX..."
|
|
||||||
while IFS='=' read -r name value ; do
|
|
||||||
# check if name of env variable matches the prefix
|
|
||||||
# sanity check environment variables to avoid code injections
|
|
||||||
if [[ "$name" = $ENV_VARIABLE_PREFIX* ]] && [[ $value =~ ^[0-9a-zA-Z_:/=?.+\-]*$ ]] && [[ $name =~ ^[0-9a-zA-Z_\-]*$ ]]; then
|
|
||||||
echo "Replacing $name with $value ..."
|
|
||||||
find /data/ -type f \( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" -or -name "*.properties" \) -exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
|
|
||||||
fi
|
|
||||||
done < <(env)
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec /start-minecraftFinalSetup $@
|
|
||||||
File renamed without changes.
@@ -0,0 +1,46 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /start-utils
|
||||||
|
|
||||||
|
umask 0002
|
||||||
|
chmod g+w /data
|
||||||
|
|
||||||
|
if [ $(id -u) = 0 ]; then
|
||||||
|
runAsUser=minecraft
|
||||||
|
runAsGroup=minecraft
|
||||||
|
|
||||||
|
if [[ -v UID ]]; then
|
||||||
|
if [[ $UID != 0 ]]; then
|
||||||
|
if [[ $UID != $(id -u minecraft) ]]; then
|
||||||
|
log "Changing uid of minecraft to $UID"
|
||||||
|
usermod -u $UID minecraft
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
runAsUser=root
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -v GID ]]; then
|
||||||
|
if [[ $GID != 0 ]]; then
|
||||||
|
if [[ $GID != $(id -g minecraft) ]]; then
|
||||||
|
log "Changing gid of minecraft to $GID"
|
||||||
|
groupmod -o -g $GID minecraft
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
runAsGroup=root
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $(stat -c "%u" /data) != $UID ]]; then
|
||||||
|
log "Changing ownership of /data to $UID ..."
|
||||||
|
chown -R ${runAsUser}:${runAsGroup} /data
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${SKIP_NSSWITCH_CONF^^} != TRUE ]]; then
|
||||||
|
echo 'hosts: files dns' > /etc/nsswitch.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec su-exec ${runAsUser}:${runAsGroup} /start-configuration $@
|
||||||
|
else
|
||||||
|
exec /start-configuration $@
|
||||||
|
fi
|
||||||
@@ -1,33 +1,37 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /start-utils
|
||||||
|
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
|
|
||||||
#umask 002
|
#umask 002
|
||||||
export HOME=/data
|
export HOME=/data
|
||||||
|
|
||||||
if [ ! -e /data/eula.txt ]; then
|
if [ ! -e /data/eula.txt ]; then
|
||||||
if [ "$EULA" != "" ]; then
|
EULA="${EULA,,}"
|
||||||
echo "# Generated via Docker on $(date)" > eula.txt
|
if [ "$EULA" != "true" ]; then
|
||||||
echo "eula=$EULA" >> eula.txt
|
log ""
|
||||||
if [ $? != 0 ]; then
|
log "Please accept the Minecraft EULA at"
|
||||||
echo "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}"
|
log " https://account.mojang.com/documents/minecraft_eula"
|
||||||
exit 2
|
log "by adding the following immediately after 'docker run':"
|
||||||
fi
|
log " -e EULA=TRUE"
|
||||||
else
|
log ""
|
||||||
echo ""
|
|
||||||
echo "Please accept the Minecraft EULA at"
|
|
||||||
echo " https://account.mojang.com/documents/minecraft_eula"
|
|
||||||
echo "by adding the following immediately after 'docker run':"
|
|
||||||
echo " -e EULA=TRUE"
|
|
||||||
echo ""
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "# Generated via Docker on $(date)" > eula.txt
|
||||||
|
echo "eula=$EULA" >> eula.txt
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
log "ERROR: unable to write eula to /data. Please make sure attached directory is writable by uid=${UID}"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
|
|
||||||
|
log "Running as uid=$(id -u) gid=$(id -g) with /data as '$(ls -lnd /data)'"
|
||||||
|
|
||||||
if ! touch /data/.verify_access; then
|
if ! touch /data/.verify_access; then
|
||||||
echo "ERROR: /data doesn't seem to be writable. Please make sure attached directory is writable by uid=$(id -u)"
|
log "ERROR: /data doesn't seem to be writable. Please make sure attached directory is writable by uid=$(id -u)"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -36,14 +40,14 @@ rm /data/.verify_access || true
|
|||||||
if [[ $PROXY ]]; then
|
if [[ $PROXY ]]; then
|
||||||
export http_proxy="$PROXY"
|
export http_proxy="$PROXY"
|
||||||
export https_proxy="$PROXY"
|
export https_proxy="$PROXY"
|
||||||
echo "INFO: Giving proxy time to startup..."
|
log "INFO: Giving proxy time to startup..."
|
||||||
sleep 5
|
sleep 5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export SERVER_PROPERTIES=/data/server.properties
|
export SERVER_PROPERTIES=/data/server.properties
|
||||||
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
|
||||||
|
|
||||||
echo "Checking version information."
|
log "Checking version information."
|
||||||
case "X$VERSION" in
|
case "X$VERSION" in
|
||||||
X|XLATEST|Xlatest)
|
X|XLATEST|Xlatest)
|
||||||
export VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.release'`
|
export VANILLA_VERSION=`curl -fsSL $VERSIONS_JSON | jq -r '.latest.release'`
|
||||||
@@ -63,7 +67,7 @@ cd /data
|
|||||||
|
|
||||||
export ORIGINAL_TYPE=${TYPE^^}
|
export ORIGINAL_TYPE=${TYPE^^}
|
||||||
|
|
||||||
echo "Checking type information."
|
log "Checking type information."
|
||||||
case "${TYPE^^}" in
|
case "${TYPE^^}" in
|
||||||
*BUKKIT|SPIGOT)
|
*BUKKIT|SPIGOT)
|
||||||
exec /start-deployBukkitSpigot $@
|
exec /start-deployBukkitSpigot $@
|
||||||
@@ -98,8 +102,8 @@ case "${TYPE^^}" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "Invalid type: '$TYPE'"
|
log "Invalid type: '$TYPE'"
|
||||||
echo "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTB, CURSEFORGE, SPONGEVANILLA"
|
log "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FTB, CURSEFORGE, SPONGEVANILLA"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -1,23 +1,27 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /start-utils
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
function buildSpigotFromSource {
|
function buildSpigotFromSource {
|
||||||
echo "Building Spigot $VANILLA_VERSION from source, might take a while, get some coffee"
|
log "Building Spigot $VANILLA_VERSION from source, might take a while, get some coffee"
|
||||||
|
rm -rf /data/temp
|
||||||
mkdir /data/temp
|
mkdir /data/temp
|
||||||
cd /data/temp
|
cd /data/temp
|
||||||
|
|
||||||
jvmOpts="-Xms${INIT_MEMORY:-$MEMORY} -Xmx${MAX_MEMORY:-$MEMORY}"
|
jvmOpts="-Xms${INIT_MEMORY:-$MEMORY} -Xmx${MAX_MEMORY:-$MEMORY}"
|
||||||
|
|
||||||
|
logn ''
|
||||||
curl -sSL -o /data/temp/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && \
|
curl -sSL -o /data/temp/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && \
|
||||||
java $jvmOpts -jar /data/temp/BuildTools.jar --rev $VANILLA_VERSION 2>&1 |tee /data/spigot_build.log| while read l; do echo -n .; done; echo "done"
|
java $jvmOpts -jar /data/temp/BuildTools.jar --rev $VANILLA_VERSION 2>&1 |tee /data/spigot_build.log| while read l; do echo -n .; done; log "done"
|
||||||
if ! mv spigot-*.jar /data/spigot_server.jar; then
|
if ! mv spigot-*.jar /data/spigot_server.jar; then
|
||||||
echo "ERR failed to build Spigot"
|
log "ERR failed to build Spigot"
|
||||||
cat /data/spigot_build.log
|
cat /data/spigot_build.log
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
mv craftbukkit-*.jar /data/craftbukkit_server.jar
|
mv craftbukkit-*.jar /data/${SERVER}
|
||||||
echo "Cleaning up"
|
log "Cleaning up"
|
||||||
rm -rf /data/temp
|
rm -rf /data/temp
|
||||||
cd /data
|
cd /data
|
||||||
}
|
}
|
||||||
@@ -37,18 +41,11 @@ function downloadSpigot {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
local downloadVersion
|
|
||||||
if [[ ${VERSION} == LATEST ]]; then
|
|
||||||
downloadVersion=${VANILLA_VERSION}
|
|
||||||
else
|
|
||||||
downloadVersion=${VERSION}
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $downloadUrl ]]; then
|
if [[ -z $downloadUrl ]]; then
|
||||||
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${downloadVersion}.jar"
|
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Downloading $match from $downloadUrl ..."
|
log "Downloading $match from $downloadUrl ..."
|
||||||
curl -fsSL -o $SERVER "$downloadUrl"
|
curl -fsSL -o $SERVER "$downloadUrl"
|
||||||
if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then
|
if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
@@ -65,10 +62,10 @@ EOF
|
|||||||
|
|
||||||
case "$TYPE" in
|
case "$TYPE" in
|
||||||
*BUKKIT|*bukkit)
|
*BUKKIT|*bukkit)
|
||||||
export SERVER=craftbukkit_server.jar
|
export SERVER=craftbukkit_server-${VANILLA_VERSION}.jar
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
export SERVER=spigot_server.jar
|
export SERVER=spigot_server-${VANILLA_VERSION}.jar
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -7,21 +7,21 @@ if isURL ${CUSTOM_SERVER}; then
|
|||||||
export SERVER=/data/${filename}
|
export SERVER=/data/${filename}
|
||||||
|
|
||||||
if [[ -f ${SERVER} ]] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
if [[ -f ${SERVER} ]] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||||
echo "Using previously downloaded jar at ${SERVER}"
|
log "Using previously downloaded jar at ${SERVER}"
|
||||||
else
|
else
|
||||||
echo "Downloading custom server jar from ${CUSTOM_SERVER} ..."
|
log "Downloading custom server jar from ${CUSTOM_SERVER} ..."
|
||||||
if ! curl -sSL -o ${SERVER} ${CUSTOM_SERVER}; then
|
if ! curl -sSL -o ${SERVER} ${CUSTOM_SERVER}; then
|
||||||
echo "Failed to download from ${CUSTOM_SERVER}"
|
log "Failed to download from ${CUSTOM_SERVER}"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [[ -f ${CUSTOM_SERVER} ]]; then
|
elif [[ -f ${CUSTOM_SERVER} ]]; then
|
||||||
echo "Using custom server jar at ${CUSTOM_SERVER} ..."
|
log "Using custom server jar at ${CUSTOM_SERVER} ..."
|
||||||
export SERVER=${CUSTOM_SERVER}
|
export SERVER=${CUSTOM_SERVER}
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "CUSTOM_SERVER is not properly set to a URL or existing jar file"
|
log "CUSTOM_SERVER is not properly set to a URL or existing jar file"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -8,11 +8,11 @@ export TYPE=FEED-THE-BEAST
|
|||||||
|
|
||||||
FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD}
|
FTB_SERVER_MOD=${FTB_SERVER_MOD:-$CF_SERVER_MOD}
|
||||||
|
|
||||||
echo "Looking for Feed-The-Beast / CurseForge server modpack."
|
log "Looking for Feed-The-Beast / CurseForge server modpack."
|
||||||
if [[ -z $FTB_SERVER_MOD ]]; then
|
if [[ -z $FTB_SERVER_MOD ]]; then
|
||||||
echo "Environment variable FTB_SERVER_MOD not set."
|
log "Environment variable FTB_SERVER_MOD not set."
|
||||||
echo "Set FTB_SERVER_MOD to the file name of the FTB server modpack."
|
log "Set FTB_SERVER_MOD to the file name of the FTB server modpack."
|
||||||
echo "(And place the modpack in the /data directory.)"
|
log "(And place the modpack in the /data directory.)"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ entryScriptExpr="-name ServerStart.sh -o -name ServerStartLinux.sh -o -name Laun
|
|||||||
if [[ -d ${FTB_BASE_DIR} ]]; then
|
if [[ -d ${FTB_BASE_DIR} ]]; then
|
||||||
startScriptCount=$(find ${FTB_BASE_DIR} $entryScriptExpr |wc -l)
|
startScriptCount=$(find ${FTB_BASE_DIR} $entryScriptExpr |wc -l)
|
||||||
if [[ $startScriptCount > 1 ]]; then
|
if [[ $startScriptCount > 1 ]]; then
|
||||||
echo "Conflicting FTB/CurseForge packages have been installed. Please cleanup ${FTB_BASE_DIR}"
|
log "Conflicting FTB/CurseForge packages have been installed. Please cleanup ${FTB_BASE_DIR}"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@@ -45,7 +45,7 @@ if [[ $startScriptCount = 0 ]]; then
|
|||||||
file=$(basename $(dirname $srv_modpack))
|
file=$(basename $(dirname $srv_modpack))
|
||||||
downloaded=/data/${file}.zip
|
downloaded=/data/${file}.zip
|
||||||
if [ ! -e $downloaded ]; then
|
if [ ! -e $downloaded ]; then
|
||||||
echo "Downloading FTB modpack...
|
log "Downloading FTB modpack...
|
||||||
$srv_modpack -> $downloaded"
|
$srv_modpack -> $downloaded"
|
||||||
curl -sSL -o $downloaded $srv_modpack
|
curl -sSL -o $downloaded $srv_modpack
|
||||||
fi
|
fi
|
||||||
@@ -60,16 +60,16 @@ if [[ $startScriptCount = 0 ]]; then
|
|||||||
srv_modpack=/data/${srv_modpack}
|
srv_modpack=/data/${srv_modpack}
|
||||||
fi
|
fi
|
||||||
if [[ ! -f ${srv_modpack} ]]; then
|
if [[ ! -f ${srv_modpack} ]]; then
|
||||||
echo "FTB server modpack ${srv_modpack} not found."
|
log "FTB server modpack ${srv_modpack} not found."
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
if [[ ! ${srv_modpack: -4} == ".zip" ]]; then
|
if [[ ! ${srv_modpack: -4} == ".zip" ]]; then
|
||||||
echo "FTB server modpack ${srv_modpack} is not a zip archive."
|
log "FTB server modpack ${srv_modpack} is not a zip archive."
|
||||||
echo "Please set FTB_SERVER_MOD to a file with a .zip extension."
|
log "Please set FTB_SERVER_MOD to a file with a .zip extension."
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Unpacking FTB server modpack ${srv_modpack} ..."
|
log "Unpacking FTB server modpack ${srv_modpack} ..."
|
||||||
mkdir -p ${FTB_BASE_DIR}
|
mkdir -p ${FTB_BASE_DIR}
|
||||||
unzip -o ${srv_modpack} -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
unzip -o ${srv_modpack} -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
||||||
fi
|
fi
|
||||||
@@ -79,7 +79,7 @@ if [[ $(find ${FTB_BASE_DIR} $entryScriptExpr | wc -l) = 0 ]]; then
|
|||||||
forgeJar=$(find ${FTB_BASE_DIR} -name 'forge*.jar' -a -not -name 'forge*installer')
|
forgeJar=$(find ${FTB_BASE_DIR} -name 'forge*.jar' -a -not -name 'forge*installer')
|
||||||
if [[ "$forgeJar" ]]; then
|
if [[ "$forgeJar" ]]; then
|
||||||
export FTB_BASE_DIR=$(dirname "${forgeJar}")
|
export FTB_BASE_DIR=$(dirname "${forgeJar}")
|
||||||
echo "No entry script found, so building one for ${forgeJar}"
|
log "No entry script found, so building one for ${forgeJar}"
|
||||||
cat > "${FTB_BASE_DIR}/ServerStart.sh" <<EOF
|
cat > "${FTB_BASE_DIR}/ServerStart.sh" <<EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
. ./settings-local.sh
|
. ./settings-local.sh
|
||||||
@@ -87,18 +87,18 @@ java \${JAVA_PARAMETERS} -Xmx\${MAX_RAM} -jar $(basename "${forgeJar}") nogui
|
|||||||
EOF
|
EOF
|
||||||
chmod +x "${FTB_BASE_DIR}/ServerStart.sh"
|
chmod +x "${FTB_BASE_DIR}/ServerStart.sh"
|
||||||
else
|
else
|
||||||
echo "Please make sure you are using the server version of the FTB modpack!"
|
log "Please make sure you are using the server version of the FTB modpack!"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
scriptCount=$(find "${FTB_BASE_DIR}" $entryScriptExpr | wc -l)
|
scriptCount=$(find "${FTB_BASE_DIR}" $entryScriptExpr | wc -l)
|
||||||
if [[ $scriptCount = 0 ]]; then
|
if [[ $scriptCount = 0 ]]; then
|
||||||
echo "Please make sure you are using the server version of the FTB modpack!"
|
log "Please make sure you are using the server version of the FTB modpack!"
|
||||||
exit 2
|
exit 2
|
||||||
elif [[ $scriptCount > 1 ]]; then
|
elif [[ $scriptCount > 1 ]]; then
|
||||||
echo "Ambigous startup scripts in FTB modpack!"
|
log "Ambigous startup scripts in FTB modpack!"
|
||||||
echo "found:"
|
log "found:"
|
||||||
find ${FTB_BASE_DIR} $entryScriptExpr
|
find ${FTB_BASE_DIR} $entryScriptExpr
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
@@ -112,7 +112,7 @@ sed -i 's/.*read.*Restart now/#\0/' "${FTB_SERVER_START}"
|
|||||||
legacyJavaFixerPath="${FTB_DIR}/mods/legacyjavafixer.jar"
|
legacyJavaFixerPath="${FTB_DIR}/mods/legacyjavafixer.jar"
|
||||||
|
|
||||||
if isTrue ${FTB_LEGACYJAVAFIXER} && [ ! -e "${legacyJavaFixerPath}" ]; then
|
if isTrue ${FTB_LEGACYJAVAFIXER} && [ ! -e "${legacyJavaFixerPath}" ]; then
|
||||||
echo "Installing legacy java fixer to ${legacyJavaFixerPath}"
|
log "Installing legacy java fixer to ${legacyJavaFixerPath}"
|
||||||
curl -sSL -o "${legacyJavaFixerPath}" ${legacyJavaFixerUrl}
|
curl -sSL -o "${legacyJavaFixerPath}" ${legacyJavaFixerUrl}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -u
|
set -eu
|
||||||
|
|
||||||
|
. /start-utils
|
||||||
|
|
||||||
export TYPE=FABRIC
|
export TYPE=FABRIC
|
||||||
|
|
||||||
@@ -7,11 +9,10 @@ FABRIC_INSTALLER=${FABRIC_INSTALLER:-}
|
|||||||
FABRIC_INSTALLER_URL=${FABRIC_INSTALLER_URL:-}
|
FABRIC_INSTALLER_URL=${FABRIC_INSTALLER_URL:-}
|
||||||
FABRICVERSION=${FABRICVERSION:-LATEST}
|
FABRICVERSION=${FABRICVERSION:-LATEST}
|
||||||
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
||||||
echo "Checking Fabric version information."
|
log "Checking Fabric version information."
|
||||||
case $FABRICVERSION in
|
case $FABRICVERSION in
|
||||||
LATEST)
|
LATEST)
|
||||||
curl -fsSL https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml | xq -c . > /tmp/fabric.json
|
FABRIC_VERSION=$(maven-metadata-release https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml)
|
||||||
FABRIC_VERSION=$(< /tmp/fabric.json jq -r ".metadata.versioning.release")
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
@@ -24,44 +25,49 @@ if [[ -z $FABRIC_INSTALLER && -z $FABRIC_INSTALLER_URL ]]; then
|
|||||||
elif [[ -z $FABRIC_INSTALLER ]]; then
|
elif [[ -z $FABRIC_INSTALLER ]]; then
|
||||||
FABRIC_INSTALLER="/tmp/fabric-installer.jar"
|
FABRIC_INSTALLER="/tmp/fabric-installer.jar"
|
||||||
elif [[ ! -e $FABRIC_INSTALLER ]]; then
|
elif [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||||
echo "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
|
log "ERROR: the given Fabric installer doesn't exist : $FABRIC_INSTALLER"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
installMarker=".fabric-installed-${FABRIC_VERSION:-manual}"
|
installMarker=".fabric-installed-${VANILLA_VERSION}-${FABRIC_VERSION:-manual}"
|
||||||
|
|
||||||
|
debug Checking for installMarker ${installMarker}
|
||||||
if [[ ! -e $installMarker ]]; then
|
if [[ ! -e $installMarker ]]; then
|
||||||
if [[ ! -e $FABRIC_INSTALLER ]]; then
|
if [[ ! -e $FABRIC_INSTALLER ]]; then
|
||||||
if [[ -z $FABRIC_INSTALLER_URL ]]; then
|
if [[ -z $FABRIC_INSTALLER_URL ]]; then
|
||||||
echo "Downloading $FABRIC_VERSION"
|
log "Downloading $FABRIC_VERSION"
|
||||||
downloadUrl="https://maven.fabricmc.net/net/fabricmc/fabric-installer/$FABRIC_VERSION/fabric-installer-$FABRIC_VERSION.jar"
|
downloadUrl="https://maven.fabricmc.net/net/fabricmc/fabric-installer/$FABRIC_VERSION/fabric-installer-$FABRIC_VERSION.jar"
|
||||||
echo "...trying $downloadUrl"
|
log "...trying $downloadUrl"
|
||||||
curl -o $FABRIC_INSTALLER -fsSL $downloadUrl
|
curl -o $FABRIC_INSTALLER -fsSL $downloadUrl
|
||||||
else
|
else
|
||||||
echo "Downloading $FABRIC_INSTALLER_URL ..."
|
log "Downloading $FABRIC_INSTALLER_URL ..."
|
||||||
if ! curl -o $FABRIC_INSTALLER -fsSL $FABRIC_INSTALLER_URL; then
|
if ! curl -o $FABRIC_INSTALLER -fsSL $FABRIC_INSTALLER_URL; then
|
||||||
echo "Failed to download from given location $FABRIC_INSTALLER_URL"
|
log "Failed to download from given location $FABRIC_INSTALLER_URL"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installing Fabric $FABRIC_VERSION using $FABRIC_INSTALLER"
|
if isDebugging; then
|
||||||
|
debug "Installing Fabric $FABRIC_VERSION using $FABRIC_INSTALLER with mcversion ${VANILLA_VERSION}"
|
||||||
|
else
|
||||||
|
log "Installing Fabric $FABRIC_VERSION using $FABRIC_INSTALLER"
|
||||||
|
fi
|
||||||
tries=3
|
tries=3
|
||||||
set +e
|
set +e
|
||||||
while ((--tries >= 0)); do
|
while ((--tries >= 0)); do
|
||||||
java -jar $FABRIC_INSTALLER server -version $VANILLA_VERSION -downloadMinecraft
|
java -jar $FABRIC_INSTALLER server -mcversion $VANILLA_VERSION -downloadMinecraft
|
||||||
if [[ $? == 0 ]]; then
|
if [[ $? == 0 ]]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
set -e
|
set -e
|
||||||
if (($tries < 0)); then
|
if (($tries < 0)); then
|
||||||
echo "Fabric failed to install after several tries." >&2
|
log "Fabric failed to install after several tries." >&2
|
||||||
exit 10
|
exit 10
|
||||||
fi
|
fi
|
||||||
export SERVER=fabric-server-launch.jar
|
export SERVER=fabric-server-launch.jar
|
||||||
echo "Using server $SERVER"
|
log "Using server $SERVER"
|
||||||
echo $SERVER > $installMarker
|
echo $SERVER > $installMarker
|
||||||
|
|
||||||
else
|
else
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /start-utils
|
||||||
|
|
||||||
export TYPE=FORGE
|
export TYPE=FORGE
|
||||||
|
|
||||||
if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
|
if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
|
||||||
@@ -14,7 +16,7 @@ if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
|
|||||||
|
|
||||||
#################################################################################
|
#################################################################################
|
||||||
|
|
||||||
echo "Checking Forge version information."
|
log "Checking Forge version information."
|
||||||
case $FORGEVERSION in
|
case $FORGEVERSION in
|
||||||
RECOMMENDED)
|
RECOMMENDED)
|
||||||
curl -fsSL -o /tmp/forge.json http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
|
curl -fsSL -o /tmp/forge.json http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
|
||||||
@@ -22,8 +24,8 @@ if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
|
|||||||
if [ $FORGE_VERSION = null ]; then
|
if [ $FORGE_VERSION = null ]; then
|
||||||
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$VANILLA_VERSION-latest\"]")
|
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$VANILLA_VERSION-latest\"]")
|
||||||
if [ $FORGE_VERSION = null ]; then
|
if [ $FORGE_VERSION = null ]; then
|
||||||
echo "ERROR: Version $VANILLA_VERSION is not supported by Forge"
|
log "ERROR: Version $VANILLA_VERSION is not supported by Forge"
|
||||||
echo " Refer to http://files.minecraftforge.net/ for supported versions"
|
log " Refer to http://files.minecraftforge.net/ for supported versions"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -41,7 +43,7 @@ if [[ -z $FORGE_INSTALLER && -z $FORGE_INSTALLER_URL ]]; then
|
|||||||
elif [[ -z $FORGE_INSTALLER ]]; then
|
elif [[ -z $FORGE_INSTALLER ]]; then
|
||||||
FORGE_INSTALLER="/tmp/forge-installer.jar"
|
FORGE_INSTALLER="/tmp/forge-installer.jar"
|
||||||
elif [[ ! -e $FORGE_INSTALLER ]]; then
|
elif [[ ! -e $FORGE_INSTALLER ]]; then
|
||||||
echo "ERROR: the given Forge installer doesn't exist : $FORGE_INSTALLER"
|
log "ERROR: the given Forge installer doesn't exist : $FORGE_INSTALLER"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -51,7 +53,7 @@ if [ ! -e $installMarker ]; then
|
|||||||
if [ ! -e $FORGE_INSTALLER ]; then
|
if [ ! -e $FORGE_INSTALLER ]; then
|
||||||
|
|
||||||
if [[ -z $FORGE_INSTALLER_URL ]]; then
|
if [[ -z $FORGE_INSTALLER_URL ]]; then
|
||||||
echo "Downloading $normForgeVersion"
|
log "Downloading $normForgeVersion"
|
||||||
|
|
||||||
forgeFileNames="
|
forgeFileNames="
|
||||||
$normForgeVersion/forge-$normForgeVersion-installer.jar
|
$normForgeVersion/forge-$normForgeVersion-installer.jar
|
||||||
@@ -60,25 +62,25 @@ if [ ! -e $installMarker ]; then
|
|||||||
"
|
"
|
||||||
for fn in $forgeFileNames; do
|
for fn in $forgeFileNames; do
|
||||||
if [ $fn == END ]; then
|
if [ $fn == END ]; then
|
||||||
echo "Unable to compute URL for $normForgeVersion"
|
log "Unable to compute URL for $normForgeVersion"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
downloadUrl=http://files.minecraftforge.net/maven/net/minecraftforge/forge/$fn
|
downloadUrl=http://files.minecraftforge.net/maven/net/minecraftforge/forge/$fn
|
||||||
echo "...trying $downloadUrl"
|
log "...trying $downloadUrl"
|
||||||
if curl -o $FORGE_INSTALLER -fsSL $downloadUrl; then
|
if curl -o $FORGE_INSTALLER -fsSL $downloadUrl; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
echo "Downloading $FORGE_INSTALLER_URL ..."
|
log "Downloading $FORGE_INSTALLER_URL ..."
|
||||||
if ! curl -o $FORGE_INSTALLER -fsSL $FORGE_INSTALLER_URL; then
|
if ! curl -o $FORGE_INSTALLER -fsSL $FORGE_INSTALLER_URL; then
|
||||||
echo "Failed to download from given location $FORGE_INSTALLER_URL"
|
log "Failed to download from given location $FORGE_INSTALLER_URL"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installing Forge $shortForgeVersion using $FORGE_INSTALLER"
|
log "Installing Forge $shortForgeVersion using $FORGE_INSTALLER"
|
||||||
mkdir -p mods
|
mkdir -p mods
|
||||||
tries=3
|
tries=3
|
||||||
while ((--tries >= 0)); do
|
while ((--tries >= 0)); do
|
||||||
@@ -88,22 +90,22 @@ if [ ! -e $installMarker ]; then
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if (($tries < 0)); then
|
if (($tries < 0)); then
|
||||||
echo "Forge failed to install after several tries." >&2
|
log "Forge failed to install after several tries." >&2
|
||||||
exit 10
|
exit 10
|
||||||
fi
|
fi
|
||||||
# NOTE $shortForgeVersion will be empty if installer location was given to us
|
# NOTE $shortForgeVersion will be empty if installer location was given to us
|
||||||
echo "Finding installed server jar..."
|
log "Finding installed server jar..."
|
||||||
unset -v latest
|
unset -v latest
|
||||||
for file in *forge*.jar; do
|
for file in *forge*.jar; do
|
||||||
[[ $file =~ installer ]] || [[ $file -nt $latest ]] && latest=$file
|
[[ $file =~ installer ]] || [[ $file -nt $latest ]] && latest=$file
|
||||||
done
|
done
|
||||||
if [[ -z $latest ]]; then
|
if [[ -z $latest ]]; then
|
||||||
echo "Unable to derive server jar for Forge"
|
log "Unable to derive server jar for Forge"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export SERVER=$latest
|
export SERVER=$latest
|
||||||
echo "Using server $SERVER"
|
log "Using server $SERVER"
|
||||||
echo $SERVER > $installMarker
|
echo $SERVER > $installMarker
|
||||||
|
|
||||||
else
|
else
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /start-utils
|
||||||
|
|
||||||
|
export SERVER=paper_server-${VANILLA_VERSION}.jar
|
||||||
|
if [ ! -f "$SERVER" ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||||
|
downloadUrl=${PAPER_DOWNLOAD_URL:-https://papermc.io/api/v1/paper/${VANILLA_VERSION}/latest/download}
|
||||||
|
log "Downloading Paper $VANILLA_VERSION from $downloadUrl ..."
|
||||||
|
curl -fsSL -o "$SERVER" "$downloadUrl"
|
||||||
|
if [ ! -f "$SERVER" ]; then
|
||||||
|
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Normalize on Spigot for operations below
|
||||||
|
export TYPE=SPIGOT
|
||||||
|
|
||||||
|
# Continue to Final Setup
|
||||||
|
exec /start-finalSetup01World $@
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /start-utils
|
||||||
|
|
||||||
export TYPE=spongevanilla
|
export TYPE=spongevanilla
|
||||||
|
|
||||||
# Parse branch
|
# Parse branch
|
||||||
echo "Choosing branch for Sponge"
|
log "Choosing branch for Sponge"
|
||||||
case "$SPONGEBRANCH" in
|
case "$SPONGEBRANCH" in
|
||||||
|
|
||||||
EXPERIMENTAL|experimental|BLEEDING|bleeding)
|
EXPERIMENTAL|experimental|BLEEDING|bleeding)
|
||||||
@@ -18,7 +20,7 @@ esac
|
|||||||
|
|
||||||
# If not SPONGEVERSION selected, detect last version on selected branch
|
# If not SPONGEVERSION selected, detect last version on selected branch
|
||||||
if [ -z $SPONGEVERSION ]; then
|
if [ -z $SPONGEVERSION ]; then
|
||||||
echo "Choosing Version for Sponge"
|
log "Choosing Version for Sponge"
|
||||||
if [ "$SPONGEBRANCH" == "stable" ]; then
|
if [ "$SPONGEBRANCH" == "stable" ]; then
|
||||||
export SPONGEVERSION=`curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.stable.latest.version'`
|
export SPONGEVERSION=`curl -fsSL https://dl-api.spongepowered.org/v1/org.spongepowered/$TYPE | jq -r '.buildTypes.stable.latest.version'`
|
||||||
else
|
else
|
||||||
@@ -29,7 +31,7 @@ fi
|
|||||||
export SERVER="spongevanilla-$SPONGEVERSION.jar"
|
export SERVER="spongevanilla-$SPONGEVERSION.jar"
|
||||||
|
|
||||||
if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||||
echo "Downloading $SERVER ..."
|
log "Downloading $SERVER ..."
|
||||||
curl -sSL -o $SERVER https://repo.spongepowered.org/maven/org/spongepowered/$TYPE/$SPONGEVERSION/$SERVER
|
curl -sSL -o $SERVER https://repo.spongepowered.org/maven/org/spongepowered/$TYPE/$SPONGEVERSION/$SERVER
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -6,16 +6,16 @@ set -o pipefail
|
|||||||
export SERVER="minecraft_server.${VANILLA_VERSION// /_}.jar"
|
export SERVER="minecraft_server.${VANILLA_VERSION// /_}.jar"
|
||||||
|
|
||||||
if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
||||||
echo "Downloading $SERVER ..."
|
log "Downloading $SERVER ..."
|
||||||
debug "Finding version manifest for $VANILLA_VERSION"
|
debug "Finding version manifest for $VANILLA_VERSION"
|
||||||
versionManifestUrl=$(curl -fsSL 'https://launchermeta.mojang.com/mc/game/version_manifest.json' | jq --arg VANILLA_VERSION "$VANILLA_VERSION" --raw-output '[.versions[]|select(.id == $VANILLA_VERSION)][0].url')
|
versionManifestUrl=$(curl -fsSL 'https://launchermeta.mojang.com/mc/game/version_manifest.json' | jq --arg VANILLA_VERSION "$VANILLA_VERSION" --raw-output '[.versions[]|select(.id == $VANILLA_VERSION)][0].url')
|
||||||
result=$?
|
result=$?
|
||||||
if [ $result != 0 ]; then
|
if [ $result != 0 ]; then
|
||||||
echo "ERROR failed to obtain version manifest URL ($result)"
|
log "ERROR failed to obtain version manifest URL ($result)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ $versionManifestUrl = "null" ]; then
|
if [ $versionManifestUrl = "null" ]; then
|
||||||
echo "ERROR couldn't find a matching manifest entry for $VANILLA_VERSION"
|
log "ERROR couldn't find a matching manifest entry for $VANILLA_VERSION"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
debug "Found version manifest at $versionManifestUrl"
|
debug "Found version manifest at $versionManifestUrl"
|
||||||
@@ -23,7 +23,7 @@ if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
|||||||
serverDownloadUrl=$(curl -fsSL ${versionManifestUrl} | jq --raw-output '.downloads.server.url')
|
serverDownloadUrl=$(curl -fsSL ${versionManifestUrl} | jq --raw-output '.downloads.server.url')
|
||||||
result=$?
|
result=$?
|
||||||
if [ $result != 0 ]; then
|
if [ $result != 0 ]; then
|
||||||
echo "ERROR failed to obtain version manifest from $versionManifestUrl ($result)"
|
log "ERROR failed to obtain version manifest from $versionManifestUrl ($result)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ if [ ! -e $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
|
|||||||
curl $verbose -fsSL -o $SERVER $serverDownloadUrl
|
curl $verbose -fsSL -o $SERVER $serverDownloadUrl
|
||||||
result=$?
|
result=$?
|
||||||
if [ $result != 0 ]; then
|
if [ $result != 0 ]; then
|
||||||
echo "ERROR failed to download server from $serverDownloadUrl ($result)"
|
log "ERROR failed to download server from $serverDownloadUrl ($result)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /start-utils
|
||||||
|
|
||||||
if [ $TYPE = "FEED-THE-BEAST" ]; then
|
if [ $TYPE = "FEED-THE-BEAST" ]; then
|
||||||
worldDest=$FTB_BASE_DIR/$LEVEL
|
worldDest=$FTB_BASE_DIR/$LEVEL
|
||||||
else
|
else
|
||||||
@@ -10,24 +12,24 @@ fi
|
|||||||
if [[ "$WORLD" ]] && [ ! -d "$worldDest" ]; then
|
if [[ "$WORLD" ]] && [ ! -d "$worldDest" ]; then
|
||||||
case "X$WORLD" in
|
case "X$WORLD" in
|
||||||
X[Hh][Tt][Tt][Pp]*)
|
X[Hh][Tt][Tt][Pp]*)
|
||||||
echo "Downloading world from $WORLD"
|
log "Downloading world from $WORLD"
|
||||||
curl -sSL -o - "$WORLD" > /data/world.zip
|
curl -sSL -o - "$WORLD" > /data/world.zip
|
||||||
echo "Unzipping world"
|
log "Unzipping world"
|
||||||
unzip -o -q /data/world.zip
|
unzip -o -q /data/world.zip
|
||||||
rm -f /data/world.zip
|
rm -f /data/world.zip
|
||||||
if [ ! -d $worldDest ]; then
|
if [ ! -d $worldDest ]; then
|
||||||
echo World directory not found
|
log World directory not found
|
||||||
for i in /data/*/level.dat; do
|
for i in /data/*/level.dat; do
|
||||||
if [ -f "$i" ]; then
|
if [ -f "$i" ]; then
|
||||||
d=`dirname "$i"`
|
d=`dirname "$i"`
|
||||||
echo Renaming world directory from $d
|
log Renaming world directory from $d
|
||||||
mv -f "$d" $worldDest
|
mv -f "$d" $worldDest
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
if [ "$TYPE" = "SPIGOT" ]; then
|
if [ "$TYPE" = "SPIGOT" ]; then
|
||||||
# Reorganise if a Spigot server
|
# Reorganise if a Spigot server
|
||||||
echo "Moving End and Nether maps to Spigot location"
|
log "Moving End and Nether maps to Spigot location"
|
||||||
[ -d "$worldDest/DIM1" ] && mv -f "$worldDest/DIM1" "/data/${LEVEL}_the_end"
|
[ -d "$worldDest/DIM1" ] && mv -f "$worldDest/DIM1" "/data/${LEVEL}_the_end"
|
||||||
[ -d "$worldDest/DIM-1" ] && mv -f "$worldDest/DIM-1" "/data/${LEVEL}_nether"
|
[ -d "$worldDest/DIM-1" ] && mv -f "$worldDest/DIM-1" "/data/${LEVEL}_nether"
|
||||||
fi
|
fi
|
||||||
@@ -35,13 +37,13 @@ case "X$WORLD" in
|
|||||||
*)
|
*)
|
||||||
if [[ -d $WORLD ]]; then
|
if [[ -d $WORLD ]]; then
|
||||||
if [[ ! -d $worldDest ]]; then
|
if [[ ! -d $worldDest ]]; then
|
||||||
echo "Cloning world directory from $WORLD ..."
|
log "Cloning world directory from $WORLD ..."
|
||||||
cp -r $WORLD $worldDest
|
cp -r $WORLD $worldDest
|
||||||
else
|
else
|
||||||
echo "Skipping clone from $WORLD since $worldDest exists"
|
log "Skipping clone from $WORLD since $worldDest exists"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Invalid URL given for world: Must be HTTP or HTTPS and a ZIP file"
|
log "Invalid URL given for world: Must be HTTP or HTTPS and a ZIP file"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
. /start-utils
|
||||||
|
|
||||||
|
# CURSE_URL_BASE used in manifest downloads below
|
||||||
|
CURSE_URL_BASE=${CURSE_URL_BASE:-https://minecraft.curseforge.com/projects}
|
||||||
|
|
||||||
|
# Remove old mods/plugins
|
||||||
|
if [ "$REMOVE_OLD_MODS" = "TRUE" ]; then
|
||||||
|
if [ "$TYPE" = "SPIGOT" ]; then
|
||||||
|
rm -rf /data/plugins/*
|
||||||
|
else
|
||||||
|
rm -rf /data/mods/*
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
|
||||||
|
if [[ "$MODPACK" ]]; then
|
||||||
|
EFFECTIVE_MODPACK_URL=$(curl -Ls -o /dev/null -w %{url_effective} $MODPACK)
|
||||||
|
case "X$EFFECTIVE_MODPACK_URL" in
|
||||||
|
X[Hh][Tt][Tt][Pp]*.zip)
|
||||||
|
log "Downloading mod/plugin pack via HTTP"
|
||||||
|
log " from $EFFECTIVE_MODPACK_URL ..."
|
||||||
|
if ! curl -sSL -o /tmp/modpack.zip "$EFFECTIVE_MODPACK_URL"; then
|
||||||
|
log "ERROR: failed to download from $EFFECTIVE_MODPACK_URL"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$TYPE" = "SPIGOT" ]; then
|
||||||
|
mkdir -p /data/plugins
|
||||||
|
if ! unzip -o -d /data/plugins /tmp/modpack.zip; then
|
||||||
|
log "ERROR: failed to unzip the modpack from $EFFECTIVE_MODPACK_URL"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
mkdir -p /data/mods
|
||||||
|
if ! unzip -o -d /data/mods /tmp/modpack.zip; then
|
||||||
|
log "ERROR: failed to unzip the modpack from $EFFECTIVE_MODPACK_URL"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
rm -f /tmp/modpack.zip
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
log "Invalid URL given for modpack: Must be HTTP or HTTPS and a ZIP file"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If supplied with a URL for a plugin download it.
|
||||||
|
if [[ "$MODS" ]]; then
|
||||||
|
for i in ${MODS//,/ }
|
||||||
|
do
|
||||||
|
EFFECTIVE_MOD_URL=$(curl -Ls -o /dev/null -w %{url_effective} $i)
|
||||||
|
case "X$EFFECTIVE_MOD_URL" in
|
||||||
|
X[Hh][Tt][Tt][Pp]*.jar)
|
||||||
|
log "Downloading mod/plugin via HTTP"
|
||||||
|
log " from $EFFECTIVE_MOD_URL ..."
|
||||||
|
if ! curl -sSL -o /tmp/${EFFECTIVE_MOD_URL##*/} $EFFECTIVE_MOD_URL; then
|
||||||
|
log "ERROR: failed to download from $EFFECTIVE_MOD_URL to /tmp/${EFFECTIVE_MOD_URL##*/}"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$TYPE" = "SPIGOT" ]; then
|
||||||
|
mkdir -p /data/plugins
|
||||||
|
mv /tmp/${EFFECTIVE_MOD_URL##*/} /data/plugins/${EFFECTIVE_MOD_URL##*/}
|
||||||
|
else
|
||||||
|
mkdir -p /data/mods
|
||||||
|
mv /tmp/${EFFECTIVE_MOD_URL##*/} /data/mods/${EFFECTIVE_MOD_URL##*/}
|
||||||
|
fi
|
||||||
|
rm -f /tmp/${EFFECTIVE_MOD_URL##*/}
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
log "Invalid URL given for modpack: Must be HTTP or HTTPS and a JAR file"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$MANIFEST" ]]; then
|
||||||
|
if [[ -e "$MANIFEST" ]]; then
|
||||||
|
EFFECTIVE_MANIFEST_FILE=$MANIFEST
|
||||||
|
elif isURL "$MANIFEST"; then
|
||||||
|
EFFECTIVE_MANIFEST_FILE=/tmp/manifest.json
|
||||||
|
EFFECTIVE_MANIFEST_URL=$(curl -Ls -o /dev/null -w %{url_effective} $MANIFEST)
|
||||||
|
curl -Ls -o $EFFECTIVE_MANIFEST_FILE "$EFFECTIVE_MANIFEST_URL"
|
||||||
|
else
|
||||||
|
log "MANIFEST='$MANIFEST' is not a valid manifest url or location"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "X$EFFECTIVE_MANIFEST_FILE" in
|
||||||
|
X*.json)
|
||||||
|
if [ -f "${EFFECTIVE_MANIFEST_FILE}" ]; then
|
||||||
|
MOD_DIR=${FTB_BASE_DIR:-/data}/mods
|
||||||
|
if [ ! -d "$MOD_DIR" ]
|
||||||
|
then
|
||||||
|
log "Creating mods dir $MOD_DIR"
|
||||||
|
mkdir -p "$MOD_DIR"
|
||||||
|
fi
|
||||||
|
log "Starting manifest download..."
|
||||||
|
cat "${EFFECTIVE_MANIFEST_FILE}" | jq -r '.files[] | (.projectID|tostring) + " " + (.fileID|tostring)'| while read -r p f
|
||||||
|
do
|
||||||
|
if [ ! -f $MOD_DIR/${p}_${f}.jar ]
|
||||||
|
then
|
||||||
|
redirect_url="$(curl -Ls -o /dev/null -w %{url_effective} ${CURSE_URL_BASE}/${p})"
|
||||||
|
url="$redirect_url/download/${f}/file"
|
||||||
|
log Downloading curseforge mod $url
|
||||||
|
# Manifest usually doesn't have mod names. Using id should be fine, tho
|
||||||
|
curl -sSL "${url}" -o $MOD_DIR/${p}_${f}.jar
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
log "Could not find manifest file, unsufficient privs, or malformed path."
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
log "Invalid manifest file for modpack. Please make sure it is a .json file."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${GENERIC_PACK}" ]]; then
|
||||||
|
if isURL "${GENERIC_PACK}"; then
|
||||||
|
generic_pack_url=${GENERIC_PACK}
|
||||||
|
GENERIC_PACK=/tmp/$(basename ${generic_pack_url})
|
||||||
|
log "Downloading generic pack from ${generic_pack_url} ..."
|
||||||
|
curl -fsSL -o ${GENERIC_PACK} ${generic_pack_url}
|
||||||
|
fi
|
||||||
|
|
||||||
|
sum_file=/data/.generic_pack.sum
|
||||||
|
if ! sha256sum -c ${sum_file} -s 2> /dev/null; then
|
||||||
|
base_dir=/tmp/generic_pack_base
|
||||||
|
mkdir -p ${base_dir}
|
||||||
|
unzip -q -d ${base_dir} ${GENERIC_PACK}
|
||||||
|
depth=$(( ${GENERIC_PACK_STRIP_DIRS:-1} + 1 ))
|
||||||
|
log "Applying generic pack, stripping $(( depth - 1 )) level ..."
|
||||||
|
find ${base_dir} -type d -mindepth $depth -maxdepth $depth -exec cp -r {} /data/ +
|
||||||
|
rm -rf ${base_dir}
|
||||||
|
sha256sum ${GENERIC_PACK} > ${sum_file}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec /start-finalSetup03Modconfig $@
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /start-utils
|
||||||
|
|
||||||
# If supplied with a URL for a config (simple zip of configurations), download it and unpack
|
# If supplied with a URL for a config (simple zip of configurations), download it and unpack
|
||||||
if [[ "$MODCONFIG" ]]; then
|
if [[ "$MODCONFIG" ]]; then
|
||||||
case "X$MODCONFIG" in
|
case "X$MODCONFIG" in
|
||||||
X[Hh][Tt][Tt][Pp]*[Zz][iI][pP])
|
X[Hh][Tt][Tt][Pp]*[Zz][iI][pP])
|
||||||
echo "Downloading mod/plugin configs via HTTP"
|
log "Downloading mod/plugin configs via HTTP"
|
||||||
echo " from $MODCONFIG ..."
|
log " from $MODCONFIG ..."
|
||||||
curl -sSL -o /tmp/modconfig.zip "$MODCONFIG"
|
curl -sSL -o /tmp/modconfig.zip "$MODCONFIG"
|
||||||
if [ "$TYPE" = "SPIGOT" ]; then
|
if [ "$TYPE" = "SPIGOT" ]; then
|
||||||
mkdir -p /data/plugins
|
mkdir -p /data/plugins
|
||||||
@@ -17,7 +19,7 @@ case "X$MODCONFIG" in
|
|||||||
rm -f /tmp/modconfig.zip
|
rm -f /tmp/modconfig.zip
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Invalid URL given for modconfig: Must be HTTP or HTTPS and a ZIP file"
|
log "Invalid URL given for modconfig: Must be HTTP or HTTPS and a ZIP file"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
+16
-10
@@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /start-utils
|
||||||
|
|
||||||
# FUNCTIONS
|
# FUNCTIONS
|
||||||
function setServerProp {
|
function setServerProp {
|
||||||
local prop=$1
|
local prop=$1
|
||||||
@@ -10,16 +12,16 @@ function setServerProp {
|
|||||||
TRUE|FALSE)
|
TRUE|FALSE)
|
||||||
var=${var,,} ;;
|
var=${var,,} ;;
|
||||||
esac
|
esac
|
||||||
echo "Setting ${prop} to '${var}' in ${SERVER_PROPERTIES}"
|
log "Setting ${prop} to '${var}' in ${SERVER_PROPERTIES}"
|
||||||
sed -i "/^${prop}\s*=/ c ${prop}=${var}" "$SERVER_PROPERTIES"
|
sed -i "/^${prop}\s*=/ c ${prop}=${var}" "$SERVER_PROPERTIES"
|
||||||
else
|
else
|
||||||
echo "Skip setting ${prop}"
|
log "Skip setting ${prop}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function customizeServerProps {
|
function customizeServerProps {
|
||||||
if [ -n "$WHITELIST" ]; then
|
if [ -n "$WHITELIST" ]; then
|
||||||
echo "Creating whitelist"
|
log "Creating whitelist"
|
||||||
setServerProp "whitelist" "true"
|
setServerProp "whitelist" "true"
|
||||||
setServerProp "white-list" "true"
|
setServerProp "white-list" "true"
|
||||||
fi
|
fi
|
||||||
@@ -41,6 +43,7 @@ function customizeServerProps {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
setServerProp "server-name" "$SERVER_NAME"
|
setServerProp "server-name" "$SERVER_NAME"
|
||||||
|
setServerProp "server-ip" "$SERVER_IP"
|
||||||
setServerProp "server-port" "$SERVER_PORT"
|
setServerProp "server-port" "$SERVER_PORT"
|
||||||
setServerProp "motd" "$MOTD"
|
setServerProp "motd" "$MOTD"
|
||||||
setServerProp "allow-nether" "$ALLOW_NETHER"
|
setServerProp "allow-nether" "$ALLOW_NETHER"
|
||||||
@@ -49,6 +52,7 @@ function customizeServerProps {
|
|||||||
setServerProp "spawn-animals" "$SPAWN_ANIMALS"
|
setServerProp "spawn-animals" "$SPAWN_ANIMALS"
|
||||||
setServerProp "spawn-monsters" "$SPAWN_MONSTERS"
|
setServerProp "spawn-monsters" "$SPAWN_MONSTERS"
|
||||||
setServerProp "spawn-npcs" "$SPAWN_NPCS"
|
setServerProp "spawn-npcs" "$SPAWN_NPCS"
|
||||||
|
setServerProp "spawn-protection" "$SPAWN_PROTECTION"
|
||||||
setServerProp "generate-structures" "$GENERATE_STRUCTURES"
|
setServerProp "generate-structures" "$GENERATE_STRUCTURES"
|
||||||
setServerProp "view-distance" "$VIEW_DISTANCE"
|
setServerProp "view-distance" "$VIEW_DISTANCE"
|
||||||
setServerProp "hardcore" "$HARDCORE"
|
setServerProp "hardcore" "$HARDCORE"
|
||||||
@@ -70,6 +74,8 @@ function customizeServerProps {
|
|||||||
setServerProp "online-mode" "$ONLINE_MODE"
|
setServerProp "online-mode" "$ONLINE_MODE"
|
||||||
setServerProp "allow-flight" "$ALLOW_FLIGHT"
|
setServerProp "allow-flight" "$ALLOW_FLIGHT"
|
||||||
setServerProp "level-type" "${LEVEL_TYPE^^}"
|
setServerProp "level-type" "${LEVEL_TYPE^^}"
|
||||||
|
setServerProp "resource-pack" "$RESOURCE_PACK"
|
||||||
|
setServerProp "resource-pack-sha1" "$RESOURCE_PACK_SHA1"
|
||||||
|
|
||||||
if [ -n "$DIFFICULTY" ]; then
|
if [ -n "$DIFFICULTY" ]; then
|
||||||
case $DIFFICULTY in
|
case $DIFFICULTY in
|
||||||
@@ -86,7 +92,7 @@ function customizeServerProps {
|
|||||||
DIFFICULTY=3
|
DIFFICULTY=3
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "DIFFICULTY must be peaceful, easy, normal, or hard."
|
log "DIFFICULTY must be peaceful, easy, normal, or hard."
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -94,7 +100,7 @@ function customizeServerProps {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$MODE" ]; then
|
if [ -n "$MODE" ]; then
|
||||||
echo "Setting mode"
|
log "Setting mode"
|
||||||
MODE_LC=$( echo $MODE | tr '[:upper:]' '[:lower:]' )
|
MODE_LC=$( echo $MODE | tr '[:upper:]' '[:lower:]' )
|
||||||
case $MODE_LC in
|
case $MODE_LC in
|
||||||
0|1|2|3)
|
0|1|2|3)
|
||||||
@@ -112,7 +118,7 @@ function customizeServerProps {
|
|||||||
MODE=3
|
MODE=3
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "ERROR: Invalid game mode: $MODE"
|
log "ERROR: Invalid game mode: $MODE"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -123,11 +129,11 @@ function customizeServerProps {
|
|||||||
# Deploy server.properties file
|
# Deploy server.properties file
|
||||||
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
||||||
export SERVER_PROPERTIES=${FTB_DIR}/server.properties
|
export SERVER_PROPERTIES=${FTB_DIR}/server.properties
|
||||||
echo "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
|
log "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e "$SERVER_PROPERTIES" ]; then
|
if [ ! -e "$SERVER_PROPERTIES" ]; then
|
||||||
echo "Creating server.properties in ${SERVER_PROPERTIES}"
|
log "Creating server.properties in ${SERVER_PROPERTIES}"
|
||||||
cp /tmp/server.properties "$SERVER_PROPERTIES"
|
cp /tmp/server.properties "$SERVER_PROPERTIES"
|
||||||
customizeServerProps
|
customizeServerProps
|
||||||
elif [ -n "${OVERRIDE_SERVER_PROPERTIES}" ]; then
|
elif [ -n "${OVERRIDE_SERVER_PROPERTIES}" ]; then
|
||||||
@@ -136,11 +142,11 @@ elif [ -n "${OVERRIDE_SERVER_PROPERTIES}" ]; then
|
|||||||
customizeServerProps
|
customizeServerProps
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "server.properties already created, skipping"
|
log "server.properties already created, skipping"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
echo "server.properties already created, skipping"
|
log "server.properties already created, skipping"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec /start-finalSetup05EnvVariables $@
|
exec /start-finalSetup05EnvVariables $@
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /start-utils
|
||||||
|
|
||||||
|
if [ "${REPLACE_ENV_VARIABLES^^}" = "TRUE" ]; then
|
||||||
|
log "Replacing env variables in configs that match the prefix $ENV_VARIABLE_PREFIX..."
|
||||||
|
while IFS='=' read -r name value ; do
|
||||||
|
# check if name of env variable matches the prefix
|
||||||
|
# sanity check environment variables to avoid code injections
|
||||||
|
if [[ "$name" = $ENV_VARIABLE_PREFIX* ]] \
|
||||||
|
&& [[ $value =~ ^[0-9a-zA-Z_:/=?.+\-]*$ ]] \
|
||||||
|
&& [[ $name =~ ^[0-9a-zA-Z_\-]*$ ]]; then
|
||||||
|
log "Replacing $name with $value ..."
|
||||||
|
find /data/ -type f \
|
||||||
|
\( -name "*.yml" -or -name "*.yaml" -or -name "*.txt" -or -name "*.cfg" \
|
||||||
|
-or -name "*.conf" -or -name "*.properties" \) \
|
||||||
|
-exec sed -i 's#${'"$name"'}#'"$value"'#g' {} \;
|
||||||
|
fi
|
||||||
|
done < <(env)
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec /start-minecraftFinalSetup $@
|
||||||
@@ -2,35 +2,47 @@
|
|||||||
|
|
||||||
. /start-utils
|
. /start-utils
|
||||||
|
|
||||||
if [ -n "$OPS" -a ! -e ops.txt.converted ]; then
|
if [ -n "$OPS" ]; then
|
||||||
echo "Setting ops"
|
log "Setting/adding ops"
|
||||||
echo $OPS | awk -v RS=, '{print}' >> ops.txt
|
rm -rf ops.txt.converted
|
||||||
|
echo $OPS | awk -v RS=, '{print}' > ops.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$WHITELIST" -a ! -e white-list.txt.converted ]; then
|
if [ -n "$WHITELIST" ]; then
|
||||||
echo "Setting whitelist"
|
log "Setting whitelist"
|
||||||
echo $WHITELIST | awk -v RS=, '{print}' >> white-list.txt
|
rm -rf white-list.txt.converted
|
||||||
|
echo $WHITELIST | awk -v RS=, '{print}' > white-list.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$ICON" -a ! -e server-icon.png ]; then
|
if [ -n "$ICON" -a ! -e server-icon.png ]; then
|
||||||
echo "Using server icon from $ICON..."
|
log "Using server icon from $ICON..."
|
||||||
# Not sure what it is yet...call it "img"
|
# Not sure what it is yet...call it "img"
|
||||||
curl -sSL -o /tmp/icon.img $ICON
|
curl -sSL -o /tmp/icon.img $ICON
|
||||||
specs=$(identify /tmp/icon.img | awk '{print $2,$3}')
|
specs=$(identify /tmp/icon.img | awk '{print $2,$3}')
|
||||||
if [ "$specs" = "PNG 64x64" ]; then
|
if [ "$specs" = "PNG 64x64" ]; then
|
||||||
mv /tmp/icon.img /data/server-icon.png
|
mv /tmp/icon.img /data/server-icon.png
|
||||||
else
|
else
|
||||||
echo "Converting image to 64x64 PNG..."
|
log "Converting image to 64x64 PNG..."
|
||||||
convert /tmp/icon.img -resize 64x64! /data/server-icon.png
|
convert /tmp/icon.img -resize 64x64! /data/server-icon.png
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set up log configuration
|
||||||
|
LOGFILE="/data/log4j2.xml"
|
||||||
|
if [ ! -e "$LOGFILE" ]; then
|
||||||
|
log "Creating log4j2.xml in ${LOGFILE}"
|
||||||
|
cp /tmp/log4j2.xml "$LOGFILE"
|
||||||
|
else
|
||||||
|
log "log4j2.xml already created, skipping"
|
||||||
|
fi
|
||||||
|
JVM_OPTS="-Dlog4j.configurationFile=/data/log4j2.xml ${JVM_OPTS}"
|
||||||
|
|
||||||
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
|
# Make sure files exist and are valid JSON (for pre-1.12 to 1.12 upgrades)
|
||||||
echo "Checking for JSON files."
|
log "Checking for JSON files."
|
||||||
JSON_FILES=$(find . -maxdepth 1 -name '*.json')
|
JSON_FILES=$(find . -maxdepth 1 -name '*.json')
|
||||||
for j in $JSON_FILES; do
|
for j in $JSON_FILES; do
|
||||||
if [[ $(python -c "print open('$j').read().strip()==''") = True ]]; then
|
if [[ $(cat $j | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') == "" ]]; then
|
||||||
echo "Fixing JSON $j"
|
log "Fixing JSON $j"
|
||||||
echo '[]' > $j
|
echo '[]' > $j
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -39,7 +51,7 @@ done
|
|||||||
# If any modules have been provided, copy them over
|
# If any modules have been provided, copy them over
|
||||||
mkdir -p /data/mods
|
mkdir -p /data/mods
|
||||||
if [ -d /mods ]; then
|
if [ -d /mods ]; then
|
||||||
echo "Copying any mods over..."
|
log "Copying any mods over..."
|
||||||
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /mods /data
|
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /mods /data
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -47,7 +59,7 @@ fi
|
|||||||
for c in /config/*
|
for c in /config/*
|
||||||
do
|
do
|
||||||
if [ -f "$c" ]; then
|
if [ -f "$c" ]; then
|
||||||
echo Copying configuration `basename "$c"`
|
log Copying configuration `basename "$c"`
|
||||||
cp -rf "$c" /data/config
|
cp -rf "$c" /data/config
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -55,7 +67,7 @@ done
|
|||||||
mkdir -p /data/plugins
|
mkdir -p /data/plugins
|
||||||
if [ "$TYPE" = "SPIGOT" ]; then
|
if [ "$TYPE" = "SPIGOT" ]; then
|
||||||
if [ -d /plugins ]; then
|
if [ -d /plugins ]; then
|
||||||
echo "Copying any Bukkit plugins over..."
|
log "Copying any Bukkit plugins over..."
|
||||||
# Copy plugins over using rsync to allow deeply nested updates of plugins
|
# Copy plugins over using rsync to allow deeply nested updates of plugins
|
||||||
# only updates files if the source file is newer and print updated files
|
# only updates files if the source file is newer and print updated files
|
||||||
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /plugins /data
|
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /plugins /data
|
||||||
@@ -74,7 +86,7 @@ if [[ ${GUI} = false || ${GUI} = FALSE ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# put these prior JVM_OPTS at the end to give any memory settings there higher precedence
|
# put these prior JVM_OPTS at the end to give any memory settings there higher precedence
|
||||||
echo "Setting initial memory to ${INIT_MEMORY:=${MEMORY}} and max to ${MAX_MEMORY:=${MEMORY}}"
|
log "Setting initial memory to ${INIT_MEMORY:=${MEMORY}} and max to ${MAX_MEMORY:=${MEMORY}}"
|
||||||
|
|
||||||
expandedDOpts=
|
expandedDOpts=
|
||||||
if [ -n "$JVM_DD_OPTS" ]; then
|
if [ -n "$JVM_DD_OPTS" ]; then
|
||||||
@@ -100,16 +112,16 @@ if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
|
|||||||
cat > "${FTB_DIR}/settings-local.sh" <<EOF
|
cat > "${FTB_DIR}/settings-local.sh" <<EOF
|
||||||
export MIN_RAM="${INIT_MEMORY}"
|
export MIN_RAM="${INIT_MEMORY}"
|
||||||
export MAX_RAM="${MAX_MEMORY}"
|
export MAX_RAM="${MAX_MEMORY}"
|
||||||
export JAVA_PARAMETERS="-Xms${INIT_MEMORY} $expandedDOpts"
|
export JAVA_PARAMETERS="${JVM_XX_OPTS} -Xms${INIT_MEMORY} ${JVM_OPTS} $expandedDOpts"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# patch CurseForge cfg file, if present
|
# patch CurseForge cfg file, if present
|
||||||
if [ -f "${FTB_DIR}/settings.cfg" ]; then
|
if [ -f "${FTB_DIR}/settings.cfg" ]; then
|
||||||
sed -i "/MAX_RAM=.*/ c MAX_RAM=${MAX_MEMORY};" "${FTB_DIR}/settings.cfg"
|
sed -i "s/MAX_RAM=[^;]*/MAX_RAM=${MAX_MEMORY}/" "${FTB_DIR}/settings.cfg"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "${FTB_DIR}"
|
cd "${FTB_DIR}"
|
||||||
echo "Running FTB ${FTB_SERVER_START} in ${FTB_DIR} ..."
|
log "Running FTB ${FTB_SERVER_START} in ${FTB_DIR} ..."
|
||||||
if isTrue ${DEBUG_EXEC}; then
|
if isTrue ${DEBUG_EXEC}; then
|
||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
@@ -120,7 +132,7 @@ else
|
|||||||
bootstrapArgs="--bootstrap /data/bootstrap.txt"
|
bootstrapArgs="--bootstrap /data/bootstrap.txt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Starting the Minecraft server..."
|
log "Starting the Minecraft server..."
|
||||||
JVM_OPTS="-Xms${INIT_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}"
|
JVM_OPTS="-Xms${INIT_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}"
|
||||||
if isTrue ${DEBUG_EXEC}; then
|
if isTrue ${DEBUG_EXEC}; then
|
||||||
set -x
|
set -x
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
function isURL {
|
function isURL {
|
||||||
local value=$1
|
local value=$1
|
||||||
|
|
||||||
if [[ ${value:0:8} == "https://" || ${value:0:7} = "http://" ]]; then
|
if [[ ${value:0:8} == "https://" || ${value:0:7} == "http://" ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
@@ -28,7 +28,7 @@ function isTrue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isDebugging {
|
function isDebugging {
|
||||||
if [[ ${DEBUG^^} = TRUE ]]; then
|
if [[ -v DEBUG ]] && [[ ${DEBUG^^} = TRUE ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
@@ -37,6 +37,14 @@ function isDebugging {
|
|||||||
|
|
||||||
function debug {
|
function debug {
|
||||||
if isDebugging; then
|
if isDebugging; then
|
||||||
echo "DEBUG: $*"
|
log "DEBUG: $*"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function logn {
|
||||||
|
echo -n "[init] $*"
|
||||||
|
}
|
||||||
|
|
||||||
|
function log {
|
||||||
|
echo "[init] $*"
|
||||||
|
}
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
FROM openjdk:8-jre
|
|
||||||
|
|
||||||
LABEL maintainer "itzg"
|
|
||||||
|
|
||||||
ENV TITAN_VERSION 0.5.4
|
|
||||||
|
|
||||||
ADD http://s3.thinkaurelius.com/downloads/titan/titan-$TITAN_VERSION-hadoop2.zip /tmp/titan.zip
|
|
||||||
RUN unzip -q /tmp/titan.zip -d /opt && \
|
|
||||||
rm /tmp/titan.zip
|
|
||||||
|
|
||||||
ENV TITAN_HOME /opt/titan-$TITAN_VERSION-hadoop2
|
|
||||||
WORKDIR $TITAN_HOME
|
|
||||||
|
|
||||||
VOLUME ["/conf","/data"]
|
|
||||||
ADD start-gremlin.sh /opt/start-gremlin.sh
|
|
||||||
|
|
||||||
CMD ["/opt/start-gremlin.sh"]
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
Runs the Gremlin console from the Titan Graph Database's "all" distribution.
|
|
||||||
|
|
||||||
# Basic Usage
|
|
||||||
|
|
||||||
To start the Gremlin console with the default configuration files available:
|
|
||||||
|
|
||||||
docker run -it itzg/titan-gremlin
|
|
||||||
|
|
||||||
In order to adjust or further define property files to use within Gremlin,
|
|
||||||
attach a host directory to the container's `/conf` such as
|
|
||||||
|
|
||||||
docker run -it -v $(pwd)/conf:/conf itzg/titan-gremlin
|
|
||||||
|
|
||||||
After running once your host directory will be populated with the distribution-default
|
|
||||||
configuration files. Modify those or add to them and they will be available during
|
|
||||||
the next time you (re)start your container.
|
|
||||||
|
|
||||||
# Connecting to Cassandra and Elasticsearch Containers
|
|
||||||
|
|
||||||
First start containers for Cassandra and Elasticsearch (pre-2.x),
|
|
||||||
where the `--name` you choose can be arbitrary or left off to use a generated name.
|
|
||||||
|
|
||||||
docker run -d --name gremlin-cass itzg/cassandra
|
|
||||||
docker run -d --name gremlin-es itzg/elasticsearch:1.x
|
|
||||||
|
|
||||||
Now start Gremlin with networking links to those containers with the aliases
|
|
||||||
|
|
||||||
* `--link <container>:cass`
|
|
||||||
* `--link <container>:es`
|
|
||||||
|
|
||||||
such as
|
|
||||||
|
|
||||||
docker run -it --rm --link gremlin-cass:cass --link gremlin-es:es itzg/titan-gremlin
|
|
||||||
|
|
||||||
and with that you can follow the
|
|
||||||
[Graph of the Gods example](http://s3.thinkaurelius.com/docs/titan/current/getting-started.html), such as
|
|
||||||
|
|
||||||
gremlin> GraphOfTheGodsFactory.load(g)
|
|
||||||
gremlin> saturn = g.V.has('name','saturn').next()
|
|
||||||
==>v[256]
|
|
||||||
gremlin> saturn.map()
|
|
||||||
==>name=saturn
|
|
||||||
==>age=10000
|
|
||||||
gremlin> saturn.in('father').in('father').name
|
|
||||||
==>hercules
|
|
||||||
|
|
||||||
# Running and Connecting with Docker Compose
|
|
||||||
|
|
||||||
Create the following Compose content as the file `docker-compose.yml` and in
|
|
||||||
that directory invoke `docker-compose run titan` to run the Gremlin shell
|
|
||||||
with the supporting Elasticsearch and Cassandra containers.
|
|
||||||
|
|
||||||
```
|
|
||||||
titan:
|
|
||||||
image: itzg/titan-gremlin
|
|
||||||
links:
|
|
||||||
- cass
|
|
||||||
- es
|
|
||||||
cass:
|
|
||||||
image: itzg/cassandra
|
|
||||||
es:
|
|
||||||
image: itzg/elasticsearch:1.x
|
|
||||||
```
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
args=
|
|
||||||
|
|
||||||
if [ $(ls /conf|wc -l) = 0 ]; then
|
|
||||||
cp -r $TITAN_HOME/conf/* /conf
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f /tmp/titan.properties
|
|
||||||
|
|
||||||
if [ -n "$CASS_PORT_9160_TCP_ADDR" ]; then
|
|
||||||
|
|
||||||
shortcut=/tmp/titan.properties
|
|
||||||
cat >> /tmp/titan.properties <<END
|
|
||||||
storage.backend=cassandra
|
|
||||||
storage.hostname=$CASS_PORT_9160_TCP_ADDR
|
|
||||||
END
|
|
||||||
|
|
||||||
elif [ -n "$CASS_ADDR" ]; then
|
|
||||||
|
|
||||||
shortcut=/tmp/titan.properties
|
|
||||||
cat >> /tmp/titan.properties <<END
|
|
||||||
storage.backend=cassandra
|
|
||||||
storage.hostname=$CASS_ADDR
|
|
||||||
END
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
esAddr=${ES_ENV_PUBLISH_AS:-${ES_PORT_9300_TCP_ADDR}}
|
|
||||||
|
|
||||||
if [ -n "$ES_CLUSTER" -o -n "$esAddr" ]; then
|
|
||||||
shortcut=/tmp/titan.properties
|
|
||||||
cat >> /tmp/titan.properties <<END
|
|
||||||
index.search.backend=elasticsearch
|
|
||||||
index.search.elasticsearch.client-only=true
|
|
||||||
END
|
|
||||||
|
|
||||||
if [ -n "$ES_CLUSTER" ]; then
|
|
||||||
cat >> /tmp/titan.properties <<END
|
|
||||||
index.search.elasticsearch.ext.cluster.name=$ES_CLUSTER
|
|
||||||
END
|
|
||||||
fi
|
|
||||||
if [ -n "$esAddr" ]; then
|
|
||||||
# strip off the port spec, if present
|
|
||||||
esAddr=$(echo $esAddr | cut -d: -f1)
|
|
||||||
cat >> /tmp/titan.properties <<END
|
|
||||||
index.search.hostname=$esAddr
|
|
||||||
END
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$shortcut" ]; then
|
|
||||||
cat > /tmp/init.groovy <<END
|
|
||||||
g = TitanFactory.open('$shortcut')
|
|
||||||
println 'The graph \'g\' was opened using $shortcut'
|
|
||||||
END
|
|
||||||
args="$args /tmp/init.groovy"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Allow a little extra time for Cassandra to be ready
|
|
||||||
sleep 1
|
|
||||||
exec $TITAN_HOME/bin/gremlin.sh $args
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
FROM itzg/ubuntu-openjdk-7
|
|
||||||
|
|
||||||
LABEL maintainer "itzg"
|
|
||||||
|
|
||||||
ENV APT_GET_UPDATE 2014-07-19
|
|
||||||
|
|
||||||
RUN apt-get update
|
|
||||||
RUN apt-get install -y wget unzip
|
|
||||||
|
|
||||||
ENV TITAN_VER 0.4.4
|
|
||||||
ENV TITAN_STORAGE all
|
|
||||||
ENV REXSTER_VER 2.4.0
|
|
||||||
|
|
||||||
RUN wget -O /tmp/titan.zip http://s3.thinkaurelius.com/downloads/titan/titan-$TITAN_STORAGE-$TITAN_VER.zip
|
|
||||||
RUN wget -O /tmp/rexster.zip http://tinkerpop.com/downloads/rexster/rexster-server-$REXSTER_VER.zip
|
|
||||||
|
|
||||||
WORKDIR /opt
|
|
||||||
|
|
||||||
RUN unzip /tmp/titan.zip
|
|
||||||
RUN rm /tmp/titan.zip
|
|
||||||
|
|
||||||
RUN unzip /tmp/rexster.zip
|
|
||||||
RUN rm /tmp/rexster.zip
|
|
||||||
|
|
||||||
RUN ln -s titan-$TITAN_STORAGE-$TITAN_VER titan
|
|
||||||
RUN ln -s rexster-server-$REXSTER_VER rexster-server
|
|
||||||
|
|
||||||
RUN mkdir /opt/rexster-server/ext/titan
|
|
||||||
RUN ln -s /opt/titan-$TITAN_STORAGE-$TITAN_VER/lib/* /opt/rexster-server/ext/titan
|
|
||||||
RUN wget -O /opt/rexster-server/ext/titan/titan-rexter-$TITAN_VER.jar \
|
|
||||||
http://central.maven.org/maven2/com/thinkaurelius/titan/titan-rexster/$TITAN_VER/titan-rexster-$TITAN_VER.jar
|
|
||||||
|
|
||||||
# Clean up distro area
|
|
||||||
RUN rm /opt/rexster-server/ext/titan/log4j* /opt/rexster-server/ext/titan/slf4j*
|
|
||||||
RUN rm /opt/rexster-server/lib/lucene-core*
|
|
||||||
|
|
||||||
ADD gremlin /usr/local/bin/gremlin
|
|
||||||
ADD rexster /usr/local/bin/rexster
|
|
||||||
|
|
||||||
WORKDIR titan
|
|
||||||
|
|
||||||
ADD titan.properties /opt/titan/conf/titan.properties
|
|
||||||
ADD init-graph-storage.groovy /tmp/init-graph-storage.groovy
|
|
||||||
|
|
||||||
VOLUME ["/data", "/config", "/scripts"]
|
|
||||||
RUN ln -s /data /opt/titan/db
|
|
||||||
|
|
||||||
RUN gremlin -e /tmp/init-graph-storage.groovy && rm /tmp/init-graph-storage.groovy
|
|
||||||
|
|
||||||
EXPOSE 8182 8184
|
|
||||||
|
|
||||||
ADD rexster.xml /config/rexster.xml
|
|
||||||
|
|
||||||
CMD ["/usr/local/bin/rexster", "-s", "-c", "/config/rexster.xml"]
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
/opt/titan/bin/gremlin.sh $*
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import com.thinkaurelius.titan.core.TitanFactory
|
|
||||||
import com.thinkaurelius.titan.core.TitanGraph
|
|
||||||
import com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration
|
|
||||||
import org.apache.commons.configuration.BaseConfiguration
|
|
||||||
import org.apache.commons.configuration.Configuration
|
|
||||||
|
|
||||||
// Setup a blank one
|
|
||||||
|
|
||||||
TitanGraph g = TitanFactory.open('conf/titan.properties')
|
|
||||||
g.shutdown()
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [ -n "$PUBLISH_ADDR" ]; then
|
|
||||||
echo "Enabling Doghouse access at http://$PUBLISH_ADDR:8182/doghouse"
|
|
||||||
sed -i "s#<base-uri>.*</base-uri>#<base-uri>http://$PUBLISH_ADDR</base-uri>#" /config/rexster.xml
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$SCRIPT" ]; then
|
|
||||||
echo "Running Gremlin script $SCRIPT from /scripts..."
|
|
||||||
gremlin -e /scripts/$SCRIPT
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Starting Rexster..."
|
|
||||||
/opt/rexster-server/bin/rexster.sh $*
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<rexster>
|
|
||||||
<http>
|
|
||||||
<base-uri>http://localhost</base-uri>
|
|
||||||
</http>
|
|
||||||
<graphs>
|
|
||||||
<graph>
|
|
||||||
<graph-name>titan</graph-name>
|
|
||||||
<graph-type>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type>
|
|
||||||
<graph-location>/data/persistit</graph-location>
|
|
||||||
<graph-read-only>false</graph-read-only>
|
|
||||||
<properties>
|
|
||||||
<storage.backend>persistit</storage.backend>
|
|
||||||
<storage.directory>/data/persistit</storage.directory>
|
|
||||||
<storage.buffercount>5000</storage.buffercount>
|
|
||||||
<storage.index.search.backend>elasticsearch</storage.index.search.backend>
|
|
||||||
<storage.index.search.local-mode>true</storage.index.search.local-mode>
|
|
||||||
<storage.index.search.client-only>false</storage.index.search.client-only>
|
|
||||||
<storage.index.search.directory>/data/es</storage.index.search.directory>
|
|
||||||
</properties>
|
|
||||||
<extensions>
|
|
||||||
<allows>
|
|
||||||
<allow>tp:gremlin</allow>
|
|
||||||
</allows>
|
|
||||||
</extensions>
|
|
||||||
</graph>
|
|
||||||
</graphs>
|
|
||||||
</rexster>
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import com.thinkaurelius.titan.core.TitanFactory
|
|
||||||
import com.thinkaurelius.titan.example.GraphOfTheGodsFactory
|
|
||||||
|
|
||||||
def g = TitanFactory.open('conf/titan.properties')
|
|
||||||
GraphOfTheGodsFactory.load(g)
|
|
||||||
|
|
||||||
g.shutdown()
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
storage.backend=persistit
|
|
||||||
storage.directory=/data/persistit
|
|
||||||
storage.buffercount=5000
|
|
||||||
|
|
||||||
storage.index.search.backend=elasticsearch
|
|
||||||
storage.index.search.local-mode=true
|
|
||||||
storage.index.search.client-only=false
|
|
||||||
storage.index.search.directory=/data/es
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
FROM ubuntu:trusty
|
|
||||||
|
|
||||||
LABEL maintainer "itzg"
|
|
||||||
|
|
||||||
ENV APT_GET_UPDATE 2015-10-29
|
|
||||||
RUN apt-get update
|
|
||||||
RUN DEBIAN_FRONTEND=noninteractive \
|
|
||||||
apt-get -q -y install openjdk-7-jre-headless wget unzip \
|
|
||||||
&& apt-get clean
|
|
||||||
|
|
||||||
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Provides the latest OpenJDK JRE on top of Ubuntu Trusty (14.04).
|
|
||||||
Reference in new issue
Block a user