earthwalker

command module
v0.0.0-...-1c8ecb5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

README

Earthwalker

Earthwalker is a game of a similar concept to GeoGuessr. You get dropped somewhere in the world in Google StreetView, and the goal is to you find out where you are and guess your location more precisely than all of your friends. You can play against the clock, restrict the game to an area, and more.

It's free and open source, and the idea is that people host it themselves to play with their friends. No Google API keys are needed, as Earthwalker "fools" the public Google Street View a bit. This is technically against Google TOS, so I am not hosting a public version of this myself.

How do I play?

You need to host Earthwalker yourself or find a friend who hosts it. Don't worry; hosting isn't too difficult. The following guide will focus on the simplest case: hosting and playing on the same computer. If you want to play on other computers too, see the "hosting outside of your network" paragraph (but first focus on getting earthwalker installed :P). If you need any help, you can create an Issue on this project's GitLab page.

If hosting on your own computer isn't an option or you want to just quickly try it out, you can also for instance use PlayWithDocker (this is by Docker, we're not affiliated). After signing in, click on "Add new instance", copy the commands in the "Docker" instructions below inside the console and then click on "8080" next to "Open Port". It will take you to a link where earthwalker should be running, which you can also share with your friends. This isn't a good permanent solution though, as you can only play for four hours and all your maps will be lost after that time.

Disclaimer

First, I need to tell you that this program is technically against Google's Terms of Service, as it hides some UI elements on Street View, and filters out information from some Google packets that are sent to Street View. Hosting this game is your own responsibility (but if you only play with your friends, Google will hardly notice, I hope).

Using Docker (the easiest way)

Install Docker and run this command:

docker run -p 8080:8080 registry.gitlab.com/glatteis/earthwalker

That's it. The website should be hosted at localhost:8080. The port can be remapped via docker. Update earthwalker using the command

docker pull registry.gitlab.com/glatteis/earthwalker
Hosting on Archlinux using the AUR package

Download, build and install the earthwalker-git package. Then start it via:

$ sudo systemctl start earthwalker.service

You can then access the website at http://localhost:8080. You can configure earthwalker (e.g. the port) by editing /etc/earthwalker/config.toml. Check out Using systemctl for more information on how to manage the server.

Hosting on Linux or the Windows Subsystem for Linux (WSL) manually (without Docker)

Start by installing Git, Go and node. This can be done through apt if you're on Debian:

apt-get install git
apt-get install golang-1.14-go
curl -sL https://deb.nodesource.com/setup_14.x | bash -
apt-get install -y nodejs

If you're on another distribution, the above installations steps might be different.

Now, clone this repo and build the program:

git clone https://gitlab.com/glatteis/earthwalker.git
cd earthwalker
make

You should now be able to run the earthwalker executable to start the server, and then go to localhost:8080 in your browser to start playing!

Hosting on Windows manually (without Docker)

I would recommend installing a Windows Subsystem for Linux, for instance the Debian one, and then following the steps for "Hosting on Linux" above.

You can also host the game directly on Windows, but it may be a bit more complicated.
As on Linux, you'll need to install Git, Go and node. If you want to use make, you'll need to install it as well.
Once you have those components installed and working, clone the repo and cd (change directory) into it:

git clone https://gitlab.com/glatteis/earthwalker.git
cd earthwalker

Then, run make if you've installed it, or if not:
Compile the server:

go build 

And compile the front end:

cd frontend
npm install
npm run build

You should now be able to run earthwalker.exe to start the server, and then go to localhost:8080 in your browser to start playing!

Using Docker but building it yourself

To use the docker container while building earthwalker yourself you have to run the following commands (given you already have docker installed and configured).

git clone https://gitlab.com/glatteis/earthwalker.git
cd earthwalker
docker build -t earthwalker:local .
docker run -p 8080:8080 earthwalker:local

It might not be necessary to use the -t earthwalker:local param, but it makes it a little prettier.

Hosting outside of your network

There are multiple possibilities with which you can host outside of your network.

  1. You already have a server somewhere with a cool nginx installation that has all ports forwarded anyway - well, you know you don't need to read this paragraph.
  2. You have full control over your router and you don't want to use any third party services - find out your IP Address, and choose any port of your liking - like 8080 or 7777. Open it to TCP in the router, and then start earthwalker on that port on your PC. Then, : should be open to others.
  3. Configuring your router is either impossible or too clumsy and you're fine with using third party services - take a look at tunnelto.dev or ngrok. They run on your PC with earthwalker and people will be able to access earthwalker through these services. Note that all traffic will flow through their servers, so don't spill your secrets. Remember to disable the service after stopping earthwalker.
Configuration

We've provided a handful of configuration options, which are read from your environment variables, a .toml file, or command line arguments (these are all summarized below). In all cases, command line arguments override environment variables, which override .toml values. All configuration options are strings. Using absolute paths is recommended.
You can rename or copy the provided sample configuration file, config.toml.sample, to config.toml to get started.

Table of configuration options.
Command Line Flag Environment Variable .toml Key Default Comments
EARTHWALKER_CONFIG_PATH ./config.toml Location of the .toml configuration file
port EARTHWALKER_PORT Port 8080
EARTHWALKER_DB_PATH DBPath ./badger Location of the database directory
EARTHWALKER_STATIC_PATH StaticPath location of executable (usually earthwalker) Absolute path to the directory containing public
TileServerURL https://mt.google.com/vt/lyrs=m&hl=en&x={x}&y={y}&z={z} URL of a raster tile server. This determines what you see on the map.
NoLabelTileServerURL https://mt.google.com/vt/lyrs=s&hl=en&x={x}&y={y}&z={z} As above, but this value is used when a map creator has turned labels off.

Note: For tileservers, using {s} is also supported. For instance, https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png.

Updating

You can update earthwalker by running git pull in its directory, and then running make or following the compilation instructions again.

Contributing

Contributions are welcome! Check out our TODO list on Trello and the Issues page for this GitLab repo. The application is written mostly in Go (back end) and Svelte/JavaScript (front end).

Even if you're not a developer, please submit an Issue on GitLab if you find any bugs or would like to request a feature.

Images

Create new game dialog Ingame Summary

Documentation

Overview

Package main is the main package of earthwalker.

Directories

Path Synopsis
Package config handles the config.toml file and the environment variables
Package config handles the config.toml file and the environment variables
Package domain defines domain types which are used throughout the application.
Package domain defines domain types which are used throughout the application.
Package handlers is an enumeration of backend handlers
Package handlers is an enumeration of backend handlers
api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL