privatebin
privatebin copied to clipboard
Config exmaple or generate config?
There is no config generated for the CLI, and I cannot find an example config in this repo.
I need to specify a URL for the default privatebin instance to use.
What is the recommended course of action here?
By default using a premade binary result sin:
Error: cannot load configuration: cannot open file: open /home/douglas/.config/privatebin/config.json: no such file or directory
However, adding an emoty cofnig file with an empty JSON objects results in:
Error: cannot find "" bin configuration: cannot find "" bin configuration
In this case, this issue is now a feature request to generate the config file if it does not exist since the CLI breaks if it's not generated for it.
I tried to reverse engineer it, but still get the same error 😒
Using the example in the docs:
cat example.txt | privatebin create
{
"bin": [
{
"name": "example",
"host": "[my private instance]",
"expire": "1week",
"open-discussion": false,
"burn-after-reading": false,
"gzip": false,
"formatter": "plaintext"
}
],
"expire": "1week",
"open-discussion": false,
"burn-after-reading": false,
"gzip": false,
"formatter": "plaintext"
}
Looks like I needed an empty bin profile name for the default.
Indeed, the default instance is unnamed, and you can specify other named instances using the --bin flag.
I agree that adding functionality to auto-generate a config if none exists would improve the user experience — I'll consider implementing this enhancement.
For more details on configuration, please refer to the documentation: https://github.com/gearnode/privatebin/blob/master/doc/privatebin.conf.5.md or man privatebin.conf
@gearnode was this solved by a pr that can be linked to it?
@douglasg14b I'll add the generator feature one day, or feel free to open a pull request to add it if you have the time. Updating the documentation to clarify that the empty string is the default for the private bin instance would also be a good improvement. However, since there’s no bug in the program, I’m closing this issue.
@gearnode
I'm not following. Is this not a bug?
The CLI will not work out of the box unless the user fixes it. It may not be a logical defect, but it is still a behavior that degrades the user experience and requires workarounds to operate as expected.
Which constitutes the requirements for a defect. One which will not go away unless repaired 🤔
@douglasg14b I've reopened the issue. I don't have time to work on this currently, but it's suitable for first-time contributors. My only concern about providing a default configuration is that it would promote a specific PrivateBin instance, which I'd prefer to avoid.