Skip to content

n-at/playtime

Repository files navigation

playtime

Personal retro games library + EmulatorJS.

Quick installation with script

Prerequisites:

  • A server with public IP address (for example, basic droplet on DO) running Ubuntu 22.04
  • A domain with A record with IP address of the server

For example domain is playtime.example.com and IP is 10.10.10.10.

Ensure A record is correct:

dig +short playtime.example.com
#should output correct IP address

On the server, execute:

mkdir playtime && cd playtime
wget "https://github.com/n-at/playtime/raw/master/docker/quick-install.sh"
chmod +x quick-install.sh
./quick-install.sh "10.10.10.10" "playtime.example.com"

This script will:

  1. Install docker (if it is not installed)
  2. Run coturn, a TURN/STUN/ICE server
  3. Get SSL certificate from Let's Encrypt
  4. Build and run playtime

admin password will be in playtime/data/admin.password file.

Building

Go 1.21+ and npm 7+ required.

./install.sh
go build -a -o app

Configuration

Commandline arguments available:

$ ./app -help
Usage of ./app:
  -db-path string
        db path (default "data/bolt.db")
  -debug-emulator
        debug emulator (extended browser console output)
  -debug-netplay
        debug netplay (extended browser console output)
  -debug-templates
        debug page templates (do not cache)
  -listen string
        address and port to listen (default ":3000")
  -turn-server-password string
        TURN/STUN/ICE server password (if required)
  -turn-server-url string
        TURN/STUN/ICE server host, required for netplay (example: turn:turn.example.com)
  -turn-server-user string
        TURN/STUN/ICE server user name (if required)
  -uploads-path string
        uploads path (default "uploads")
  -verbose
        show debug output

docker

Build an image:

docker image build -t playtime:latest .

Available image environment variables:

  • PLAYTIME_TURN_URL
  • PLAYTIME_TURN_USER
  • PLAYTIME_TURN_PASSWORD
  • PLAYTIME_DEBUG_EMULATOR
  • PLAYTIME_DEBUG_TEMPLATES
  • PLAYTIME_DEBUG_NETPLAY
  • PLAYTIME_VERBOSE

Exposed volumes:

  • /app/data - database directory
  • /app/uploads - uploads directory

Exposed default port 3000.

Netplay

TURN server is required for netplay. It can be obtained from:

For a particular game netplay needs to be enabled in game settings.

Uses

About

Personal retro games library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published