mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2025-06-07 20:15:24 +00:00
Merge 374c48f66c6769277ca67d9f81479da4ab865c40 into 3dd3e7559d99fcd263669e048851b9aa9ceb43c2
This commit is contained in:
commit
6a2ddaa9c7
@ -38,7 +38,12 @@ RUN dpkg -i /libgl1-mesa-dri.deb \
|
|||||||
# Create flaresolverr user
|
# Create flaresolverr user
|
||||||
&& useradd --home-dir /app --shell /bin/sh flaresolverr \
|
&& useradd --home-dir /app --shell /bin/sh flaresolverr \
|
||||||
&& mv /usr/bin/chromedriver chromedriver \
|
&& mv /usr/bin/chromedriver chromedriver \
|
||||||
&& chown -R flaresolverr:flaresolverr .
|
&& chown -R flaresolverr:flaresolverr . \
|
||||||
|
# Create config dir
|
||||||
|
&& mkdir /config \
|
||||||
|
&& chown flaresolverr:flaresolverr /config
|
||||||
|
|
||||||
|
VOLUME /config
|
||||||
|
|
||||||
# Install Python dependencies
|
# Install Python dependencies
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
|
@ -264,10 +264,11 @@ This is the same as `request.get` but it takes one more param:
|
|||||||
| Name | Default | Notes |
|
| Name | Default | Notes |
|
||||||
|--------------------|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|--------------------|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| LOG_LEVEL | info | Verbosity of the logging. Use `LOG_LEVEL=debug` for more information. |
|
| LOG_LEVEL | info | Verbosity of the logging. Use `LOG_LEVEL=debug` for more information. |
|
||||||
|
| LOG_FILE | none | Capture log to file. |
|
||||||
| LOG_HTML | false | Only for debugging. If `true` all HTML that passes through the proxy will be logged to the console in `debug` level. |
|
| LOG_HTML | false | Only for debugging. If `true` all HTML that passes through the proxy will be logged to the console in `debug` level. |
|
||||||
| CAPTCHA_SOLVER | none | Captcha solving method. It is used when a captcha is encountered. See the Captcha Solvers section. |
|
| CAPTCHA_SOLVER | none | Captcha solving method. It is used when a captcha is encountered. See the Captcha Solvers section. |
|
||||||
| TZ | UTC | Timezone used in the logs and the web browser. Example: `TZ=Europe/London`. |
|
| TZ | UTC | Timezone used in the logs and the web browser. Example: `TZ=Europe/London`. |
|
||||||
| LANG | none | Language used in the web browser. Example: `LANG=en_GB`. |
|
| LANG | none | Language used in the web browser. Example: `LANG=en_GB`. |
|
||||||
| HEADLESS | true | Only for debugging. To run the web browser in headless mode or visible. |
|
| HEADLESS | true | Only for debugging. To run the web browser in headless mode or visible. |
|
||||||
| BROWSER_TIMEOUT | 40000 | If you are experiencing errors/timeouts because your system is slow, you can try to increase this value. Remember to increase the `maxTimeout` parameter too. |
|
| BROWSER_TIMEOUT | 40000 | If you are experiencing errors/timeouts because your system is slow, you can try to increase this value. Remember to increase the `maxTimeout` parameter too. |
|
||||||
| TEST_URL | https://www.google.com | FlareSolverr makes a request on start to make sure the web browser is working. You can change that URL if it is blocked in your country. |
|
| TEST_URL | https://www.google.com | FlareSolverr makes a request on start to make sure the web browser is working. You can change that URL if it is blocked in your country. |
|
||||||
|
@ -7,9 +7,12 @@ services:
|
|||||||
container_name: flaresolverr
|
container_name: flaresolverr
|
||||||
environment:
|
environment:
|
||||||
- LOG_LEVEL=${LOG_LEVEL:-info}
|
- LOG_LEVEL=${LOG_LEVEL:-info}
|
||||||
|
- LOG_FILE=flaresolver.log
|
||||||
- LOG_HTML=${LOG_HTML:-false}
|
- LOG_HTML=${LOG_HTML:-false}
|
||||||
- CAPTCHA_SOLVER=${CAPTCHA_SOLVER:-none}
|
- CAPTCHA_SOLVER=${CAPTCHA_SOLVER:-none}
|
||||||
- TZ=Europe/London
|
- TZ=Europe/London
|
||||||
ports:
|
ports:
|
||||||
- "${PORT:-8191}:8191"
|
- "${PORT:-8191}:8191"
|
||||||
|
volumes:
|
||||||
|
- /var/lib/flaresolver:/config
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
@ -76,6 +76,7 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
# validate configuration
|
# validate configuration
|
||||||
log_level = os.environ.get('LOG_LEVEL', 'info').upper()
|
log_level = os.environ.get('LOG_LEVEL', 'info').upper()
|
||||||
|
log_file = os.environ.get('LOG_FILE', None)
|
||||||
log_html = utils.get_config_log_html()
|
log_html = utils.get_config_log_html()
|
||||||
headless = utils.get_config_headless()
|
headless = utils.get_config_headless()
|
||||||
server_host = os.environ.get('HOST', '0.0.0.0')
|
server_host = os.environ.get('HOST', '0.0.0.0')
|
||||||
@ -93,6 +94,15 @@ if __name__ == "__main__":
|
|||||||
logging.StreamHandler(sys.stdout)
|
logging.StreamHandler(sys.stdout)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
if log_file:
|
||||||
|
if not log_file.startswith("/config"):
|
||||||
|
log_file = "/config/" + log_file
|
||||||
|
log_file = os.path.realpath(log_file)
|
||||||
|
log_path = os.path.dirname(log_file)
|
||||||
|
os.makedirs(log_path, exist_ok=True)
|
||||||
|
|
||||||
|
logging.getLogger().addHandler(logging.FileHandler(log_file))
|
||||||
|
|
||||||
# disable warning traces from urllib3
|
# disable warning traces from urllib3
|
||||||
logging.getLogger('urllib3').setLevel(logging.ERROR)
|
logging.getLogger('urllib3').setLevel(logging.ERROR)
|
||||||
logging.getLogger('selenium.webdriver.remote.remote_connection').setLevel(logging.WARNING)
|
logging.getLogger('selenium.webdriver.remote.remote_connection').setLevel(logging.WARNING)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user