On 8/7/23 13:30, Paco Esteban wrote:
> Hi ports@,
>
> This is a new port for shiori: https://github.com/go-shiori/shiori
>
> from pkg/DESCR:
>
>     Shiori is a simple bookmarks manager written in the Go language. Intended 
> as
>     a simple clone of Pocket. You can use it as a command line application or 
> as
>     a web application.
>
> I had to make a bit of a dance to make it work as a system daemon.
> The configuration is partly done via command line arguments and
> environment variables.  In order to be able to use those, I moved the
> binary to /usr/local/libexec and created a wrapper script that loads the
> variables from a config file (/etc/shiori.conf) if it exists and calls
> the actual binary (thank you semarie@ for your help there).

Not aimed at shiori in particular but I wanted to talk about how we are
loading environment variables in rcctl in general.

Until now the recommended approach was to put the variables in the
/etc/login.conf.d/<service> file (like with the step-ca port), while
I've also seen daemons who had to write these wrapper like scripts to
load environment variables from config files (I did the same for all
jitsi ports).

Do we want to keep this fragmented approach or try to some up with a
different method for loading/setting these variables?
While not the ideal model, systemd allows setting environment variables
in its unit file or allows setting a file from which to load environment
variables (the EnvironmentFile variable) and openrc loads variables from
/etc/conf.d/<service-name>.

Best,
Aisha

>
> Problem with this approach is that rcctl stop fails, as the $pexp
> argument we pass to pgrep/pkill will never match with the running
> processes.  Any ideas on how to fix this ?
>
> Anyway, port attached.  It will also need this diff to add a user and
> hook it to www:
>
> diff /usr/ports
> commit - fa6409aecca5030e95103349250be29ad6145e00
> path + /usr/ports
> blob - 4294460c8486b64663e65e8e8f384a6a9255e9d2
> file + infrastructure/db/user.list
> --- infrastructure/db/user.list
> +++ infrastructure/db/user.list
> @@ -400,3 +400,4 @@ id  user          group           port
>  889 _gromox          _gromox         mail/grommunio/gromox
>  890 _grommunio               _grommunio      mail/grommunio/admin-api
>  891 _kiwix-serve     _kiwix-serve    www/kiwix/kiwix-tools
> +892 _shiori          _shiori         www/shiori
> blob - 5f97bc1356340c54242707d468c15bb5a70389bb
> file + www/Makefile
> --- www/Makefile
> +++ www/Makefile
> @@ -551,6 +551,7 @@
>       SUBDIR += seamonkey-i18n
>       SUBDIR += selfoss
>       SUBDIR += sfeed
> +     SUBDIR += shiori
>       SUBDIR += slowhttptest
>       SUBDIR += smarc
>       SUBDIR += snownews
>

Reply via email to