Common Configurations
Variables / Options Descriptions
Required
PORT: Starting port, api will listen on this port only (default port8000, host0.0.0.0, don't set if using Heroku)API_USER&API_PASS: Using basic http auth to protect core endpoints , use unique password (don't useadmin&admin, default isadmin&admin)CREATE_REDIS:false(default), Check hereLOG_REQUESTS:false(default)
Optional
-
INACTIVITY_TIMEOUT(second): By default the Uvicorn worker will restart (to clear ram) after300seconds (default) if there is no request. -
IPINFO_TOKEN: For IP logging purposes -
REMEMBER_ME_TOKEN&JDB_SESSION: Some cotent on JAVDB requires account to view (scrape),if any result from JAVDB returnnullthen maybe you need to fill up this- These are cookie values, login into javdb and copy values from
_jdb_session&remember_me_token. This cookies will expire after 7 days if you checked Keep me logged in for 7 days during sign in
- These are cookie values, login into javdb and copy values from
-
JAVDB_EMAIL&JAVDB_PASSWORD: For auto-login into JAVDB account, some query on JAVDB required login , captcha is bypassed via another api, check repo here -
CAPTCHA_SOLVER_URL:https://captcha-solver-api2.herokuapp.com/javdbCheck repo
Healthcheck (Optional)
-
HEALTHCHECK_PROVIDER:None(default)uptimekuma(push method)healthchecksioself(ping to public url, neededBASE_URLenv)local(docker healthcheck)
-
UPTIMEKUMA_PUSH_URL: Set this url in this formathttps://uptime-kuma-instance-url/api/push/monitor-slugwith or without optional parameters and setHEALTHCHECK_PROVIDERtouptimekuma -
HEALTHCHECKSIO_PING_URL: Set url in this format,https://healthchecks-io-instance-url/monitor-uuidorhttps://healthchecks-io-instance-url/ping-key/monitor-nameand setHEALTHCHECK_PROVIDERtohealthchecksio
Log request (Optional)
- Set
LOG_REQUEST=trueto log incoming request headers, query parameters, time, ip address details from ipinfo - Set
IPINFO_TOKENwith API token from ipinfo.io (Optional)
LOG Example
{
"query": {
"id": "EBOD-391"
},
"method": "POST",
"path": "/search",
"headers": {
"host": "(BASE_URL)",
"accept-encoding": "gzip, deflate",
"accept": "*/*",
"content-length": "0",
"authorization": "(BASIC AUTH)",
"user-agent": "HTTPie/3.2.1",
"x-forwarded-for": "(IP ADDRESS)",
"x-forwarded-proto": "https",
"x-envoy-external-address": "(IP ADDRESS)",
"x-request-id": "XXX-XXX-XXX-XXX"
},
"user": {
"ip": "(IP ADDRESS)",
"hostname": "XXX",
"city": "XXX",
"region": "XXX",
"country": "XXX",
"loc": "XXX, XXX",
"org": "XXX",
"postal": "XXX",
"timezone": "XXX/XXX"
},
"time": "2022-05-28 03:08:58"
}
Using without Redis Database Plugin (Optional)
(Example: All-in-One Template)
- Set
CREATE_REDIS=truein variables - using redis.conf from
conf/redis.conf - DO NOT SET PASSWORD in redis.conf, REDIS_PASS =
echo $API_PASS | base64
Note
On every push / build a previous copy of local-database (via /database endpoint)will be downloaded automatically (if available) and restored
An ephemeral redis server can't be accessed from outside app container
To access the database you need to download the whole database and restore locally
send a GET request to /database endpoint with API_USER and API_PASS as HTTP basicauth to download database.rdb file
Example:
orDownload database.rdb file
Restore with redis-server
- Set
CREATE_REDIS=false -
Set
REDIS_URL=<redis_connection_string>with your redis-server credentials Example Connection String- For SSL enabled connections use
rediss://instead ofredis://in connection string
- For SSL enabled connections use