]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
sw-collector: Moved to its own directory and added man page
authorAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 16 Jul 2017 07:52:52 +0000 (09:52 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 18 Jul 2017 05:25:45 +0000 (07:25 +0200)
18 files changed:
configure.ac
src/Makefile.am
src/libimcv/plugins/imc_swima/Makefile.am
src/sw-collector/.gitignore [new file with mode: 0644]
src/sw-collector/Makefile.am [new file with mode: 0644]
src/sw-collector/sw-collector.8.in [new file with mode: 0644]
src/sw-collector/sw-collector.c [moved from src/libimcv/plugins/imc_swima/sw_collector/sw-collector.c with 100% similarity]
src/sw-collector/sw_collector_db.c [moved from src/libimcv/plugins/imc_swima/sw_collector/sw_collector_db.c with 100% similarity]
src/sw-collector/sw_collector_db.h [moved from src/libimcv/plugins/imc_swima/sw_collector/sw_collector_db.h with 100% similarity]
src/sw-collector/sw_collector_dpkg.c [moved from src/libimcv/plugins/imc_swima/sw_collector/sw_collector_dpkg.c with 100% similarity]
src/sw-collector/sw_collector_dpkg.h [moved from src/libimcv/plugins/imc_swima/sw_collector/sw_collector_dpkg.h with 100% similarity]
src/sw-collector/sw_collector_history.c [moved from src/libimcv/plugins/imc_swima/sw_collector/sw_collector_history.c with 100% similarity]
src/sw-collector/sw_collector_history.h [moved from src/libimcv/plugins/imc_swima/sw_collector/sw_collector_history.h with 100% similarity]
src/sw-collector/sw_collector_info.c [moved from src/libimcv/plugins/imc_swima/sw_collector/sw_collector_info.c with 100% similarity]
src/sw-collector/sw_collector_info.h [moved from src/libimcv/plugins/imc_swima/sw_collector/sw_collector_info.h with 100% similarity]
src/sw-collector/sw_collector_rest_api.c [moved from src/libimcv/plugins/imc_swima/sw_collector/sw_collector_rest_api.c with 100% similarity]
src/sw-collector/sw_collector_rest_api.h [moved from src/libimcv/plugins/imc_swima/sw_collector/sw_collector_rest_api.h with 100% similarity]
src/sw-collector/sw_collector_tables.sql [moved from src/libimcv/plugins/imc_swima/sw_collector/sw_collector_tables.sql with 100% similarity]

index 320c50b0a5ea0d9233abe432ce323c8756a5d545..c00cb801b15f987ba7bc1e15ec5e8ef0edc4b36b 100644 (file)
@@ -1956,6 +1956,7 @@ AC_CONFIG_FILES([
        src/checksum/Makefile
        src/conftest/Makefile
        src/pt-tls-client/Makefile
+       src/sw-collector/Makefile
        src/swanctl/Makefile
        scripts/Makefile
        testing/Makefile
@@ -1988,6 +1989,8 @@ AC_CONFIG_FILES([
        src/swanctl/swanctl.8
        src/swanctl/swanctl.conf.5.head
        src/swanctl/swanctl.conf.5.tail
+       src/pt-tls-client/pt-tls-client.1
+       src/sw-collector/sw-collector.8
 ])
 
 AC_OUTPUT
index df171b27040993be77f57a57abdf91e3e66bd29b..193b77c1ab3d79223d0c6478852f3b0ffdbd6673 100644 (file)
@@ -135,3 +135,7 @@ endif
 if USE_AIKGEN
   SUBDIRS += aikgen
 endif
+
+if USE_IMC_SWIMA
+  SUBDIRS += sw-collector
+endif
index e14556c629afe1401a7b7b56955d48e06983414c..4a29e7949252f748b2928b86c19245086e6c932d 100644 (file)
@@ -19,8 +19,7 @@ $(swid_tag) : $(regid)__strongSwan.swidtag.in
 AM_CPPFLAGS = \
        -I$(top_srcdir)/src/libstrongswan \
        -I$(top_srcdir)/src/libtncif \
-       -I$(top_srcdir)/src/libimcv \
-       -DPLUGINS=\""random openssl sqlite curl"\"
+       -I$(top_srcdir)/src/libimcv
 
 AM_CFLAGS = \
        $(PLUGIN_CFLAGS) $(json_CFLAGS)
@@ -32,23 +31,3 @@ imc_swima_la_LIBADD = \
        $(top_builddir)/src/libstrongswan/libstrongswan.la
 imc_swima_la_SOURCES = imc_swima.c imc_swima_state.h imc_swima_state.c
 imc_swima_la_LDFLAGS = -module -avoid-version -no-undefined
-
-ipsec_PROGRAMS = sw-collector
-sw_collector_SOURCES = \
-       sw_collector/sw-collector.c \
-       sw_collector/sw_collector_db.h sw_collector/sw_collector_db.c \
-       sw_collector/sw_collector_dpkg.h sw_collector/sw_collector_dpkg.c \
-       sw_collector/sw_collector_history.h sw_collector/sw_collector_history.c \
-       sw_collector/sw_collector_info.h sw_collector/sw_collector_info.c \
-       sw_collector/sw_collector_rest_api.h sw_collector/sw_collector_rest_api.c
-
-sw_collector_LDADD = \
-       $(top_builddir)/src/libstrongswan/libstrongswan.la \
-       $(top_builddir)/src/libimcv/libimcv.la \
-       $(json_LIBS)
-
-sw-collector.o : $(top_builddir)/config.status
-
-templatesdir = $(pkgdatadir)/templates/database/sw-collector
-dist_templates_DATA = sw_collector/sw_collector_tables.sql
-
diff --git a/src/sw-collector/.gitignore b/src/sw-collector/.gitignore
new file mode 100644 (file)
index 0000000..152dd95
--- /dev/null
@@ -0,0 +1,2 @@
+sw-collector
+sw-collector.8
diff --git a/src/sw-collector/Makefile.am b/src/sw-collector/Makefile.am
new file mode 100644 (file)
index 0000000..c36aa37
--- /dev/null
@@ -0,0 +1,33 @@
+sbin_PROGRAMS = sw-collector
+
+sw_collector_SOURCES = \
+       sw-collector.c \
+       sw_collector_db.h sw_collector_db.c \
+       sw_collector_dpkg.h sw_collector_dpkg.c \
+       sw_collector_history.h sw_collector_history.c \
+       sw_collector_info.h sw_collector_info.c \
+       sw_collector_rest_api.h sw_collector_rest_api.c
+
+sw-collector.o : $(top_builddir)/config.status
+
+AM_CPPFLAGS = \
+       -I$(top_srcdir)/src/libstrongswan \
+       -I$(top_srcdir)/src/libtncif \
+       -I$(top_srcdir)/src/libimcv \
+       -DPLUGINS=\""random openssl sqlite curl"\"
+
+AM_CFLAGS = $(json_CFLAGS)
+
+sw_collector_LDADD = \
+       $(top_builddir)/src/libstrongswan/libstrongswan.la \
+       $(top_builddir)/src/libimcv/libimcv.la \
+       $(json_LIBS)
+
+templatesdir = $(pkgdatadir)/templates/database/sw-collector
+dist_templates_DATA = sw_collector_tables.sql
+
+man8_MANS = sw-collector.8
+
+CLEANFILES = $(man8_MANS)
+
+
diff --git a/src/sw-collector/sw-collector.8.in b/src/sw-collector/sw-collector.8.in
new file mode 100644 (file)
index 0000000..a31c401
--- /dev/null
@@ -0,0 +1,90 @@
+.TH SW-COLLECTOR 1 "2017-07-15" "@PACKAGE_VERSION@" "strongSwan"
+.
+.SH "NAME"
+.
+sw-collector \- Extracts software installation events from dpkg history log
+.
+.SH "SYNOPSIS"
+.
+.SY "sw-collector"
+.OP \-\-debug level
+.OP \-\-quiet
+.OP \-\-count event-count
+.YS
+.
+.SY "sw-collector"
+.OP \-\-debug level
+.OP \-\-quiet
+.BR \-\-list |\fB\-\-unregistered\fR|\fB\-\-generate\fR|\fB\-\-migrate
+.YS
+.
+.SY "sw-collector"
+.B \-h
+|
+.B \-\-help
+.YS
+.
+.SH "DESCRIPTION"
+.
+.B sw-collector
+extracts information about software package installation, update or removal
+events from the apt history log and stores the software events in an SQLite
+database. The retrieved history information is then merged and made consistent
+with the actual list of installed software packages obtained with dpkg-query.
+.
+.SH "OPTIONS"
+.
+.TP
+.B "\-h, \-\-help"
+Prints usage information and a short summary of the available commands.
+.TP
+.BI "\-v, \-\-debug " level
+Set debug level, default: 2.
+.TP
+.B "\-q, \-\-quiet
+Disable debug output to stderr.
+.TP
+.B "\-l, \-\-list
+Lists all software packages stored in the collector database showing their
+installation status.
+.TP
+.B "\-u, \-\-unregistered
+Lists all software packages residing in the local collector database but for
+which no SWID tags exist yet in a central collector database reachable via a
+REST interface. 
+.TP
+.B "\-g, \-\-generate
+Generates minimal SWID tags for all deleted software packages residing in the
+local collector database but for which no SWID tags exist in a central collector
+database reachable via a REST interface.
+.TP
+.B "\-m, \-\-migrate
+Can be used to migrate collector database versions. Currently all architecture
+suffixes are removed from dpkg package names.
+.
+.SH "CONFIGURATION"
+.
+The following parameters can be configured in strongswan.conf:
+.P
+ sw-collector {
+    database = sqlite:///etc/pts/collector.db
+    history = /var/log/apt/history.log
+    first_time = 2016-04-22T20:55:14Z
+    rest_api {
+       uri = https://admin-user:ietf99hackathon@tnc.strongswan.org/api/
+       timeout = 120
+    }
+    tag_creator {
+       name = strongSwan Project
+       regid = strongswan.org
+    }
+ }
+.
+.SH "FILES"
+.
+@PKGDATADIR@/templates/database/sw-collector/sw_collector_tables.sql
+.
+.SH "SEE ALSO"
+.
+.BR strongswan.conf (5)
+