diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..377f60ab --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu:20.10 +RUN apt update +RUN apt install -y build-essential bison gperf cmake libsqlite3-dev libaspell-dev libpcre3-dev nettle-dev g++ libcurl4-openssl-dev libargon2-dev + +WORKDIR /toaststunt +COPY src /toaststunt/src/ + +COPY CMakeLists.txt /toaststunt/ +COPY CMakeModules /toaststunt/CMakeModules + + +WORKDIR /toaststunt/ +RUN pwd ; mkdir build && cd build && cmake ../ +RUN cd /toaststunt/build && make -j2 + +# A special restart which output on stdout is needed for docker +COPY docker_restart.sh /toaststunt/build/ +EXPOSE 7777 +ENTRYPOINT cd /toaststunt/build/ ; ./docker_restart.sh /cores/$CORE_TO_LOAD diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..d59cbfd7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +version: '2' + +services: + dev_server: + image: toaststunt:2.7.0_10 + build: + context: . + # Server port can be re-mapped outside container below + # Just change the left side of the following line: + ports: + - 7777:7777 + environment: + # OTHER EXAMPLES: CORE_TO_LOAD=test-cores/toastcore + - CORE_TO_LOAD=Minimal + volumes: + - ./:/cores diff --git a/docker_restart.sh b/docker_restart.sh new file mode 100644 index 00000000..ebdb415b --- /dev/null +++ b/docker_restart.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +# Copyright (c) 1992, 1994, 1995, 1996 Xerox Corporation. All rights reserved. +# Portions of this code were written by Stephen White, aka ghond. +# Use and copying of this software and preparation of derivative works based +# upon this software are permitted. Any distribution of this software or +# derivative works must comply with all applicable United States export +# control laws. This software is made available AS IS, and Xerox Corporation +# makes no warranty about the software, its performance or its conformity to +# any specification. Any person obtaining a copy of this software is requested +# to send their name and post office or electronic mail address to: +# Pavel Curtis +# Xerox PARC +# 3333 Coyote Hill Rd. +# Palo Alto, CA 94304 +# Pavel@Xerox.Com + +if [ $# -lt 1 -o $# -gt 2 ]; then + echo 'Usage: restart dbase-prefix [port]' + exit 1 +fi + +if [ ! -r $1.db ]; then + echo "Unknown database: $1.db" + exit 1 +fi + +if [ -r $1.db.new ]; then + mv $1.db $1.db.old + mv $1.db.new $1.db + rm -f $1.db.old.Z + compress $1.db.old & +fi + +if [ -f $1.log ]; then + cat $1.log >> $1.log.old + rm $1.log +fi + +echo `date`: RESTARTED >> $1.log +./moo $1.db $1.db.new $2 2>&1 diff --git a/docs/README.md b/docs/README.md index a2c5ae15..25459a9a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,18 +2,21 @@ ToastStunt is a fork of the LambdaMOO / Stunt server. It has a number of features and improvements that were found useful while developing [Miriani](https://www.toastsoft.net) and [ChatMud](https://www.chatmud.com/), a mostly complete list of which can be found below. -* [Features](#features) -* [ChangeLog](ChangeLog.md) -* [Build Instructions](#build-instructions) - * [Debian/Ubuntu](#debian-ubuntu) - * [REL/CentOS](#rel-centos) - * [Gentoo](#gentoo) - * [FreeBSD](#freebsd) - * [macOS](#macos) -* [Function Documentation](https://github.com/lisdude/toaststunt-documentation) -* [ToastCore](https://github.com/lisdude/toastcore) -* [Support and Development](#support-and-development) -* [Stunt Information](README.stunt) +- [ToastStunt](#toaststunt) + - [Features](#features) + - [Build Instructions](#build-instructions) + - [**Docker**](#docker) + - [**Debian/Ubuntu**](#debianubuntu) + - [**REL/CentOS**](#relcentos) + - [**Gentoo**](#gentoo) + - [**FreeBSD**](#freebsd) + - [**macOS**](#macos) + - [**Notes**](#notes) + - [Argon2](#argon2) + - [CMake Build Options](#cmake-build-options) + - [Stuck seeding from /dev/random](#stuck-seeding-from-devrandom) + - [Login screen not showing](#login-screen-not-showing) + - [Support and Development](#support-and-development) ## Features @@ -135,6 +138,12 @@ ToastStunt is a fork of the LambdaMOO / Stunt server. It has a number of feature - Allow handling of SIGUSR signals in the database with `#0:handle_signal()` ## Build Instructions + +### **Docker** +A Docker image based on Ubuntu 20 is provided. +You must init git submodules because the image will build argon2 from the provided sources (see below). + + ### **Debian/Ubuntu** ```bash apt install build-essential bison gperf cmake libsqlite3-dev libaspell-dev libpcre3-dev nettle-dev g++ libcurl4-openssl-dev