Skip to content

Commit ffe127a

Browse files
committed
readme: ref: ENVs
1 parent 7a84e17 commit ffe127a

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

README.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A headless browser task server based on [Hero](https://github.com/ulixee/hero).
44

55
- Hero is a web browser that's built for scraping.
66
- This task server allow you to process multiple task simultaneously on single server instance
7-
- Has [Helper](https://github.com/luka-dev/headless-task-server-php#helpers) for PHP to make request easy (Outdated)
7+
- Has [Helper](https://github.com/luka-dev/headless-task-server-php#helpers) for PHP to make request easy (!!!!!!Outdated!!!!!!, update soon)
88

99
# Install
1010

@@ -43,24 +43,32 @@ npm run build
4343
4444
- #### Enjoy
4545
46+
### Additional ENVs:
47+
- `AUTH_KEY` - Auth key for requests, default `null`
48+
- `SERVER_PORT` - Server port, default `8080`
49+
- `UPSTREAM_PROXY_URL` - Default proxy for script, default `null`, also can be set personally for each task in options `upstreamProxyUrl`
50+
- `SESSION_TIMEOUT` - Timeout task script execution, default `60000` (1 min)
51+
- `QUEUE_TIMEOUT` - Timeout og waiting to begin task processing, default `30000` (30 sec)
52+
- `MAX_CONCURRENCY` - Limit of concurrent tasks, default `5`
53+
> NOTE: If you want to calculate custom value, you can use this formula `MAX_CONCURRENCY = (FREE_RAM - 1.5GB) / 0.5GB`, also to prevent stuttering avg formula for CPU is `MAX_CONCURRENCY = CPU_CORES_COUNT * 2`
54+
- `CONCURRENCY_DISABLE_MEM_LIMITER` - Memory limiter for concurrency, can be disabled with `true`.
55+
> NOTE: If free memory less than 500MB, new task wouldn't be runned until memory will be free.\
56+
> For example, when chrome instance will be closed after finishing tasks, memory will be free.\
57+
> Due to chrome/chromium specific behavior, memory can't be freed immediately, so we need to wait for it.
58+
- `TELEGRAM_TOKEN` & `TELEGRAM_CHAT_ID` - Telegram bot token and chat id for sending logs on crash or restart, default `null`
59+
- `DEBUG` & `ULX_DEBUG` - Enable debug mode, default `false`
60+
- `SHOW_CHROME` - Show browser window, default `false`. Works only on systems with GUI
61+
> NOTE: On non GUI systems will crash! If you want to see browser window, you need to set `SHOW_CHROME` to `true` and run server directly on machine, not in Docker.
62+
63+
64+
4665
# Usage
4766
4867
> Example IP `127.0.0.1`.
4968
>
5069
> Auth work via header `Authorization`.
5170
>
5271
> Auth key loading from `config.json` and overwriting with env `AUTH_KEY`
53-
>
54-
> Additional ENVs:
55-
> > `SESSION_TIMEOUT` - Timeout for request session, default `60000` (1 min)
56-
> >
57-
> > `MAX_CONCURRENCY` - Limit of concurrent tasks, default `5`
58-
> > > NOTE: If you want to calculate custom value, you can use this formula `MAX_CONCURRENCY = (FREE_RAM - 1.5GB) / 0.5GB`, also to prevent stuttering avg formula for CPU is `MAX_CONCURRENCY = CPU_CORES_COUNT * 2`
59-
> >
60-
> > `CONCURRENCY_DISABLE_MEM_LIMITER` - Memory limiter for concurrency, can be disabled with `true`.
61-
> > > NOTE: If free memory less than 500MB, new task wouldn't be runned until memory will be free.\
62-
> > > For example, when chrome instance will be closed after finishing tasks, memory will be free.\
63-
> > > Due to chrome/chromium specific behavior, memory can't be freed immediately, so we need to wait for it.
6472
6573
- Health Check
6674

0 commit comments

Comments
 (0)