{"id":23235753,"url":"https://github.com/openrfsense/backend","last_synced_at":"2026-02-02T10:41:34.066Z","repository":{"id":62866775,"uuid":"475023771","full_name":"openrfsense/backend","owner":"openrfsense","description":"OpenRFSense self-hostable server backend","archived":false,"fork":false,"pushed_at":"2024-07-02T08:25:55.000Z","size":707,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-17T03:06:44.412Z","etag":null,"topics":["api","backend","go","golang","nats","nats-server","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openrfsense.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-03-28T13:51:10.000Z","updated_at":"2024-08-24T02:21:24.000Z","dependencies_parsed_at":"2022-11-08T06:47:47.914Z","dependency_job_id":"a276faf7-8f03-4d42-a098-e259bc0f08a1","html_url":"https://github.com/openrfsense/backend","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/openrfsense/backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openrfsense%2Fbackend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openrfsense%2Fbackend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openrfsense%2Fbackend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openrfsense%2Fbackend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openrfsense","download_url":"https://codeload.github.com/openrfsense/backend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openrfsense%2Fbackend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29010560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T10:37:29.253Z","status":"ssl_error","status_checked_at":"2026-02-02T10:37:28.644Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","backend","go","golang","nats","nats-server","rest-api"],"created_at":"2024-12-19T03:29:26.760Z","updated_at":"2026-02-02T10:41:34.050Z","avatar_url":"https://github.com/openrfsense.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenRFSense Backend\nThe backend is responsible for:\n- controlling and querying the sensors remotely via NATS\n- managing encryption keys and TLS certificates for secure communication with the sensors\n- exposing a RESTful API to fetch data and provide an abstraction layer over the sensors control\n\n## Table of contents \u003c!-- omit in toc --\u003e\n- [OpenRFSense Backend](#openrfsense-backend)\n    - [Usage and deployment](#usage-and-deployment)\n    - [Security](#security)\n    - [Configuration](#configuration)\n    - [API](#api)\n    - [Metrics](#metrics)\n\n### Usage and deployment\nDocker has become the industry standard nowadays, so an official Docker image is provided as part of this project. The basic setup requires only the one image, but an external NATS server can be provided (`WIP`, see configuration).\n\nAn external database is required for data storage (measurement campaigns and general sample retrieval). Only PostgreSQL is supported and it's easy enough to deploy (see example below). See also default configuration file for more information on how to configure the database connection.\n\nA reverse proxy is also recommended: something like [Caddy](https://caddyserver.com/) is simple to use and has automatic TLS among other nice features.\n\nDocker Compose can also be used to manage your infrastructure with Caddy. An example `docker-compose.yml` would look like this:\n\u003e Please not that this is just **an example** of configuration for an external project and, as such, not guaranteed to be future-proof or maintained as-is.\n\u003c!-- TODO: add TLS docs for embedded NATS --\u003e\n```yaml\nservices:\n  caddy:\n    image: caddy:2-alpine\n    container_name: caddy\n    restart: always\n    ports:\n      - \"80:80\"\n      - \"443:443\"\n    networks:\n      - proxy\n    volumes:\n      - ./caddy_data:/data\n      - ./caddy_config:/config\n    command: [\"caddy\", \"reverse-proxy\", \"--to\", \"orfs_backend:8081\"]\n\n  postgres:\n    image: postgres:alpine\n    container_name: postgres\n    restart: always\n    ports:\n      - \"5432:5432\"\n    environment:\n      POSTGRES_PASSWORD: postgres\n  \n  openrfsense_backend:\n    image: openrfsense-backend:latest\n    container_name: orfs_backend\n    depends_on:\n      - caddy\n    networks:\n      - db\n      - proxy\n    environment:\n      ORFS_POSTGRES_HOST: postgres\n      ORFS_POSTGRES_USERNAME: postgres\n      ORFS_POSTGRES_PASSWORD: postgres\n      ORFS_POSTGRES_DBNAME: postgres\n\nnetworks:\n  proxy:\n  db:\n```\n\n### Security\nMost of the API endpoints are locked behind [basic HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). It is strongly recommended that the default credentials be changed in the configuration file, under `backend.users`.\n\n### Configuration\n\u003e ⚠️ The configuration is still WIP: keys may change in the future\n\nConfiguration values are loaded from a YAML file first, then from environment variables.\n\n#### YAML\nSee the example [`config.yml`](./config.yml) file for now, as the configuration is very prone to change.\n\n#### Environment variables\nEnvironment variables are defined as follows: `ORFS_SECTION_SUBSECTION_KEY=value`. They are loaded after any other configuration file, so they cam be used to overwrite any configuration value.\n\nFor example, it's recommended to set `nats.token` (the NATS server access token for API calls, see [NATS documentation](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/tokens)) as an envionment variable: `ORFS_NATS_TOKEN=token`.\n\n### API\nThe backend will automatically generate its own [Swagger](https://swagger.io/) documentation and serve a webpage with [Swagger UI](https://swagger.io/tools/swagger-ui/) at `https://$DOMAIN/api/docs`. The common JSON objects are defined as Golang structs in [`openrfsense/common.types`](https://github.com/openrfsense/common).\n\n### Metrics\nMetrics are served at `https://$DOMAIN/metrics` if enabled in the configuration (defined by the value of `backend.metrics`, see default configuration). A simple, dynamic web page is shown by default but the metrics can also be retrieved in JSON format by sending `Accept: application/json` along with the request. For more information, see the [Monitor middleware for Fiber](https://docs.gofiber.io/api/middleware/monitor).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenrfsense%2Fbackend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenrfsense%2Fbackend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenrfsense%2Fbackend/lists"}