{"id":25668481,"url":"https://github.com/borud/simpleton","last_synced_at":"2025-04-23T00:20:33.985Z","repository":{"id":149426781,"uuid":"247482918","full_name":"borud/simpleton","owner":"borud","description":"A very simple UDP-to-database logger.","archived":false,"fork":false,"pushed_at":"2020-09-26T19:34:32.000Z","size":10,"stargazers_count":23,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T20:22:44.430Z","etag":null,"topics":["go","sqlite3","udp"],"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/borud.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":"2020-03-15T14:30:50.000Z","updated_at":"2023-06-17T06:00:44.000Z","dependencies_parsed_at":"2023-09-04T00:01:54.541Z","dependency_job_id":null,"html_url":"https://github.com/borud/simpleton","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borud%2Fsimpleton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borud%2Fsimpleton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borud%2Fsimpleton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borud%2Fsimpleton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borud","download_url":"https://codeload.github.com/borud/simpleton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250344510,"owners_count":21415137,"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":["go","sqlite3","udp"],"created_at":"2025-02-24T10:34:12.307Z","updated_at":"2025-04-23T00:20:33.962Z","avatar_url":"https://github.com/borud.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simpleton\n\nSimpleton is a dead simple UDP to database logging solution that just\naccepts UDP packets and stores them in an SQLite3 database.  Per\ndefault it stores them in `simpleton.db` in the current directory, but\nyou can override this with command line options.\n\nThis isn't terribly useful for anything but really simple testing, but\nyou can expand on it.\n\n## Building\n\nIn order to build simpleton you just run `make` and the binary will\nturn up in the `bin` directory.  Per default it will build for OSX.\n\n    make\n\n## Building for other platforms\n\nTo build for other platforms please edit the `GOOS` and `GOARCH`\nvariables in the `Makefile`.  You can also enter these parameters on\nthe command line when you run `make`, like this.\n\n    GOOS=linux GOARCH=amd64 make\n\t\nYou can find the values for these variables for different platforms in \n[syslist.go](https://github.com/golang/go/blob/master/src/go/build/syslist.go),\nbut the most common values are:\n\n| OS      | GOOS     | GOARCH |\n|---------|----------|--------|\n| OSX     | darwin   | amd64  |\n| Linux   | linux    | amd64  |\n| Windows | windows  | amd64  |\n\nOf course, you can cross compile (eg compile Linux binaries on OSX\nmachines) by just setting the right combination of GOOS and GOARCH,\nthough Windows you might run into trouble.  (I haven't built this for\nWindows).\n  \n## Running \n\nThe binary will turn up in `bin`, so you can run it from the main\ndirectory with:\n\n    bin/simpleton\n\t\nTo list the command line options, you use the `-h` flag:\n\n    bin/simpleton -h\n\t\nHere is an example of running Simpleton with options to make it listen\nto a particular interface (10.1.0.3 in the example) and port (7788)\nand store the database in `/tmp/simpleton.db`:\n\n    bin/simpleton -u 10.1.0.3:7788 -d /tmp/simpleton.db\n\t\n## Poking around the database\n\nIf you want to poke around the resulting database you can install\nSQLite3 on your machine and inspect the database using the `sqlite3`\ncommand.  To open the database in the previous example just run:\n\n    sqlite3 /tmp/simpleton.db\n\t\nType `.schema` to see the very simple database schema.  You can now\nperform SQL statements on the data.\n\nNote: I'm not entirely sure about the concurrency of SQLite3 so I\nwouldn't use the database as an integration point (you never should).\n\nThis is also why the code has a mutex lock around database accesses.\nThe code was taken from a project that has multiple goroutines\naccessing the database.  This program doesn't have that, but I left\nthe mutex locking in just as a reminder.\n\nFor production uses you should use a PostgreSQL database or similar,\nthat is built for concurrency.  But for small experiments and when you\nhave limited concurrency, SQLite3 is a surprisingly capable little\nbeast.\n\n\n## Accessing via HTTP interface\n\nNote that the HTTP interface has **no authentication or security\nmechanisms** so don't use this for anything other than testing.  The\ndefault address of the web interface is:\n\n    http://localhost:8008/\n\nThe web interface is quite simple.  You have two URLs that access\ndata:\n\n    /data\n\t/data/{id}\n\t\nThe first returns a JSON array, the second only returns the payload of\nthe data entry given by ID.  The `/data` path will be limited to just\nthe 20 newest entries in the database, but you can page through the\ndatabase by setting `offset` and `limit` URL parameters:\n\n    /data?offset=10\u0026limit=10\n\t\n\nSimpleton supports having a directory with static files so that you\ncan make some HTML pages with useful links to the content or perhaps\nto host JS-frontend applications.\n\nCheck the command line help to see the parameters you can fiddle with.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborud%2Fsimpleton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborud%2Fsimpleton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborud%2Fsimpleton/lists"}