-
-
Notifications
You must be signed in to change notification settings - Fork 309
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
Configuration file #101
Comments
@boastful-squirrel I do see your point, especially in a UNIX-like system: A UNIX program only does one thing and does it well. But not all systems are UNIX-like (Windows, obviously), and this tool is hardly an ideal UNIX program. As for the advantage of configuration as opposed for alias/custom-commands: A configuration file is a data file and can be treated like data. It also works regardless of platform (aliases only work on POSIX shell, UNIX commands only works on UNIX-like system and .bat commands only works on Windows). I also proposed #100, which, when combined with this feature, allows a system manager to easily manage users and passwords. BTW, what is the "CTRL-R" that you referred to? |
It allows to search for commands in your bash history. |
I have trouble deciding whether I want this or not. The general idea of miniserve is that it's a simple, basically braindead easy way of serving your files in a somewhat convenient way. It grew to allow auth and uploading and now it's supposedly growing to allow for multiple auth providers at the same time. It's a logical consequence for it to gain config file support and honestly, at this point, I'm not sure that would exceed the complexity I had originally planned for miniserve. Don't get me wrong. I use miniserve in production myself in a big company and therefore it's certainly not just a toy project to me. However, the whole reason I made miniserve is that I wanted a simple tool without too much bloat. I'm not saying no. I'm saying I'd appreciate some discussion on this. |
@svenstaro Then according to the UNIX philosophy™, miniserve should not have to handle any of this (including reading configuration file, authentication, themes), rather, there should be other helper programs that handle them for you:
|
I'm not saying anything about UNIX philosophy. I'm not a minimalism purist. I'm a simplicity-loving pragmatist. I know that miniserve hardly adhere to UNIX principles. |
@svenstaro Well, we can keep some existing feature out of convenient while also allow other programs (or modules) to extend miniserve's feature. What is great about UNIX philosophy is that it is infinitely extensible ("build program that works together") since every program is essentially a programmable function. |
@boastful-squirrel I'd value your input on this. I know you already said you wouldn't use it but what do you think about this in the general context of this tool and what I said? |
@svenstaro if we keep it as simple as possible, aka something like this interfaces = ["[::1]", "127.0.0.1"]
port = 9999
auth = ["foo:bar", "bip:bop"]
allow-upload = true
overwrite-files = true
default-color-scheme = "Archlinux" then why not, it might be helpful for some people (is it worth it ? Only you can tell this :)) , especially the I would use |
Actually, now that I think about it, this feature isn't necessary, one can easily create a program that translates whatever configuration format they want into CLI arguments. |
Ok so I had a proper long think and I agree we should have a very simple config file. I like the format proposed by @boastful-squirrel which seems to be TOML and since TOML and rust seem to go together a lot, let's use that. However, I think that we should use the config by default since that is what every other program does and it would be weird to deviate from that behavior. After all, if there is no config in place, it won't be used and there won't be a config in place without you knowing that since you have to put it in place specifically. So, let's think about the implementation. I think the config should be searched in this order: I don't want the config format to be visually nested (except for TOML lists) and I don't want it to have in-built versioning. |
You means using |
Yes, serde would be good for this. |
Summary
Right now, the only way to "configure" miniserve is via command-line arguments
miniserve --interfaces ::1 --port 8080 --auth user:sha256:hash $@
But it would be more convenient to have a global configuration file for recurring command-line options
Discussion
~/.miniserverc.$ext
,~/.miniserve/config.$ext
,~/.config/miniserve/config.$ext
?serde
)The text was updated successfully, but these errors were encountered: