doduapi

command module
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: GPL-3.0 Imports: 35 Imported by: 0

README

doduapi

The Dofus encyclopedia API.

Try it!

Usage

The dofusdude server is always running with the latest Dofus version and it is highly recommended to use its public endpoints at https://api.dofusdu.de/. Try them out here and use the SDKs for real development.

If you host your own instance you have to update it yourself. You can use a doduda Watchdog as a trigger.

Development Setup

Assumptions:

  • Linux / MacOS

Create a simple .env file.

export MEILI_MASTER_KEY=$(echo $RANDOM | md5sum | head -c 20; echo;)

echo "MEILI_MASTER_KEY=$MEILI_MASTER_KEY" > .env

If you had a problem with the md5sum, you are probably on MacOS and need to brew install md5sha1sum. Also, jq could be a problem, brew install jq or sudo apt install jq. Or just make up your own keys.

Download Meilisearch for the search engine and let it run in the background.

curl -L https://install.meilisearch.com | sh
./meilisearch --master-key $MEILI_MASTER_KEY &

You can get the process back with fg later.

Now build it from source. You need to have Go >= 1.18 installed.

git clone git@github.com:dofusdude/doduapi.git
cd doduapi
go run .

If you want more info about the specific tasks, you can set the LOG_LEVEL env to one of debug, info, warn (default), error or fatal. The more left you go in that list, the more info you get.

LOG_LEVEL=debug go run . --headless

Configuration

Open the .env with your favorite editor. Add more parameters if you want. Here is a full list.

MEILI_MASTER_KEY=<already set> # a random string that must be the same in the meilisearch.service file or parameter
DIR=<working directory> # directory where the ./data dir can be found
DOFUS_VERSION=2.68.5.6 # must match a name from https://github.com/dofusdude/dofus2-main/releases
API_SCHEME=http # http or https. Just used for building links
API_HOSTNAME=localhost # the hostname of the api. Just used for building links
API_PORT=3000 # the port where to listen on
MEILI_PORT=7700 # the port where meilisearch is listening on
MEILI_PROTOCOL=http # http or https
MEILI_HOST=127.0.0.1 # the hostname of meilisearch
PROMETHEUS=false # enable prometheus metrics export running on one apiport + 1
FILESERVER=true # will tell doduapi to serve the image files itself
IS_BETA=false # main (false) vs beta (true)
UPDATE_HOOK_TOKEN=secret # /update/<token> will trigger an update with a POST request {"version": "<dofusversion>"}

Known Problems

Run doduapi with --headless in a server environment to avoid "no tty" errors.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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