Bug 280886

Summary: mail/hydroxide: Fix rc.d script
Product: Ports & Packages Reporter: Yusuf Yaman <nxjoseph>
Component: Individual Port(s)Assignee: Vladimir Druzenko <vvd>
Status: Closed FIXED    
Severity: Affects Some People CC: nxjoseph, vvd
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
mail/hydroxide
nxjoseph: maintainer-approval+
rc.d script
none
pkg-message
none
pkg-message
none
rc.d script none

Description Yusuf Yaman 2024-08-17 15:43:56 UTC

    
Comment 1 Yusuf Yaman 2024-08-17 15:45:53 UTC
Created attachment 252850 [details]
mail/hydroxide

* rc.d script was not working properly because hydroxide
  does want to store some files and users were running
  "hydroxide auth" with normal user. Now, hydroxide user
  has a home directory, and it does store them there now.
  I forked upstream hydroxide and changed the path to
  where files will be stored on FreeBSD.
Comment 2 Yusuf Yaman 2024-08-17 15:46:40 UTC
Created attachment 252851 [details]
rc.d script
Comment 3 Yusuf Yaman 2024-08-17 15:46:52 UTC
Created attachment 252852 [details]
pkg-message
Comment 4 Yusuf Yaman 2024-08-17 15:47:51 UTC
Created attachment 252853 [details]
pkg-message
Comment 5 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-18 00:01:03 UTC
This work:
eval "${rcvar}=\${${rcvar}:-'NO'}"
eval "__args=\${${name}_args:-''}"
eval "__user=\${${name}_user:-'%%USER%%'}"
eval "__log=\${${name}_log:-/dev/null}"

pidfile="/var/run/${name}.pid"

command="/usr/sbin/daemon"
command_args="-P ${pidfile} -u ${__user} -f -H -o ${__log} -m 3 %%PREFIX%%/bin/hydroxide ${__args} serve"

hydroxide_init() {
        read -p "Enter mail account id: " id
        ${su_cmd} -m ${__user} -c "%%PREFIX%%/bin/hydroxide auth $id"
}

/etc/rc.subr run "unset _user".
Comment 6 Yusuf Yaman 2024-08-18 10:19:18 UTC
Created attachment 252870 [details]
rc.d script
Comment 7 commit-hook freebsd_committer freebsd_triage 2024-08-18 12:56:57 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=138d30ed37c7eee5f1f616c74eac2d646b26ce0b

commit 138d30ed37c7eee5f1f616c74eac2d646b26ce0b
Author:     Yusuf Yaman <nxjoseph@protonmail.com>
AuthorDate: 2024-08-18 12:51:41 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2024-08-18 12:53:59 +0000

    mail/hydroxide: Fix rc.d script

    - hydroxide does want to store some files and users were running
    "hydroxide auth" with normal user. Now, hydroxide user has a home
    directory, and it does store them there now.
    - Change upstream.

    PR:     280886

 UIDs                              |  2 +-
 mail/hydroxide/Makefile           |  4 ++--
 mail/hydroxide/distinfo           |  6 +++---
 mail/hydroxide/files/hydroxide.in | 17 +++++++++++++----
 mail/hydroxide/pkg-message (new)  | 13 +++++++++++++
 5 files changed, 32 insertions(+), 10 deletions(-)
Comment 8 Vladimir Druzenko freebsd_committer freebsd_triage 2024-08-18 12:57:35 UTC
Thanks.