{"id":21436744,"url":"https://github.com/modfin/idly","last_synced_at":"2026-03-06T01:02:27.608Z","repository":{"id":183990676,"uuid":"669184844","full_name":"modfin/idly","owner":"modfin","description":"A simple IDS emailing users when a new IP is used for login in","archived":false,"fork":false,"pushed_at":"2025-01-28T17:32:23.000Z","size":114,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-14T16:30:33.781Z","etag":null,"topics":["email","ids","smtp"],"latest_commit_sha":null,"homepage":"","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/modfin.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}},"created_at":"2023-07-21T14:50:09.000Z","updated_at":"2024-10-31T09:53:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"3d580069-1d07-49b2-847c-b6166fbc845b","html_url":"https://github.com/modfin/idly","commit_stats":null,"previous_names":["modfin/idly"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/modfin/idly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modfin%2Fidly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modfin%2Fidly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modfin%2Fidly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modfin%2Fidly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/modfin","download_url":"https://codeload.github.com/modfin/idly/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modfin%2Fidly/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30156850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"ssl_error","status_checked_at":"2026-03-05T22:39:24.771Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["email","ids","smtp"],"created_at":"2024-11-23T00:14:38.248Z","updated_at":"2026-03-06T01:02:27.549Z","avatar_url":"https://github.com/modfin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# idly\nA small service to send IDS type emails\n\nIt is a common practice in industry to have a service report back to a users registered email address when \na login is detected from a new source, eg a new ip address, in order to facilitate instruction detection. Idly is a \nsmall service ment to run in a k8s cluster or similarly to notify users when a new ip is used for login.\n\nSimply put, idly sends emails to user notifying them that their account was used to login to a service.\n\n## Env Config\n* `PRODUCTION` if true, mmailer or smtp will be used to send the email. if false, the email will just be logged to std out\n* `LOGIN_TTL` The TTL for how long a login record will be kept. If an ip does not exist in the records an email will be sent.\ndefault 720h (30 days)\n* `ALERT_ON_INIT` if true, an alert will be sent on the very first login. \n* `HTTP_PORT` port used for HTTP\n* `BADGER_URI` the path to the location of the badger kv store user for storing data. default ./badger \n\n* `IP_API_ENABLE` if true, the idly uses ip-api.com to lookup metadata about the IP address. default true\n* `IP_API_KEY` you can subscribe to ip api and get an api key for higher volumes\n\n* `ALERT_EMAIL_FROM` from who will the service send the email, \n* `ALERT_EMAIL_TITLE` The title of the email as a go template. default `[{{.Service}}]: Your {{.Service}} account has been accessed from a new IP Address`\n* `ALERT_EMAIL_TEMPLATE` The path to a file containing a template for the email.\n* `ALERT_EMAIL_POSTHOOK` HTTP endpoint to be called when alerting instead of sending an email.\n\n* `MMAILER_URL` MMailer API base URL (https://github.com/modfin/mmailer)\n* `MMAILER_KEY` MMailer API key \n\n* `SMTP_SERVER` smtp server address\n* `SMTP_PORT` smtp server port\n* `SMTP_USER` smtp user for auth\n* `SMTP_PASSWORD` smtp user password for auth\n\n\n## Usage\nWhen a login attempt fail or succeeds in you application/service, use the provided client or make a http request to idly\n\n```go \n\nfunc login(email, password string, r http.Request) bool{\n\t\n    ids := idly.NewClient(\"ServiceName\", \"http://idly:8080\").\n        Request(email, r.Header.Get(\"X-Real-IP\")).\n        WithUserAgent(r.Header.Get(\"User-Agent\"))\n\t\n    if email != \"luke@example.com\" || password != \"skywalker\"{\n        ids.Fail()\n        return false\n    }\n\t\n    ids.Success()\n    return true\n}\n\n\n```\n\n\n## Monitoring\n\nhttp://idly:8080/metrics provides prometheus metrics that can be monitored for successfully and failed logins along with \nother metrics. This can be used in conjunction with eg. Grafana to set up alerts on failed logins to raise notice of a \npotential instruction.\n\n## Example k8s config\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: idly\nspec:\n  replicas: 1\n  template:\n    metadata:\n      labels:\n        app: idly-pod\n    spec:\n      volumes:\n        - name: data\n          persistentVolumeClaim:\n            claimName: data-idly\n      containers:\n        - name: idly\n          image: modfin/idly:latest\n          volumeMounts:\n            - mountPath: /badger\n              name: data\n          env:\n            - name: PRODUCTION\n              value: \"true\"\n            - name: ALERT_ON_INIT\n              value: \"true\"\n            - name: ALERT_EMAIL_FROM\n              value: the_from_email@exampl.com\n            - name: BADGER_URI\n              value: /badger\n            - name: SMTP_SERVER\n              value: smtp.example.com\n            - name: SMTP_PORT\n              value: 587\n            - name: SMTP_USER\n              value: the_user@example.com\n            - name: SMTP_PASSWORD\n              value: the_password\n              \n---\nkind: Service\nmetadata:\n  name: idly\nspec:\n  ports:\n    - name: http\n      port: 8080\n      targetPort: 8080\n  selector:\n    app: idly-pod\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodfin%2Fidly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodfin%2Fidly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodfin%2Fidly/lists"}