-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow deleting and updating sites and users from the CLI #344
Comments
|
Ehm, there's no way to do that right now 😅 It probably makes the most sense to expose the "delete site" in settings (currently only enabled for goatcounter.com) with some minor changes rather than adding a new CLI subcommand. |
|
ah, i see the tab, but now i'm a little confused: i thought that, when i created a "site", i created a goatcounter site, not a site being tracked. what happens when i hit that "delete site" tab? It seems to say it deletes the site being tracked but for some reason I was under the impression that ... ie. In general, I get confused between the Can multiple "sites" be tracked by a single "goatcounter site"? Maybe that could desserve a new ticket though... :) |
|
In other words: I have created both It would be real nice to have "CRUD" (create/read/update/delete) on the sites (especially "list and delete" i guess) on the commandline to find those orphan sites... Thanks again, in any case! |
|
The You can send whatever you want from whereever you want; it's all the same to GoatCounter. It doesn't need to know that your site is You can optionally fill in As for the CLI, I thought about that, but I don't really want to make the CLI too complex. On the other hand, if you create a site you can't access (which is what you did) or make a typo, then you can never update or delete it without manual DB frobbing 🤔 Need to think a bit on how to best do this, and also thinking about the future when GoatCounter supports multiple users (which also needs some CLI-fu). The "obvious way" is And we can keep It's a little bit more work, but would also be a lot more future-proof and flexibe 😅 |
|
In the meanwhile, if you want to delete the site you can use: In the SQLite or PostgreSQL CLI and it'll be deleted by the cron job (runs every 12 hours and on server startup/shutdown). |
Hmm... maybe that's good enough and a docs update would suffice. ;) After all, reimplementing SQL on the commandline might not be necessary...
... cron job? I have a cron job? |
Yeah, dunno; wouldn't be in favour of telling people to run manual SQL queries; it's hard for non-technical people, and easy to typo and screw things up.
Yeah, a full SQL-interface might be a bit too much, although it wouldn't be hard to do. Was thinking out loud with the previous CLI interface, but I do like the idea of a generic(-y) CRUD interface, rather than a complex CLI with loads of commands and subcommands. Ideally, the
It's just a |
so that runs magically in the background somewhere (as a coroutine?) or do i need to configure something myself? |
|
Nah, it's magic 🧙♂️ |
…"; expand "goatcounter db" to create API keys; You can now have multiple users for a site, each with their own login. Having permissions and settings per-user isn't implemented yet. Having a single "db" command for all database management is a bit clearer, and also allows expanding to other things such as "goatcounter db create user". This removes the -site=1 option from "goatcounter import", as that was more confusing than anything else. You can now use "goatcounter db create apikey" if you want to make an API key from a script. Ref #2 Fixes #344
…"; expand "goatcounter db" to create API keys; You can now have multiple users for a site, each with their own login. Having permissions and settings per-user isn't implemented yet. Having a single "db" command for all database management is a bit clearer, and also allows expanding to other things such as "goatcounter db create user". This removes the -site=1 option from "goatcounter import", as that was more confusing than anything else. You can now use "goatcounter db create apikey" if you want to make an API key from a script. Ref #2 Fixes #344
since #120, there's now a
createcommand which is great, but there is noremovecommand that I can find. I created a test site in my instance - how do I delete it? :)thanks for this great software!
The text was updated successfully, but these errors were encountered: