diff --git a/CLAUDE.md b/CLAUDE.md index 1adfd703f..3e601b453 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -35,9 +35,9 @@ npm run format # Prettier formatting ### Docker Development ```bash -cd docker/dev -./build_images.sh -docker run -d -p 27017:27017 -v uptime_mongo_data:/data/db --name uptime_database_mongo mongo:6.0 +docker build -f docker/Dockerfile -t checkmate . # build the mono image (server + built client) +docker compose -f docker/dev/docker-compose.yaml up # local full stack (builds image, runs mongo + worker) +docker run -d -p 27017:27017 -v uptime_mongo_data:/data/db --name uptime_database_mongo mongo:8.0 # just a dev database ``` ## Environment Setup diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c2e536da5..b93d6e7d8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -88,34 +88,10 @@ cd Checkmate #### Step 2: Set Up Docker Containers (MongoDB) -Navigate to the Docker dev directory: - -```bash -cd docker/dev -``` - -Build the Docker images: - -Linux: -```bash -./build_images.sh -``` - -Windows: -```bash -./build_images.bat -``` - Run MongoDB container: ```bash -docker run -d -p 27017:27017 -v uptime_mongo_data:/data/db --name uptime_database_mongo mongo:6.0 -``` - -Navigate back to the root directory: - -```bash -cd ../.. +docker run -d -p 27017:27017 -v uptime_mongo_data:/data/db --name uptime_database_mongo mongo:8.0 ``` #### Step 3: Set Up the Backend (Server) diff --git a/README.md b/README.md index c6830f566..05eb688ff 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,16 @@ Usage instructions can be found [here](https://checkmate.so/docs). ## Installation -See installation instructions in [Checkmate documentation portal](https://checkmate.so/docs). +The quickest way to run Checkmate is the reference Docker Compose file, which runs the all-in-one image (`ghcr.io/bluewave-labs/checkmate`) plus MongoDB: + +```bash +curl -O https://raw.githubusercontent.com/bluewave-labs/checkmate/master/docker/docker-compose.yaml +JWT_SECRET="$(openssl rand -hex 32)" docker compose up -d +``` + +Then open http://localhost:52345. If the app is reached at another origin (domain or LAN IP), set `CLIENT_HOST` accordingly. To build the image yourself, run `docker build -f docker/Dockerfile -t checkmate .` from a checkout. For TLS, put any reverse proxy (Caddy, Traefik, nginx) in front of port 52345. + +See full installation instructions in the [Checkmate documentation portal](https://checkmate.so/docs). Alternatively, you can also use [Coolify](https://coolify.io/), [Elestio](https://elest.io/open-source/checkmate), [K8s](./charts/helm/checkmate/INSTALLATION.md), [Sive Host](https://sive.host) (South Africa), [Cloudzy](https://cloudzy.com/marketplace/checkmate) or [Pikapods](https://www.pikapods.com/) to quickly spin off a Checkmate instance. If you would like to monitor your server infrastructure, you'll need [Capture agent](https://github.com/bluewave-labs/capture). Capture repository also contains the installation instructions. diff --git a/client/.gitignore b/client/.gitignore index 23b6e49af..8882da3ee 100644 --- a/client/.gitignore +++ b/client/.gitignore @@ -28,5 +28,4 @@ dist-ssr # Scripts *.sh -!env.sh .env.development \ No newline at end of file diff --git a/client/env.sh b/client/env.sh deleted file mode 100755 index d95f8ee8f..000000000 --- a/client/env.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -for i in $(env | grep UPTIME_APP_) -do - key=$(echo $i | cut -d '=' -f 1) - value=$(echo $i | cut -d '=' -f 2-) - echo $key=$value - find /usr/share/nginx/html -type f \( -name '*.js' -o -name '*.css' \) -exec sed -i "s|${key}|${value}|g" '{}' + -done \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index b8904d1f9..09698b115 100644 --- a/docs/README.md +++ b/docs/README.md @@ -19,8 +19,6 @@ If you need to monitor internal HTTPS endpoints with certificates from private C ### Example Configurations The `docker/dev/` directory contains example configurations: - `docker-compose.custom-ca-example.yaml` - Example Docker Compose with custom CA -- `server-custom-ca.Dockerfile` - Example Dockerfile for OS-level CA trust -- `export-smallstep-ca.sh` - Helper script for Smallstep CA export ## Contributing to Documentation diff --git a/docs/custom-ca-trust.md b/docs/custom-ca-trust.md index b3a19831f..6e94894c0 100644 --- a/docs/custom-ca-trust.md +++ b/docs/custom-ca-trust.md @@ -18,8 +18,8 @@ Add a volume mount for your CA certificate and set the environment variable: ```yaml services: - server: - image: uptime_server:latest + checkmate: + image: ghcr.io/bluewave-labs/checkmate:latest restart: always ports: - "52345:52345" @@ -30,7 +30,6 @@ services: volumes: - ./certs:/certs:ro depends_on: - - redis - mongodb ``` @@ -52,67 +51,53 @@ For more comprehensive trust configuration, you can create a derived Dockerfile ### Custom Dockerfile -Create `docker/dev/server-custom-ca.Dockerfile`: +Create `checkmate-custom-ca.Dockerfile`: ```dockerfile -FROM node:20-alpine +FROM ghcr.io/bluewave-labs/checkmate:latest -# Install ca-certificates for Alpine -RUN apk add --no-cache ca-certificates +USER root -WORKDIR /app +RUN apt-get update \ + && apt-get install -y ca-certificates \ + && rm -rf /var/lib/apt/lists/* -COPY ./server/package*.json ./ - -RUN npm install - -COPY ./server/ ./ - -# Copy your custom CA certificate +# Copy your custom CA certificate (must have a .crt extension) COPY ./certs/custom-ca.crt /usr/local/share/ca-certificates/ # Update CA certificates RUN update-ca-certificates -EXPOSE 52345 +USER node -CMD ["node", "src/index.js"] +# Node uses its bundled CA store by default; make it read the system store +ENV NODE_OPTIONS="--use-system-ca" ``` ### Docker Compose Override -Create `docker/dev/docker-compose.custom-ca.yaml`: +Create `docker-compose.custom-ca.yaml`: ```yaml services: - server: + checkmate: build: context: . - dockerfile: server-custom-ca.Dockerfile + dockerfile: checkmate-custom-ca.Dockerfile restart: always ports: - "52345:52345" env_file: - server.env depends_on: - - redis - mongodb ``` -Run with: `docker-compose -f docker-compose.yaml -f docker-compose.custom-ca.yaml up` +Run with: `docker compose -f docker-compose.yaml -f docker-compose.custom-ca.yaml up` -## Alpine Linux Considerations +## Base Image Considerations -Since Checkmate uses Alpine Linux as the base image, you need to install the `ca-certificates` package: - -```dockerfile -# Install ca-certificates for Alpine -RUN apk add --no-cache ca-certificates - -# Copy and update CA certificates -COPY ./certs/custom-ca.crt /usr/local/share/ca-certificates/ -RUN update-ca-certificates -``` +The Checkmate image is Debian-based (`node:22-slim`), which does not ship the `ca-certificates` package — install it before running `update-ca-certificates` (see the Dockerfile above). Certificates dropped into `/usr/local/share/ca-certificates/` must have a `.crt` extension, and Node only consults the system store when started with `--use-system-ca`. For most setups the `NODE_EXTRA_CA_CERTS` compose approach is simpler. ## Smallstep CA Configuration diff --git a/server/.github/pull_request_template.md b/server/.github/pull_request_template.md deleted file mode 100755 index 4f4da5d80..000000000 --- a/server/.github/pull_request_template.md +++ /dev/null @@ -1,25 +0,0 @@ -**(Please remove this line only before submitting your PR. Ensure that all relevant items are checked before submission.)** - -## Describe your changes - -Briefly describe the changes you made and their purpose. - -## Write your issue number after "Fixes " - -Fixes #123 - -## Please ensure all items are checked off before requesting a review. "Checked off" means you need to add an "x" character between brackets so they turn into checkmarks. - -- [ ] (Do not skip this or your PR will be closed) I deployed the application locally. -- [ ] (Do not skip this or your PR will be closed) I have performed a self-review and testing of my code. -- [ ] I have included the issue # in the PR. -- [ ] I have added i18n support to visible strings (instead of `