{"id":22902462,"url":"https://github.com/urethramancer/anthropoi","last_synced_at":"2026-04-13T07:02:07.824Z","repository":{"id":57604239,"uuid":"213747501","full_name":"Urethramancer/anthropoi","owner":"Urethramancer","description":"A simple accounts package and management tool.","archived":false,"fork":false,"pushed_at":"2023-03-06T22:40:31.000Z","size":114,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T04:13:40.730Z","etag":null,"topics":["accounts","database","golang","library","postgres"],"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/Urethramancer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-10-08T20:30:28.000Z","updated_at":"2023-07-20T09:11:05.000Z","dependencies_parsed_at":"2024-06-20T04:18:55.991Z","dependency_job_id":"f4713cf7-8e41-437e-8daa-6aa85985f4ae","html_url":"https://github.com/Urethramancer/anthropoi","commit_stats":{"total_commits":149,"total_committers":2,"mean_commits":74.5,"dds":0.006711409395973145,"last_synced_commit":"551e2c23ac0c7d34364561431272bcb4ba9c0541"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urethramancer%2Fanthropoi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urethramancer%2Fanthropoi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urethramancer%2Fanthropoi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urethramancer%2Fanthropoi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Urethramancer","download_url":"https://codeload.github.com/Urethramancer/anthropoi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246598154,"owners_count":20802974,"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":["accounts","database","golang","library","postgres"],"created_at":"2024-12-14T02:15:48.743Z","updated_at":"2026-04-13T07:02:02.787Z","avatar_url":"https://github.com/Urethramancer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Anthropoi\nA simple accounts package and management tool.\n\n## What is it\nThis package sets up and manages user accounts with multi-site support and per-site groups.\n\n## Requirements\nThis package was made for use with PostgreSQL. CockroachDB probably won't work because of triggers.\n\n## Installing\nRun this command to get the package:\n\n`go get -u github.com/Urethramancer/anthropoi`\n\nAnd run this to compile and install the management command:\n\n`go get -u github.com/Urethramancer/anthropoi/cmd/anthro`\n\n## Using the package\n(See built-in documentation for parameter information.)\n- `New()` creates a DBM structure to use for all further calls.\n- `ConnectionString()` rebuilds and returns a string based on the internally stored parameters.\n- `Connect()` opens the connection to the specified host, or localhost.\n- `DatabaseExists()` checks if there is a database of the specified name.\n- `Create()` creates a new account database with the specified name.\n- `InitDatabase()` sets up a new database with tables and triggers.\n\n`New()` will use reasonable defaults for its connection string:\n- `host`: localhost\n- `port`: 5432\n- `user`: postgres\n- `password`: unused if blank\n- `name`: unused if blank\n- `mode`: enable if set to \"enable\", disable otherwise\n\n## Using the CLI tool\nThe command line tool, `anthro`, can be used to manage users, profiles, groups and permissions, saving you from having to write your own manager.\n\n### init\nRunning `anthro init` will set up the initial database. If you want to drop the current database, supply the `-D` flag. For more advanced features, such as dumping a backup of the database, use the `pgsql` command from the relevant PostgreSQL package.\n\n### user\nThe `user`command has subcommands for user account management. A user account has just the bare minimum details about a user, such as a display username, primary e-mail, login password, name and special data for some sites. There are two JSON fields, data and tokens, available to use for whatever you need. Methods to make use of them aren't currently implemented, but using PostgreSQL's JSON lookup is fairly straightforward.\n\n#### user add\nThe `user add` subcommand takes a username at minimum. A password and salt will be generated and stored, and the password will be displayed in the terminal. Write it down or lose it!\n\nOptional arguments are e-mail, first and last name and a cost, which is the complexity to use for hashing the password. The current minimum amount is 10, which gives a decent amount for testing. 11+ is recommended for production use, especially on very fast server hardware. The time roughly doubles for each increase by 1.\n\n#### user remove\nThe `user remove` (or `user rm`) subcommand removes a user by ID or name.\n\n#### user edit\nLine by line editing of user fields, except password.\n\n#### user list\nThis lists all users. More flags to filter on will be added in the near future.\n\n### profile\nThe `profile` command has subcommands for per-site profiles. Profiles are useful when you want one system to handle many domains with different profiles, containing different access rights, but which should share common logins. This is useful for blogging systems where different subdomains are used for different subjects, or to create a domain admin system for e-mail, for example.\n\n#### profile add\nThe `profile add` subcommand adds a profile to a user. Permissions and groups are handled separately.\n\n#### profile remove\nRemoves a profile, effectively removing access to a domain for a user.\n\n#### profile setgroups\nThis manages groups for a profile, i.e. per-site permissions. Access rights are handled via groups, while profiles can contain collections of groups.\n\n#### profile copy\nThis allows you to copy the non-personal parts of a profile from one user to another to quickly set permissions.\n\n#### profile list\nLists profiles in the database, with optional filtering by site and by user.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furethramancer%2Fanthropoi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furethramancer%2Fanthropoi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furethramancer%2Fanthropoi/lists"}