{"id":16031898,"url":"https://github.com/dckc/dnsanchor","last_synced_at":"2025-04-05T04:43:07.150Z","repository":{"id":136541001,"uuid":"224939666","full_name":"dckc/dnsanchor","owner":"dckc","description":null,"archived":false,"fork":false,"pushed_at":"2020-10-13T20:00:32.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T20:15:01.546Z","etag":null,"topics":["capabilities","dynamic-dns","javascript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/dckc.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}},"created_at":"2019-11-30T00:36:23.000Z","updated_at":"2020-10-13T20:00:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"63d699a9-3dda-45c0-a31a-e09a202d5f0b","html_url":"https://github.com/dckc/dnsanchor","commit_stats":{"total_commits":41,"total_committers":1,"mean_commits":41.0,"dds":0.0,"last_synced_commit":"0f8432a8aae092d555bedcaf95730d80fef63bab"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dckc%2Fdnsanchor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dckc%2Fdnsanchor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dckc%2Fdnsanchor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dckc%2Fdnsanchor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dckc","download_url":"https://codeload.github.com/dckc/dnsanchor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289394,"owners_count":20914464,"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":["capabilities","dynamic-dns","javascript"],"created_at":"2024-10-08T21:07:01.681Z","updated_at":"2025-04-05T04:43:07.130Z","avatar_url":"https://github.com/dckc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dnsanchor - a Dynamic DNS anchor\n\n**dnsanchor** is a dynamic DNS client for\n[NearlyFreeSpeech.net][nfsn] much like [nfsn-pingbot][], built\nwith JavaScript using object capability ([ocap][])\nsecurity techniques.\n\n_It's *intended* to run on the [xs][] platform, though it's\nlightly tested and depends on an [agoric-specific branch][2]._\n\n[nfsn-pingbot]: https://github.com/joshkunz/nfsn-pingbot\n[nfsn]: https://www.nearlyfreespeech.net/\n[ocap]: https://en.wikipedia.org/wiki/Object-capability_model\n\n## Configuration and node.js Usage\n\nGet an API key for the [NSFN API][3] and make a `config.json` file a\nla:\n\n```json\n{\n  \"login\": \"mememe\",\n  \"API_KEY\": \"super-sekret\",\n  \"domain\": \"my.nfsn.domain.example\",\n  \"host\": \"dyndnshost1\"\n}\n```\n\nThen `npm install` as usual and `npm start` to run it:\n\n```\n$ npm start\n\n\u003e dnsanchor@0.1.0 start /home/connolly/projects/dnsanchor\n\u003e node -r esm index.js\n\n{ action: 'add', name: 'dyndnshost1', type: 'A', data: '1.2.3.4' }\n{ action: 'remove', addrs: [] }\n```\n\nRun it again and it will detect that no changes are needed:\n\n```\nnpm start\n{ action: 'noop', name: 'dyndnshost1', ip: '1.2.3.4',\n  target: [{\n      name: 'dyndnshost1', type: 'A', data: '1.2.3.4',\n      ttl: 3600, scope: 'member'\n    }]}\n```\n\n[3]: https://members.nearlyfreespeech.net/wiki/API/Introduction\n\n## xs: Tiny, Modern JavaScript Runtime (WIP)\n\nThe [Moddable XS SDK][xs] is designed to run JS in microcontrollers. It\nhas good support for JavaScript best practices including object\ncapability discipline and it supports deployment as a single small\nexecutable.\n\n[xs]: https://github.com/Moddable-OpenSource/moddable\n\n### Build from source\n\nThe `x-cli-lin` platform is a custom [ag-linux-cli][2] branch. Only\nlinux is supported (patches welcome!).\n\n[2]: https://github.com/dckc/moddable/tree/ag-linux-cli\n\n```\n$ make\nmcconfig -p x-cli-lin\ncd .../moddable/build/tmp/lin/release/dnsanchor \u0026\u0026 make\nmake[1]: Entering directory '.../moddable/build/tmp/lin/release/dnsanchor'\n# xsc instrumentation.xsb\n# xsc console.xsb\n# xsc dnsanchor.xsb\n...\n# cc dnsanchor\nmake[1]: Leaving directory '.../moddable/build/tmp/lin/release/dnsanchor'\n```\n\n## Integration Test Passed on XS\n\n```\nbootstrap main()...\n@@go...\n@@got compartment...\n@@got exports...\nrun()...\nHello, world!\nAPI key length: 16\nweb.https: api.ipify.org 443\n@@httpsPath https://api.ipify.org:443/ {}\n@@readFile makeRequest {\"host\":\"api.ipify.org\",\"port\":443,\"method\":\"GET\",\"path\":\"/\",\"headers\":{},\"body\":false}\nIP address: 169.147.3.26\nweb.https: api.nearlyfreespeech.net 443\n@@httpsPath https://api.nearlyfreespeech.net:443/ {}\n@@httpsPath https://api.nearlyfreespeech.net:443/dns/madmode.com/listRRs {}\n@@httpsPath https://api.nearlyfreespeech.net:443/dns/madmode.com/listRRs {\"X-NFSN-Authentication\":\"connolly;1602611772;5d41ff08485f3a7c;41e1b412d8f22ee4d0ff39e294b2ede969148196\",\"Content-Type\":\"application/x-www-form-urlencoded\"}\n@@readFile makeRequest {\"host\":\"api.nearlyfreespeech.net\",\"port\":443,\"method\":\"POST\",\"path\":\"/dns/madmode.com/listRRs\",\"headers\":{\"X-NFSN-Authentication\":\"connolly;1602611772;5d41ff08485f3a7c;41e1b412d8f22ee4d0ff39e294b2ede969148196\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"content-length\":\"20\"},\"body\":\"name=capnhook\u0026type=A\"}\n@@sendRequest cb 1 200 undefined\n@@sendRequest cb 5 [{\"name\":\"capnhook\",\"type\":\"A\",\"data\":\"136.33.249.0\",\"ttl\":3600,\"scope\":\"member\"}] undefined\n{\"action\":\"add\",\"name\":\"capnhook\",\"type\":\"A\",\"data\":\"169.147.3.26\"}\n{\"action\":\"remove\",\"addrs\":[{\"name\":\"capnhook\",\"type\":\"A\",\"data\":\"136.33.249.0\",\"ttl\":3600,\"scope\":\"member\"}]}\nweb.https: api.nearlyfreespeech.net 443\n@@httpsPath https://api.nearlyfreespeech.net:443/ {}\n@@httpsPath https://api.nearlyfreespeech.net:443/dns/madmode.com/addRR {}\n@@httpsPath https://api.nearlyfreespeech.net:443/dns/madmode.com/addRR {\"X-NFSN-Authentication\":\"connolly;1602611773;244010a8649db010;c7351ca9b200df2f7c6190a16df45cdab0ffea7c\",\"Content-Type\":\"application/x-www-form-urlencoded\"}\n@@readFile makeRequest {\"host\":\"api.nearlyfreespeech.net\",\"port\":443,\"method\":\"POST\",\"path\":\"/dns/madmode.com/addRR\",\"headers\":{\"X-NFSN-Authentication\":\"connolly;1602611773;244010a8649db010;c7351ca9b200df2f7c6190a16df45cdab0ffea7c\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"content-length\":\"38\"},\"body\":\"name=capnhook\u0026type=A\u0026data=169.147.3.26\"}\n\nweb.https: api.nearlyfreespeech.net 443\n@@httpsPath https://api.nearlyfreespeech.net:443/ {}\n@@httpsPath https://api.nearlyfreespeech.net:443/dns/madmode.com/removeRR {}\n@@httpsPath https://api.nearlyfreespeech.net:443/dns/madmode.com/removeRR {\"X-NFSN-Authentication\":\"connolly;1602611773;042c46363e2dd3d0;310a2098b2f158752b1b6dd80a9f8515ecb9bc2f\",\"Content-Type\":\"application/x-www-form-urlencoded\"}\n@@readFile makeRequest {\"host\":\"api.nearlyfreespeech.net\",\"port\":443,\"method\":\"POST\",\"path\":\"/dns/madmode.com/removeRR\",\"headers\":{\"X-NFSN-Authentication\":\"connolly;1602611773;042c46363e2dd3d0;310a2098b2f158752b1b6dd80a9f8515ecb9bc2f\",\"Content-Type\":\"application/x-www-form-urlencoded\",\"content-length\":\"38\"},\"body\":\"name=capnhook\u0026type=A\u0026data=136.33.249.0\"}\n@@sendRequest cb 1 200 undefined\n@@sendRequest cb 5  undefined\n@@ran\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdckc%2Fdnsanchor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdckc%2Fdnsanchor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdckc%2Fdnsanchor/lists"}