Commit Graph

41 Commits

Author SHA1 Message Date
Kiril Kovachev
ea4d6f6889 doc: finish reporting the ReadableConfig error 2025-05-09 19:39:33 +01:00
Kiril Kovachev
3ad70ce318 build: Only invoke constrain_unix_permissions on UNIX-like builds using #[cfg]. 2025-05-09 15:42:25 +01:00
Kiril Kovachev
09f9fd3703 style: Use Args instead of clap::Args 2025-05-09 15:34:34 +01:00
Kiril Kovachev
c3da322a90 doc: Add note in to-do list about improving the clap API 2025-05-09 14:33:43 +01:00
Kiril Kovachev
2650d1d92e refactor: Extract create_toml_line function out from fill_config_template 2025-05-09 12:30:26 +01:00
Kiril Kovachev
9a219d4416 refactor: Factor newline character into pushed strings inside fill_config_template, instead of using a separate push call 2025-05-09 12:26:37 +01:00
Kiril Kovachev
6ebd7fc11b refactor: Rename chosen_method to auth_method inside fill_config_template 2025-05-09 12:25:56 +01:00
Kiril Kovachev
1400334ce0 feat: Now allow supplying either password or OAuth2 token in config generation 2025-05-09 12:24:10 +01:00
Kiril Kovachev
357e012525 feat: Add ArgGroup to allow choice of multiple possible auth methods 2025-05-09 12:13:39 +01:00
Kiril Kovachev
9c7bcc8f99 doc: Rephrase doc for the setup action in the CLI 2025-05-09 00:08:38 +01:00
Kiril Kovachev
b4b605861a doc: Add plan to add selective OAuth/password filling-in depending on which was entered 2025-05-09 00:07:21 +01:00
Kiril Kovachev
26f933cced doc: Update note concerning error-handling to refer to refactored function 2025-05-09 00:06:09 +01:00
Kiril Kovachev
d2c2f09ec3 feat: Make OAuth2 token the default credential for authentification 2025-05-09 00:05:20 +01:00
Kiril Kovachev
8f779d005f refactor: Factor out file permission constraint from setup 2025-05-08 23:50:52 +01:00
Kiril Kovachev
36dae8ca6e refactor: Factor out read_config_template from setup as well 2025-05-08 23:48:05 +01:00
Kiril Kovachev
d5c3e55613 refactor: Extract fill_config_template function out from setup code 2025-05-08 23:46:51 +01:00
Kiril Kovachev
784c28af77 refactor: Use ? operator instead of unwrapping inside of setup() 2025-05-08 23:42:08 +01:00
Kiril Kovachev
dec35b4c8f style: Use "FILE_NAME" instead of "FILENAME" to be consistent with Rust std::path naming convention 2025-05-08 23:40:14 +01:00
Kiril Kovachev
54b303f632 feat: Use default config_dir (from dirs crate) instead of hard-coded UNIX path 2025-05-08 23:38:55 +01:00
Kiril Kovachev
3a33a5d5fc doc: Comment why permissions are being altered 2025-05-08 23:20:10 +01:00
Kiril Kovachev
502170da63 fix: Do not panic if .env is not found. 2025-05-08 23:18:32 +01:00
Kiril Kovachev
a6b5171ad8 doc: Add note to to-do: must clean up the syntax of the error handling in setup(). 2025-05-08 01:51:53 +01:00
Kiril Kovachev
874506a5de refactor: Use Result::or to simplify setup() control flow 2025-05-08 01:50:35 +01:00
Kiril Kovachev
fa1e646f01 doc: Add TODO file, which currently tracks my intention to report the previous "ReadableConfig" (permissions-related) bug 2025-05-08 01:33:23 +01:00
Kiril Kovachev
9af87c2cbd fix: Temporarily comment out oauth2_token in config template whilst a more principled way of choosing OAuth2 vs password is implemented 2025-05-08 01:32:23 +01:00
Kiril Kovachev
477a39d764 fix: Use "password" field in generated mwbot.toml instead of "botpassword" to authenticate 2025-05-08 01:31:25 +01:00
Kiril Kovachev
4ba5dc66e5 fix: Correctly set permissions of generated config file, which were previously too loose 2025-05-08 01:29:45 +01:00
Kiril Kovachev
5404259896 refactor: use CONFIG_TEMPLATE_PATH constant in error message instead of hard-coding 2025-05-08 01:13:03 +01:00
Kiril Kovachev
e508a94cce style: rename mwbot.toml template to mwbot_template.toml 2025-05-08 01:12:12 +01:00
Kiril Kovachev
679e0af600 refactor: Use constant to represent template for generated config file 2025-05-08 00:39:31 +01:00
Kiril Kovachev
a15b23a70a refactor: Factor arguments of Setup variant into their own struct and remove prior janky matching 2025-05-08 00:37:35 +01:00
Kiril Kovachev
a6e9bce223 style: Remove space between uses 2025-05-08 00:31:02 +01:00
Kiril Kovachev
59c6dc104d refactor: Remove unused FromStr use 2025-05-08 00:30:31 +01:00
Kiril Kovachev
db7ce5cb7e refactor: Use constant for ~/.config/mwbot.toml 2025-05-08 00:27:39 +01:00
Kiril Kovachev
e1856f70cd refactor: Remove unused env import 2025-05-08 00:22:06 +01:00
Kiril Kovachev
c22af9bedf feat: Add ability to set up API and REST URLs 2025-05-08 00:21:29 +01:00
Kiril Kovachev
2fcbe535b9 feat: Use setup subcommand to set up config instead of passing args to run 2025-05-08 00:20:11 +01:00
Kiril Kovachev
cabc194158 style: Remove redundant import 2025-05-08 00:10:54 +01:00
Kiril Kovachev
6229d9d5a8 refactor: Improved error handling using ? operator and better function signatures 2025-05-08 00:08:35 +01:00
Kiril Kovachev
c5beab75d5 Initial commit 2025-05-07 23:56:33 +01:00
229cc38238 Initial commit 2025-05-05 16:27:20 +00:00