diff --git a/.gitignore b/.gitignore index 4208719..4cacd56 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,6 @@ data/ *.log .DS_Store syncpi.sh + +# Docker +/data diff --git a/README.md b/README.md index aec74bc..ae3d2d4 100644 --- a/README.md +++ b/README.md @@ -320,17 +320,34 @@ This script will: The script will prompt you for each optional removal step. -## Docker +## Docker Compose -You can now run PyMC Repeater from within a [Docker Container](https://www.docker.com/). Checkout the example [Docker Compose](./docker-compose.yml) file before you get started. +You can now run pyMC Repeater from within a [Docker Container](https://www.docker.com/). Checkout the example [Docker Compose](./docker-compose.yml) file before you get started. It will need some configuration changes based on what hardware you're using (USB vs SPI). Look at the commented out lines to see which hardware requires what lines and only enable what you need. + +Here is what you'll need to do in order to get the container running: + +1. Copy the `config.yaml.example` to `config.yaml` + +```bash +cp ./config.yaml.example ./config.yaml +``` + +2. Run the configuration script and follow the prompts. + +```bash +sudo bash ./setup-radio-config.sh +``` + +3. Modify the `config.yaml` file with a unique web UI password. This allows you to bypass the `/setup` page when logging for the first time. You can find the value under `repeater.security.admin_password`. Change to _anything_ besides the default of `admin123`. + +4. Configure the [docker compose](./docker-compose.yml) to your specific hardware and file paths. Be sure to comment-out or delete lines that aren't required for your hardware. Please note that your hardware devices might be at a different path than those listed in the docker compose file. + +5. Build and start the container. ```bash docker compose up -d --force-recreate --build ``` -Just note that you will have to pass in a `config.yaml` into the container. You can create a new config by following the instructions in the [Configuration section](#configuration). - - ## Roadmap / Planned Features - [ ] **Public Map Integration** - Submit repeater location and details to public map for discovery diff --git a/docker-compose.yml b/docker-compose.yml index f65a1de..1048993 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,10 +6,17 @@ services: ports: - 8000:8000 devices: + # SPI DEVICES (Your path may differ) - /dev/spidev0.0 - /dev/gpiochip0 + # USB DEVICES (Your path may differ) + - /dev/bus/usb/002:/dev/bus/usb/002 + # SPI DEVICES PERMISSIONS cap_add: - SYS_RAWIO + # USB DEVICSE PERMISSIONS + group_add: + - plugdev volumes: - ./config.yaml:/etc/pymc_repeater/config.yaml - ./data:/var/lib/pymc_repeater diff --git a/dockerfile b/dockerfile index 8d3689f..2dfee91 100644 --- a/dockerfile +++ b/dockerfile @@ -12,6 +12,7 @@ RUN apt-get update && apt-get install -y \ python3-rrdtool \ jq \ wget \ + libusb-1.0-0 \ swig \ git \ build-essential \ @@ -26,6 +27,8 @@ WORKDIR ${INSTALL_DIR} # Copy source COPY repeater ./repeater COPY pyproject.toml . +COPY radio-presets.json . +COPY radio-settings.json . # Install package RUN pip install --no-cache-dir .