[GH-ISSUE #1256] Feature Request: Adding an env file with all variables #771

Closed
opened 2026-03-01 14:46:11 +03:00 by kerem · 2 comments
Owner

Originally created by @marcbria on GitHub (Oct 27, 2023).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1256

Type

  • General question or discussion

What is the problem that your feature request solves

Adding an .env.sample file could help to facilitate the configuration.

Describe the ideal specific solution you'd want, and whether it fits into any broader scope of changes

Create a sample env file and modify installation instructions to use it.
Existing env variables could be moved to this env file, and you can also add all the existing ones.
Some parameters (ie: ports) could be converted to variables to.

How badly do you want this new feature?

  • It's an urgent deal-breaker, I can't live without it
  • It's important to add it in the near-mid term future
  • It would be nice to have eventually

This is my env file, that still need to be extened with vars default values:

PROJECT=archivebox

ADMIN_USERNAME=admin
ADMIN_USERPWD=mypwd

ALLOWED_HOSTS=*                     # add any config options you want as env vars
MEDIA_MAX_SIZE=750m
# - SEARCH_BACKEND_ENGINE=sonic     # uncomment these if you enable sonic below
# - SEARCH_BACKEND_HOST_NAME=sonic
# - SEARCH_BACKEND_PASSWORD=SecretPassword

# More params: 
# https://github.com/ArchiveBox/ArchiveBox/wiki/Configuration#general-settings

## General Settings
# OUTPUT_PERMISSIONS
# ONLY_NEW
# TIMEOUT
# MEDIA_TIMEOUT
# ADMIN_USERNAME / ADMIN_PASSWORD 
# PUBLIC_INDEX / PUBLIC_SNAPSHOTS / PUBLIC_ADD_VIEW 
# CUSTOM_TEMPLATES_DIR
# SNAPSHOTS_PER_PAGE
# FOOTER_INFO
# URL_BLACKLIST
# URL_WHITELIST

## Archive Method Toggles
# SAVE_TITLE
# SAVE_FAVICON
# SAVE_WGET
# SAVE_WARC
# SAVE_PDF
# SAVE_SCREENSHOT
# SAVE_DOM
# SAVE_SINGLEFILE
# SAVE_READABILITY
# SAVE_MERCURY
# SAVE_GIT
# SAVE_MEDIA
# SAVE_ARCHIVE_DOT_ORG

## Archive Method Options
# CHECK_SSL_VALIDITY
# SAVE_WGET_REQUISITES
# RESOLUTION
# CURL_USER_AGENT
# WGET_USER_AGENT
# CHROME_USER_AGENT
# GIT_DOMAINS
# COOKIES_FILE
# CHROME_USER_DATA_DIR
# CHROME_HEADLESS
# CHROME_SANDBOX

## Shell Options
# USE_COLOR
# SHOW_PROGRESS
 
## Dependency Options
# CHROME_BINARY
# WGET_BINARY
# YOUTUBEDL_BINARY
# GIT_BINARY
# CURL_BINARY
# SINGLEFILE_BINARY
# READABILITY_BINARY
# MERCURY_BINARY
# RIPGREP_BINARY
# SINGLEFILE_ARGS
# CURL_ARGS
# WGET_ARGS
# YOUTUBEDL_ARGS
# GIT_ARGS
Originally created by @marcbria on GitHub (Oct 27, 2023). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1256 ## Type - [x] General question or discussion ## What is the problem that your feature request solves Adding an `.env.sample` file could help to facilitate the configuration. ## Describe the ideal specific solution you'd want, and whether it fits into any broader scope of changes Create a sample env file and modify installation instructions to use it. Existing env variables could be moved to this env file, and you can also add all the existing ones. Some parameters (ie: ports) could be converted to variables to. ## How badly do you want this new feature? - [ ] It's an urgent deal-breaker, I can't live without it - [ ] It's important to add it in the near-mid term future - [x] It would be nice to have eventually --- This is my env file, that still need to be extened with vars default values: ``` PROJECT=archivebox ADMIN_USERNAME=admin ADMIN_USERPWD=mypwd ALLOWED_HOSTS=* # add any config options you want as env vars MEDIA_MAX_SIZE=750m # - SEARCH_BACKEND_ENGINE=sonic # uncomment these if you enable sonic below # - SEARCH_BACKEND_HOST_NAME=sonic # - SEARCH_BACKEND_PASSWORD=SecretPassword # More params: # https://github.com/ArchiveBox/ArchiveBox/wiki/Configuration#general-settings ## General Settings # OUTPUT_PERMISSIONS # ONLY_NEW # TIMEOUT # MEDIA_TIMEOUT # ADMIN_USERNAME / ADMIN_PASSWORD # PUBLIC_INDEX / PUBLIC_SNAPSHOTS / PUBLIC_ADD_VIEW # CUSTOM_TEMPLATES_DIR # SNAPSHOTS_PER_PAGE # FOOTER_INFO # URL_BLACKLIST # URL_WHITELIST ## Archive Method Toggles # SAVE_TITLE # SAVE_FAVICON # SAVE_WGET # SAVE_WARC # SAVE_PDF # SAVE_SCREENSHOT # SAVE_DOM # SAVE_SINGLEFILE # SAVE_READABILITY # SAVE_MERCURY # SAVE_GIT # SAVE_MEDIA # SAVE_ARCHIVE_DOT_ORG ## Archive Method Options # CHECK_SSL_VALIDITY # SAVE_WGET_REQUISITES # RESOLUTION # CURL_USER_AGENT # WGET_USER_AGENT # CHROME_USER_AGENT # GIT_DOMAINS # COOKIES_FILE # CHROME_USER_DATA_DIR # CHROME_HEADLESS # CHROME_SANDBOX ## Shell Options # USE_COLOR # SHOW_PROGRESS ## Dependency Options # CHROME_BINARY # WGET_BINARY # YOUTUBEDL_BINARY # GIT_BINARY # CURL_BINARY # SINGLEFILE_BINARY # READABILITY_BINARY # MERCURY_BINARY # RIPGREP_BINARY # SINGLEFILE_ARGS # CURL_ARGS # WGET_ARGS # YOUTUBEDL_ARGS # GIT_ARGS ```
kerem closed this issue 2026-03-01 14:46:12 +03:00
Author
Owner

@pirate commented on GitHub (Oct 27, 2023):

I don't recommend .env files for persistent config, using ./data/ArchiveBox.conf or archivebox config --set ... is what I push users towards as it will be automatically and consistently loaded by any ArchiveBox instances that use that data dir (across all install methods like pip/apt/brew/etc). Compare that to .env which is only automatically loaded by Docker or custom shell hooks, which creates confusing situations when a user is running ArchiveBox server in Docker but interacting with archivebox shell/archivebox list/etc. outside docker and wondering why their config isn't being applied consistently.

Of course both methods are supported and documented (even at the same time) and will remain that way, but I'd rather have the ini .conf file be the canonical default that's recommended for beginners.

<!-- gh-comment-id:1783207597 --> @pirate commented on GitHub (Oct 27, 2023): I don't recommend `.env` files for persistent config, using `./data/ArchiveBox.conf` or `archivebox config --set ...` is what I push users towards as it will be automatically and consistently loaded by any ArchiveBox instances that use that data dir (across all install methods like pip/apt/brew/etc). Compare that to `.env` which is only automatically loaded by Docker or custom shell hooks, which creates confusing situations when a user is running ArchiveBox server in Docker but interacting with `archivebox shell`/`archivebox list`/etc. outside docker and wondering why their config isn't being applied consistently. Of course both methods are supported and documented (even at the same time) and will remain that way, but I'd rather have the ini `.conf` file be the canonical default that's recommended for beginners.
Author
Owner

@marcbria commented on GitHub (Oct 29, 2023):

Interesting approach.
Actually, I really liked the automated installation and configuration process using "docker-compose run".

Thanks for your work. It's impressive.

Cheers,
m.

<!-- gh-comment-id:1784157944 --> @marcbria commented on GitHub (Oct 29, 2023): Interesting approach. Actually, I really liked the automated installation and configuration process using "docker-compose run". Thanks for your work. It's impressive. Cheers, m.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#771
No description provided.