### Configure HamClock with environment variables Source: https://context7.com/leftrightthere/hamclock/llms.txt Example deployment with environment variables for setting callsign, location, and radio preferences. These variables configure the EEPROM on first run and persist via volume storage. ```bash podman run --detach --name hamclock \ -p 8080:8080 \ -p 8081:8081 \ -p 8082:8082 \ -e CALLSIGN=W1ABC \ -e LOCATOR=FN42aa \ -e LAT=42.50 \ -e LONG=-71.25 \ -e UTC_OFFSET=-5 \ -e VOACAP_MODE=38 \ -e VOACAP_POWER=100 \ -e USE_METRIC=0 \ -e CALLSIGN_BACKGROUND_COLOR="80,80,80" \ -e CALLSIGN_COLOR="255,255,0" \ -e DXGRID=JN48aa \ -v hamclock-vol:/opt/hamclock/hamuser/.hamclock \ ghcr.io/leftrightthere/hamclock ``` -------------------------------- ### Pull and run HamClock with Podman Source: https://context7.com/leftrightthere/hamclock/llms.txt Basic deployment command to pull the HamClock image from GitHub Container Registry and run it with port mappings. No persistent storage is configured in this example. ```bash podman pull ghcr.io/leftrightthere/hamclock podman run --detach --name hamclock \ -p 8080:8080 \ -p 8081:8081 \ -p 8082:8082 \ ghcr.io/leftrightthere/hamclock ``` -------------------------------- ### Run HamClock with Docker and persistent storage Source: https://context7.com/leftrightthere/hamclock/llms.txt Deployment command using Docker with a named volume for persistent configuration storage. This setup retains user preferences and configuration across container restarts. ```bash docker pull docker.io/leftrightthere/hamclock docker run --detach --name hamclock \ -p 8080:8080 \ -p 8081:8081 \ -p 8082:8082 \ -v hamclock-data:/opt/hamclock/hamuser/.hamclock \ docker.io/leftrightthere/hamclock ``` -------------------------------- ### Podman: Pull Hamclock Container Image Source: https://github.com/leftrightthere/hamclock/blob/main/README.md This command uses Podman to pull the hamclock container image from its registry. Ensure you have Podman installed and configured. ```bash podman pull ghcr.io/leftrightthere/hamclock ``` -------------------------------- ### Docker: Pull Hamclock Container Image Source: https://github.com/leftrightthere/hamclock/blob/main/README.md This command uses Docker to pull the hamclock container image from its registry. Ensure you have Docker installed and configured. ```bash docker pull ghcr.io/leftrightthere/hamclock ``` -------------------------------- ### HamClock Initialization Script (init.sh) Source: https://context7.com/leftrightthere/hamclock/llms.txt A shell script that automatically configures HamClock's EEPROM settings on its first run. It checks for an existing EEPROM file, generates a default one if needed, configures it using environment variables via 'hceeprom.pl', and then restarts HamClock. ```bash #!/bin/sh # Script behavior: # 1. Checks if EEPROM file exists at $HOME/.hamclock/eeprom # 2. If not, starts HamClock to generate default EEPROM # 3. Configures EEPROM using environment variables via hceeprom.pl # 4. Restarts HamClock with skip-setup flag # Environment variable processing EEPROM_PATH=$HOME/.hamclock/eeprom if [ ! -f ${EEPROM_PATH} ]; then # Start HamClock to create initial EEPROM /usr/local/bin/hamclock -0 & while [ ! -f ${EEPROM_PATH} ]; do sleep 1 done # Configure with environment variables let OFFSET=$UTC_OFFSET*3600 perl hceeprom.pl NV_CALLSIGN $CALLSIGN perl hceeprom.pl NV_DE_GRID $LOCATOR perl hceeprom.pl NV_DE_LAT $LAT perl hceeprom.pl NV_DE_LNG $LONG perl hceeprom.pl NV_DE_TZ $OFFSET perl hceeprom.pl NV_BCMODE $VOACAP_MODE perl hceeprom.pl NV_BCPOWER $VOACAP_POWER # Kill initial process to reload configuration pkill hamclock fi # Start HamClock with: # -o: output to stdout instead of log file # -k: skip setup screen /usr/local/bin/hamclock -o -k ``` -------------------------------- ### Complete HamClock environment variables Source: https://context7.com/leftrightthere/hamclock/llms.txt Comprehensive list of environment variables available for configuring station identification, geographic location, propagation settings, radio control, and display preferences. ```bash CALLSIGN=AB1CDE LOCATOR=FN42aa LAT=42.50 LONG=-71.25 UTC_OFFSET=-5 VOACAP_MODE=38 VOACAP_POWER=100 FLRIG_HOST=localhost FLRIG_PORT=12345 USE_FLRIG=0 USE_METRIC=1 CALLSIGN_BACKGROUND_COLOR=80,80,80 CALLSIGN_COLOR=255,255,0 WIFI_SSID=MyNetwork WIFI_PWD=password SHOW_PUB_IP=1 DXGRID=JN48aa ``` -------------------------------- ### Podman: Run Hamclock Container (Env Vars & Storage) Source: https://github.com/leftrightthere/hamclock/blob/main/README.md This command runs the hamclock container using Podman, configuring specific environment variables (UTC_OFFSET, LOCATOR, DXGRID) and utilizing persistent storage. Ports are also mapped. ```bash podman run --detach --name hamclock \ -p 8080:8080 \ -p 8081:8081 \ -p 8082:8082 \ -e UTC_OFFSET=-5 \ -e LOCATOR=AA00aa \ -e DXGRID=JJ00aa \ -v ghcr-hamclock:/opt/hamclock/hamuser/.hamclock \ ghcr.io/leftrightthere/hamclock ``` -------------------------------- ### List Available Environment Variables for Hamclock Container Source: https://github.com/leftrightthere/hamclock/blob/main/README.md This list displays the environment variables that can be configured when running the hamclock container. These variables allow customization of settings such as timezone, callsign, location, and more. ```text # Environmental Variables available UTC_OFFSET CALLSIGN LOCATOR LAT LONG OFFSET VOACAP_MODE VOACAP_POWER FLRIG_HOST FLRIG_PORT USE_FLRIG USE_METRIC CALLSIGN_BACKGROUND_COLOR CALLSIGN_BACKGROUND_RAINBOW CALLSIGN_COLOR WIFI_SSID WIFI_PWD WIFI_PWD SHOW_PUB_IP DXGRID ``` -------------------------------- ### Docker Build Commands for HamClock Image Source: https://context7.com/leftrightthere/hamclock/llms.txt Bash commands to build custom Docker images for HamClock. This includes cloning the repository, building with default or custom resolutions, and running the built image. ```bash # Clone the repository git clone https://github.com/leftrightthere/hamclock.git cd hamclock # Build with default resolution (2400x1440) docker build -f Containerfile -t my-hamclock:latest . # Build with custom resolution (800x480, 1600x960, 2400x1440, or 3200x1920) docker build -f Containerfile \ --build-arg RESOLUTION=1600x960 \ -t my-hamclock:1600x960 . # Run your custom build docker run -d --name hamclock \ -p 8080:8080 -p 8081:8081 -p 8082:8082 \ my-hamclock:latest ``` -------------------------------- ### List Hamclock Image Repositories Source: https://github.com/leftrightthere/hamclock/blob/main/README.md This section lists the available image repositories for hamclock on GitHub Container Registry and Docker Hub. These are the sources from which you can pull the container image. ```text # Weekly builds scheduled to build every Friday morning # GitHub ghcr.io/leftrightthere/hamclock # Docker docker.io/leftrightthere/hamclock ``` -------------------------------- ### Docker: Run Hamclock Container (Env Vars & Storage) Source: https://github.com/leftrightthere/hamclock/blob/main/README.md This command runs the hamclock container using Docker, configuring specific environment variables (UTC_OFFSET, LOCATOR, DXGRID) and utilizing persistent storage. Ports are also mapped. ```bash docker run --detach --name hamclock \ -p 8080:8080 \ -p 8081:8081 \ -p 8082:8082 \ -e UTC_OFFSET=-5 \ -e LOCATOR=AA00aa \ -e DXGRID=JJ00aa \ -v ghcr-hamclock:/opt/hamclock/hamuser/.hamclock \ ghcr.io/leftrightthere/hamclock ``` -------------------------------- ### Kubernetes Command-Line Operations Source: https://context7.com/leftrightthere/hamclock/llms.txt A set of bash commands to manage the HamClock deployment in Kubernetes. These commands cover applying manifests, checking pod status, viewing logs, and forwarding ports. ```bash # Apply the Kubernetes manifest kubectl apply -f hamclock-example.yaml # Check pod status kubectl get pods -l app=hamclock-pod # View logs kubectl logs hamclock-pod # Access services via port forwarding kubectl port-forward hamclock-pod 8080:8080 8081:8081 8082:8082 ``` -------------------------------- ### Podman: Run Hamclock Container (Persistent Storage) Source: https://github.com/leftrightthere/hamclock/blob/main/README.md This command runs the hamclock container using Podman with persistent storage. It maps ports and mounts a volume named 'ghcr-hamclock' to '/opt/hamclock/hamuser/.hamclock' for data persistence. ```bash podman run --detach --name hamclock \ -p 8080:8080 \ -p 8081:8081 \ -p 8082:8082 \ -v ghcr-hamclock:/opt/hamclock/hamuser/.hamclock \ ghcr.io/leftrightthere/hamclock ``` -------------------------------- ### Query system status via REST API Source: https://context7.com/leftrightthere/hamclock/llms.txt Curl command to retrieve system information, status, version, uptime, and current propagation data from the HamClock REST API. ```bash curl http://localhost:8080/get_sys.txt ``` -------------------------------- ### GitHub Actions Workflow for CI/CD Source: https://context7.com/leftrightthere/hamclock/llms.txt A GitHub Actions workflow file (docker-image.yml) that automates the building and pushing of the HamClock Docker image to GitHub Container Registry and Docker Hub. It triggers on pushes to the main branch and weekly schedules. ```yaml # GitHub Actions workflow (.github/workflows/docker-image.yml) # Automatically builds and publishes on: # - Every push to main branch # - Every Friday at 5:00 AM UTC (weekly schedule) name: Build and push HamClock container on: schedule: - cron: '0 5 * * 5' push: branches: [ "main" ] jobs: build: runs-on: ubuntu-latest steps: - name: Build the Docker image run: docker build --file Containerfile --tag ghcr.io/username/hamclock:latest . - name: Push to GitHub Registry run: docker push ghcr.io/username/hamclock:latest - name: Push to Docker Hub run: docker push username/hamclock:latest ``` -------------------------------- ### Docker: Run Hamclock Container (Persistent Storage) Source: https://github.com/leftrightthere/hamclock/blob/main/README.md This command runs the hamclock container using Docker with persistent storage. It maps ports and mounts a volume named 'ghcr-hamclock' to '/opt/hamclock/hamuser/.hamclock' for data persistence. ```bash docker run --detach --name hamclock \ -p 8080:8080 \ -p 8081:8081 \ -p 8082:8082 \ -v ghcr-hamclock:/opt/hamclock/hamuser/.hamclock \ ghcr.io/leftrightthere/hamclock ``` -------------------------------- ### Kubernetes Deployment Manifest for HamClock Source: https://context7.com/leftrightthere/hamclock/llms.txt This YAML manifest defines a Kubernetes Pod and a PersistentVolumeClaim for deploying the HamClock application. It configures environment variables, ports, resources, and liveness probes for the HamClock pod. ```yaml apiVersion: v1 kind: Pod metadata: labels: app: hamclock-pod name: hamclock-pod spec: containers: - image: ghcr.io/leftrightthere/hamclock:latest name: hamclock env: - name: CALLSIGN value: W1ABC - name: LOCATOR value: FN42aa - name: LAT value: "42.50" - name: LONG value: "-71.25" - name: UTC_OFFSET value: "-5" - name: VOACAP_MODE value: "38" - name: VOACAP_POWER value: "100" ports: - containerPort: 8080 hostPort: 8080 - containerPort: 8081 hostPort: 8081 - containerPort: 8082 hostPort: 8082 resources: limits: memory: "128Mi" cpu: "500m" requests: memory: "64Mi" cpu: "250m" livenessProbe: httpGet: path: /get_sys.txt port: 8080 initialDelaySeconds: 120 periodSeconds: 30 timeoutSeconds: 10 failureThreshold: 3 volumeMounts: - mountPath: /opt/hamclock/hamuser/.hamclock name: hamclock-pvc volumes: - name: hamclock-pvc persistentVolumeClaim: claimName: hamclock-volume --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: hamclock-volume spec: accessModes: - ReadWriteOnce resources: requests: storage: 64Mi ``` -------------------------------- ### Manual EEPROM Configuration within Docker Container Source: https://context7.com/leftrightthere/hamclock/llms.txt Bash commands to manually configure HamClock's EEPROM settings by executing commands inside a running Docker container. This includes accessing the container, modifying specific EEPROM values using 'hceeprom.pl', listing all values, and restarting the service. ```bash # Access running container docker exec -it hamclock sh # Manually configure EEPROM values cd /opt/hamclock/ESPHamClock perl hceeprom.pl NV_CALLSIGN W2XYZ perl hceeprom.pl NV_DE_GRID FN31aa perl hceeprom.pl NV_DE_LAT 41.75 perl hceeprom.pl NV_DE_LNG -73.50 # List all EEPROM values perl hceeprom.pl -l # Restart to apply changes curl http://localhost:8080/restart ``` -------------------------------- ### Podman: Run Hamclock Container (No Persistent Storage) Source: https://github.com/leftrightthere/hamclock/blob/main/README.md This command runs the hamclock container using Podman without persistent storage. It maps ports 8080, 8081, and 8082 from the container to the host machine and detaches the container. ```bash podman run --detach --name hamclock \ -p 8080:8080 \ -p 8081:8081 \ -p 8082:8082 \ ghcr.io/leftrightthere/hamclock ``` -------------------------------- ### Docker: Run Hamclock Container (No Persistent Storage) Source: https://github.com/leftrightthere/hamclock/blob/main/README.md This command runs the hamclock container using Docker without persistent storage. It maps ports 8080, 8081, and 8082 from the container to the host machine and detaches the container. ```bash docker run --detach --name hamclock \ -p 8080:8080 \ -p 8081:8081 \ -p 8082:8082 \ ghcr.io/leftrightthere/hamclock ``` -------------------------------- ### Update callsign via REST API Source: https://context7.com/leftrightthere/hamclock/llms.txt Curl commands to change the callsign and restart the HamClock application to apply the new configuration. Direct API calls persist immediately without requiring a restart. ```bash curl http://localhost:8080/set_newde?call=K2XYZ curl http://localhost:8080/restart ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.