{"id":23080931,"url":"https://github.com/aceberg/watchyourports","last_synced_at":"2025-09-05T01:34:47.220Z","repository":{"id":245716043,"uuid":"814250087","full_name":"aceberg/WatchYourPorts","owner":"aceberg","description":"Open ports inventory for local servers. Exports data to InfluxDB2/Grafana","archived":false,"fork":false,"pushed_at":"2024-11-05T17:05:39.000Z","size":439,"stargazers_count":164,"open_issues_count":2,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-18T07:05:30.860Z","etag":null,"topics":["docker-app","go-app","network-monitoring","network-security","self-hosted","selfhosted"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/aceberg/watchyourports","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aceberg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":["https://boosty.to/aceberg/donate","https://github.com/aceberg#donate"]}},"created_at":"2024-06-12T16:18:29.000Z","updated_at":"2025-05-16T09:46:03.000Z","dependencies_parsed_at":"2024-07-08T23:48:28.057Z","dependency_job_id":"d4d7b9a6-ca67-4bdd-ab4c-8ddce6f21ca9","html_url":"https://github.com/aceberg/WatchYourPorts","commit_stats":null,"previous_names":["aceberg/watchyourports"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/aceberg/WatchYourPorts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aceberg%2FWatchYourPorts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aceberg%2FWatchYourPorts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aceberg%2FWatchYourPorts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aceberg%2FWatchYourPorts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aceberg","download_url":"https://codeload.github.com/aceberg/WatchYourPorts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aceberg%2FWatchYourPorts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273699680,"owners_count":25152282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["docker-app","go-app","network-monitoring","network-security","self-hosted","selfhosted"],"created_at":"2024-12-16T13:28:17.978Z","updated_at":"2025-09-05T01:34:42.203Z","avatar_url":"https://github.com/aceberg.png","language":"Go","funding_links":["https://boosty.to/aceberg/donate","https://github.com/aceberg#donate"],"categories":[],"sub_categories":[],"readme":"[![Main-Docker](https://github.com/aceberg/watchyourports/actions/workflows/main-docker.yml/badge.svg)](https://github.com/aceberg/watchyourports/actions/workflows/main-docker.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/aceberg/watchyourports)](https://goreportcard.com/report/github.com/aceberg/watchyourports)\n[![Maintainability](https://api.codeclimate.com/v1/badges/e8f67994120fc7936aeb/maintainability)](https://codeclimate.com/github/aceberg/WatchYourPorts/maintainability)\n![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/aceberg/watchyourports)\n\n\u003ch1\u003e\u003ca href=\"https://github.com/aceberg/watchyourports\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/aceberg/watchyourports/main/assets/logo.png\" width=\"35\" /\u003e\n\u003c/a\u003eWatchYourPorts\u003c/h1\u003e\n\nOpen ports inventory for local servers. Exports data to InfluxDB2/Grafana \n\n- [Quick start](https://github.com/aceberg/watchyourports#quick-start)\n- [Login](https://github.com/aceberg/watchyourports#login)\n- [Import ports from Docker](https://github.com/aceberg/watchyourports#import-ports-from-docker)\n- [Config](https://github.com/aceberg/watchyourports#config)\n- [Options](https://github.com/aceberg/watchyourports#options)\n- [Local network only](https://github.com/aceberg/watchyourports#local-network-only)\n- [API](https://github.com/aceberg/watchyourports#api)\n- [Thanks](https://github.com/aceberg/watchyourports#thanks)\n\n\n![Screenshot](https://raw.githubusercontent.com/aceberg/WatchYourPorts/main/assets/Screenshot1.png)   \n\u003cdetails\u003e\n  \u003csummary\u003eMore screenshots\u003c/summary\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/aceberg/WatchYourPorts/main/assets/Screenshot2.png\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/aceberg/WatchYourPorts/main/assets/Screenshot3.png\"\u003e\n\u003c/details\u003e \n\n## Quick start\n\n```sh\ndocker run --name wyp \\\n-e \"TZ=Asia/Novosibirsk\" \\\n-v ~/.dockerdata/WatchYourPorts:/data/WatchYourPorts \\\n-p 8853:8853 \\\naceberg/watchyourports\n```\nOr use [docker-compose.yml](docker-compose.yml)\n\n\n## Auth\nYou can limit access to WYP with [ForAuth](https://github.com/aceberg/ForAuth). Here is an example: [docker-compose-auth.yml](docker-compose-auth.yml)   \nAlso, SSO tools like Authelia should work.\n\n## Import ports from Docker\n1. Run [docker-export.sh](configs/docker-export.sh) on a server, where Docker is installed. `$ADDR` is IP or domain name of the server, without `http(s)://` prefix. It will be used to ping ports.\n```sh\n./docker-export.sh $ADDR\n```   \n2. Paste the output to `hosts.yaml` file in WatchYourPorts config dir\n3. You can add as many servers to `hosts.yaml`, as you want\n\n\n## Config\n\n\nConfiguration can be done through `config.yaml` file or GUI, or environment variables\n\n| Variable  | Description | Default |\n| --------  | ----------- | ------- |\n| HOST | Listen address | 0.0.0.0 |\n| PORT   | Port for web GUI | 8853 |\n| THEME | Any theme name from https://bootswatch.com in lowcase or [additional](https://github.com/aceberg/aceberg-bootswatch-fork) | grass |\n| COLOR | Background color: light or dark | dark |\n| TIMEOUT | How often watched ports are scanned (minutes) | 10 |\n| HIST_TRIM | How many port states are saved in memory and displayed | 90 |\n| TZ | Set your timezone for correct time | \"\" |\n\n### InfluxDB2 config\nThis config matches Grafana's config for InfluxDB data source\n\n| Variable  | Description | Default | Example |\n| --------  | ----------- | ------- | ------- |\n| INFLUX_ENABLE | Enable export to InfluxDB2 | false | true |\n| INFLUX_SKIP_TLS | Skip TLS Verify | false | true |\n| INFLUX_ADDR | Address:port of InfluxDB2 server | | https://192.168.2.3:8086/ |\n| INFLUX_BUCKET | InfluxDB2 bucket | | test |\n| INFLUX_ORG | InfluxDB2 org | | home |\n| INFLUX_TOKEN | Secret token, generated by InfluxDB2 | | |\n\n## Options\n\n| Key  | Description | Default | \n| --------  | ----------- | ------- | \n| -d | Path to config dir | /data/WatchYourPorts | \n| -n | Path to local JS and Themes ([node-bootstrap](https://github.com/aceberg/my-dockerfiles/tree/main/node-bootstrap)) | \"\" | \n\n## Local network only\nBy default, this app pulls themes, icons and fonts from the internet. But, in some cases, it may be useful to have an independent from global network setup. I created a separate [image](https://github.com/aceberg/my-dockerfiles/tree/main/node-bootstrap) with all necessary modules and fonts.    \n```sh\ndocker run --name node-bootstrap       \\\n    -v ~/.dockerdata/icons:/app/icons  \\ # For local images\n    -p 8850:8850                       \\\n    aceberg/node-bootstrap\n```\n```sh\ndocker run --name wyp \\\n    -v ~/.dockerdata/WatchYourPorts:/data/WatchYourPorts \\\n    -p 8853:8853 \\\n    aceberg/watchyourports -n \"http://$YOUR_IP:8850\"\n```\nOr use [docker-compose](docker-compose-local.yml)\n\n## API\n```http\nGET /api/all\n```\nReturns all data about saved addresses in `json`.\n\u003cdetails\u003e\n  \u003csummary\u003eResponse example\u003c/summary\u003e\n  \n```json\n{\n    \"192.168.2.2\": {\n        \"Name\": \"SomeAddrName\",\n        \"Addr\": \"192.168.2.2\",\n        \"PortMap\": {},  // All saved ports will be here\n        \"Total\": 0,\n        \"Watching\": 0,\n        \"Online\": 0,\n        \"Offline\": 0\n    },\n}\n```\n\u003c/details\u003e\u003cbr\u003e   \n\n```http\nGET /api/history\n```\nAll history data from memory.\n\u003cdetails\u003e\n  \u003csummary\u003eResponse example\u003c/summary\u003e\n  \n```json\n{\n\"192.168.2.3:8849\": {\n        \"Name\": \"OS\",\n        \"Addr\": \"192.168.2.3\",\n        \"Port\": 8849,\n        \"PortName\": \"MiniBoard\",\n        \"State\": [\n            {\n                \"Date\": \"2024-06-28 22:42:45\",\n                \"State\": true\n            },\n            {\n                \"Date\": \"2024-06-28 22:52:45\",\n                \"State\": true\n            }\n        ],\n        \"NowState\": true\n    },\n}\n```\n\u003c/details\u003e\u003cbr\u003e \n\n```http\nGET /api/port/:addr\n```\nReturns current PortMap for `addr`.    \n\u003cdetails\u003e\n  \u003csummary\u003eRequest example\u003c/summary\u003e\n\n```bash\ncurl http://0.0.0.0:8853/api/port/192.168.2.2\n```\n\u003c/details\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eResponse example\u003c/summary\u003e\n  \n```json\n{\n    \"8850\": {\n        \"Name\": \"node-bootstrap\",\n        \"Port\": 8850,\n        \"State\": true,\n        \"Watch\": true\n    },\n    \"8851\": {\n        \"Name\": \"Exercise Diary\",\n        \"Port\": 8851,\n        \"State\": true,\n        \"Watch\": true\n    },\n\n}\n```\n\u003c/details\u003e\u003cbr\u003e  \n\n```http\nGET /api/port/:addr/:port\n```\nGets state of one port\n\u003cdetails\u003e\n  \u003csummary\u003eRequest example\u003c/summary\u003e\n\n```bash\ncurl http://0.0.0.0:8853/api/port/192.168.2.2/8844\n```\n\u003c/details\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eResponse example\u003c/summary\u003e\n  \n```json\n{\n    \"Name\": \"git-syr\",\n    \"Port\": 8844,\n    \"State\": true,\n    \"Watch\": true\n}\n```\n\u003c/details\u003e\u003cbr\u003e  \n\n## Thanks\n- All go packages listed in [dependencies](https://github.com/aceberg/watchyourports/network/dependencies)\n- [Bootstrap](https://getbootstrap.com/)\n- Themes: [Free themes for Bootstrap](https://bootswatch.com)\n- Favicon and logo: [Flaticon](https://www.flaticon.com/icons/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faceberg%2Fwatchyourports","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faceberg%2Fwatchyourports","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faceberg%2Fwatchyourports/lists"}