summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksandr Natalenko2020-07-26 12:06:48 +0200
committerOleksandr Natalenko2020-07-26 12:06:48 +0200
commit7dd1327997893b065b15ca0bbe9dced79e92464e (patch)
treeff7ab0edb334e42829f150b4c11d89636bdff4f8
parentac19b2a08a7b3f933849fd11c6fa22c15549b2d3 (diff)
downloadaur-bandwidthd.tar.gz
update to v2.0.4
Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name>
-rw-r--r--.SRCINFO36
-rw-r--r--01-bandwidthd-recover-cdf.patch16
-rw-r--r--02-bandwidthd-missing-comma.patch12
-rw-r--r--03-bandwidthd-subnet-reporting.patch17
-rw-r--r--04-bandwidthd-misc.patch107
-rw-r--r--05-bandwidthd-pidfile.patch40
-rw-r--r--06-bandwidthd-externs.patch89
-rw-r--r--PKGBUILD82
-rw-r--r--bandwidthd-rotate.service5
-rw-r--r--bandwidthd-rotate.timer9
-rw-r--r--bandwidthd-webui.conf37
-rw-r--r--bandwidthd-webui.service39
-rw-r--r--bandwidthd.service40
-rw-r--r--bandwidthd.sysusers1
-rw-r--r--bandwidthd.tmpfiles4
15 files changed, 22 insertions, 512 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 59f894faa6b..b124538b43c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
pkgbase = bandwidthd
pkgdesc = Daemon for graphing traffic of subnet machines
- pkgver = 2.0.2.r1.0307fbba56
- pkgrel = 11
+ pkgver = 2.0.4
+ pkgrel = 1
epoch = 1
- url = https://github.com/neatbasis/bandwidthd
+ url = https://gitlab.com/post-factum/bandwidthd
arch = x86_64
license = GPL
depends = sqlite
@@ -13,34 +13,8 @@ pkgbase = bandwidthd
depends = nginx
backup = etc/bandwidthd/bandwidthd.conf
backup = etc/bandwidthd/bandwidthd-webui.conf
- source = bandwidthd-2.0.2.r1.0307fbba56.tar.gz::https://github.com/neatbasis/bandwidthd/archive/0307fbba56a39a6e65ebadf488ad87979c64fdef.tar.gz
- source = 01-bandwidthd-recover-cdf.patch
- source = 02-bandwidthd-missing-comma.patch
- source = 03-bandwidthd-subnet-reporting.patch
- source = 04-bandwidthd-misc.patch
- source = 05-bandwidthd-pidfile.patch
- source = 06-bandwidthd-externs.patch
- source = bandwidthd.service
- source = bandwidthd-webui.service
- source = bandwidthd-webui.conf
- source = bandwidthd-rotate.timer
- source = bandwidthd-rotate.service
- source = bandwidthd.sysusers
- source = bandwidthd.tmpfiles
- sha256sums = 7e8ebf7e2eeb5266af904a8f7188b11d5a13ebb0343022c2a118b86f48a952e4
- sha256sums = b679dbd2fcc4ac8246c75cab0a5f0db86c00d2083c3b202e7fafb339114c971f
- sha256sums = 641c006a8b90e9548a1b2ea3e40326a2128df69d490a13173e61469543b20352
- sha256sums = 88c38a18b7bda6f3496dda3030ba118f8c461447dea426c13245099ae37a6d86
- sha256sums = be5fa230311258f14d4af6a00496443bfbc1a148a77f237bb4a0b663947e090a
- sha256sums = fc38a5623e66d82dec2efd28d2729e76e8f3b6056fb2bc2462a1ea1549f68807
- sha256sums = 51788ac70e44ca20706014302466cee7d70e19ad70faba52e3a54fb5c2c3c2a2
- sha256sums = 9c1cd09515073875438dc75fa0919cf6654dd1bd6398dbbb3772b990f515e71f
- sha256sums = 4e9f265d8cb2f23a5458afae61a8f88377ddc9ee31fa42b38a4062f0ffe426e1
- sha256sums = cd7b1ffff5dd9490ab69d777e459d79c229d5fef2e71a811df29f6c11e6acde4
- sha256sums = 73637c20e8e13f69efdfa58460dc8aa61478a3adb5c72927686adbbc524c468d
- sha256sums = 7526f4baa5e2e66f87647f876a0b3a4c766ed7d7489ae801e85608338c85a782
- sha256sums = d734cea9710691a1658b9996e35cd407e85b542aa0961aec57fc49281516aa5d
- sha256sums = 6c9e5bf89ecb580261a5a68ac240bd80ee43a7516c79023864acacbd8cee0ae2
+ source = bandwidthd-2.0.4.tar.bz2::https://gitlab.com/post-factum/bandwidthd/-/archive/v2.0.4/bandwidthd-v2.0.4.tar.bz2
+ sha256sums = 48ab79e81dcde5a5aeaab6ffe262c0d51c8739c7773d4dd9fa503d0f122e1e80
pkgname = bandwidthd
diff --git a/01-bandwidthd-recover-cdf.patch b/01-bandwidthd-recover-cdf.patch
deleted file mode 100644
index edfe3e7bd2e..00000000000
--- a/01-bandwidthd-recover-cdf.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/bandwidthd.c bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/bandwidthd.c
---- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/bandwidthd.c 2019-03-27 20:05:31.000000000 +0100
-+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/bandwidthd.c 2020-04-09 10:49:12.151941214 +0200
-@@ -1148,10 +1148,10 @@
- ip->timestamp = timestamp;
- if (fscanf(cdf, "%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu,",
- &ip->Send.total, &ip->Send.icmp, &ip->Send.udp,
-- &ip->Send.tcp, &ip->Send.ftp, &ip->Send.http, &ip->Send.mail, &ip->Send.p2p) != 7
-+ &ip->Send.tcp, &ip->Send.ftp, &ip->Send.http, &ip->Send.mail, &ip->Send.p2p) != 8
- || fscanf(cdf, "%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu",
- &ip->Receive.total, &ip->Receive.icmp, &ip->Receive.udp,
-- &ip->Receive.tcp, &ip->Receive.ftp, &ip->Receive.http, &ip->Receive.mail, &ip->Receive.p2p) != 7)
-+ &ip->Receive.tcp, &ip->Receive.ftp, &ip->Receive.http, &ip->Receive.mail, &ip->Receive.p2p) != 8)
- goto End_RecoverDataFromCdf;
- }
- End_RecoverDataFromCdf:
diff --git a/02-bandwidthd-missing-comma.patch b/02-bandwidthd-missing-comma.patch
deleted file mode 100644
index 934fba08d5a..00000000000
--- a/02-bandwidthd-missing-comma.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/bandwidthd.c bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/bandwidthd.c
---- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/bandwidthd.c 2019-03-27 20:05:31.000000000 +0100
-+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/bandwidthd.c 2020-04-09 10:58:06.145231013 +0200
-@@ -889,7 +889,7 @@
- HostIp2CharIp(IPData->ip, IPBuffer);
- fprintf(cdf, "%s,%lu,", IPBuffer, IPData->timestamp);
- Stats = &(IPData->Send);
-- fprintf(cdf, "%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu", Stats->total, Stats->icmp, Stats->udp, Stats->tcp, Stats->ftp, Stats->http, Stats->mail, Stats->p2p);
-+ fprintf(cdf, "%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu,", Stats->total, Stats->icmp, Stats->udp, Stats->tcp, Stats->ftp, Stats->http, Stats->mail, Stats->p2p);
- Stats = &(IPData->Receive);
- fprintf(cdf, "%llu,%llu,%llu,%llu,%llu,%llu,%llu,%llu\n", Stats->total, Stats->icmp, Stats->udp, Stats->tcp, Stats->ftp, Stats->http, Stats->mail, Stats->p2p);
- }
diff --git a/03-bandwidthd-subnet-reporting.patch b/03-bandwidthd-subnet-reporting.patch
deleted file mode 100644
index 4f1a15e98c8..00000000000
--- a/03-bandwidthd-subnet-reporting.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/bandwidthd.c bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/bandwidthd.c
---- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/bandwidthd.c 2019-03-27 20:05:31.000000000 +0100
-+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/bandwidthd.c 2020-04-09 11:13:08.489071600 +0200
-@@ -346,9 +346,12 @@
- // Log list of monitored subnets
- for (Counter = 0; Counter < SubnetCount; Counter++)
- {
-+ char subnet[16], mask[16];
- addr.s_addr = ntohl(SubnetTable[Counter].ip);
- addr2.s_addr = ntohl(SubnetTable[Counter].mask);
-- syslog(LOG_INFO, "Monitoring subnet %s with netmask %s", inet_ntoa(addr), inet_ntoa(addr2));
-+ strncpy(subnet, inet_ntoa(addr), 16);
-+ strncpy(mask, inet_ntoa(addr2), 16);
-+ syslog(LOG_INFO, "Monitoring subnet %s with netmask %s", subnet, mask);
- }
- for (Counter = 0; Counter < NotSubnetCount; Counter++)
- {
diff --git a/04-bandwidthd-misc.patch b/04-bandwidthd-misc.patch
deleted file mode 100644
index f830a1df01d..00000000000
--- a/04-bandwidthd-misc.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-diff -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/bandwidthd.c bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/bandwidthd.c
---- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/bandwidthd.c 2019-03-27 20:05:31.000000000 +0100
-+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/bandwidthd.c 2020-04-09 11:23:31.431948002 +0200
-@@ -120,6 +120,7 @@
- int NumGraphs = 0;
- pid_t graphpid;
- int Counter;
-+ int niceness __attribute__((unused));
- /* Did we catch any packets since last time? */
- if (!DataStore)
- return -2;
-@@ -136,7 +137,7 @@
- monstartup((u_long) &_start, (u_long) &etext);
- #endif
- signal(SIGHUP, SIG_IGN);
-- nice(4); // reduce priority so I don't choke out other tasks
-+ niceness = nice(4); // reduce priority so I don't choke out other tasks
- // Count Number of IP's in datastore
- for (DataStore = IPDataStore, Counter = 0; DataStore; Counter++, DataStore = DataStore->Next);
- // +1 because we don't want to accidently allocate 0
-@@ -256,6 +257,7 @@
- int ForkBackground = TRUE;
- int ListDevices = FALSE;
- int Counter;
-+ int niceness __attribute__((unused));
- char *bd_conf = NULL;
- struct in_addr addr, addr2;
- signal(SIGHUP, SIG_IGN);
-@@ -480,7 +482,7 @@
- // This is also set in CloseInterval because it gets overwritten in some commit modules
- signal(SIGALRM, handle_interval);
- alarm(config.interval);
-- nice(1);
-+ niceness = nice(1);
- while (1)
- {
- // Bookeeping
-@@ -610,7 +612,7 @@
- int AlreadyTotaled = FALSE;
- PacketCallbackLock = TRUE;
- eptr = (struct ether_header *) p;
-- vlanhdr = (struct vlanhdr *) p;
-+ vlanhdr = (struct VlanHeader *) p;
- if (eptr->ether_type == htons(1537))
- ParseBroadcast(p);
- if (vlanhdr->ether_type[0]==0x81 && vlanhdr->ether_type[1]==0x00) //Two byte-wise checks instead of 1 word-wise check to avoid word boundary issues on some intel processors
-diff -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/graph.c bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/graph.c
---- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/graph.c 2019-03-27 20:05:31.000000000 +0100
-+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/graph.c 2020-04-09 11:21:50.611498930 +0200
-@@ -387,7 +387,7 @@
- FILE *OutputFile;
- char filename[MAX_FILENAME];
- gdImagePtr im, im2;
-- int white;
-+ int white __attribute__((unused));
- unsigned long long int YMax;
- char CharIp[20];
-
-@@ -489,7 +489,9 @@
- char Buffer2[50];
-
- int blue, lblue, orange, red, yellow, purple, green, brown, black;
-- int blue2, lblue2, orange2, red2, yellow2, purple2, green2, brown2, black2;
-+ int blue2, lblue2;
-+ int orange2 __attribute__((unused));
-+ int red2, yellow2, purple2, green2, brown2, black2;
-
- unsigned long long int SentPeak = 0;
- unsigned long long int ReceivedPeak = 0;
-@@ -802,7 +804,8 @@
- {
- char buffer[100];
- int black, red;
-- time_t sample_begin, sample_end;
-+ time_t sample_begin;
-+ time_t sample_end __attribute__((unused));
- struct tm *timestruct;
- long int MarkTime;
- long int MarkTimeStep;
-diff -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/pgsql.c bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/pgsql.c
---- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/pgsql.c 2019-03-27 20:05:31.000000000 +0100
-+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/pgsql.c 2020-04-09 11:24:13.432131299 +0200
-@@ -471,10 +471,12 @@
- }
- #endif
-
-+#ifdef HAVE_LIBPQ
- static void pgsqllngjmp(int signal)
- {
- longjmp(pgsqljmp, 1);
- }
-+#endif
-
- void pgsqlStoreIPData(struct IPData IncData[], struct extensions *extension_data)
- {
-diff -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/sqlite.c bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/sqlite.c
---- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/sqlite.c 2019-03-27 20:05:31.000000000 +0100
-+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/sqlite.c 2020-04-09 11:27:57.313078710 +0200
-@@ -250,7 +250,7 @@
-
- time_t now;
-
-- if (!config.output_database == DB_SQLITE)
-+ if (config.output_database != DB_SQLITE)
- return;
-
- // ************ Inititialize the db if it's not already
diff --git a/05-bandwidthd-pidfile.patch b/05-bandwidthd-pidfile.patch
deleted file mode 100644
index bc6afc75109..00000000000
--- a/05-bandwidthd-pidfile.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-diff -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/README.md bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/README.md
---- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/README.md 2019-03-27 20:05:31.000000000 +0100
-+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/README.md 2020-04-09 13:41:44.713813385 +0200
-@@ -113,7 +113,7 @@
- in it's directory. recover_cdf will cause Bandwidthd to load that file when
- it starts. You will also want to make a crontab entry like so:
-
--0 0 * * * * /bin/kill -HUP `cat /var/run/bandwidthd.pid`
-+0 0 * * * * /bin/kill -HUP `cat /run/bandwidthd/bandwidthd.pid`
-
- This will send Bandwidthd a HUP every night at midnight. When Bandwidthd
- receives a HUP it schedules a rotation of it's log files during the next
-diff -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/bandwidthd.c bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/bandwidthd.c
---- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/bandwidthd.c 2019-03-27 20:05:31.000000000 +0100
-+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/bandwidthd.c 2020-04-09 13:41:49.993831659 +0200
-@@ -208,20 +208,20 @@
- void makepidfile(pid_t pid)
- {
- FILE *pidfile;
-- pidfile = fopen("/var/run/bandwidthd.pid", "wt");
-+ pidfile = fopen("/run/bandwidthd/bandwidthd.pid", "wt");
- if (pidfile)
- {
- if (fprintf(pidfile, "%d\n", pid) == 0)
- {
-- syslog(LOG_ERR, "Bandwidthd: failed to write '%d' to /var/run/bandwidthd.pid", pid);
-+ syslog(LOG_ERR, "Bandwidthd: failed to write '%d' to /run/bandwidthd/bandwidthd.pid", pid);
- fclose(pidfile);
-- unlink("/var/run/bandwidthd.pid");
-+ unlink("/run/bandwidthd/bandwidthd.pid");
- }
- else
- fclose(pidfile);
- }
- else
-- syslog(LOG_ERR, "Could not open /var/run/bandwidthd.pid for write");
-+ syslog(LOG_ERR, "Could not open /run/bandwidthd/bandwidthd.pid for write");
- }
-
- void PrintHelp(void)
diff --git a/06-bandwidthd-externs.patch b/06-bandwidthd-externs.patch
deleted file mode 100644
index 436dee2202d..00000000000
--- a/06-bandwidthd-externs.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-Common subdirectories: bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/autom4te.cache and bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/autom4te.cache
-diff --color -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/bandwidthd.h bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/bandwidthd.h
---- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/bandwidthd.h 2019-03-27 20:05:31.000000000 +0100
-+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/bandwidthd.h 2020-07-26 01:02:59.083501756 +0200
-@@ -138,7 +138,7 @@
- {
- uint32_t ip;
- uint32_t mask;
-- } SubnetTable[SUBNET_NUM];
-+ };
-
- struct Statistics
- {
-@@ -162,7 +162,7 @@
- uint32_t ip; // Host byte order
- struct Statistics Send;
- struct Statistics Receive;
-- } IpTable[IP_NUM];
-+ };
-
- struct SummaryData
- {
-diff --color -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/conf.y bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/conf.y
---- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/conf.y 2019-03-27 20:05:31.000000000 +0100
-+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/conf.y 2020-07-26 01:03:49.061196876 +0200
-@@ -13,9 +13,10 @@
-
- extern unsigned int SubnetCount;
- extern unsigned int NotSubnetCount;
--extern struct SubnetData SubnetTable[];
-+extern struct SubnetData SubnetTable[SUBNET_NUM];
- extern struct SubnetData NotSubnetTable[];
- extern struct config config;
-+extern struct IPData IpTable[IP_NUM];
-
- int bdconfig_lex(void);
- int LineNo = 1;
-Common subdirectories: bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/etc and bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/etc
-Common subdirectories: bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/extensions and bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/extensions
-diff --color -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/extensions.c bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/extensions.c
---- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/extensions.c 2019-03-27 20:05:31.000000000 +0100
-+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/extensions.c 2020-07-26 01:04:11.524995125 +0200
-@@ -5,6 +5,8 @@
- #include <unistd.h>
-
- extern struct config config;
-+extern struct SubnetData SubnetTable[SUBNET_NUM];
-+extern struct IPData IpTable[IP_NUM];
-
- static char *execute_extension(char * filename);
-
-diff --color -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/graph.c bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/graph.c
---- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/graph.c 2019-03-27 20:05:31.000000000 +0100
-+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/graph.c 2020-07-26 01:03:31.484168544 +0200
-@@ -20,6 +20,8 @@
-
- extern unsigned int SubnetCount;
- extern struct config config;
-+extern struct SubnetData SubnetTable[SUBNET_NUM];
-+extern struct IPData IpTable[IP_NUM];
-
- jmp_buf dnsjump;
-
-Common subdirectories: bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/htdocs and bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/htdocs
-diff --color -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/pgsql.c bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/pgsql.c
---- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/pgsql.c 2019-03-27 20:05:31.000000000 +0100
-+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/pgsql.c 2020-07-26 01:04:02.908148428 +0200
-@@ -5,6 +5,8 @@
- extern unsigned int IpCount;
- extern struct Broadcast *Broadcasts;
- extern time_t ProgramStart;
-+extern struct SubnetData SubnetTable[SUBNET_NUM];
-+extern struct IPData IpTable[IP_NUM];
-
- jmp_buf pgsqljmp;
-
-Common subdirectories: bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/phphtdocs and bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/phphtdocs
-diff --color -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/sqlite.c bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/sqlite.c
---- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/sqlite.c 2019-03-27 20:05:31.000000000 +0100
-+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/sqlite.c 2020-07-26 01:04:07.021566388 +0200
-@@ -3,6 +3,8 @@
- extern struct config config;
- extern unsigned int IpCount;
- extern time_t ProgramStart;
-+extern struct SubnetData SubnetTable[SUBNET_NUM];
-+extern struct IPData IpTable[IP_NUM];
-
- #ifdef HAVE_LIBSQLITE3
-
diff --git a/PKGBUILD b/PKGBUILD
index b236f5c711e..0cdcd549411 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,102 +1,54 @@
# Maintainer: Oleksandr Natalenko <oleksandr@natalenko.name>
pkgname=bandwidthd
-_repouser=neatbasis
+_repouser=post-factum
_reponame=bandwidthd
-_rev=0307fbba56a39a6e65ebadf488ad87979c64fdef
-pkgver=2.0.2.r1.${_rev:0:10}
-pkgrel=11
+pkgver=2.0.4
+pkgrel=1
epoch=1
pkgdesc="Daemon for graphing traffic of subnet machines"
arch=(x86_64)
-url="https://github.com/neatbasis/bandwidthd"
+url="https://gitlab.com/post-factum/bandwidthd"
license=(GPL)
depends=(sqlite libpcap libpng gd nginx)
-source=(${pkgname}-${pkgver}.tar.gz::https://github.com/${_repouser}/${_reponame}/archive/${_rev}.tar.gz
- 01-bandwidthd-recover-cdf.patch
- 02-bandwidthd-missing-comma.patch
- 03-bandwidthd-subnet-reporting.patch
- 04-bandwidthd-misc.patch
- 05-bandwidthd-pidfile.patch
- 06-bandwidthd-externs.patch
- bandwidthd.service
- bandwidthd-webui.service
- bandwidthd-webui.conf
- bandwidthd-rotate.timer
- bandwidthd-rotate.service
- bandwidthd.sysusers
- bandwidthd.tmpfiles)
+source=(${pkgname}-${pkgver}.tar.bz2::https://gitlab.com/${_repouser}/${_reponame}/-/archive/v${pkgver}/${_reponame}-v${pkgver}.tar.bz2)
-sha256sums=('7e8ebf7e2eeb5266af904a8f7188b11d5a13ebb0343022c2a118b86f48a952e4'
- 'b679dbd2fcc4ac8246c75cab0a5f0db86c00d2083c3b202e7fafb339114c971f'
- '641c006a8b90e9548a1b2ea3e40326a2128df69d490a13173e61469543b20352'
- '88c38a18b7bda6f3496dda3030ba118f8c461447dea426c13245099ae37a6d86'
- 'be5fa230311258f14d4af6a00496443bfbc1a148a77f237bb4a0b663947e090a'
- 'fc38a5623e66d82dec2efd28d2729e76e8f3b6056fb2bc2462a1ea1549f68807'
- '51788ac70e44ca20706014302466cee7d70e19ad70faba52e3a54fb5c2c3c2a2'
- '9c1cd09515073875438dc75fa0919cf6654dd1bd6398dbbb3772b990f515e71f'
- '4e9f265d8cb2f23a5458afae61a8f88377ddc9ee31fa42b38a4062f0ffe426e1'
- 'cd7b1ffff5dd9490ab69d777e459d79c229d5fef2e71a811df29f6c11e6acde4'
- '73637c20e8e13f69efdfa58460dc8aa61478a3adb5c72927686adbbc524c468d'
- '7526f4baa5e2e66f87647f876a0b3a4c766ed7d7489ae801e85608338c85a782'
- 'd734cea9710691a1658b9996e35cd407e85b542aa0961aec57fc49281516aa5d'
- '6c9e5bf89ecb580261a5a68ac240bd80ee43a7516c79023864acacbd8cee0ae2')
+sha256sums=('48ab79e81dcde5a5aeaab6ffe262c0d51c8739c7773d4dd9fa503d0f122e1e80')
backup=('etc/bandwidthd/bandwidthd.conf'
'etc/bandwidthd/bandwidthd-webui.conf')
prepare () {
- cd "${_reponame}-${_rev}"
+ cd "${_reponame}-v${pkgver}"
- patch -Np1 -i ../01-bandwidthd-recover-cdf.patch
- patch -Np1 -i ../02-bandwidthd-missing-comma.patch
- patch -Np1 -i ../03-bandwidthd-subnet-reporting.patch
- patch -Np1 -i ../04-bandwidthd-misc.patch
- patch -Np1 -i ../05-bandwidthd-pidfile.patch
- patch -Np1 -i ../06-bandwidthd-externs.patch
-
- sed -i 's|EXTRA_VERSION=".IPv6"|EXTRA_VERSION=".'${_rev:0:10}'"|' configure.in
-
- sed -i 's|output_cdf false|output_cdf true|' etc/bandwidthd.conf
- sed -i 's|recover_cdf false|recover_cdf true|' etc/bandwidthd.conf
- sed -i 's|graph false|graph true|' etc/bandwidthd.conf
-
- sed -i 's|#log_dir "/usr/local/var/bandwidthd"|log_dir "/var/lib/bandwidthd"|' etc/bandwidthd.conf
- sed -i 's|#htdocs_dir "/usr/local/var/bandwidthd/htdocs"|htdocs_dir "/var/lib/bandwidthd/htdocs"|' etc/bandwidthd.conf
-
- sed -i 's|pgsql_connect_string "dbname = bandwidthd password=kahlas12451 user = perkins host = localhost"|#pgsql_connect_string "dbname = bandwidthd password=kahlas12451 user = perkins host = localhost"|' etc/bandwidthd.conf
- sed -i 's|#sqlite_filename "/var/bandwidthd.db"|sqlite_filename "/var/lib/bandwidthd/bandwidthd.db"|' etc/bandwidthd.conf
+ autoreconf
CFLAGS="-std=gnu89 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt" ./configure \
--prefix=/usr \
--sysconfdir=/etc/bandwidthd \
--localstatedir=/var/lib \
- --disable-python \
- --disable-pgsql \
--without-x
}
build() {
- cd "${_reponame}-${_rev}"
-
- make -j1
+ cd "${_reponame}-v${pkgver}"
}
package() {
- cd "${_reponame}-${_rev}"
+ cd "${_reponame}-v${pkgver}"
install -dm700 "${pkgdir}/var/lib/bandwidthd"
make DESTDIR="${pkgdir}" install
- install -Dm644 "../bandwidthd.service" -t "${pkgdir}/usr/lib/systemd/system"
- install -Dm644 "../bandwidthd-webui.service" -t "${pkgdir}/usr/lib/systemd/system"
- install -Dm644 "../bandwidthd-webui.conf" -t "${pkgdir}/etc/bandwidthd"
- install -Dm644 "../bandwidthd-rotate.timer" -t "${pkgdir}/usr/lib/systemd/system"
- install -Dm644 "../bandwidthd-rotate.service" -t "${pkgdir}/usr/lib/systemd/system"
- install -Dm644 "../bandwidthd.sysusers" "${pkgdir}/usr/lib/sysusers.d/bandwidthd.conf"
- install -Dm644 "../bandwidthd.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/bandwidthd.conf"
+ install -Dm644 "etc/bandwidthd.service" -t "${pkgdir}/usr/lib/systemd/system"
+ install -Dm644 "etc/bandwidthd-webui.service" -t "${pkgdir}/usr/lib/systemd/system"
+ install -Dm644 "etc/bandwidthd-webui.conf" -t "${pkgdir}/etc/bandwidthd"
+ install -Dm644 "etc/bandwidthd-rotate.timer" -t "${pkgdir}/usr/lib/systemd/system"
+ install -Dm644 "etc/bandwidthd-rotate.service" -t "${pkgdir}/usr/lib/systemd/system"
+ install -Dm644 "etc/bandwidthd.sysusers" "${pkgdir}/usr/lib/sysusers.d/bandwidthd.conf"
+ install -Dm644 "etc/bandwidthd.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/bandwidthd.conf"
}
# vim: set tabstop=4:softtabstop=4:shiftwidth=4:noexpandtab
diff --git a/bandwidthd-rotate.service b/bandwidthd-rotate.service
deleted file mode 100644
index 1a8d2208896..00000000000
--- a/bandwidthd-rotate.service
+++ /dev/null
@@ -1,5 +0,0 @@
-[Unit]
-Description=Daemon for graphing traffic of subnet machines - Rotate
-
-[Service]
-ExecStart=/usr/bin/systemctl kill --signal=SIGHUP bandwidthd.service
diff --git a/bandwidthd-rotate.timer b/bandwidthd-rotate.timer
deleted file mode 100644
index 2025123bfa1..00000000000
--- a/bandwidthd-rotate.timer
+++ /dev/null
@@ -1,9 +0,0 @@
-[Unit]
-Description=Daemon for graphing traffic of subnet machines - Rotate
-PartOf=bandwidthd.service
-
-[Timer]
-OnCalendar=*-*-* 00:00:00
-
-[Install]
-WantedBy=bandwidthd.service
diff --git a/bandwidthd-webui.conf b/bandwidthd-webui.conf
deleted file mode 100644
index e72cb98c43d..00000000000
--- a/bandwidthd-webui.conf
+++ /dev/null
@@ -1,37 +0,0 @@
-daemon off;
-worker_processes auto;
-
-pid /run/bandwidthd/bandwidthd-webui.pid;
-
-error_log stderr;
-
-events {
- worker_connections 1024;
-}
-
-http {
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
-
- access_log off;
-
- types_hash_max_size 4096;
-
- sendfile on;
- gzip on;
-
- server {
- listen 667;
- listen [::]:667;
-
- root /var/lib/bandwidthd/htdocs;
-
- location / {
- index index.html;
- }
-
- location = /favicon.ico {
- log_not_found off;
- }
- }
-}
diff --git a/bandwidthd-webui.service b/bandwidthd-webui.service
deleted file mode 100644
index 1486f316efa..00000000000
--- a/bandwidthd-webui.service
+++ /dev/null
@@ -1,39 +0,0 @@
-[Unit]
-Description=Daemon for graphing traffic of subnet machines - Web UI
-PartOf=bandwidthd.service
-
-[Service]
-User=bandwidthd
-Group=bandwidthd
-CapabilityBoundingSet=CAP_NET_BIND_SERVICE
-AmbientCapabilities=CAP_NET_BIND_SERVICE
-RestrictAddressFamilies=AF_INET AF_INET6
-RestrictNamespaces=true
-PrivateDevices=true
-NoNewPrivileges=true
-PrivateTmp=true
-ProtectClock=true
-ProtectControlGroups=true
-ProtectHome=true
-ProtectKernelLogs=true
-ProtectKernelModules=true
-ProtectKernelTunables=true
-ProtectSystem=strict
-StateDirectory=bandwidthd
-RuntimeDirectory=bandwidthd
-ConfigurationDirectory=bandwidthd
-RestrictSUIDSGID=true
-SystemCallArchitectures=native
-RestrictRealtime=true
-LockPersonality=true
-MemoryDenyWriteExecute=true
-RemoveIPC=true
-UMask=066
-ProtectHostname=true
-SystemCallFilter=@system-service
-SystemCallFilter=~@privileged @resources
-ExecStart=/usr/bin/nginx -c /etc/bandwidthd/bandwidthd-webui.conf
-PIDFile=bandwidthd/bandwidthd-webui.pid
-
-[Install]
-WantedBy=bandwidthd.service
diff --git a/bandwidthd.service b/bandwidthd.service
deleted file mode 100644
index f9f4675eb99..00000000000
--- a/bandwidthd.service
+++ /dev/null
@@ -1,40 +0,0 @@
-[Unit]
-Description=Daemon for graphing traffic of subnet machines
-Requires=network-online.target bandwidthd-rotate.timer bandwidthd-webui.service
-
-[Service]
-User=bandwidthd
-Group=bandwidthd
-CapabilityBoundingSet=CAP_NET_RAW
-AmbientCapabilities=CAP_NET_RAW
-RestrictAddressFamilies=AF_UNIX AF_PACKET
-RestrictNamespaces=true
-PrivateDevices=true
-NoNewPrivileges=true
-PrivateTmp=true
-ProtectClock=true
-ProtectControlGroups=true
-ProtectHome=true
-ProtectKernelLogs=true
-ProtectKernelModules=true
-ProtectKernelTunables=true
-ProtectSystem=strict
-StateDirectory=bandwidthd
-RuntimeDirectory=bandwidthd
-ConfigurationDirectory=bandwidthd
-RestrictSUIDSGID=true
-SystemCallArchitectures=native
-RestrictRealtime=true
-LockPersonality=true
-MemoryDenyWriteExecute=true
-RemoveIPC=true
-UMask=066
-ProtectHostname=true
-IPAddressDeny=any
-SystemCallFilter=@system-service
-SystemCallFilter=~@privileged
-ExecStart=/usr/bin/bandwidthd -D -c /etc/bandwidthd/bandwidthd.conf
-PIDFile=bandwidthd/bandwidthd.pid
-
-[Install]
-WantedBy=multi-user.target
diff --git a/bandwidthd.sysusers b/bandwidthd.sysusers
deleted file mode 100644
index 20ff4733207..00000000000
--- a/bandwidthd.sysusers
+++ /dev/null
@@ -1 +0,0 @@
-u bandwidthd - "bandwidthd user" /var/lib/bandwidthd -
diff --git a/bandwidthd.tmpfiles b/bandwidthd.tmpfiles
deleted file mode 100644
index e83cc711d12..00000000000
--- a/bandwidthd.tmpfiles
+++ /dev/null
@@ -1,4 +0,0 @@
-d /var/lib/bandwidthd 0700 bandwidthd bandwidthd -
-Z /var/lib/bandwidthd - bandwidthd bandwidthd -
-d /run/bandwidthd 0700 bandwidthd bandwidthd -
-Z /run/bandwidthd - bandwidthd bandwidthd -