Giter Site home page Giter Site logo

doduapi's Introduction

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_GEN=$(echo $RANDOM | md5sum | head -c 20; echo;)

echo "MEILI_MASTER_KEY=$MEILI_MASTER_KEY_GEN" > .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_GEN &

You can get the process back with fg later.

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

git clone [email protected]: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

If you get some Docker errors and the socket is not at /var/run/docker.sock, add a parameter DOCKER_HOST to the .env file.

DOCKER_HOST=unix://<your docker.sock path>

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

doduapi's People

Contributors

stelzo avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.