Compare commits
49 Commits
Author | SHA1 | Date |
---|---|---|
Deon George | ffae70dabb | |
Deon George | 0cf79f7354 | |
Deon George | 68fd0ff94e | |
Deon George | 31f1f89ad8 | |
Deon George | 9937972d6a | |
Deon George | 6a21185f0a | |
Deon George | a5457d80af | |
Deon George | 64c13dacb4 | |
Deon George | f6f89f6086 | |
Deon George | 1f612dd027 | |
Deon George | 7a32a52517 | |
Deon George | f321af3062 | |
Deon George | a20a9022ce | |
Deon George | 4000df716c | |
Deon George | 99308f701b | |
Deon George | 6be2019885 | |
Deon George | c6930db160 | |
Deon George | 363a9184c0 | |
Deon George | aceeed758b | |
Deon George | 50f6e8fe0c | |
Deon George | 7cb746ceb2 | |
Deon George | 57c3e5149a | |
Deon George | 4ede70a917 | |
Deon George | 0d2de5c97c | |
Deon George | 564e85a1d9 | |
Deon George | ba0b285a8f | |
Deon George | e2c81af094 | |
Deon George | ec80048e19 | |
Deon George | 9727eb7578 | |
Deon George | 7055833ed3 | |
Deon George | 196b15be0c | |
Deon George | 61b025f91f | |
Deon George | 1f75382ada | |
Deon George | ebe72b1d8f | |
Deon George | 8453f48ae4 | |
Deon George | 4e0224589b | |
Deon George | 1059cdf82a | |
Deon George | 273a605ea0 | |
Deon George | 530d917267 | |
Deon George | 6a13bd0be7 | |
Deon George | adc38bc7d4 | |
Deon George | 1e75b5fe05 | |
Deon George | 90ebcf6059 | |
Deon George | 9c0765283b | |
Deon George | 6c9dfc37dc | |
Deon George | 28a1cc2aa8 | |
Deon George | 6986bc92d8 | |
Deon George | 7ac241d5bc | |
Deon George | 3ef795079c |
|
@ -1,21 +1,26 @@
|
|||
image: docker:latest
|
||||
|
||||
stages:
|
||||
- build
|
||||
- build-manifest
|
||||
|
||||
variables:
|
||||
VERSION: 3.17c-${ARCH}
|
||||
CACHETAG: build-${ARCH}
|
||||
VERSION: latest
|
||||
DOCKER_HOST: tcp://docker:2375
|
||||
VERSIONARCH: ${VERSION}-${ARCH}
|
||||
|
||||
cache:
|
||||
key: ${CI_JOB_NAME_SLUG}-${CI_COMMIT_REF_SLUG}
|
||||
paths:
|
||||
- build-cache
|
||||
|
||||
image: docker:latest
|
||||
services:
|
||||
- docker:dind
|
||||
|
||||
before_script:
|
||||
- docker info
|
||||
- docker version
|
||||
- if [ ! -d build-cache ]; then mkdir build-cache; fi
|
||||
- docker info && docker version
|
||||
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
|
||||
- ls -alR .
|
||||
|
||||
include: .gitlab-docker-x86_64.yml
|
||||
#include: .gitlab-docker-armv7l.yml
|
||||
include:
|
||||
- .gitlab-docker-x86_64.yml
|
||||
- .gitlab-docker-manifest.yml
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
armv7l:build:
|
||||
variables:
|
||||
ARCH: armv7l
|
||||
stage: build
|
||||
image: docker:latest
|
||||
script:
|
||||
- if [ -f init ]; then chmod 500 init; fi
|
||||
- ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || echo "true"
|
||||
- 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}
|
||||
tags:
|
||||
- docker
|
||||
- armv7l
|
||||
only:
|
||||
- master
|
|
@ -0,0 +1,10 @@
|
|||
x86_64:build-manifest:
|
||||
stage: build-manifest
|
||||
script:
|
||||
- docker manifest create ${CI_REGISTRY_IMAGE}:${VERSION} ${CI_REGISTRY_IMAGE}:${VERSION}-x86_64 #${CI_REGISTRY_IMAGE}:${VERSION}-arm64 ${CI_REGISTRY_IMAGE}:${VERSION}-armv7l
|
||||
- docker manifest push --purge ${CI_REGISTRY_IMAGE}:${VERSION}
|
||||
tags:
|
||||
- docker
|
||||
- x86_64
|
||||
only:
|
||||
- master
|
|
@ -2,16 +2,15 @@ x86_64:build:
|
|||
variables:
|
||||
ARCH: x86_64
|
||||
stage: build
|
||||
image: docker:latest
|
||||
script:
|
||||
- if [ -f init ]; then chmod 500 init; fi
|
||||
- ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || echo "true"
|
||||
- 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}
|
||||
- ([ -z "$REFRESH" -a -f build-cache/${CI_COMMIT_REF_SLUG} ]) && docker load < build-cache/${CI_COMMIT_REF_SLUG} || true
|
||||
- rm build-cache/* || true
|
||||
- docker build ${HTTP_PROXY:+--build-arg HTTP_PROXY=${HTTP_PROXY}} --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} .
|
||||
- docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}
|
||||
- docker save ${CI_REGISTRY_IMAGE}:${VERSIONARCH} > build-cache/${CI_COMMIT_REF_SLUG}
|
||||
tags:
|
||||
- docker
|
||||
- x86_64
|
||||
only:
|
||||
- master
|
||||
|
||||
- x86_64
|
||||
|
|
78
Dockerfile
78
Dockerfile
|
@ -1,51 +1,51 @@
|
|||
# NAME leenooks/sbbs
|
||||
# VERSION 3.17c
|
||||
# VERSION latest
|
||||
|
||||
FROM debian:stretch-slim
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
# Base utilities
|
||||
RUN apt-get update \
|
||||
&& apt-get install -yqq curl procps less zip unzip arj unrar-free lhasa arc zoo logrotate libmozjs185-1.0 cron \
|
||||
&& apt-get install -yqq curl supervisor procps less zip unzip arj unrar-free lhasa arc logrotate cron \
|
||||
&& apt-get -y autoremove \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Add in Leenooks' apt repository
|
||||
RUN curl -s http://apt.leenooks.net/setup.sh | sh
|
||||
|
||||
# Add ZeroTier
|
||||
RUN echo "deb http://download.zerotier.com/debian/stretch stretch main" > /etc/apt/sources.list.d/zerotier.list
|
||||
|
||||
# Leenooks Utils
|
||||
RUN apt-get update \
|
||||
&& apt-get install -yqq --allow-unauthenticated makenl zerotier-one \
|
||||
&& apt-get -y autoremove \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
# Set the default timezone for the container
|
||||
RUN ln -sf /usr/share/zoneinfo/Australia/Melbourne /etc/localtime
|
||||
|
||||
# Other Utilities
|
||||
RUN echo "deb http://ftp.au.debian.org/debian/ stretch contrib" > /etc/apt/sources.list.d/contrib.list
|
||||
RUN apt-get update \
|
||||
&& apt-get install -yqq dosemu \
|
||||
&& apt-get -y autoremove \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
#RUN echo "deb http://deb.debian.org/debian stretch main contrib" > /etc/apt/sources.list.d/contrib.list
|
||||
#RUN apt-get update \
|
||||
# && apt-get install -yqq dosemu \
|
||||
# && sed -ie 's#^lredir \(.*\)/media/cdrom#rem &#' /etc/dosemu/freedos/autoexec.bat \
|
||||
# && apt-get -y autoremove \
|
||||
# && apt-get clean \
|
||||
# && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Build SBBS
|
||||
RUN apt-get update \
|
||||
&& apt-get install -yqq build-essential libnspr4-dev libncurses5-dev libmozjs185-dev cvs wget pkgconf \
|
||||
&& apt-get install -yqq git build-essential autoconf2.13 libnspr4-dev libncurses5-dev libncursesw5-dev libarchive-dev wget python2.7 pkgconf libcap2-bin sudo libarchive13 libnspr4 \
|
||||
&& mkdir /opt/sbbs && cd /tmp \
|
||||
&& wget http://cvs.synchro.net/cgi-bin/viewcvs.cgi/*checkout*/install/GNUmakefile \
|
||||
&& make RELEASE=1 USE_DOSEMU=1 NO_X=1 JSINCLUDE=/usr/include/js JSLIB=mozjs185 SBBSDIR=/opt/sbbs install \
|
||||
&& wget https://gitlab.synchro.net/sbbs/sbbs/-/raw/master/install/GNUmakefile \
|
||||
&& git clone https://gitlab.com/SynchronetBBS/sbbs.git /opt/sbbs/repo \
|
||||
&& cd /tmp \
|
||||
&& make RELEASE=1 NO_X=1 SBBSDIR=/opt/sbbs install \
|
||||
&& rm -rf /opt/sbbs/3rdp /opt/sbbs/src \
|
||||
&& mv /opt/sbbs/ctrl /opt/sbbs/ctrl.orig \
|
||||
&& mkdir /opt/sbbs/nodes.orig && mv /opt/sbbs/node[1-4] /opt/sbbs/nodes.orig \
|
||||
&& ln -sf nodes/node1 /opt/sbbs/ \
|
||||
&& ln -sf nodes/node2 /opt/sbbs/ \
|
||||
&& ln -sf nodes/node3 /opt/sbbs/ \
|
||||
&& ln -sf nodes/node4 /opt/sbbs/ \
|
||||
&& mv /opt/sbbs/text /opt/sbbs/text.orig \
|
||||
&& mv /opt/sbbs/xtrn /opt/sbbs/xtrn.orig \
|
||||
&& mv /opt/sbbs/web /opt/sbbs/web.orig \
|
||||
&& mkdir /opt/sbbs/nodes.orig && mv /opt/sbbs/node[1-5] /opt/sbbs/nodes.orig \
|
||||
&& find /opt/sbbs -name CVS -type d -exec rm -rf {} + \
|
||||
&& apt-get -y purge build-essential libnspr4-dev libncurses5-dev libmozjs185-dev cvs wget pkgconf \
|
||||
&& SUDO_FORCE_REMOVE=yes apt-get -y purge git build-essential autoconf2.13 libnspr4-dev libncurses5-dev libarchive-dev libncursesw5-dev wget pkgconf libcap2-bin sudo \
|
||||
&& apt-get -y autoremove \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /opt/sbbs/repo \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Add PHP
|
||||
RUN apt-get update \
|
||||
&& apt-get install -yqq composer php-cgi php-fpm php-gd php-sqlite3 php-xml \
|
||||
&& apt-get -y autoremove \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
@ -55,12 +55,18 @@ ENV SBBSCTRL=/opt/sbbs/ctrl
|
|||
ENV SBBSEXEC=/opt/sbbs/exec
|
||||
ENV PATH=$PATH:${SBBSEXEC}
|
||||
|
||||
COPY start.sh ${SBBSEXEC}/
|
||||
COPY doorparty.js ${SBBSEXEC}/
|
||||
COPY main.cnf /opt/sbbs/ctrl.orig/
|
||||
|
||||
VOLUME [ "/opt/sbbs/data","/opt/sbbs/ctrl","/opt/sbbs/fido","/opt/sbbs/mods","/opt/sbbs/text","/opt/sbbs/web" ]
|
||||
|
||||
COPY logrotate.d /etc/logrotate.d/
|
||||
RUN chmod 644 /etc/logrotate.d/*
|
||||
COPY supervisord.d /etc/supervisor/conf.d/
|
||||
|
||||
COPY init /sbin/init
|
||||
ENTRYPOINT [ "/sbin/init" ]
|
||||
CMD ["sbbs"]
|
||||
|
||||
VOLUME [ "/var/lib/zerotier-one" ]
|
||||
VOLUME [ "/opt/sbbs/data","/opt/sbbs/ctrl","/opt/sbbs/nodes","/opt/sbbs/fido" ]
|
||||
|
||||
# Set the default timezone for the container
|
||||
RUN ln -sf /usr/share/zoneinfo/Australia/Melbourne /etc/localtime
|
||||
# Our ndoes are in ../nodes/node[0-9]
|
||||
RUN sed -i -e 's#=../node\([0-9]\+\)/#=../nodes/node\1/#' /opt/sbbs/ctrl.orig/main.ini
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
load('sbbsdefs.js');
|
||||
var userprops = load({}, "userprops.js");
|
||||
var cfg = load({}, 'modopts.js', "doorparty") || {};
|
||||
|
||||
var attr = console.attributes;
|
||||
|
||||
function make_password() {
|
||||
var c;
|
||||
var p = [];
|
||||
while (p.length < 8) {
|
||||
c = ascii(Math.ceil(Math.random() * 58) + 32);
|
||||
if (p.indexOf(c) > -1) continue;
|
||||
p.push(c);
|
||||
}
|
||||
return p.join('');
|
||||
}
|
||||
|
||||
function get_password() {
|
||||
if (cfg.password) return cfg.password; // If a system-wide password has been set, use it
|
||||
var password = userprops.get('doorparty', 'password', '');
|
||||
if (password != '') return password; // If the user has a DoorParty password on file, use it
|
||||
password = make_password();
|
||||
userprops.set('doorparty', 'password', password); // Store a DoorParty password for this user
|
||||
return password;
|
||||
}
|
||||
|
||||
console.clear(LIGHTGRAY);
|
||||
console.putmsg('Connecting to DoorParty, please wait ...');
|
||||
|
||||
bbs.rlogin_gate(
|
||||
(cfg.tunnel_host || 'localhost') + ':' + (cfg.tunnel_port || 9999),
|
||||
get_password(), // password
|
||||
user.alias,
|
||||
argv.length ? 'xtrn='+argv[0] : undefined
|
||||
);
|
||||
|
||||
console.attributes = attr;
|
||||
console.clear();
|
23
init
23
init
|
@ -7,18 +7,37 @@ export PATH=$PATH:${SBBSEXEC}
|
|||
|
||||
if [ ! -e "${SBBSCTRL}/sbbs.ini" ]; then
|
||||
echo "* Installing SBBS ctrl files into ${SBBSCTRL}"
|
||||
cp -a ${SBBSCTRL}.orig/* ${SBBSCTRL}
|
||||
cp -Ras ${SBBSCTRL}.orig/* ${SBBSCTRL}
|
||||
fi
|
||||
|
||||
if [ ! -d "${SBBSCTRL}/../nodes/node1" ]; then
|
||||
[ ! -d "${SBBSCTRL}/../nodes" ] && mkdir ${SBBSCTRL}/../nodes
|
||||
echo "* Installing SBBS nodes files into ${SBBSCTRL}/../nodes"
|
||||
cp -Ra ${SBBSCTRL}/../nodes.orig/* ${SBBSCTRL}/../nodes/
|
||||
fi
|
||||
|
||||
if [ ! -e "${SBBSCTRL}/../text/answer.msg" ]; then
|
||||
echo "* Installing SBBS text files into ${SBBSCTRL}/../text"
|
||||
cp -Ras ${SBBSCTRL}/../text.orig/* ${SBBSCTRL}/../text/
|
||||
fi
|
||||
|
||||
if [ ! -d "${SBBSCTRL}/../xtrn" -o $((ls -1 ${SBBSCTRL}/../xtrn 2>/dev/null|wc -l)||echo 0) -eq 0 ]; then
|
||||
echo "* Installing SBBS xtrn files into ${SBBSCTRL}/../xtrn"
|
||||
[ ! -d ${SBBSCTRL}/../xtrn ] && mkdir ${SBBSCTRL}/../xtrn
|
||||
cp -Ras ${SBBSCTRL}/../xtrn.orig/* ${SBBSCTRL}/../xtrn
|
||||
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
|
||||
|
||||
exec "$@"
|
||||
if [ -n "$1" ]; then
|
||||
echo "* Starting [$@]"
|
||||
exec "$@"
|
||||
else
|
||||
# Start Supervisord
|
||||
echo "* Starting supervisord"
|
||||
exec /usr/bin/supervisord -nc /etc/supervisor/supervisord.conf
|
||||
fi
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
/opt/sbbs/data/*.log {
|
||||
daily
|
||||
compress
|
||||
rotate 31
|
||||
dateext
|
||||
olddir /opt/sbbs/data/logs/old
|
||||
missingok
|
||||
createolddir 775 root root
|
||||
notifempty
|
||||
copytruncate
|
||||
dateyesterday
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
#!/bin/bash
|
||||
|
||||
export PIDDIR=${PIDDIR:-/var/run}
|
||||
export SBBSCTRL=/opt/sbbs/ctrl
|
||||
PIDFILE=${PIDDIR}/sbbs.pid
|
||||
|
||||
# Proxy signals
|
||||
function kill_app(){
|
||||
kill $(cat ${PIDFILE})
|
||||
exit 0 # exit okay
|
||||
}
|
||||
trap "kill_app" SIGINT SIGTERM
|
||||
|
||||
sbbs -d
|
||||
sleep 5
|
||||
|
||||
SBBS_PID=$(cat ${PIDFILE})
|
||||
echo "* SBBS PID [${SBBS_PID}]"
|
||||
|
||||
if [ -n ${SBBS_PID} ]; then
|
||||
while [ -d /proc/${SBBS_PID} ]; do
|
||||
NAME=$(cat /proc/${SBBS_PID}/cmdline |awk 'BEGIN { FS = "\0" } ;{print $1}')
|
||||
#echo "* SBBS NAME [${NAME}]"
|
||||
|
||||
if [ "${NAME}" != "sbbs" -a "${NAME}" != "/mnt/lima-rosetta/rosetta" ]; then
|
||||
echo "! Name not matching? [${NAME}]"
|
||||
break;
|
||||
fi
|
||||
|
||||
sleep 15
|
||||
done
|
||||
|
||||
echo "? SBBS stopped"
|
||||
else
|
||||
echo "? NO SBBS PID?"
|
||||
fi
|
||||
|
||||
exit 1
|
|
@ -0,0 +1,2 @@
|
|||
[program:cron]
|
||||
command=/usr/sbin/cron -f
|
|
@ -0,0 +1,7 @@
|
|||
[program:sbbs]
|
||||
command=/opt/sbbs/exec/start.sh
|
||||
stopwaitsecs=60
|
||||
startsecs=30
|
||||
startretries=2
|
||||
environment=SBBSCTRL="/opt/sbbs/ctrl"
|
||||
directory=/opt/sbbs
|
Loading…
Reference in New Issue