Compare commits

...

49 Commits

Author SHA1 Message Date
Deon George ffae70dabb Updated start.sh, to allow for different PID location 2023-12-09 16:21:28 +11:00
Deon George 0cf79f7354 Only use HTTP proxy if environment defined 2023-06-27 09:35:35 +10:00
Deon George 68fd0ff94e Remove NNCP and other commented out tools 2023-05-29 13:17:18 +10:00
Deon George 31f1f89ad8 Removed the force IPv4, not required since we use squid via http_proxy 2023-05-29 12:35:50 +10:00
Deon George 9937972d6a Preserve web from build 2023-05-29 11:18:19 +10:00
Deon George 6a21185f0a Update CI so we can build other archs 2023-05-24 20:45:55 +10:00
Deon George a5457d80af sed is -i -e not -ie 2023-05-24 20:19:48 +10:00
Deon George 64c13dacb4 PID file is now var/run 2023-05-24 20:19:38 +10:00
Deon George f6f89f6086 Removed my tags buffer patch as it has been fixed upstream #f7d2b24d 2023-05-17 09:39:44 +10:00
Deon George 1f612dd027 Put back NNCP, sbbs.pid is now in SBBSCTRL, remove cvs from build. 2023-04-14 13:26:06 +10:00
Deon George 7a32a52517 Update tags patch, remove nncp 2023-04-11 22:18:20 +10:00
Deon George f321af3062 Force apt to use IPv4, update config to have nodes in ../nodes/ now that SBBS 3.20 uses ini files 2023-01-22 11:43:58 +11:00
Deon George a20a9022ce Added some more supervisor config for sbbs, giving sbbs more time to start 2022-10-27 11:54:46 +11:00
Deon George 4000df716c Fix awk FS with nulls 2022-10-17 22:57:20 +11:00
Deon George 99308f701b Updated to bullseye, added nncp 2022-10-17 00:05:44 +11:00
Deon George 6be2019885 Checkout a custom branch, so git_*.h headers reflect our custom version of SBBS, but with the upstreams commit 2022-05-28 13:34:33 +10:00
Deon George c6930db160 Add patch to reserve space for tags in message headers 2022-05-28 13:07:54 +10:00
Deon George 363a9184c0 Revert "Force build on apu runner"
No longer required, since the issue with cryptlib has been resolved

This reverts commit aceeed758b.
2022-02-27 16:24:09 +11:00
Deon George aceeed758b Force build on apu runner 2021-04-24 12:01:52 +10:00
Deon George 50f6e8fe0c Updates for SBBS v3.19 2021-04-05 00:05:51 +10:00
Deon George 7cb746ceb2 Moved Doorparty out into its own container - part 2 2021-03-16 21:55:21 +11:00
Deon George 57c3e5149a Moved Doorparty out into its own container 2021-03-16 20:59:44 +11:00
Deon George 4ede70a917 Remove attempts to map to a CD 2021-01-15 17:42:03 +11:00
Deon George 0d2de5c97c Move xtrn into xtrn orig 2021-01-15 08:59:35 +11:00
Deon George 564e85a1d9 Fix syntasx error in init from last commit 2021-01-14 17:46:26 +11:00
Deon George ba0b285a8f Auto run doorparty.sh on container start 2021-01-14 17:43:48 +11:00
Deon George e2c81af094 Doorparty setup fixes and creating users 2021-01-14 17:29:43 +11:00
Deon George ec80048e19 Add doorparty and sshd 2021-01-14 00:45:02 +11:00
Deon George 9727eb7578 Revert "Revert patch f6ffda09 - fails to build otherwise"
This reverts commit 1f75382ada.

No longer required, fix implemented upstream.
2021-01-04 12:30:31 +11:00
Deon George 7055833ed3 More fixes for nodes/ initialisation 2020-11-26 21:38:01 +11:00
Deon George 196b15be0c Fix nodes/ initialisation 2020-11-23 14:17:15 +11:00
Deon George 61b025f91f Put initial main.cnf in the right place for initial builds 2020-11-23 13:32:42 +11:00
Deon George 1f75382ada Revert patch f6ffda09 - fails to build otherwise 2020-11-23 13:14:06 +11:00
Deon George ebe72b1d8f Changed leenooks apt repository config 2020-11-23 10:39:17 +11:00
Deon George 8453f48ae4 Updated to new main.cnf where nodes are in nodes/ 2020-11-23 10:35:17 +11:00
Deon George 4e0224589b Change version to latest 2020-09-10 11:31:08 +10:00
Deon George 1059cdf82a Remove git repo after install 2020-09-10 11:30:09 +10:00
Deon George 273a605ea0 Change CVS to GIT, added PHP 2020-09-10 00:25:25 +10:00
Deon George 530d917267 Added sqlite and xml php libraries
Change to build libmozjs
2020-08-11 11:12:14 +10:00
Deon George 6a13bd0be7 Fixed daemon name checking 2020-08-02 17:52:09 +10:00
Deon George adc38bc7d4 Updates and now enabled using daemon mode 2020-06-21 14:01:30 +10:00
Deon George 1e75b5fe05 Remove makenl, update to 3.18a 2020-05-13 22:29:53 +10:00
Deon George 90ebcf6059 Updated to buster, added php 2020-03-11 13:52:35 +11:00
Deon George 9c0765283b Added node 5 2019-10-03 17:36:37 +10:00
Deon George 6c9dfc37dc Fixes for logrotate 2019-08-15 08:58:32 +10:00
Deon George 28a1cc2aa8 Lock ZT to 1.4.0, 1.4.2 segfaults 2019-08-14 22:21:34 +10:00
Deon George 6986bc92d8 Added supervisor/logrotate and startup dirs use symlinks 2019-08-14 20:57:45 +10:00
Deon George 7ac241d5bc Removed variables in gitlab-ci 2019-07-25 21:16:08 +10:00
Deon George 3ef795079c Consilidate gitlab-ci files 2019-07-25 21:13:50 +10:00
12 changed files with 190 additions and 70 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

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.

38
start.sh Executable file
View File

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

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

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

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

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