[update] goaccess 1.4

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[update] goaccess 1.4

Landry Breuil-5
Hi,

here's an update to goaccess 1.4 (cf
http://goaccess.io/release-notes#release-1.4), drops the tokyocabinet
flavor (dep dropped upstream), removed some patches from upstream, i
have to admit i'm a bit puzzled by the src/settings.c patch, upstream
code was modified a bit there.

feedback/testing welcome !

Landry

goaccess-1.4.diff (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [update] goaccess 1.4

Stuart Henderson
src/settings.c was committed upstream (hence the header), hopefully they
didn't break it again (it used to prefer config in /etc rather than ~).

--
  Sent from a phone, apologies for poor formatting.
On 1 August 2020 07:13:06 Landry Breuil <[hidden email]> wrote:

> Hi,
>
> here's an update to goaccess 1.4 (cf
> http://goaccess.io/release-notes#release-1.4), drops the tokyocabinet
> flavor (dep dropped upstream), removed some patches from upstream, i
> have to admit i'm a bit puzzled by the src/settings.c patch, upstream
> code was modified a bit there.
>
> feedback/testing welcome !
>
> Landry

Reply | Threaded
Open this post in threaded view
|

Re: [update] goaccess 1.4

Paco Esteban-2
In reply to this post by Landry Breuil-5
On Sat, 01 Aug 2020, Landry Breuil wrote:

> Hi,
>
> here's an update to goaccess 1.4 (cf
> http://goaccess.io/release-notes#release-1.4), drops the tokyocabinet
> flavor (dep dropped upstream), removed some patches from upstream, i
> have to admit i'm a bit puzzled by the src/settings.c patch, upstream
> code was modified a bit there.
>
> feedback/testing welcome !

Tested with combined logs from httpd.  On the config file I've
uncommented:

    # httpd(8) combined log format
    date-format %d/%b/%Y
    time-format %T %z
    log-format %v %h %^ %^ [%d:%t] "%r" %s %b "%R" "%u"

It crashes for me with this error:

    GoAccess - version 1.4 - Aug  1 2020 17:35:48
    Config file: No config file used

    Fatal error has occurred
    Error occurred at: src/goaccess.c - set_curses - 1411
    No time format was found on your conf file.

I have to explicitly specify the config file with
`--config-file=/etc/goaccess.conf`.  After that it works fine.  Could it
be related to that patch that you were talking about ?

Cheers,

--
Paco Esteban.
0x5818130B8A6DBC03

Reply | Threaded
Open this post in threaded view
|

Re: [update] goaccess 1.4

Stuart Henderson
On 2020/08/01 17:40, Paco Esteban wrote:

> On Sat, 01 Aug 2020, Landry Breuil wrote:
>
> > Hi,
> >
> > here's an update to goaccess 1.4 (cf
> > http://goaccess.io/release-notes#release-1.4), drops the tokyocabinet
> > flavor (dep dropped upstream), removed some patches from upstream, i
> > have to admit i'm a bit puzzled by the src/settings.c patch, upstream
> > code was modified a bit there.
> >
> > feedback/testing welcome !
>
> Tested with combined logs from httpd.  On the config file I've
> uncommented:
>
>     # httpd(8) combined log format
>     date-format %d/%b/%Y
>     time-format %T %z
>     log-format %v %h %^ %^ [%d:%t] "%r" %s %b "%R" "%u"
>
> It crashes for me with this error:
>
>     GoAccess - version 1.4 - Aug  1 2020 17:35:48
>     Config file: No config file used
>
>     Fatal error has occurred
>     Error occurred at: src/goaccess.c - set_curses - 1411
>     No time format was found on your conf file.
>
> I have to explicitly specify the config file with
> `--config-file=/etc/goaccess.conf`.  After that it works fine.  Could it
> be related to that patch that you were talking about ?
>
> Cheers,
>
> --
> Paco Esteban.
> 0x5818130B8A6DBC03

Oh, sounds like they messed up the fix afterwards then :(

Reply | Threaded
Open this post in threaded view
|

Re: [update] goaccess 1.4

Paco Esteban-2
On Sat, 01 Aug 2020, Stuart Henderson wrote:

> On 2020/08/01 17:40, Paco Esteban wrote:
> > On Sat, 01 Aug 2020, Landry Breuil wrote:
> >
> > > Hi,
> > >
> > > here's an update to goaccess 1.4 (cf
> > > http://goaccess.io/release-notes#release-1.4), drops the tokyocabinet
> > > flavor (dep dropped upstream), removed some patches from upstream, i
> > > have to admit i'm a bit puzzled by the src/settings.c patch, upstream
> > > code was modified a bit there.
> > >
> > > feedback/testing welcome !
> >
> > Tested with combined logs from httpd.  On the config file I've
> > uncommented:
> >
> >     # httpd(8) combined log format
> >     date-format %d/%b/%Y
> >     time-format %T %z
> >     log-format %v %h %^ %^ [%d:%t] "%r" %s %b "%R" "%u"
> >
> > It crashes for me with this error:
> >
> >     GoAccess - version 1.4 - Aug  1 2020 17:35:48
> >     Config file: No config file used
> >
> >     Fatal error has occurred
> >     Error occurred at: src/goaccess.c - set_curses - 1411
> >     No time format was found on your conf file.
> >
> > I have to explicitly specify the config file with
> > `--config-file=/etc/goaccess.conf`.  After that it works fine.  Could it
> > be related to that patch that you were talking about ?
> >
> > Cheers,
> >
> > --
> > Paco Esteban.
> > 0x5818130B8A6DBC03
>
> Oh, sounds like they messed up the fix afterwards then :(

I think I've found the issue.  I had to add a new patch to src/util.c.
They were trying to get the config file from
${SYSCONFDIR}/goaccess/goaccess.conf and we put it on
${SYSCONFDIR}/goaccess.conf

Here's the updated patch.  With this it works fine for me on amd64.

diff refs/heads/master refs/heads/new-goaccess
blob - b303baf12ea0cb2bae267d2ffe28f8f5879f264b
blob + f49e11b52834371f140af6d054c093beafe1ac04
--- www/goaccess/Makefile
+++ www/goaccess/Makefile
@@ -2,8 +2,7 @@
 
 COMMENT = realtime console web log analyzer
 
-DISTNAME = goaccess-1.3
-REVISION = 2
+DISTNAME = goaccess-1.4
 
 CATEGORIES = www
 
@@ -34,14 +33,5 @@ CONFIGURE_ARGS = --enable-geoip=mmdb \
 CONFIGURE_ENV = CPPFLAGS="-I${LOCALBASE}/include" \
  LDFLAGS="-L${LOCALBASE}/lib"
 FAKE_FLAGS = confdir="${PREFIX}/share/examples/goaccess"
-
-FLAVORS = tokyocabinet
-FLAVOR ?=
-
-.if ${FLAVOR:Mtokyocabinet}
-WANTLIB += bz2 tokyocabinet z
-LIB_DEPENDS += databases/tokyocabinet
-CONFIGURE_ARGS += --enable-tcb=btree
-.endif
 
 .include <bsd.port.mk>
blob - df1345bc846efcdcb4f2cb2b9da05c2a03fe532c
blob + b3eae565661ce3a4dbb95601c2ef686e5b78dfce
--- www/goaccess/distinfo
+++ www/goaccess/distinfo
@@ -1,2 +1,2 @@
-SHA256 (goaccess-1.3.tar.gz) = jHdcXCS/hakz/W8SSQBIRzQtZUKqUz5OwCqve+Qde5s=
-SIZE (goaccess-1.3.tar.gz) = 541374
+SHA256 (goaccess-1.4.tar.gz) = 6Pu5/4UlVtct/Z8dATS6B1zltMQSiZAqb04Nl8aTd74=
+SIZE (goaccess-1.4.tar.gz) = 595264
blob - b84ac32c8ba78bfddcc3b638970a30fd65d6a600
blob + 357c5b22171025f049dfbd463e88c01b24f45e28
--- www/goaccess/patches/patch-config_goaccess_conf
+++ www/goaccess/patches/patch-config_goaccess_conf
@@ -20,38 +20,15 @@ Index: config/goaccess.conf
  ######################################
  # Date Format Options (required)
  ######################################
-@@ -653,31 +663,10 @@ static-file .flv
- #std-geoip false
-
- # Specify path to GeoIP database file. i.e., GeoLiteCity.dat
--# .dat file needs to be downloaded from maxmind.com.
-+# Free GeoLite2 databases are available in the geolite2-city/country packages.
+@@ -698,7 +708,10 @@ static-file .flv
+ # Download the GeoLite2-Country.mmdb.gz
+ # gunzip GeoLite2-Country.mmdb.gz
  #
--# For IPv4 City database:
--# wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
--# gunzip GeoLiteCity.dat.gz
--#
--# For IPv6 City database:
--# wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz
--# gunzip GeoLiteCityv6.dat.gz
--#
--# For IPv6 Country database:
--# wget -N http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz
--# gunzip GeoIPv6.dat.gz
--#
--# For GeoIP2 City database:
--# wget -N http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
--# gunzip GeoLite2-City.mmdb.gz
--#
--# For GeoIP2 Country database:
--# wget -N http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz
--# gunzip GeoLite2-Country.mmdb.gz
--#
--# Note: `geoip-city-data` is an alias of `geoip-database`
--#
 -#geoip-database /usr/local/share/GeoIP/GeoLiteCity.dat
++
++# Free GeoLite2 databases are available in the geolite2-city/country packages.
 +#geoip-database /var/db/GeoIP/GeoLite2-City.mmdb
 +geoip-database /var/db/GeoIP/GeoLite2-Country.mmdb
 
  ######################################
- # Tokyo Cabinet Options
+ # Persistence Options
blob - 0e79c1d1d3b663c46ab44915980409c725c869e2
blob + e1fde41afa844fc90ec97bfcc0a57db0f5239a4a
--- www/goaccess/patches/patch-src_browsers_c
+++ www/goaccess/patches/patch-src_browsers_c
@@ -5,7 +5,7 @@ https://github.com/allinurl/goaccess/pull/1350
 Index: src/browsers.c
 --- src/browsers.c.orig
 +++ src/browsers.c
-@@ -116,6 +116,8 @@ static const char *browsers[][2] = {
+@@ -114,6 +114,8 @@ static const char *browsers[][2] = {
    {"MicroMessenger", "Others"},
    {"Apache", "Others"},
    {"JOSM", "Others"},
@@ -14,10 +14,10 @@ Index: src/browsers.c
 
    /* Feed-reader-as-a-service */
    {"AppleNewsBot", "Feeds"},
-@@ -183,6 +185,7 @@ static const char *browsers[][2] = {
-   {"Python", "Crawlers"},
-   {"LinkedIn", "Crawlers"},
+@@ -189,6 +191,7 @@ static const char *browsers[][2] = {
    {"Microsoft-WebDAV", "Crawlers"},
+   {"DuckDuckGo-Favicons-Bot", "Crawlers"},
+   {"bingbot", "Crawlers"},
 +  {"The Knowledge AI", "Crawlers"},
 
    /* Podcast fetchers */
blob - 90119a7c5bf28610fbd3f8084451b537a01458a3 (mode 644)
blob + /dev/null
--- www/goaccess/patches/patch-src_gholder_c
+++ /dev/null
@@ -1,15 +0,0 @@
-$OpenBSD: patch-src_gholder_c,v 1.2 2019/01/20 15:38:34 kirby Exp $
-
-upstream commit 61a4648ecb6e9cbedbc79a2ae0e69a69a348273d
-
-Index: src/gholder.c
---- src/gholder.c.orig
-+++ src/gholder.c
-@@ -32,6 +32,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <sys/socket.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
-
blob - /dev/null
blob + 23f7ad2dd8843100bab9223181f53a412f0e946e (mode 644)
--- /dev/null
+++ www/goaccess/patches/patch-src_parser_c
@@ -0,0 +1,13 @@
+$OpenBSD$
+
+Index: src/parser.c
+--- src/parser.c.orig
++++ src/parser.c
+@@ -54,7 +54,6 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+-#include <malloc.h>
+
+ #include "gkhash.h"
+
blob - 79d9d8637c46405a2d33fc5c1f544a630b30d907 (mode 644)
blob + /dev/null
--- www/goaccess/patches/patch-src_settings_c
+++ /dev/null
@@ -1,34 +0,0 @@
-$OpenBSD: patch-src_settings_c,v 1.1 2019/01/20 13:36:51 sthen Exp $
-
-From a224c92d27919d30cf5cfeafde41f9c50c6f84f2 Mon Sep 17 00:00:00 2001
-From: Stuart Henderson <[hidden email]>
-Date: Fri, 11 Jan 2019 10:28:32 +0000
-Subject: [PATCH] Fix fallback to global config
-
-Index: src/settings.c
---- src/settings.c.orig
-+++ src/settings.c
-@@ -121,6 +121,7 @@ char *
- get_config_file_path (void)
- {
-   char *upath = NULL, *rpath = NULL;
-+  FILE *file;
-
-   /* determine which config file to open, default or custom */
-   if (conf.iconfigfile != NULL) {
-@@ -138,12 +139,14 @@ get_config_file_path (void)
-   }
-
-   /* otherwise, fallback to global config file */
--  if (rpath == NULL && conf.load_global_config) {
-+  if ((file = fopen (rpath, "r")) == NULL && conf.load_global_config) {
-     upath = get_global_config ();
-     rpath = realpath (upath, NULL);
-     if (upath) {
-       free (upath);
-     }
-+  } else {
-+    fclose (file);
-   }
-
-   return rpath;
blob - /dev/null
blob + 08f20e51549c7b72e0644b92b883742deb0e30cd (mode 644)
--- /dev/null
+++ www/goaccess/patches/patch-src_util_c
@@ -0,0 +1,19 @@
+$OpenBSD$
+
+global config file not found by default.
+Ours is at ${SYSCONFDIR}/goaccess.conf
+
+Index: src/util.c
+--- src/util.c.orig
++++ src/util.c
+@@ -465,8 +465,8 @@ char *
+ get_global_config (void) {
+   char *path = NULL;
+
+-  path = xmalloc (snprintf (NULL, 0, "%s/goaccess/goaccess.conf", SYSCONFDIR) + 1);
+-  sprintf (path, "%s/goaccess/goaccess.conf", SYSCONFDIR);
++  path = xmalloc (snprintf (NULL, 0, "%s/goaccess.conf", SYSCONFDIR) + 1);
++  sprintf (path, "%s/goaccess.conf", SYSCONFDIR);
+
+   return path;
+ }
blob - c99e77ea105947bce7b3ce1d46e2556e59f4a41c
blob + 6cb5822ad5fb680b63a649a76585c8c1edaf852a
--- www/goaccess/pkg/PLIST
+++ www/goaccess/pkg/PLIST
@@ -5,7 +5,11 @@ share/examples/goaccess/
 share/examples/goaccess/browsers.list
 share/examples/goaccess/goaccess.conf
 @sample ${SYSCONFDIR}/goaccess.conf
+share/examples/goaccess/podcast.list
+share/locale/de/LC_MESSAGES/goaccess.mo
 share/locale/es/LC_MESSAGES/goaccess.mo
 share/locale/fr/LC_MESSAGES/goaccess.mo
 share/locale/ja/LC_MESSAGES/goaccess.mo
+share/locale/pt_BR/LC_MESSAGES/goaccess.mo
+share/locale/sv/LC_MESSAGES/goaccess.mo
 share/locale/zh_CN/LC_MESSAGES/goaccess.mo

--
Paco Esteban.
0x5818130B8A6DBC03

Reply | Threaded
Open this post in threaded view
|

Re: [update] goaccess 1.4

Landry Breuil-5
On Sun, Aug 02, 2020 at 05:24:39PM +0200, Paco Esteban wrote:

> On Sat, 01 Aug 2020, Stuart Henderson wrote:
>
> > On 2020/08/01 17:40, Paco Esteban wrote:
> > > On Sat, 01 Aug 2020, Landry Breuil wrote:
> > >
> > > > Hi,
> > > >
> > > > here's an update to goaccess 1.4 (cf
> > > > http://goaccess.io/release-notes#release-1.4), drops the tokyocabinet
> > > > flavor (dep dropped upstream), removed some patches from upstream, i
> > > > have to admit i'm a bit puzzled by the src/settings.c patch, upstream
> > > > code was modified a bit there.
> > > >
> > > > feedback/testing welcome !
> > >
> > > Tested with combined logs from httpd.  On the config file I've
> > > uncommented:
> > >
> > >     # httpd(8) combined log format
> > >     date-format %d/%b/%Y
> > >     time-format %T %z
> > >     log-format %v %h %^ %^ [%d:%t] "%r" %s %b "%R" "%u"
> > >
> > > It crashes for me with this error:
> > >
> > >     GoAccess - version 1.4 - Aug  1 2020 17:35:48
> > >     Config file: No config file used
> > >
> > >     Fatal error has occurred
> > >     Error occurred at: src/goaccess.c - set_curses - 1411
> > >     No time format was found on your conf file.
> > >
> > > I have to explicitly specify the config file with
> > > `--config-file=/etc/goaccess.conf`.  After that it works fine.  Could it
> > > be related to that patch that you were talking about ?
> > >
> > > Cheers,
> > >
> > > --
> > > Paco Esteban.
> > > 0x5818130B8A6DBC03
> >
> > Oh, sounds like they messed up the fix afterwards then :(
>
> I think I've found the issue.  I had to add a new patch to src/util.c.
> They were trying to get the config file from
> ${SYSCONFDIR}/goaccess/goaccess.conf and we put it on
> ${SYSCONFDIR}/goaccess.conf
>
> Here's the updated patch.  With this it works fine for me on amd64.

Sure, but maybe we should follow upstream and @sample the file in
${SYSCONFDIR}/goaccess/goaccess.conf as it was apparently a deliberate
change in
https://github.com/allinurl/goaccess/commit/91d3adaddd0a53cd23373f2ee1480de610bc4439#
..