Compare commits

...

29 Commits

Author SHA1 Message Date
Deon George 16c3f94992 Updates for SBBS v3.19 2021-04-05 00:06:21 +10:00
Deon George f939158f42 Moved Doorparty out into its own container 2021-03-16 21:02:11 +11:00
Deon George 63ea56421e doorparty.sh is for Intel not arm 2021-01-21 22:41:27 +11:00
Deon George 3313d5e330 Add Doorparty Connector 2021-01-16 23:56:28 +11:00
Deon George 60af119bb9 Move xtrn into xtrn orig 2021-01-16 23:43:47 +11:00
Deon George 3fcabaf58e Revert "Revert patch f6ffda09 - fails to build otherwise"
This reverts commit 0dc5ddde5e.

No longer required, fix implemented upstream.
2021-01-13 22:46:46 +11:00
Deon George 3e9ecf42da More fixes for nodes/ initialisation 2021-01-13 22:44:32 +11:00
Deon George 4053b0081e Fix location of patch 2020-11-23 14:24:20 +11:00
Deon George 2c731f2bd8 Fix nodes/ initialisation 2020-11-23 14:17:42 +11:00
Deon George a13e99ccfd Put initial main.cnf in the right place for initial builds 2020-11-23 13:32:22 +11:00
Deon George 0dc5ddde5e Revert patch f6ffda09 - fails to build otherwise 2020-11-23 13:27:06 +11:00
Deon George b0b3889f0d Changed leenooks apt repository config 2020-11-23 13:26:17 +11:00
Deon George cc4da2cd94 Updated to new main.cnf where nodes are in nodes/ 2020-11-23 13:26:17 +11:00
Deon George a03bf979a8 Remove git repo after install 2020-09-10 12:18:28 +10:00
Deon George abb660f380 Change version to latest 2020-09-10 12:17:40 +10:00
Deon George b82d77534b Change CVS to GIT, added PHP 2020-09-10 00:28:02 +10:00
Deon George 8020b06e06 Added sqlite and xml php libraries 2020-08-12 16:33:04 +10:00
Deon George 07d781a18d Fixed daemon name checking 2020-08-02 17:53:03 +10:00
Deon George c4f4769bcf Added missing library libnspr4 2020-07-08 16:58:49 +10:00
Deon George 5dfc317e87 Cant have RELEASE=1 and DEBUG=1 2020-07-08 10:10:51 +10:00
Deon George c3324db785 Force SBBS to build libmoz 2020-07-08 09:57:13 +10:00
Deon George e7e4b3eec8 Updates and now enabled using daemon mode 2020-06-21 14:03:27 +10:00
Deon George 6ce8e626f1 Remove makenl, update to 3.18a 2020-05-13 23:36:32 +10:00
Deon George d1a7de1949 Revert "Fix build on armv7l due to Open File Descriptor Locks used in latest CVS"
This reverts commit b69cf7851a.
2020-05-13 23:36:16 +10:00
Deon George b69cf7851a Fix build on armv7l due to Open File Descriptor Locks used in latest CVS 2019-08-28 15:28:32 +10:00
Deon George 31b240ba37 Add DOCKER_DRIVER to address CI docker push issues 2019-08-26 12:00:04 +10:00
Deon George 0689ba85c2 Fixes for logrotate 2019-08-17 12:30:56 +10:00
Deon George 5dcdfd0705 Added supervisor/logrotate and startup dirs use symlinks 2019-08-14 20:56:48 +10:00
Deon George 3d0236736d Removed DOSEMU, not avialable for arm 2019-07-25 21:24:26 +10:00
11 changed files with 150 additions and 53 deletions

View File

@ -4,7 +4,7 @@ stages:
- build
variables:
VERSION: 3.17c-${ARCH}
VERSION: latest-${ARCH}
CACHETAG: build-${ARCH}
DOCKER_HOST: tcp://docker:2375
@ -15,7 +15,5 @@ before_script:
- 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.yml

View File

@ -1,17 +0,0 @@
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}
tags:
- docker
- x86_64
only:
- master

View File

@ -13,4 +13,4 @@ armv7l:build:
- docker
- armv7l
only:
- master
- armv7l

View File

@ -1,51 +1,52 @@
# NAME leenooks/sbbs
# VERSION 3.17c
# VERSION latest
FROM debian:stretch-slim
FROM debian:buster-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 libnspr4 \
&& 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
# Add in Leenooks' apt repository
RUN curl -s http://apt.leenooks.net/setup.sh | sh
RUN curl -sL http://apt.leenooks.net/setup.sh | DISTRO=buster bash
# Add ZeroTier
RUN echo "deb http://download.zerotier.com/debian/stretch stretch main" > /etc/apt/sources.list.d/zerotier.list
RUN echo "deb [trusted=yes] http://download.zerotier.com/debian/buster buster 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/*
# 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 install -yqq zerotier-one \
&& 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 libnspr4-dev libncurses5-dev libncursesw5-dev libarchive-dev cvs wget pkgconf libcap2-bin sudo libarchive13 \
&& 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 \
&& 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 \
&& 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 libnspr4-dev libncurses5-dev libarchive-dev libncursesw5-dev cvs 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 +56,16 @@ ENV SBBSCTRL=/opt/sbbs/ctrl
ENV SBBSEXEC=/opt/sbbs/exec
ENV PATH=$PATH:${SBBSEXEC}
COPY init /sbin/init
ENTRYPOINT [ "/sbin/init" ]
CMD ["sbbs"]
COPY start.sh ${SBBSEXEC}/
COPY doorparty.js ${SBBSEXEC}/
COPY main.cnf /opt/sbbs/ctrl.orig/
VOLUME [ "/var/lib/zerotier-one" ]
VOLUME [ "/opt/sbbs/data","/opt/sbbs/ctrl","/opt/sbbs/nodes","/opt/sbbs/fido" ]
VOLUME [ "/opt/sbbs/data","/opt/sbbs/ctrl","/opt/sbbs/fido","/opt/sbbs/mods","/opt/sbbs/text" ]
# Set the default timezone for the container
RUN ln -sf /usr/share/zoneinfo/Australia/Melbourne /etc/localtime
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" ]

38
doorparty.js Normal file
View File

@ -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
View File

@ -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

12
logrotate.d/sbbsecho Normal file
View File

@ -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
}

BIN
main.cnf Normal file

Binary file not shown.

37
start.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
export SBBSCTRL=/opt/sbbs/ctrl
PIDFILE=/run/sbbs.pid
# Proxy signals
function kill_app(){
kill $(cat ${SBBS_PID})
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 -F\00 '{print $1}')
#echo "* SBBS NAME [${NAME}]"
if [ "${NAME}" != "sbbs" ]; then
echo "! Name not matching? [${NAME}]"
break;
fi
sleep 15
done
echo "? SBBS stopped"
else
echo "? NO SBBS PID?"
fi
exit 1

2
supervisord.d/cron.conf Normal file
View File

@ -0,0 +1,2 @@
[program:cron]
command=/usr/sbin/cron -f

3
supervisord.d/sbbs.conf Normal file
View File

@ -0,0 +1,3 @@
[program:sbbs]
command=/opt/sbbs/exec/start.sh
stopwaitsecs=60