Skip to main content

Environment variables

BookLogr uses environment variables to customize and set important variables across the app and between services. The variables and how they work are described below.

warning

The environment variables need to be changed in order to deploy booklogr to production.

.env file

VariableOptionsDefaultDescription
DATABASE_URLSQLAlchemy Database URLsqlite:///books.dbUsed by the API server and points to where the database is hosted. Use either SQLite or PostgreSQL. For PostgreSQL use postgresql://admin:password@booklogr-db/booklogr and use the env variables POSTGRES_USER, POSTGRES_PASSWORD and POSTGRES_DB and set them accordingly. Note: for PostgreSQL, when using docker it is important that the host part uses the same name as the database container.
AUTH_SECRET_KEYTextNoneThe secret key for authentication. This needs to be set to a random string in order for BookLogr to start.
AUTH_ALLOW_REGISTRATIONTrue or FalseTrueAllows non-authenticated users to sign up for an account. Set to False to not allow sign ups.
AUTH_REQUIRE_VERIFICATIONTrue or FalseFalseWhen registration is allowed, also require the user to verify their email address. Set to False to not require verification.
GOOGLE_CLIENT_IDTextNoneChange this to your own Google Client ID if you want to allow authentication with Google
GOOGLE_CLIENT_SECRETTextxxxChange this to your own Google Client Secret if you want to allow authentication with Google
POSTGRES_USERTextadminThe user to authenticate against the database with if using PostgreSQL
POSTGRES_PASSWORDTextpasswordThe password for the user to authenticate against the database if using PostgreSQL.
POSTGRES_DBTextbooklogrThe name of the database if using PostgreSQL.
AUTH_DEFAULT_USERText (email address)Commented outUncomment and type in an email address if you want to create a specific user on startup. Example use case is the demo instance.
AUTH_DEFAULT_PASSWORDText (email address)Commented outPassword for the user set with AUTH_DEFAULT_USER
SINGLE_USER_MODEtrue or falsefalseDisables all authentication and account management for private, trusted environments. Warning: Do not enable if the instance is public. See Single-user Mode documentation.

Service: booklogr-web

VariableOptionsDefaultDescription
BL_API_ENDPOINTURLhttp://localhost:5000/URL to the booklogr API service.
BL_GOOGLE_IDTextEmptyLeave empty to disable Google Login. Change this to your own Google Client ID if you want to allow authentication with Google. Set this to the same as in the .env file in the root directory.
BL_DEMO_MODEtrue or falsefalseAdds information to login screen and removes features such as Google Login, used for demo purposes.
BL_SINGLE_USER_MODEtrue or falsefalseDisables login and account management UI for private environments. See Single-user Mode documentation.
BL_CHECK_UPDATEStrue or falsetrueEnables the periodic check for new releases from GitHub and shows a notification icon in the footer.
BL_DEBUGtrue or falsefalseEnables debug mode, exposing settings and debug information on the frontend (/debug). Do NOT enable in production.

.env file for frontend

The frontend has its own .env file located in the web directory. This is because Vite, the frontend tooling used in this project, requires environment variables to be prefixed with VITE_. This causes some duplicate environment variables.

warning

These are only used if building from source or in a development fashion. If you are using Docker and want to set these variables, see the table Service: booklogr-web above.

VariableOptionsDefaultDescription
VITE_API_ENDPOINTURLhttp://localhost:5000/URL to the BookLogr API service.
VITE_GOOGLE_CLIENT_IDTextXXX.apps.googleusercontent.comChange this to your own Google Client ID if you want to allow authentication with Google. Set this to the same as in the .env file in the root directory.
VITE_DEMO_MODEtrue or falsefalseAdds information to login screen and removes features such as Google Login, used for demo purposes.
VITE_SINGLE_USER_MODEtrue or falsefalseDisables login and account management UI for private environments. See Single-user Mode documentation.
VITE_CHECK_UPDATEStrue or falsetrueEnables the periodic check for new releases from GitHub and shows a notification icon in the footer.
VITE_DEBUGtrue or falsefalseEnables debug mode, exposing settings and debug information on the frontend (/debug). Do NOT enable in production.