Refactored Contrib docs, renamed many files

This commit is contained in:
Griatch 2022-11-23 21:15:23 +01:00
parent 7845369d50
commit da341af663
44 changed files with 664 additions and 917 deletions

View file

@ -96,4 +96,4 @@ This shows only a basic tweet setup, other things to do could be:
* Changing locks to make tweeting open to more people
* Echo your tweets to an in-game channel
Rather than using an explicit command you can set up a Script to send automatic tweets, for example to post updated game stats. See the [Tweeting Game Stats tutorial](../Howtos/Tutorial-Tweeting-Game-Stats.md) for help.
Rather than using an explicit command you can set up a Script to send automatic tweets, for example to post updated game stats. See the [Tweeting Game Stats tutorial](../Howtos/Web-Tweeting-Game-Stats.md) for help.

View file

@ -1,11 +1,8 @@
# Installing with Docker
Evennia releases [docker images](https://hub.docker.com/r/evennia/evennia/) which makes
running an Evennia-based game in a Docker container easy.
Evennia releases [docker images](https://hub.docker.com/r/evennia/evennia/) as part of regular commits and releases. This makes running an Evennia-based game in a Docker container easy.
First, install the `docker` program so you can run the Evennia container. You can get it freely from
[docker.com](https://www.docker.com/). Linux users can likely also get it through their normal
package manager.
First, install the `docker` program so you can run the Evennia container. You can get it freely from [docker.com](https://www.docker.com/). Linux users can likely also get it through their normal package manager.
To fetch the latest evennia docker image, run:
@ -30,11 +27,7 @@ the docker container:
evennia|docker /usr/src/game $
```
This is a normal shell prompt. We are in the `/usr/src/game` location inside the docker container.
If you had anything in the folder you started from, you should see it here (with `ls`) since we
mounted the current directory to `usr/src/game` (with `-v` above). You have the `evennia` command
available and can now proceed to create a new game as per the normal [game setup](./Installation.md)
instructions (no virtualenv needed).
This is a normal shell prompt. We are in the `/usr/src/game` location inside the docker container. If you had anything in the folder you started from, you should see it here (with `ls`) since we mounted the current directory to `usr/src/game` (with `-v` above). You have the `evennia` command available and can now proceed to create a new game as per the normal [game setup](./Installation.md) instructions (no virtualenv needed).
You can run Evennia from inside this container if you want to, it's like you are root in a little
isolated Linux environment. To exit the container and all processes in there, press `Ctrl-D`. If you
@ -54,8 +47,7 @@ on your drive.
## Running your game as a docker image
If you run the `docker` command given in the previous section from your game dir you can then
easily start Evennia and have a running server without any further fuss.
If you run the `docker` command given in the previous section from your game dir you can then easily start Evennia and have a running server without any further fuss.
But apart from ease of install, the primary benefit to running an Evennia-based game in a container is to simplify its deployment into a public production environment. Most cloud-based hosting
providers these days support the ability to run container-based applications. This makes deploying
@ -63,7 +55,7 @@ or updating your game as simple as building a new container image locally, pushi
### Start Evennia and run through docker
For remote or automated deployment you may want to start Evennia immediately as soon as the docker container comes up. If you already have a game folder with a database set up you can also start the docker container and pass commands directly to it. The command you pass will be the main process to run in the container. From your game dir, run for example this command:
For remote or automated deployment you may want to start Evennia immediately as soon as the docker container comes up. If you already have a game folder with a database set up you can also start the docker container and pass commands directly to it. The command you pass will be the main process to run in the container. From your game dir, run for example this command:
docker run -it --rm -p 4000:4000 -p 4001:4001 -p 4002:4002 --rm -v $PWD:/usr/src/game evennia/evennia evennia start -l
@ -92,16 +84,13 @@ To build the image:
docker build -t mydhaccount/mygame .
```
(don't forget the period at the end, it will use the `Dockerfile` from the current location). Here
`mydhaccount` is the name of your `dockerhub` account. If you don't have a dockerhub account you can build the image locally only (name the container whatever you like in that case, like just `mygame`).
(don't forget the period at the end, it will use the `Dockerfile` from the current location). Here `mydhaccount` is the name of your `dockerhub` account. If you don't have a dockerhub account you can build the image locally only (name the container whatever you like in that case, like just `mygame`).
Docker images are stored centrally on your computer. You can see which ones you have available
locally with `docker images`. Once built, you have a couple of options to run your game.
Docker images are stored centrally on your computer. You can see which ones you have available locally with `docker images`. Once built, you have a couple of options to run your game.
### Run container from your game image for development
To run the container based on your game image locally for development, mount the local game
directory as before:
To run the container based on your game image locally for development, mount the local game directory as before:
```
docker run -it --rm -p 4000:4000 -p 4001:4001 -p 4002:4002 -v $PWD:/usr/src/game --user $UID:$GID
@ -160,11 +149,9 @@ container will get a new container id to reference.
## How it Works
The `evennia/evennia` docker image holds the evennia library and all of its dependencies. It also has an `ONBUILD` directive which is triggered during builds of images derived from it. This
`ONBUILD` directive handles setting up a volume and copying your game directory code into the proper location within the container.
The `evennia/evennia` docker image holds the evennia library and all of its dependencies. It also has an `ONBUILD` directive which is triggered during builds of images derived from it. This `ONBUILD` directive handles setting up a volume and copying your game directory code into the proper location within the container.
In most cases, the Dockerfile for an Evennia-based game will only need the `FROM evennia/evennia:latest` directive, and optionally a `MAINTAINER` directive if you plan to publish
your image on Docker Hub and would like to provide contact info.
In most cases, the Dockerfile for an Evennia-based game will only need the `FROM evennia/evennia:latest` directive, and optionally a `MAINTAINER` directive if you plan to publish your image on Docker Hub and would like to provide contact info.
For more information on Dockerfile directives, see the [Dockerfile Reference](https://docs.docker.com/engine/reference/builder/).
@ -222,8 +209,7 @@ services:
volumes:
- .:/usr/src/game
```
With this file in the game directory next to the `Dockerfile`, starting the container is as simple
as
With this file in the game directory next to the `Dockerfile`, starting the container is as simple as
```
docker-compose up
```

View file

@ -39,31 +39,38 @@ not recognize `localhost`).
A Python [virtual environment](https://docs.python.org/3/library/venv.html) allows you to install Evennia in its own little folder, separate from the rest of the system. You also won't need any extra permissions. It's optional to use a virtualenv, but it's highly recommended. Python supports this natively:
python3.11 -m venv evenv (linux/mac)
python -m venv venv evenv (Windows)
> If you have older versions of Python installed on Windows, you should instead use `py` instead of `python` - the `py` launcher automatically selects the latest python version among those you installed.
```{sidebar} Using py on Windows
If you have older versions of Python installed on Windows, you should instead use `py` here instead of `python`. The `py` launcher automatically selects the latest python version among those you installed.
```
```bash
python3.11 -m venv evenv (linux/mac)
python -m venv evenv (Windows)
```
This will create a new folder `evenv` in your current directory.
Activate it like this:
`source evenv/bin/activate` (Linux, Mac)
`evenv\Scripts\activate` (Windows)
`.\evenv\scripts\activate` (Windows with PS Shell, Git Bash etc)
```
source evenv/bin/activate (Linux, Mac)
evenv\Scripts\activate (Windows Console)
.\evenv\scripts\activate (Windows PS Shell,
Git Bash etc)
```
The text `(evenv)` should appear next to your prompt to show that the virtual
environment is active. You _don't_ need to actually be in or near the `evenv` folder for
the environment to be active.
> Remember that you need to re-activate the virtualenv like this *every time* you
> start a new terminal/console. Otherwise the `evennia` command will not be available.
```{important}
Remember that you need to (re-)activate the virtualenv like this *every time* you
start a new terminal/console (or restart your computer). Until you do, the `evennia` command will not be available.
```
## Linux Install
For Debian-derived systems (like Ubuntu, Mint etc), start a terminal and
install the requirements:
```
```bash
sudo apt-get update
sudo apt-get install python3.11 python3.11-venv python3.11-dev gcc
```
@ -71,7 +78,7 @@ You should make sure to *not* be `root` after this step, running as `root` is a
security risk. Now create a folder where you want to do all your Evennia
development:
```
```bash
mkdir muddev
cd muddev
```
@ -88,7 +95,9 @@ At this point it's now optional but recommended that you initialize and activate
Next, install Evennia (system-wide, or into your active virtualenv). Make sure you are standing
at the top of your mud directory tree (so you see the `evennia/` folder, and likely the `evenv` virtualenv folder) and do
```{sidebar}
The `-e ` means that we install evennia in editable mode. If you want to develop on Evennia itself, it means that changes you do to the code is immediately reflected on your running server (you don't have to reinstall every time you make a change).
```
```
pip install -e evennia
```

View file

@ -1,21 +1,19 @@
# Installation Troubleshooting
If you have an issue not covered here, [please report it](https://github.com/evennia/evennia/issues/new/choose)
so it can be fixed or a workaround found!
If you have an issue not covered here, [please report it](https://github.com/evennia/evennia/issues/new/choose) so it can be fixed or a workaround found!
The server logs are in `mygame/server/logs/`. To easily view server logs in the terminal,
you can run `evennia -l`, or (in the future) start the server with `evennia start -l`.
you can run `evennia -l`, or start/reload the server with `evennia start -l` or `evennia reload -l`.
## Check your Requirements
Any system that supports Python3.9+ should work. We'll describe how to install
everything in the following sections.
Any system that supports Python3.9+ should work.
- Linux/Unix
- Windows (Win7, Win8, Win10, Win11)
- Mac OSX (>10.5 recommended)
- [Python](https://www.python.org) (v3.9, 3.10 and 3.11 are tested)
- [Twisted](https://twistedmatrix.com) (v22.0+)
- [Python](https://www.python.org) (v3.9, 3.10 and 3.11 are tested. 3.11 is recommended)
- [Twisted](https://twistedmatrix.com) (v22.3+)
- [ZopeInterface](https://www.zope.org/Products/ZopeInterface) (v3.0+) - usually included in Twisted packages
- Linux/Mac users may need the `gcc` and `python-dev` packages or equivalent.
- Windows users need [MS Visual C++](https://aka.ms/vs/16/release/vs_buildtools.exe) and *maybe* [pypiwin32](https://pypi.python.org/pypi/pypiwin32).

View file

@ -7,29 +7,26 @@ over things manually.
### Upgrading the Evennia library
Prior to 1.0, all Evennia installs were [Git-installs](./Installation-Git.md). These instructions
assume that you have a cloned `evennia` repo and use a virtualenv (best practices).
Prior to 1.0, all Evennia installs were [Git-installs](./Installation-Git.md). These instructions assume that you have a cloned `evennia` repo and use a virtualenv (best practices).
- Make sure to stop Evennia 0.9.5 entirely with `evennia stop`.
- Make sure to stop Evennia 0.9.5 entirely with `evennia stop` from your game dir.
- `deactivate` to leave your active virtualenv.
- Make a _backup_ of your entire `mygame` folder, just to be sure!
- Install Python 3.11 (recommended). Follow the [Git-installation](./Installation-Git.md) for your OS if needed.
- Delete the old virtualenv `evenv` folder, or rename it (in case you want to keep using 0.9.5 for a while).
- Make _new_ `evenv` virtualenv (see the [virtualenv instructions](./Installation-Git.md#virtualenv) for help)
- `cd` into your `evennia/` root folder (you want to see the `docs/` and `bin/` directories as well as a nested `evennia/` folder)
- `git pull`
- `git checkout develop` TODO - only until 1.0 release.
- `pip install -e .`
- If you want the optional extra libs (needed by some contribs), do `pip install -e .[extra]`
- Test that you can run the `evennia` command.
### Upgrading your game dir
If you don't have anything you want to keep in your existing game dir, you can just start a new onew
using the normal [install instructions](./Installation.md). If you want to keep/convert your existing
game dir, continue below.
If you don't have anything you want to keep in your existing game dir, you can just start a new one using the normal [install instructions](./Installation.md). If you want to keep/convert your existing game dir, continue below.
- First, make a backup of your exising game dir! If you use version control, make sure to commit your current state.
- `cd` to your existing 0.9.5-based game folder (like `mygame`.)
- First, make a _backup_ of your exising game dir! If you use version control, make sure to commit your current state.
- `cd` to your existing 0.9.5-based game folder (like `mygame`).
- If you have changed `mygame/web`, _rename_ the folder to `web_0.9.5`. If you didn't change anything (or don't have anything you want to keep), you can _delete_ it entirely.
- Copy `evennia/evennia/game_template/web` to `mygame/` (e.g. using `cp -Rf` or a file manager). This new `web` folder _replaces the old one_ and has a very different structure.
- It's possible you need to replace/comment out import and calls to the deprecated

View file

@ -124,4 +124,4 @@ See [here](./Evennia-Game-Index.md) for more instructions and please [check out
You are good to go!
Next, why not head into the [Starting Tutorial](../Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Part1-Intro.md) to learn how to start making your new game!
Next, why not head into the [Starting Tutorial](../Howtos/Beginner-Tutorial/Beginner-Tutorial-Overview.md) to learn how to start making your new game!

View file

@ -19,8 +19,7 @@ Out of the box, Evennia uses three ports for outward communication. If your comp
Evennia will by default accept incoming connections on all interfaces (`0.0.0.0`) so in principle anyone knowing the ports to use and has the IP address to your machine should be able to connect to your game.
```{sidebar} Closing the log view
If you need to close the log-view, use `Ctrl-C`. Use just `evennia --log` on its own to
start tailing the logs again.
If you need to close the log-view, use `Ctrl-C`. Use just `evennia --log` on its own to start tailing the logs again.
```
- Make sure Evennia is installed and that you have activated the virtualenv. Start the server with `evennia start --log`. The `--log` (or `-l`) will make sure that the logs are echoed to the terminal.
- Make sure you can connect with your web browser to `http://localhost:4001` or, alternatively, `http://127.0.0.1:4001` which is the same thing. You should get your Evennia web site and be able to play the game in the web client. Also check so that you can connect with a mud client to host `localhost`, port `4000` or host `127.0.0.1`, port `4000`.

View file

@ -41,6 +41,6 @@ Online-Setup
Client-Support-Grid
Security-Practices
Config-HAProxy
Config-Apache
Config-Apache-Proxy
```