No description
Find a file
Graham McIntire b4206b63d1
Increase GPS drift threshold from 15m to 50m
Fixed issue where stationary stations like K5SGD-D were showing multiple
positions due to minor GPS accuracy variations. The previous 15-meter
threshold was too strict for typical GPS drift which can vary 5-30 meters.

- Increased default threshold in GeoUtils from 10m to 50m
- Updated packet processor to use 50m threshold for movement detection
- Verified with K5SGD-D showing ~24m variations that are now ignored

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-21 11:23:37 -05:00
.cursor/rules test coverage 2025-06-22 20:38:25 -05:00
.github/workflows Fix GitHub Action gleam setup error 2025-07-21 08:34:10 -05:00
.kiro/steering Add comprehensive input sanitization for coordinate parsing 2025-07-14 10:20:10 -05:00
assets vendor all js 2025-07-21 11:09:14 -05:00
config vendor all js 2025-07-21 11:09:14 -05:00
k8s refactor to use external parser 2025-06-24 14:22:09 -05:00
lib Increase GPS drift threshold from 15m to 50m 2025-07-21 11:23:37 -05:00
priv Fix timer cancellation in PacketConsumer and simplify migration 2025-07-21 08:48:57 -05:00
rel Optimize memory usage thresholds and VM garbage collection settings 2025-07-19 15:21:42 -05:00
src/aprsme Add Gleam language integration to Elixir project 2025-07-18 13:58:21 -05:00
test Optimize test suite performance - 32.5% faster execution 2025-07-21 09:23:07 -05:00
vendor vendor update 2025-07-18 08:39:43 -05:00
.credo.exs auto style things 2023-12-17 12:11:57 -06:00
.dialyzer_ignore.exs performance improvements 2025-07-08 10:03:52 -05:00
.dockerignore regenerate release 2025-01-27 14:13:18 -06:00
.formatter.exs clean up warnings 2025-07-16 08:55:46 -05:00
.gitignore vendor all js 2025-07-21 11:09:14 -05:00
.gitmodules change aprs lib to https link 2025-07-11 14:32:56 -05:00
.tool-versions minor updates for gleam 2025-07-20 18:08:28 -05:00
CLAUDE.md minor updates for gleam 2025-07-20 18:08:28 -05:00
Dockerfile vendor all js 2025-07-21 11:09:14 -05:00
Dockerfile.distroless Fix Docker deployment with Gleam integration 2025-07-18 14:06:36 -05:00
fly.toml fly things 2025-06-13 15:10:29 -05:00
gleam.toml Add Gleam language integration to Elixir project 2025-07-18 13:58:21 -05:00
GLEAM_INTEGRATION.md Add Gleam language integration to Elixir project 2025-07-18 13:58:21 -05:00
horusec-config.json add horusec to ci 2025-06-15 17:19:26 -05:00
LICENSE Initial commit 2023-01-26 13:19:38 -06:00
manifest.toml Add Gleam language integration to Elixir project 2025-07-18 13:58:21 -05:00
mix.exs vendor all js 2025-07-21 11:09:14 -05:00
mix.lock Add Gleam language integration to Elixir project 2025-07-18 13:58:21 -05:00
README.md minor updates for gleam 2025-07-20 18:08:28 -05:00
security-policy.json docker security 2025-06-15 11:06:24 -05:00
test-docker-build.sh Fix Docker deployment with Gleam integration 2025-07-18 14:06:36 -05:00
tsconfig.json typescript 2025-06-18 12:26:13 -05:00

Aprs

Prerequisites

Before setting up the project, ensure you have the following installed:

Setup

To start your Phoenix server:

  • First install the mix_gleam archive:
    mix archive.install hex mix_gleam --force
    
  • Run the complete setup:
    mix setup
    
  • Start Phoenix endpoint with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

Learn more

Kubernetes (K3s) Deployment

This application can be automatically deployed to a K3s Kubernetes cluster using GitHub Actions.

Prerequisites

  1. K3s Cluster: You need a running K3s cluster.
  2. kubectl access: Ensure you have kubectl configured to interact with your K3s cluster.
  3. Container Registry: This setup uses GitHub Container Registry (GHCR) to store the application's Docker image.

Initial Setup

1. GitHub Actions Secrets

The GitHub Actions workflow requires the following secret to be configured in your repository's settings (Settings -> Secrets and variables -> Actions -> Repository secrets):

  • KUBE_CONFIG_DATA: The base64 encoded content of your K3s kubeconfig file. This file grants GitHub Actions permission to deploy to your cluster.
    • To get this value, you can typically run:
      cat ~/.kube/config | base64 -w 0
      
      (If you're on macOS, you might need cat ~/.kube/config | base64). Or, directly from the K3s server node:
      sudo cat /etc/rancher/k3s/k3s.yaml | base64 -w 0
      
    • Ensure the user in this kubeconfig has sufficient permissions in your K3s cluster to create namespaces, deployments, services, PVCs, and secrets in the target namespace (aprs-app).

2. Kubernetes Secrets for the Application

The application requires secrets for database connection, Phoenix secret key base, etc. These are managed by a Kubernetes Secret object named aprs-secrets in the aprs-app namespace.

  1. Copy the example secrets file:

    cp k8s/secrets.yaml.example k8s/secrets.yaml
    
  2. Edit k8s/secrets.yaml: Open k8s/secrets.yaml and replace the placeholder values with your actual credentials and configuration:

    • POSTGRES_USER: Your desired PostgreSQL username.
    • POSTGRES_PASSWORD: Your desired PostgreSQL password.
    • SECRET_KEY_BASE: A strong secret key for Phoenix. You can generate one using mix phx.gen.secret.
    • APRS_CALLSIGN, APRS_PASSCODE: Your APRS credentials, if applicable.
    • PHX_HOST: The domain name or IP where your application will be accessible.
  3. Apply the secrets to your K3s cluster: Make sure you are targeting your K3s cluster with kubectl.

    kubectl apply -f k8s/namespace.yaml # Ensure namespace exists
    kubectl apply -f k8s/secrets.yaml -n aprs-app
    

    Important: k8s/secrets.yaml is included in .gitignore and should not be committed to the repository with your actual secrets.

GitHub Actions CI/CD Workflow

The workflow is defined in .github/workflows/deploy-k3s.yaml. It will:

  1. Trigger on pushes to the main branch.
  2. Build the application's Docker image using the provided Dockerfile.
  3. Push the image to GitHub Container Registry (GHCR), tagged with the Git SHA and latest. The image will be named ghcr.io/<YOUR_GITHUB_USERNAME_OR_ORG>/<YOUR_REPO_NAME>.
  4. Deploy the application and its PostgreSQL database to the K3s cluster using the manifests in the k8s/ directory.
    • It automatically updates k8s/app-deployment.yaml to use the newly built image tag.

Application Configuration Notes

  • Database Migrations: The Kubernetes deployment for the application includes an init container that automatically runs database migrations (/app/bin/migrate) before the main application container starts.
  • Health Check Endpoint: The application deployment (k8s/app-deployment.yaml) is configured with readiness and liveness probes that expect a health check endpoint at /health (returning HTTP 200). You may need to add this to your Phoenix application's router and controller:
    • In lib/aprsme_web/router.ex:
      scope "/", AprsmeWeb do
        pipe_through :browser
        # ... other routes
        get "/health", PageController, :health
      end
      
    • In lib/aprsme_web/controllers/page_controller.ex (or another suitable controller):
      def health(conn, _params) do
        # You can add more sophisticated checks here if needed
        json(conn, %{status: "ok", version: Application.spec(:aprsme, :vsn)})
      end
      
  • Image Name: The application deployment manifest (k8s/app-deployment.yaml) uses a placeholder image name your-ghcr-username/aprs-app:latest. The CI/CD pipeline automatically replaces this with the correct image name from GHCR (e.g., ghcr.io/your-github-owner/your-repo-name:<git-sha>).

Accessing the Application

The application service (k8s/app-service.yaml) is configured with type: NodePort.

  1. Find the NodePort assigned by Kubernetes:
    kubectl get svc aprs-app-service -n aprs-app -o=jsonpath='{.spec.ports[0].nodePort}'
    
  2. Access your application at http://<your-k3s-node-ip>:<nodePort>.

If your K3s cluster is configured with an external load balancer and Ingress, you might want to change the service type to ClusterIP and create an Ingress resource for more sophisticated routing and SSL termination.