Friday, December 03, 2021

Re: New port for www/goatcounter

Omar Polo <op@omarpolo.com> writes:

> Vinh Nguyen <cavoirom.wanted@yahoo.com> writes:
>
>> Hello Omar,
>>
>> I'm sorry for the long delay, time flied, I fixed the port following
>> all comments on your message.
>
> no problem :)
>
>> The author have just updated Goatcounter to v2.1.0. Yesterday, I
>> tried to update dependencies by command
>>
>> make modgo-gen-modules > modules.inc
>>
>> but it still gets v1.4.2, do you have any idea?
>>
>> I attached the modified port in the attachment below.
>
> I managed to get 2.1.0 by using
>
> MODGO_MODNAME = zgo.at/goatcounter/v2
> MODGO_VERSION = v2.1.0
>
> most of the variables default are fine, so here's an improved tarball
> that seems to build the correct version. I haven't tried it yet
> thought, so only build-time testing and `goatcounter version'.
>
> % goatcounter version
> version=v2.1.0; go=go1.17.3; GOOS=openbsd; GOARCH=amd64; race=false; cgo=true
>
> I dropped the -static from ldflags and used the default install target
> provided by modgo (gcbench seems potentially useful to provide.)
> @comment bin/check because it's meant for development (goes some check
> on go sources if i've understood correctly.) Added WANTLIB and fixed
> MODGO_FLAGS. Also, the syntax for -X to set the version changed, I've
> updated MODGO_LDFLAGS to reflect what's on the readme.
>
> It'd be nice if we could convince it to use the sqlite from ports and
> link dynamically to it instead of whatever is doing right now (either
> statically link it or bundle its own version.) Some digging on
> github.com/mattn/go-sqlite3 may be needed.

this was easier than expected, it just needs the libsqlite3 tag.
Attaching an updated tarball with a LDEP on sqlite3 \o/ and MODGO_FLAGS
trimmed down to `-tags libsqlite3' only.

I've also tweaked goatcounter.rc: it's ugly to send its output to
/dev/null, it's more useful to log it, isn't it? Also, to don't
hardcode /var. Also, I'm wondering if it's a bad idea to set
-automigrate by default: that's what I'm doing in the attached tarball,
but I haven't digged deeper to see if it can bite us.

Regarding the email, I added `-stmp smtp://localhost' so it uses smtpd
to send them rather the printing to /var/log/daemon.log, but I haven't
tried to actually send emails from it.

Then, since we're using a custom path for the database I tried to add a
README with some info on how to start using it. I've tested in on
localhost and it's working fine!

I'd like if someone with more experience on go ports would give a
feedback nevertheless. (Also, I'd like if someone could review the
README to ensure it reads fine ^^")

(it'd be also cool if someone could test it against postgresql)

`make test' passes ;)

portcheck complains about a long line in goatcounter.rc (daemon_flags)

> Also, for the user you need a diff along the lines of the following one.
>
> Cheers,
>
> Omar Polo

Index: infrastructure/db/user.list
===================================================================
RCS file: /home/cvs/ports/infrastructure/db/user.list,v
retrieving revision 1.392
diff -u -p -r1.392 user.list
--- infrastructure/db/user.list 17 Nov 2021 20:32:34 -0000 1.392
+++ infrastructure/db/user.list 3 Dec 2021 09:02:28 -0000
@@ -380,3 +380,4 @@ id user group port
869 _headscale _headscale net/headscale
870 _unit _unit www/unit
871 _gelatod _gelatod net/gelatod
+872 _goatcounter _goatcounter www/goatcounter

No comments:

Post a Comment