Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,22 @@ stop: # Terminates the execution of all containers

.PHONY: clean
clean: # Terminates the execution of all containers + delete volumes
docker compose down -v --remove-orphans
docker volume rm bookmark_db -f
rm -r priv/static/archive/*
@if [ "${IS_PROD}" = "true" ]; then \
echo "You can't run 'make clean' in production.\nIf you want to stop the containers, run 'make stop'"; \
else \
echo "ATTENTION: You are on the verge of DELETING the ENTIRE database and files. Please be aware, this action is IRREVERSIBLE.\nAre you absolutely certain you want to proceed? Y/n"; \
read response; \
response=$$(echo "$$response" | tr '[:upper:]' '[:lower:]'); \
if [ "$$response" = "y" ]; then \
docker compose down -v --remove-orphans; \
docker volume rm bookmark_db -f; \
rm -r priv/static/archive/*; \
echo "Successful deletion"; \
else \
echo "Operation aborted"; \
fi \
fi


.PHONY: push-image
push-image: # Push image to registry
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ This repository contains the code for [bookmark.org](https://bookmark.org/), an

1. Install [Docker](https://docs.docker.com/engine/install/). Don't forget to perform the [Docker post-installation](https://docs.docker.com/engine/install/linux-postinstall/).

2. Optional: Create the following `.env` file in the root folder of this project (only required for archive summary generated with AI and custom delay in bulk archiving)
2. Create the following `.env` file in the root directory of this project

```
# Required: Set to true if you are in a production environment, otherwise, use false.
IS_PROD=true

# (Optional) Only required for archive summary generated with AI.
OPENAI_API_KEY=<api-key>
# Expressed in milliseconds

# (Optional) Delay expressed in milliseconds, to avoid concurrency issues during bulk archive processing (Default: 300).
BOOKMARK_ARCHIVE_DELAY=1000
```

Expand Down