{"id":34768924,"url":"https://github.com/migueldcdev/file-integrity-service","last_synced_at":"2026-05-25T10:33:39.279Z","repository":{"id":322888821,"uuid":"1080619100","full_name":"migueldcdev/file-integrity-service","owner":"migueldcdev","description":"Go-based service that monitors files in directories, calculates their hashes, exposes a REST API and CLI for querying integrity","archived":false,"fork":false,"pushed_at":"2025-11-06T21:14:50.000Z","size":1595,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-06T23:24:07.902Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/migueldcdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-21T16:11:49.000Z","updated_at":"2025-11-06T21:14:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/migueldcdev/file-integrity-service","commit_stats":null,"previous_names":["migueldcdev/file-integrity-service"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/migueldcdev/file-integrity-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/migueldcdev%2Ffile-integrity-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/migueldcdev%2Ffile-integrity-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/migueldcdev%2Ffile-integrity-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/migueldcdev%2Ffile-integrity-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/migueldcdev","download_url":"https://codeload.github.com/migueldcdev/file-integrity-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/migueldcdev%2Ffile-integrity-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33471520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T06:32:55.349Z","status":"ssl_error","status_checked_at":"2026-05-25T06:32:35.322Z","response_time":57,"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":[],"created_at":"2025-12-25T07:53:27.375Z","updated_at":"2026-05-25T10:33:39.264Z","avatar_url":"https://github.com/migueldcdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# File Integrity Service\n\nA Go-based file monitoring and integrity verification project.  \nTracks file changes in specified directories, computes file hashes, stores them in SQLite, and exposes a REST API for querying and updating file integrity.\n\n\n## Project Overview\n\nThis project consists of three main components:\n\n1. **Monitor Service**  \n   - Watches one directory for file changes.  \n   - Logs file creation, modification, and deletion events.\n    \n2. **Deep File Walker \u0026 Hasher**  \n   - Recursively walks the specified directories.  \n   - Computes cryptographic hashes (SHA-256) for each file.  \n   - Saves file path, hash, and timestamps into an SQLite database.\n\n3. **HTTP REST API**  \n   Provides endpoints to:\n   - List all hashed files\n   - Check integrity of a specific file\n   - Update file hashes manually\n\n\n## Folder Structure\n\n```\n\n/cmd/\nservice/   → contains main binary for running the service\n/internal/\nmonitor/   → file monitoring\ndb/        → SQLite database access and queries\napi/       → HTTP API handlers\nhash/      → hashing logic\nservice/   → recursive file hashing\ngo.mod\ngo.sum\n.gitignore\nREADME.md\n````\n\n\n## Key Features\n\n- **Directory Monitoring**: Detects changes in real-time using `fsnotify`.\n- **Integrity Verification**: Computes file hashes and compares them with stored values.\n- **Database Storage**: Stores file metadata and hashes in SQLite for persistence.\n- **REST API**: Query file list, check integrity, update hashes via HTTP requests.\n\n\n## Usage\n\n### Run the Service\n\n```bash\ngo build -o service ./cmd/service\n./service\n````\n\n### REST API Endpoints\n\n| Endpoint            | Method | Description                                                             |\n| ------------------- | ------ | ----------------------------------------------------------------------- |\n| `/hashedfiles`            | GET    | List all tracked files                                                  |\n| `/check-file-integrity?path=\u003cfile\u003e` | GET    | Check integrity of a file                                               |\n| `/update-file-hash`             | POST   | Recompute and update the hash of a specific file (send path in JSON body)|\n\n---\n\n## Database Schema\n\n```sql\nCREATE TABLE hash (\n   id INTEGER PRIMARY KEY AUTOINCREMENT,\n   path TEXT UNIQUE NOT NULL,\n   hash TEXT NOT NULL,\n   size INTEGER NOT NULL,\n   created_at DATETIME NOT NULL,\n   last_checked DATETIME NOT NULL\n)\n```\n\n* `id` hash id.\n* `path` path to the hashed file.\n* `hash` the latest computed value.\n* `size` lenght in bytes.\n* `created_at` hash creation time.\n* `last_checked` last time the file was processed.\n\n\n## Planned Enhancements\n\n* Add a **CLI tool** to interact with the API (scan, status, update commands).\n* Support **recursive directory watching**, including new subdirectories.\n* Add **unit tests** for hashing and database functions.\n* Add **logging and observability** for better debugging and monitoring.\n\n\n## Technologies\n\n* **Language**: Go\n* **Database**: SQLite3\n* **API**: net/http (RESTful)\n* **Concurrency**: Goroutines for monitoring and hash computation\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmigueldcdev%2Ffile-integrity-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmigueldcdev%2Ffile-integrity-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmigueldcdev%2Ffile-integrity-service/lists"}