{"id":15714338,"url":"https://github.com/foiovituh/hash-watcher","last_synced_at":"2026-05-15T21:09:09.074Z","repository":{"id":247495989,"uuid":"826004400","full_name":"foiovituh/hash-watcher","owner":"foiovituh","description":"Monitors, detects, and notifies changes in files (using SHA-256)  🔍","archived":false,"fork":false,"pushed_at":"2024-07-10T00:54:15.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T22:36:46.530Z","etag":null,"topics":["file-change-detection","file-changes","file-monitoring","go","hash","hash-watcher","io","sha256","slack","slack-channels","slack-notifications"],"latest_commit_sha":null,"homepage":"","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/foiovituh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-08T23:39:57.000Z","updated_at":"2024-07-10T00:54:19.000Z","dependencies_parsed_at":"2024-10-24T11:58:26.641Z","dependency_job_id":"ba3ca547-6c7f-4de7-a72f-aded287a0618","html_url":"https://github.com/foiovituh/hash-watcher","commit_stats":null,"previous_names":["foiovituh/hash-watcher"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foiovituh%2Fhash-watcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foiovituh%2Fhash-watcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foiovituh%2Fhash-watcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foiovituh%2Fhash-watcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foiovituh","download_url":"https://codeload.github.com/foiovituh/hash-watcher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246372502,"owners_count":20766625,"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","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":["file-change-detection","file-changes","file-monitoring","go","hash","hash-watcher","io","sha256","slack","slack-channels","slack-notifications"],"created_at":"2024-10-03T21:36:14.006Z","updated_at":"2026-05-15T21:09:04.054Z","avatar_url":"https://github.com/foiovituh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HashWatcher 🔍\n![GitHub License](https://img.shields.io/github/license/foiovituh/hash-watcher)\n\n![banner](https://github.com/foiovituh/hash-watcher/assets/68431603/466efc10-64cf-4ac7-84ca-02c9af63770b)\n\nMonitors, detects, and notifies changes in files (using SHA-256)\n\nScenarios where HashWatcher can be useful:\n- Security Monitoring: Detect unauthorized changes to critical system or configuration files.\n- Configuration Management: Track changes in configuration files to ensure they are intentional and documented.\n- Software Development: Monitor source code or project files for unexpected modifications\n\n## Summary 📝\n- [HashWatcher 🔍](#hashwatcher-)\n  - [Summary 📝](#summary-)\n  - [How does it work? 💡](#how-does-it-work-)\n  - [Requirements 🔗](#requirements-)\n  - [Quick usage guide 📚](#quick-usage-guide-)\n      - [Build:](#build)\n      - [Configuring targets:](#configuring-targets)\n      - [Usage example:](#usage-example)\n  - [Slack app 💬](#slack-app-)\n      - [Main steps:](#main-steps)\n  - [Future plans 📌](#future-plans-)\n  - [Do you want help me? 👥](#do-you-want-help-me-)\n  - [License 🏳️](#license-️)\n\n## How does it work? 💡\nSHA-256 is a hash function that works like a fingerprint for files. It converts any text into a 256-bit code. So if anything in the file changes, even a single character, the hash generated will be different. This is very useful (among other things) for checking whether a file has been modified by comparing the current hash with a previous one.\n\n## Requirements 🔗\n\u003cb\u003eSupported OS\u003c/b\u003e:\n- Linux\n- Windows\n- macOS (née OS X, aka Darwin)\n- OpenBSD\n- DragonFly BSD\n- FreeBSD\n- NetBSD\n- Solaris\n\n\u003cb\u003eTo build\u003c/b\u003e:\n- Go compiler\n\n## Quick usage guide 📚\n#### Build:\n```\ngo build -o hash-watcher cmd/main.go\n```\n\n\u003cbr\u003e\n\n\u003e \u003cb\u003eNOTE\u003c/b\u003e: Generate in the root directory of the project\n\n---\n\n#### Configuring targets:\nCurrently, you must create a JSON configuration file for each directory you wish to monitor. Put the file in a non-intrusive directory and name it as you wish. The JSON must follow the structure below:\n```json\n{\n  \"directoryPath\": \"/full/path/to/directory/\",\n  \"fileNames\": [],\n  \"checkFrequencyInSeconds\": 60\n}\n\n```\n\nIf you prefer not to monitor all files, you can filter specific files to include in the monitoring process:\n```json\n\"fileNames\": [\n  \"file-1.txt\",\n  \"file-2.txt\"\n],\n```\n\nOptionally, you can also send notifications to Slack channels using an app. Endpoint refers to the identifier of the channel where the app is located. Token refers to the \"Bot User OAuth Token\" for your Workspace. To achieve this, configure the JSON as follows:\n```json\n{\n  \"directoryPath\": \"/full/path/to/directory/\",\n  \"fileNames\": [\n    \"file-1.txt\",\n    \"file-2.txt\"\n  ],\n  \"checkFrequencyInSeconds\": 60,\n  \"notification\": {\n    \"endpoint\": \"CXXXXXXXXXX\",\n    \"token\": \"xoxb-11111111111-2222222222222-abcdefghijklmnopqrstuvwx\"\n  }\n}\n\n```\n\n---\n\n#### Usage example:\n```\n./hash-watcher /full/path/to/configuration/file/settings.json\n```\n\nThe  `file-1.txt` was initially empty. Upon adding the letter 'X', the change was detected (after 60 seconds), and the hash comparison triggered a notification:\n\n```\n2024/07/09 11:44:43 =\u003e Watching...\n2024/07/09 11:45:43 =\u003e file-1.txt was modified!\n  - Before: e6de32585e70330a8de848b7b7859911e1e108e00dd6527391533853dd7c9409\n  - Now: ea6fcfe57703205da4d1b74ec99a8c67f721b2ab2e9c31d2222da066606d5d44\n```\n\n## Slack app 💬\nQuick guide to create an app using a manifest. For more information, see https://api.slack.com/reference/manifests\n\n#### Main steps:\n1- Go to https://api.slack.com/apps, and click on \"Create New App\".\u003cbr\u003e\n2- Select \"From an app manifest\":\n\n![create_an_app](https://github.com/foiovituh/hash-watcher/assets/68431603/b0c85247-301c-47f4-9fb9-758b6216f228)\n\n3- Choose a workspace:\n\n![pick_a_workspace](https://github.com/foiovituh/hash-watcher/assets/68431603/67156b6a-03d2-496f-8374-39d600942065)\n\n4- Copy the YAML from `hash-watcher/doc/slack/slack_app_manifest.yml` and paste it in:\n\n![enter_app_manifest_bellow](https://github.com/foiovituh/hash-watcher/assets/68431603/7e52d43a-78fe-4764-b1f9-ef65f518c5a0)\n\n5- Check that the settings are correct and proceed:\n\n![review_summary_and_create_your_app](https://github.com/foiovituh/hash-watcher/assets/68431603/d1fbf572-ad09-4d85-a1a1-98919fe2419c)\n\n6- Once the app has been created, go to `Settings -\u003e Basic Information` and set up an icon (e.g. the official one in `hash-watcher/doc/slack/logo.png`):\n\n![display_information](https://github.com/foiovituh/hash-watcher/assets/68431603/f9dd1f85-783c-446b-9898-2a580c790ceb)\n\n7- Go to `Features -\u003e OAuth \u0026 Permissions -\u003e OAuth Tokens for Your Workspace` and copy the token generated when creating:\n\n![oauth_tokens_for_your_workspace](https://github.com/foiovituh/hash-watcher/assets/68431603/dd64df61-746b-400b-8e6d-4b91420cd791)\n\n8- Finally, choose or create a new channel and add the HashWatcher app to the channel: `Channel details -\u003e Integrations -\u003e Add apps`\n\n## Future plans 📌\n- Check sub-directories\n- Create customized schedules\n- Write unit and functional tests\n\n## Do you want help me? 👥\nIf you have any ideas or wish to contribute to the project, contact me on X (\u003ca href=\"https://x.com/ohtoaki\" target=\"_blank\"\u003e@ohtoaki\u003c/a\u003e) or send me a pull request :)\n\n## License 📄\nDistributed under the MIT License. See [`LICENSE`](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoiovituh%2Fhash-watcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoiovituh%2Fhash-watcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoiovituh%2Fhash-watcher/lists"}