camera

🔧 Build It Yourself Guide

This page explains how to download the CammyCam repository, create a .env file, and spin up the Docker hub. It assumes basic familiarity with Git and Docker but keeps the steps short and friendly.

1. Clone the Repository

git clone https://github.com/iamfatben/camera.git
cd camera

2. Configure Environment Variables

Copy .env.example to .env and fill in the blanks. At minimum set a secret key and name for the hub to advertise.

cp .env.example .env
# edit .env with your favorite editor

3. Build the Docker Image

Run the Python helper to compile the UI, generate certificates and build the Docker image.

python tools/build_docker.py

4. Run the Hub Container

docker run -p 443:443 --env-file .env cammy-hub

Set CAMMY_PORT in .env if you want to use a different HTTPS port and adjust the -p mapping accordingly. The Dockerfile exposes the build argument HUB_PORT (default 443). Run docker run -p 8443:$HUB_PORT cammy-hub when using a custom build. The entrypoint searches for certificates under certs/<CAMMY_NAME>.pem and generates them if missing. If you create certificates manually, place them in that directory before starting the container.

Once running, the container prints the login URL (ending in /login). After signing in you can access the API docs at /api-docs.

Troubleshooting

Image fails to build – ensure Docker is running and try docker build --no-cache -t cammy ..

Server exits immediately – check .env; mismatched CAMMY_SECRET_KEY values cause failures.

Ports already in use – Stop other services using port 8000 or change the exposed port in the docker run command.