-
Notifications
You must be signed in to change notification settings - Fork 2
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
Please make bind address and port user configurable #3
Comments
Hello there @kseistrup ! Thanks again for the detailed review and explanation. Let me try to elaborate on some of these:
I do agree with this and I have this item in my TODO list. I haven't implemented this yet, as I haven't come up with the ideal way to do it (yet). While it is pretty easy to implement it for the HTTP server part of the app by using either:
That's an interesting suggestion, I haven't thought of this at all, tbh. I'll need to give it a thought and do some reading on the topic (as I don't have much experience in low-level network programming with Go). The initial idea was to make this tool as simple (for the end user) as possible, so, for example, the setup with sharing the instance among the machines might be too advanced tool-spirit-wise. Also, I'd like to double-check how portable this approach is for non-Linux OS (MacOS and Windows to be more specific), as those platforms are supported by the tool as well: as an option, I might need to implement a different approach for different OS:
Anyway, I'll look into that, as this sounds like a fun and (potentially) useful thing to implement. I wonder though whether the configurable address approach ( But thanks again for the feedback and the cool ideas, I'll play with the things discussed above. |
The environment variables are all held in private memory. Nobody except the user themself can see or set the user's environment variables. If an adversary is able to set your environment variables, then you're already fscked.
I don't think you need to worry about that. Countless programs are reading their configuration files or environment variables on each invocation, and we have never noticed. I would suggest the following priority, and shortcut it on first match:
For all it's worth, it's just three tiny tests. |
Thanks for the comment.
Agree. I mentioned this within the context of one of your previouss comments stating that
meaning that we are taking into account this very case.
The mentioned complexity comes not for the Anyway, I have already implemented the port changing feature. The app accepts the port number either via a new
or via the The port resolution order is the following:
As for the socket and address binding, I'm still considering whether this is something worth implementing for this simple app. I'll keep you posted. |
I'm unsure if we are speaking about the same thing. If user A logs into their account and launches a It is for this reason that a socket (or similar) is not only nice-to-have on a multiuser machine, but need-to-have. If not, (I apologize in advance if I have misunderstood your messsages.) |
Hey, sorry, I missed your reply. I reread your message and, yeah, you are absolutely right, it's important to have it on the multiuser machine. But I greatly appreciate your input, and once I have more free time again, I'll consider implementing the socket version, as it sounds like both a useful and fun thing to do - that's why we code, isn't it? =) |
Currently (v1.0.10 @ commit 8b70c23)
remindme
is listening on port 15555. As mentioned in #1, this port may already be in use on the local machine, in which caseremindme
will be unable to run.Therefore it will make sense to make the listening port configurable.
In spite of what has been written about safe IP addresses in #1, it may also be useful to make the listening address configurable.
E.g., you could have more than once instance of
remindme
running locally by using127.0.0.1
,127.0.0.2
, …, or you could choose to let it bind to an address on a VPN so that several machines can share a single instance ofremindme
, or you could use it to overrride the default socket path (once that has been implemented).The bind address and port could be specified via options for the
remindme start
command, or simply by using environment variables, e.g.:$REMINDME_BIND_ADDR
$REMINDME_BIND_PORT
(
_BIND
can be omitted)Ideally,
$REMINDME_BIND_ADDR
should default to a socket or to localhost, and$REMINDME_BIND_PORT
could very well default to 15555 if the bind address is an IP address.As also mentioned in #1, a safe choice for the socket name is
$XDG_RUNTIME_DIR/remindme-$UID.socket
, but the user may have a different opinion and specify the absolute path to the desired socket, in which case the$REMINDME_BIND_ADDR
starts with a/
(at least on linux/unix).A configuration file can also be used, of course.
Redundant information: XDG Base Directory Specification:
The text was updated successfully, but these errors were encountered: