Skip to content

aksiksi/ncdmv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

84db3fc · Feb 23, 2025

History

93 Commits
Feb 23, 2025
Oct 20, 2024
Oct 20, 2024
Feb 23, 2025
Jun 10, 2023
Oct 20, 2024
Sep 2, 2023
Sep 2, 2023
Oct 20, 2024
Feb 23, 2025
Feb 23, 2025
Feb 23, 2025
Feb 23, 2025
Oct 20, 2024

Repository files navigation

ncdmv

Monitor NCDMV for new appointment slots and get notified through Discord.

Discord message example

Usage

ncdmv monitors NC DMV appointments

Usage:
  ncdmv [flags]

Flags:
  -t, --appt-type string         appointment type (one of: [knowledge-test motorcycle-skills-test non-cdl-road-test permit driver-license driver-license-duplicate driver-license-renewal id-card]) (default "permit")
  -d, --database-path string     database path
      --debug                    enable debug mode
      --debug-chrome             enable debug mode for Chrome
      --disable-gpu              disable GPU acceleration
  -w, --discord-webhook string   Discord webhook URL
      --headless                 run Chrome in headless mode (no GUI) (default true)
  -h, --help                     help for ncdmv
      --interval duration        interval between searches (default 5m0s)
  -l, --locations strings        locations to search (default [cary,durham-east,durham-south])
      --notify-unavailable       if set, send a notification if an appointment becomes unavailable (default true)
      --stop-on-failure          if set, completely stop on failure instead of just logging
      --timeout duration         timeout for each search, in seconds (default 5m0s)

Examples

Run in headless mode:

go run ./cmd/ncdmv -l cary,durham-east,durham-south -w [WEBHOOK] --database-path ./ncdmv.db

Show the browser with a timeout of 5 minutes each check (across all locations) and an interval of 10 minutes:

go run ./cmd/ncdmv -l cary,durham-east,durham-south -w [WEBHOOK] --database-path ./ncdmv.db --timeout 5m --interval 10m --headless=false 

Docker

Note: you can only run headless Chrome with Docker.

docker run --rm -v $(pwd):/config -e NCDMV_APPT_TYPE=permit -e NCDMV_LOCATIONS=cary,durham-east ghcr.io/aksiksi/ncdmv:latest

Docker Compose

services:
  ncdmv:
    image: ghcr.io/aksiksi/ncdmv:latest
    volumes:
      - /var/volumes/ncdmv:/config
    environment:
      NCDMV_APPT_TYPE: permit
      NCDMV_LOCATIONS: cary,durham-east
      NCDMV_DISCORD_WEBHOOK: "https://..." # optional
      NCDMV_TIMEOUT: 5m # optional
      NCDMV_INTERVAL: 5m # optional
      NCDMV_NOTIFY_UNAVAILABLE: true # optional
      NCDMV_DISABLE_GPU: false # optional

Appendix

If you are new to Go

  1. Install: https://go.dev/doc/install
  2. go mod tidy
  3. go run ./cmd/ncdmv-migrate
  4. Run!

Setup (Debian)

  1. Install Google Chrome: https://www.if-not-true-then-false.com/2021/install-google-chrome-on-debian/. Quick summary:
sudo su -

cat  /etc/apt/sources.list.d/google-chrome.list
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
EOF

wget -O- https://dl.google.com/linux/linux_signing_key.pub |gpg --dearmor > /etc/apt/trusted.gpg.d/google.gpg

apt update

apt install google-chrome-stable
  1. Run!

Setup (Ubuntu)

  1. Install Google Chrome:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

sudo dpkg -i google-chrome-stable_current_amd64.deb

sudo apt --fix-broken install
  1. Install sqlite
sudo apt install sqlite3