adminlog: default path, use ~ instead of /home/user #605

Open
opened 2026-10-05 04:32:45 +02:00 by adam · 2 comments
Owner

So, now that the path is customizable, I see that it defaults to a full path in the style of /home/user/.znc/moddata/adminlog/znc.log. I think it would be a better idea to have it use ~ instead of /home/user so that the path becomes ~/.znc/moddata/adminlog/znc.log and is also saved as such in the .registry file. The identfile module does this too, and makes it easier to move the .znc folder between different home directories without having to remember to change the .registry file.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

So, now that the path is customizable, I see that it defaults to a full path in the style of `/home/user/.znc/moddata/adminlog/znc.log`. I think it would be a better idea to have it use `~` instead of `/home/user` so that the path becomes `~/.znc/moddata/adminlog/znc.log` and is also saved as such in the .registry file. The identfile module does this too, and makes it easier to move the `.znc` folder between different home directories without having to remember to change the .registry file. ## <bountysource-plugin> Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26990874-adminlog-default-path-use-instead-of-home-user?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github). </bountysource-plugin> <!-- github-sync-id:108570676 -->
Author
Owner

The only case I can think for this to be OK is if the user's $HOME is not /home/$USER/... and you can guarantee that ~ will expand in all environments.

If anything it should use a value from the $HOME env var, not assume that ~ will be usable.

The only case I can think for this to be OK is if the user's `$HOME` is not `/home/$USER/...` and you can guarantee that `~` will expand in all environments. If anything it should use a value from the `$HOME` env var, not assume that `~` will be usable. <!-- github-comment-id:143607958 -->
Author
Owner

I think the $HOME not being /home/$USER/... shouldn't be a requirement at all. What if I had /users/$USER/... or some other home directory structure? Unless I'm misunderstanding you.

Also, ZNC already has code to determine the home path, which indeed also looks at the $HOME environment variable, and it can handle ~ internally.

I think the `$HOME` not being `/home/$USER/...` shouldn't be a requirement at all. What if I had `/users/$USER/...` or some other home directory structure? Unless I'm misunderstanding you. Also, ZNC already has code to determine the home path, which indeed also looks at the `$HOME` environment variable, and it can handle `~` internally. <!-- github-comment-id:143620860 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#605