| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
|
||
| adduser --system --quiet --home /nonexistent --no-create-home jamulus | ||
|
|
||
| sudo mkdir /etc/jamulus |
There was a problem hiding this comment.
This will fail if the directory already exists. It will also
| sudo mkdir /etc/jamulus | |
| sudo mkdir -p /etc/jamulus |
Sorry, something went wrong.
There was a problem hiding this comment.
Why is sudo required anyway? If adduser I'd executable meditate should also work without sudo. Nevertheless, I believe there's another way to add files and folders which is then also automatically cleaned up by dpkg/apt. Check out deploy_linux.sh
Sorry, something went wrong.
There was a problem hiding this comment.
Writing in /etc might require root access, but I can't explain why adduser doesn't in this instance. Should I test this without the sudo?
There is no deploy_linux.sh. Do you mean deploy_deb.sh ?
If I am uninstalling an application, there's a case for intentionally not removing a small file the user has customized. I guess a concern is that if I re-install, I don't expect the previous welcome file?
Are there examples of our files that are handled in the auto-cleanup way you prefer?
Sorry, something went wrong.
| adduser --system --quiet --home /nonexistent --no-create-home jamulus | ||
|
|
||
| sudo mkdir /etc/jamulus | ||
| sudo touch /etc/jamulus/welcome.html |
There was a problem hiding this comment.
This will require the user to edit the file as root (it is being created by root and both owner and group will be root). The file needs to be readable by the user jamulus, and - depending on how the system is already set up - this may not be the case - it may not be readable others.
Sorry, something went wrong.
There was a problem hiding this comment.
How about:
chmod -c 666 /path/to/file
Everyone can read and write, nobody can execute.
Sorry, something went wrong.
There was a problem hiding this comment.
I wouldn't want files installed on a system that any user could edit without control, that were then displayed publicly...
Ideally:
This is getting outside the scope of this PR, though, so I think just leaving (with -p) will do for now - so only root can edit. It probably is worth making use it's a+r permissions (i.e. anyone can read, other permissions unchanged).
Sorry, something went wrong.
There was a problem hiding this comment.
a+r appears to work
Sorry, something went wrong.
There was a problem hiding this comment.
Check jamulus.install file and deploy_deb.sh. I think you just need to move the file to the correct location during deb creation. This ensures the file doesn't get overwritten by updates, I suppose
Sorry, something went wrong.
There was a problem hiding this comment.
I don't want my custom welcome file to be overwritten when I upgrade.
Sorry, something went wrong.
There was a problem hiding this comment.
Exactly. I think that we might want to add an empty file to the deb directly instead of creating it during install time. But I'm unsure about the actual way config files are handled.
For example I'd like that a apt purge deletes it while an apt remove doesn't.
I found https://wiki.debian.org/ConfigPackages but it doesn't help me.
@mirabilos how should config files be handled correctly in deb files?
Sorry, something went wrong.
There was a problem hiding this comment.
The usual Debian way: ship it as conffile by placing it in /etc/jamulus/ in the package contents, then it will be placed there on first install by dpkg and later updated with newer versions iff the user did not change it; if the user changed it, they’ll get a chance to merge, keep their changes or throw their changes away. And the file will have proper default root:root 0644 permissions.
Sorry, something went wrong.
There was a problem hiding this comment.
@ann0see, touch won't overwrite anything. The Debian technique would behave more appropriately with apt purge vs. apt remove, and I guess that's good citizenship. Someday deploying default welcome file metadata could be a thing.
Sorry, something went wrong.
There was a problem hiding this comment.
@mirabilos thanks for answering.
Sorry, something went wrong.
Co-authored-by: Peter L Jones <pljones@users.noreply.github.com>
|
Before this gets merged, we should check how newly clients behave. Do they show an empty chat window? |
Sorry, something went wrong.
There was a problem hiding this comment.
See comments. Also maybe @jujudusud can help out a bit as he knows packaging on Arch (I think).
Sorry, something went wrong.
Yes. There's no content change in the chat window, visually same as if there's no welcome message. Should I also test that getServerProfile returns same results in result.welcomeMessage in both cases? |
Sorry, something went wrong.
Yes |
Sorry, something went wrong.
|
John Dempsey dixit:
+sudo mkdir /etc/jamulus
+sudo touch /etc/jamulus/welcome.html
@ann0see, touch won't overwrite anything. This file would behave more
@appropriately with apt purge vs. apt remove, and I guess that's good
@CITIZENSHIP. Someday deploying default welcome file metadata could be
@A thing.
No.
• sudo is not available by default but as this *already* runs as root…
• this will not preserve user changes as per Policy if some
default content is also deployed
• this will need manual cleanup via postrm maintainer scripts on purge
|
Sorry, something went wrong.
|
Nobody has ever expressed a great usage of metadata in the welcome file. Instead, our docs now mention bad uses for it. I tried to pitch welcome file metadata that our client reads and uses, but rdica and pljones found this idea meritless. So default content remains a fantasy. But littering a 50 byte file is no joke. |
Sorry, something went wrong.
|
It's still no problem, but we best follow the standard approach. |
Sorry, something went wrong.
|
This will apparently be our first usage of conffiles. How can this be? This command would seem to work the same way: sudo systemctl edit --full jamulus-headless It shows an editable configuration file, our ./linux/debian/jamulus-headless.service file. I hope if we change a field, then the user would get the option to merge, discard local changes, etc. But I don't see a file named conffiles. I do see jamulus.install, and jamulus-headless.install, which maybe have the format of a conffile. jamulus-headless.install has a two-token line separated by whitespace, but the first field does not seem like a fflag (and remove-on-upgrade is the only supported flag anyway). Also, these files maybe don't contain absolute pathnames, because lines don't start with a slash, which is a requirement for conffiles. Why don't I see a file named DEBIAN/conffile? Is that optional? Are we using this mechanism now? (Once I was framed for a speech crime. After three nights in jail, I was taken to a room to wait for arraignment, where a judge sets the bail. One by one, each defendant was taken before the judge. As they'd return some said there was a television camera in the courtroom. Why? As we ran out of defendants, a math wiz with an opioid addiction calculated that the cameras must be for me. He said a judge can't show weakness on television. He turned to me, pointed at me, and said, "They must be here for you. You're the sacrificial lamb!" I hope I'm not the sacrificial lamb for conffiles.) |
Sorry, something went wrong.
|
I don't know the progress of the top of my head, but I remember that the DEBIAN folder is created and populated via the shell script I mentioned. So you'd cp the empty welcome message in there.
|
Sorry, something went wrong.
|
Ah stop. I believe it's just an entry in https://github.com/jamulussoftware/jamulus/blob/main/linux/debian/jamulus-headless.install |
Sorry, something went wrong.
There was a problem hiding this comment.
I'd not do it this way.
Modify the files in this folder instead: https://github.com/jamulussoftware/jamulus/tree/main/linux/debian
Add an empty .html file to the directory.
Add the empty file here: https://github.com/jamulussoftware/jamulus/blob/main/linux/debian/jamulus.install and here: https://github.com/jamulussoftware/jamulus/blob/main/linux/debian/jamulus-headless.install
Maybe you'd also need to edit https://github.com/jamulussoftware/jamulus/blob/main/linux/deploy_deb.sh
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
With this change, a Debian installation will create an empty /etc/jamulus/welcome.html file and specify it as the welcome file in the systemd default configuration.
https://github.com/orgs/jamulussoftware/discussions/3086#discussioncomment-6248420
Checklist