-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* db cleanup * dev * pg setup * postgres uuid migration * cleanup * fk * sqlite migration * cleanup * wal * max open conns = 1 * fix panic --------- Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
- Loading branch information
1 parent
4583880
commit be38c83
Showing
38 changed files
with
1,000,425 additions
and
7,113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
gameid = minetest | ||
creative_mode = true | ||
enable_damage = true | ||
|
||
auth_backend = postgresql | ||
pgsql_auth_connection = host=postgres user=postgres password=enter dbname=postgres | ||
|
||
player_backend = postgresql | ||
pgsql_player_connection = host=postgres port=5432 user=postgres password=enter dbname=postgres | ||
|
||
backend = postgresql | ||
pgsql_connection = host=postgres port=5432 user=postgres password=enter dbname=postgres | ||
|
||
mod_storage_backend = postgresql | ||
pgsql_mod_storage_connection = host=postgres user=postgres password=enter dbname=postgres | ||
|
||
pgsql_mapserver_connection = host=postgres port=5432 user=postgres password=enter dbname=postgres |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,37 @@ | ||
|
||
# System overview | ||
|
||
<img src="./Overview.png"> | ||
|
||
# Build dependencies | ||
|
||
* go >= 1.16 | ||
* nodejs >= v17.4.0 | ||
* npm >= 8.3.0 | ||
* docker | ||
* docker-compose | ||
|
||
# Create the frontend bundle | ||
|
||
```bash | ||
cd public | ||
npm ci | ||
npm run bundle | ||
docker-compose up mapserver_frontend | ||
``` | ||
|
||
# Development setup | ||
|
||
Working directory: `./server` | ||
|
||
## Preparing the files and map | ||
|
||
Copy your `map.sqlite` into the working directory if you want to test with | ||
a sqlite map database | ||
|
||
### world.mt | ||
|
||
You need a `world.mt` too in order to make the connection to the database. | ||
In the sqlite case: | ||
# Development setup (sqlite) | ||
|
||
``` | ||
gameid = minetest | ||
backend = sqlite3 | ||
creative_mode = false | ||
enable_damage = false | ||
player_backend = files | ||
```bash | ||
# start the engine in the first window/shell | ||
docker-compose up minetest | ||
# and the mapserver in another | ||
docker-compose up mapserver | ||
``` | ||
|
||
For postgres: | ||
``` | ||
gameid = minetest | ||
backend = postgresql | ||
creative_mode = true | ||
enable_damage = true | ||
player_backend = postgresql | ||
pgsql_connection = host=localhost port=5432 user=postgres password=enter dbname=postgres | ||
pgsql_player_connection = host=localhost port=5432 user=postgres password=enter dbname=postgres | ||
``` | ||
# Development setup (postgres) | ||
|
||
## Running the server | ||
```bash | ||
# start postgres in the background | ||
docker-compose -f docker-compose.yml -f docker-compose.postgres.yml up -d postgres | ||
# start the engine in the first window/shell | ||
docker-compose -f docker-compose.yml -f docker-compose.postgres.yml up minetest | ||
# and the mapserver in another | ||
docker-compose -f docker-compose.yml -f docker-compose.postgres.yml up mapserver | ||
``` | ||
|
||
* Create a `mapserver.json` with `go run . -createconfig` | ||
* Change the value `webdev` in the `mapserver.json` to `true` | ||
* Start the server with `go run .` or with debug output: `go run . -debug` | ||
* The web files in `public/` can now be changed on the fly without restarting the server | ||
Utilities: | ||
```sh | ||
# psql | ||
docker-compose -f docker-compose.yml -f docker-compose.postgres.yml exec postgres psql -U postgres | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: "3.6" | ||
|
||
services: | ||
postgres: | ||
image: postgres:16.1 | ||
restart: always | ||
environment: | ||
POSTGRES_PASSWORD: enter | ||
volumes: | ||
- "pg_data:/var/lib/postgresql/data" | ||
|
||
mapserver: | ||
volumes: | ||
- "./dev/world.postgres.mt:/data/world/world.mt" | ||
|
||
minetest: | ||
volumes: | ||
- "./dev/world.postgres.mt:/root/.minetest/worlds/world/world.mt" | ||
|
||
volumes: | ||
pg_data: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.