Compare commits

..

20 Commits

Author SHA1 Message Date
Deon George
32c5348864 Fixed timezone for Mystic 2019-06-21 17:15:22 +10:00
Deon George
a614fcadf9 Version update for .gitlab-ci 2019-04-07 23:37:19 +10:00
Deon George
739f9a75bc Update to 1.12A43 added ZeroTier 2019-04-07 23:03:49 +10:00
Deon George
219697e2d1 Added temp paths to avoid cross device issues 2019-02-16 21:48:16 +11:00
Deon George
c8c5cbcd6c Change version 2019-02-03 11:43:25 +11:00
Deon George
f16644ac15 Change gitlab-ci tag 2019-02-03 11:29:46 +11:00
Deon George
dbd8bc3a99 Update to 1.12A42 2019-02-03 11:24:41 +11:00
Deon George
48cf62dd15 Fix trigger for armv7l 2018-09-14 21:32:05 +10:00
Deon George
cf18917a39 Added custom scripts in data 2018-09-14 21:17:16 +10:00
Deon George
bde5de7730 Showing msg on first install about data dir 2018-09-13 23:35:11 +10:00
Deon George
03851190a2 Moved build trigger token to a variable 2018-09-03 10:15:15 +10:00
Deon George
99dbc6b4b6 Added curl as a pre-req 2018-09-03 09:50:26 +10:00
Deon George
cb74c9599b Moved trigger to build 2018-09-03 09:43:01 +10:00
Deon George
abe95e8fd8 Updated trigger-build-ci to include runner tags 2018-09-03 09:36:28 +10:00
Deon George
f22ef035cc Minor tweeking 2018-09-03 09:28:02 +10:00
Deon George
25fb0567df Added tempdirs to data path 2018-09-02 23:27:38 +10:00
Deon George
b0f48263aa Updated apt url, trigger rebuild 2018-08-30 13:22:10 +10:00
Deon George
3f4890970a Added Python to the base image 2018-08-30 00:33:58 +10:00
Deon George
fa04bef3de Updated libcl to stretch compile 2018-08-27 20:07:49 +10:00
Deon George
3e961b585e Update to stretch 2018-08-27 00:30:33 +10:00
8 changed files with 163 additions and 20 deletions

View File

@ -5,7 +5,7 @@ stages:
- build
variables:
VERSION: 1.12a39-${CI_COMMIT_REF_NAME}
VERSION: 1.12a43-${CI_COMMIT_REF_NAME}
CACHETAG: build-${CI_COMMIT_REF_NAME}
DOCKER_HOST: tcp://docker:2375
@ -26,7 +26,7 @@ test:
- docker build -t ${CI_REGISTRY_IMAGE}:${VERSION} .
- docker images
tags:
- docker
- docker-armv7l
only:
- debug
@ -38,8 +38,9 @@ build:
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} .
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}
- docker push ${CI_REGISTRY_IMAGE}:${CACHETAG}
- if [ -n "${TRIGGER_PIPELINE}" ]; then curl -sSX POST -F token=${TRIGGER_PIPELINE} -F ref=x86_64-extras http://dev.leenooks.net/api/v4/projects/45/trigger/pipeline > /dev/null; fi
- if [ -n "${TRIGGER_PIPELINE}" ]; then curl -sSX POST -F token=${TRIGGER_PIPELINE} -F ref=armv7l-extras http://dev.leenooks.net/api/v4/projects/45/trigger/pipeline > /dev/null; fi
tags:
- docker
- armv7l
only:
- x86_64
- armv7l

View File

@ -1,5 +1,5 @@
# NAME leenooks/mysticbbs
# VERSION 1.12a39-x86_64
# VERSION 1.12a43
FROM debian:stretch-slim
@ -8,7 +8,7 @@ MAINTAINER Deon George <deon@leenooks.net>
# Pre-requisites
# + Base application requires unzip zip curl libhunspell-dev libpython2.7
RUN apt-get update \
&& apt-get install -yqq unzip zip curl libhunspell-dev libpython2.7 \
&& apt-get install -yqq unzip zip curl libhunspell-dev libpython2.7 patch \
&& rm -rf /var/lib/apt/lists/* /tmp/*
# Add in Leenooks' apt repository
@ -16,18 +16,37 @@ RUN curl -s http://apt.leenooks.net/setup.sh | sh
# For SSH connections
RUN apt-get update \
&& apt-get install --allow-unauthenticated -yqq cryptlib \
&& apt-get install --allow-unauthenticated -yqq libcl \
&& rm -rf /var/lib/apt/lists/* /tmp/*
RUN ln -sf /usr/share/zoneinfo/Australia/Melbourne /etc/localtime
RUN ln -sf /usr/share/zoneinfo/Australia/Melbourne /etc/localtime && echo 'Australia/Melbourne' > /etc/timezone
WORKDIR /mystic
ENV mysticbbs /mystic/data
EXPOSE 22 23 24554
ADD mystic.tar.gz /
VOLUME ["/mystic/data"]
# Enable custom scripts to live in the data dir
RUN ln -sf ../data/scripts /mystic/scripts/custom
# Fix temp locations
RUN ln -s data/tempftn /mystic/tempftn && ln -s data/tempmis /mystic/tempmis && ln -s data/temputil /mystic/temputil
# Add ZeroTier
RUN apt-get update \
&& apt-get install -yqq gnupg1 \
&& rm -rf /var/lib/apt/lists/* /tmp/*
RUN echo "deb http://download.zerotier.com/debian/stretch stretch main" > /etc/apt/sources.list.d/zerotier.list
COPY zt-gpg-key /tmp/
RUN apt-key add /tmp/zt-gpg-key
RUN apt-get update \
&& apt-get install -yq zerotier-one \
&& rm -rf /var/lib/apt/lists/* /tmp/*
VOLUME [ "/var/lib/zerotier-one" ]
COPY init /sbin/init
ENTRYPOINT [ "/sbin/init" ]
CMD [ "start" ]
ADD mystic.tar.gz /
VOLUME ["/mystic/data"]

View File

@ -19,7 +19,7 @@ To use this container:
1. Docker pull it from my registry. (Actually you can skip this step, but its worth doing it anyway!)
docker pull registry.leenooks.net/leenooks/mysticbbs:1.12a39-x86_64
docker pull registry.leenooks.net/leenooks/mysticbbs:1.12a39-armv7l
2. Create a directory to hold your BBS data. (I use */srv/docker/mystic*).
@ -27,7 +27,7 @@ To use this container:
3. Start the container.
docker run -itd -v /srv/mystic/data:/mystic/data -p 10022:22 -p 10023:23 -p 24554:24554 registry.leenooks.net/leenooks/mysticbbs:1.12a39-x86_64
docker run -itd -v /srv/mystic/data:/mystic/data -p 10022:22 -p 10023:23 -p 24554:24554 registry.leenooks.net/leenooks/mysticbbs:1.12a39-armv7l
Explanation of these parameters:
@ -35,7 +35,7 @@ To use this container:
| :- | :-- |
| -d | Detached mode: run the container in the background and print the new container ID. |
| -i | Keep STDIN open even if not attached. (required) |
| --name= | Give your container a specific name. (optional) |
| -n | Give your container a specific name. (optional) |
| -p | Map host ports to container ports. (may be required, otherwise recommended) |
| -t | Allocate a pseudo-TTY. (required) |
| -v | Map a path on the host into the container (optional but recommended). |
@ -64,4 +64,4 @@ You can also run this in a swarm (I do)!
----
## Extras Container
There is an "extras" container with some additional MysticBBS mods pre-installed. You'll find info on that in the [x86_64-extras](https://dev.leenooks.net/leenooks/mysticbbs/blob/x86_64-extras/README.md#info-on-the-images) branch.
There is an "extras" container with some additional MysticBBS mods pre-installed. You'll find info on that in the [armv7l-extras](https://dev.leenooks.net/leenooks/mysticbbs/blob/armv7l-extras/README.md#info-on-the-images) branch.

View File

@ -2,4 +2,3 @@ data
mystic
mods
*.zip
*.rar

View File

@ -2,7 +2,7 @@
set -e
MYSTIC_SOURCE=${1:-mys112a39_l64.rar}
MYSTIC_SOURCE=${1:-mys112a42_pi.zip}
[ "$1" ] && shift
SPELL_SOURCE=${1:-mystic_spellcheck_v2.zip}
[ "$1" ] && shift
@ -24,8 +24,9 @@ else
# 2) Create a new directory for it and unzip the App into it
[ -d ${CLEAN_INSTALL_DIR} ] && echo "ERROR: Directory [${CLEAN_INSTALL_DIR}] already exists!" && exit 1
mkdir ${CLEAN_INSTALL_DIR}; cd ${CLEAN_INSTALL_DIR}; unrar x ../${MYSTIC_SOURCE}; cd ..
[ $? -gt 0 ] && echo "ERROR: Unrar failed?" && exit 1
unzip ${MYSTIC_SOURCE} -d ${CLEAN_INSTALL_DIR}
chmod +x ${CLEAN_INSTALL_DIR}/install
[ $? -gt 0 ] && echo "ERROR: Unzip failed?" && exit 1
# 3) Run docker with -v mapping the unzip files to an arbitrary directory -v unzipfiles:/install
# ** @TODO Request upstream to default QWK and Echo DIRs to named dir as well during installation
@ -62,6 +63,9 @@ else
# Clean up data dir
find data -type f -exec chmod 644 {} \;
# Create our temp dirs
mkdir data/tempftn data/tempmis data/temputil
# Finished
mv data ../..
cd ../..

70
init
View File

@ -2,6 +2,7 @@
set -e
NAME="Mystic BBS"
VERSION="A43"
INIT=mis
function stop {
@ -14,7 +15,74 @@ export PATH=$PATH:/mystic
if [ "$1" == "start" ]; then
# First time install - expand out our data directory
[ $(find data|wc -l) -le 1 ] && tar xzf data.tar.gz
if [ $(find data|wc -l) -le 1 ]; then
echo "** First time install, deploying sample setup"
tar xzf data.tar.gz
echo ${VERSION} > .version
# We need to upgrade
else
OLD_VERSION=$(cat data/.version)
echo "** Upgrading [${OLD_VERSION}]"
case ${OLD_VERSION} in
A39)
echo "Processing data/default.txt"
set -x
[ ! -d data/upgrade/${VERSION}/${OLD_VERSION} ] && mkdir -p data/upgrade/${VERSION}/${OLD_VERSION}
cd data/upgrade/${VERSION}/${OLD_VERSION}
[ -d data ] && rm -rf data
tar xzf /mystic/data.tar.gz
cd /mystic/data
diff -u data/default.txt upgrade/${VERSION}/${OLD_VERSION}/data/data/default.txt > upgrade/${VERSION}/${OLD_VERSION}/default.txt.patch && echo $?
if [ -s upgrade/${VERSION}/${OLD_VERSION}/default.txt.patch ]; then
patch -p 0 < upgrade/${VERSION}/${OLD_VERSION}/default.txt.patch
echo "! Check upgrade/${VERSION}/${OLD_VERSION}/default.txt.patch for an strings that may have been overwritten..."
else
rm -f upgrade/${VERSION}/${OLD_VERSION}/default.txt.patch
fi
for i in msg_index.ini msg_index.ans msg_index_help.ans; do
cp upgrade/${VERSION}/${OLD_VERSION}/data/text/$i text/
done
cp upgrade/${VERSION}/${OLD_VERSION}/data/data/cfgroot4.ans data/
../upgrade
cd ../scripts
./mplc -all
cd ../data
rm -rf upgrade/${VERSION}/${OLD_VERSION}/data
echo A42 > .version
;;
A42)
set -x
[ ! -d data/upgrade/${VERSION}/${OLD_VERSION} ] && mkdir -p data/upgrade/${VERSION}/${OLD_VERSION}
cd data/upgrade/${VERSION}/${OLD_VERSION}
[ -d data ] && rm -rf data
tar xzf /mystic/data.tar.gz
cd /mystic/data
for i in text/userchat.ans text/userchat.ini; do
cp upgrade/${VERSION}/${OLD_VERSION}/data/$i ./$i
done
diff -ur text/ upgrade/${VERSION}/${OLD_VERSION}/data/text/ > upgrade/${VERSION}/${OLD_VERSION}/text.patch || true
rm -rf upgrade/${VERSION}/${OLD_VERSION}/data
echo A43 > .version
;;
A43) echo "Already up to date!" ;;
*) echo "!! Dont know how to upgrade" && exit 1
esac
fi
if [ -x /usr/sbin/zerotier-one -a -n "${ENABLE_ZT}" ]; then
echo "** Starting ZeroTier"
mkdir /dev/net && mknod /dev/net/tun -m 666 c 10 200
/usr/sbin/zerotier-one -d
fi
# OK, start
exec ${INIT} server

Binary file not shown.

52
zt-gpg-key Normal file
View File

@ -0,0 +1,52 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: GPGTools - https://gpgtools.org
mQINBFdQq7oBEADEVhyRiaL8dEjMPlI/idO8tA7adjhfvejxrJ3Axxi9YIuIKhWU
5hNjDjZAiV9iSCMfJN3TjC3EDA+7nFyU6nDKeAMkXPbaPk7ti+Tb1nA4TJsBfBlm
CC14aGWLItpp8sI00FUzorxLWRmU4kOkrRUJCq2kAMzbYWmHs0hHkWmvj8gGu6mJ
WU3sDIjvdsm3hlgtqr9grPEnj+gA7xetGs3oIfp6YDKymGAV49HZmVAvSeoqfL1p
pEKlNQ1aO9uNfHLdx6+4pS1miyo7D1s7ru2IcqhTDhg40cHTL/VldC3d8vXRFLIi
Uo2tFZ6J1jyQP5c1K4rTpw3UNVne3ob7uCME+T1+ePeuM5Y/cpcCvAhJhO0rrlr0
dP3lOKrVdZg4qhtFAspC85ivcuxWNWnfTOBrgnvxCA1fmBX+MLNUEDsuu55LBNQT
5+WyrSchSlsczq+9EdomILhixUflDCShHs+Efvh7li6Pg56fwjEfj9DJYFhRvEvQ
7GZ7xtysFzx4AYD4/g5kCDsMTbc9W4Jv+JrMt3JsXt2zqwI0P4R1cIAu0J6OZ4Xa
dJ7Ci1WisQuJRcCUtBTUxcYAClNGeors5Nhl4zDrNIM7zIJp+GfPYdWKVSuW10mC
r3OS9QctMSeVPX/KE85TexeRtmyd4zUdio49+WKgoBhM8Z9MpTaafn2OPQARAQAB
tFBaZXJvVGllciwgSW5jLiAoWmVyb1RpZXIgU3VwcG9ydC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