diff options
-rw-r--r-- | community/greenbone-security-assistant/APKBUILD | 41 | ||||
-rw-r--r-- | community/greenbone-security-assistant/gsa-pid.patch (renamed from community/greenbone-security-assistant/cmakelist.patch) | 0 | ||||
-rw-r--r-- | community/greenbone-security-assistant/gsad-sbin.patch | 13 | ||||
-rw-r--r-- | community/greenbone-security-assistant/gsad.confd | 42 | ||||
-rw-r--r-- | community/greenbone-security-assistant/gsad.initd | 17 | ||||
-rw-r--r-- | community/greenbone-security-assistant/gsad.logrotate | 22 | ||||
-rw-r--r-- | community/greenbone-security-assistant/remove-husky-git-hook.patch | 24 |
7 files changed, 118 insertions, 41 deletions
diff --git a/community/greenbone-security-assistant/APKBUILD b/community/greenbone-security-assistant/APKBUILD index b32698f164..b7e1999b62 100644 --- a/community/greenbone-security-assistant/APKBUILD +++ b/community/greenbone-security-assistant/APKBUILD @@ -2,8 +2,8 @@ # Maintainer: Francesco Colista <fcolista@alpinelinux.org> pkgname=greenbone-security-assistant _pkgname=gsad -pkgver=8.0.1 -pkgrel=2 +pkgver=9.0.0 +pkgrel=0 pkgdesc="Greenbone Security Assistant (gsa) - OpenVAS web frontend" url="http://www.openvas.org/" arch="all" @@ -14,41 +14,52 @@ makedepends="cmake doxygen xmltoman graphviz gvm-libs-dev nodejs-current npm yarn clang-dev" checkdepends="cppcheck" subpackages="$pkgname-doc $pkgname-openrc" -source="$pkgname-$pkgver.tar.gz::https://github.com/greenbone/gsa/archive/v${pkgver}.tar.gz +source="$pkgname-$pkgver.tar.gz::https://github.com/greenbone/gsa/archive/v$pkgver.tar.gz $_pkgname.initd $_pkgname.confd $_pkgname.logrotate - cmakelist.patch sys-siglist.patch - musl-stack-size.patch - remove-husky-git-hook.patch" + remove-husky-git-hook.patch + gsa-pid.patch + gsad-sbin.patch + musl-stack-size.patch" builddir="$srcdir/gsa-$pkgver" +prepare() { + default_prepare + mkdir build +} + build() { + cd $builddir/build cmake -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DSYSCONFDIR=/etc \ -DSBINDIR=/usr/sbin \ - -DLOCALSTATEDIR=/var . - make + -DLOCALSTATEDIR=/var \ + .. + make } check() { + cd $builddir/build make check } package() { + cd $builddir/build make DESTDIR="$pkgdir" install install -Dm644 "$srcdir/$_pkgname.logrotate" "$pkgdir/etc/logrotate.d/$_pkgname" install -Dm755 "$srcdir/$_pkgname.initd" "$pkgdir/etc/init.d/$_pkgname" install -Dm755 "$srcdir/$_pkgname.confd" "$pkgdir/etc/conf.d/$_pkgname" } -sha512sums="b91c1c4b8073c3ad3d3d636abbaa7881393f1448eae7366636ff618391c199c240e6bc4c848740a4267b4142aa872fb91c0798b8034d152d16016e650fbda2b8 greenbone-security-assistant-8.0.1.tar.gz -0734d3b7dc77b8de56dec63e677aefad14dcb718b5f3081f98738397c267d4fb36bbb167085213bc1d02d9261e4913f43f974f65226c459f9dfed0d970cf9b85 gsad.initd -aea96cef16ca7a63570c2d94a1fc7ef27d4163c28e1d729fd11821295f88a96864add0146d407e7b6de296dd6ca6f2c97d72097dd4ffe786b575f128abdbb1bf gsad.confd -0d459084f95e00dfb06912b9d89af011fac117a32687ffd3da3887c24e80c074b681c0d87532a4a7511e42c540f8d8b2ceaa04208fff531b94047a08decddd0f gsad.logrotate -6752bb6834811fc7c1259d2c8a0ae5f25a01de881008f6f6635b1f7a43672b5c1862de5b3591f81d7a2f22258614b71bb6ab588a3930648d9d74ef8a75d28c92 cmakelist.patch +sha512sums="5f2b955408e0231b96f4b2415df0c76e9003079acd65b9e1c771082999540121ff92a8c17d9529362be8f7fc632d91bd3f48854a5a2d9632efe10fb354361d8e greenbone-security-assistant-9.0.0.tar.gz +884f78ae19a5d42d192f822f0799c201a861ee44a741628c76a7daa1100e1e1e1992cca67daae40192510db3efd487ae5360f0ed88c8f3464782b1eb34ec65bb gsad.initd +94b78225cd6b452a26911f48926ed807c2718d426e891287c3053def385ca586446bf29be5c1a8957267a9640545011b264cd72f57f92e490940878e09e817ec gsad.confd +ab43f8c54cf72e2a800bdcf4daebeabfa18a7ef49f098d65e70f97ccab3d36606c353b82b8fd6b4f2cecd289d36f48f805a5c34cba86f8e8c61bf074b0afe695 gsad.logrotate 1fd6585bc5c5131d19d5d89ddc56b683d5ab1b28793059f5b147ad05eb6330b69d590caa2f12afce6da20b1676d8cdd26d90e51d165e94b308643ec7d2525015 sys-siglist.patch -ad78cce9f4f21157d679e227698896364c33eac9c5af4228552b61c0f9bde0e3b2743ae6717766acde38d5445d08e60832b2b0418456cdb8a77a91b3c440735b musl-stack-size.patch -61a2ad4f6f5742de36e1468f5c4f6d85099e9b8c6be805eb08aea05ffed183d1d972063596193e5e2305d4c133392a698123e364e1e0fe5c90889b50f235172a remove-husky-git-hook.patch" +c23ac92076d1ef41f8f3a2cdda1148d1005212ce4eb11c43251d6b43c21062c4d98ae780f65f1e34b909133561c439dc2c771da95054aff131e70633e4039594 remove-husky-git-hook.patch +6752bb6834811fc7c1259d2c8a0ae5f25a01de881008f6f6635b1f7a43672b5c1862de5b3591f81d7a2f22258614b71bb6ab588a3930648d9d74ef8a75d28c92 gsa-pid.patch +3afa191863e1056182f8abf7f6d9a65cbd5d3fd69a522c5e414e19fcf2dd6d02eb8b5b2867383eaa659ce913f169c0739a4bc1209996879337b60ccd80d0bcfa gsad-sbin.patch +ad78cce9f4f21157d679e227698896364c33eac9c5af4228552b61c0f9bde0e3b2743ae6717766acde38d5445d08e60832b2b0418456cdb8a77a91b3c440735b musl-stack-size.patch" diff --git a/community/greenbone-security-assistant/cmakelist.patch b/community/greenbone-security-assistant/gsa-pid.patch index 0501cb785e..0501cb785e 100644 --- a/community/greenbone-security-assistant/cmakelist.patch +++ b/community/greenbone-security-assistant/gsa-pid.patch diff --git a/community/greenbone-security-assistant/gsad-sbin.patch b/community/greenbone-security-assistant/gsad-sbin.patch new file mode 100644 index 0000000000..738f9dfac5 --- /dev/null +++ b/community/greenbone-security-assistant/gsad-sbin.patch @@ -0,0 +1,13 @@ +diff --git a/gsad/src/CMakeLists.txt b/gsad/src/CMakeLists.txt +index 27dbb22..b7f6d6f 100644 +--- a/gsad/src/CMakeLists.txt ++++ b/gsad/src/CMakeLists.txt +@@ -177,7 +177,7 @@ add_definitions (-DPREFIX="${CMAKE_INSTALL_PREFIX}") + ## Install + + install (TARGETS gsad +- RUNTIME DESTINATION ${SBINDIR} ++ RUNTIME DESTINATION ${BINDIR} + LIBRARY DESTINATION ${LIBDIR} + ARCHIVE DESTINATION ${LIBDIR}/static) + diff --git a/community/greenbone-security-assistant/gsad.confd b/community/greenbone-security-assistant/gsad.confd index f18d71979d..c484af78c7 100644 --- a/community/greenbone-security-assistant/gsad.confd +++ b/community/greenbone-security-assistant/gsad.confd @@ -1,10 +1,32 @@ -# If you want ssl, you need a certificate -GSAD_EXTRA_ARGS="--http-only" -#By default on 9392 -GSAD_PORT="--port=9392" -#By default on locallhost, but you might want to use a reachable ip address -GSAD_LISTEN="--listen=127.0.0.1" -#Manager listens on given address - by default manager listens on all addresses -MANAGER_LISTEN="--mlisten=127.0.0.1" -#Manager listens on given port - by default 9390 -MANAGER_PORT="--mport=9390" +# OpenVAS Security Assistant command args +# man page --> https://www.mankier.com/8/gsad + +# e.g. --foreground | e.g. --no-redirect -- > Don't listen port 80 anymore +OPENVAS_SECURITY_ASSISTANT_OPTIONS="--no-redirect" + +# WebUI adress +OPENVAS_SECURITY_ASSISTANT_LISTEN_ADDRESS="--listen=127.0.0.1" + +# WebUI Port +OPENVAS_SECURITY_ASSISTANT_LISTEN_PORT="--port=9392" + +# WebUI Manager Address +OPENVAS_SECURITY_ASSISTANT_MANAGER_LISTEN_ADDRESS="--mlisten=127.0.0.1" + +# WebUI Manager Port +OPENVAS_SECURITY_ASSISTANT_MANAGER_LISTEN_PORT="--mport=9390" + +# TLS Settings +OPENVAS_SECURITY_ASSISTANT_GNUTLS_PRIORITIES="--gnutls-priorities=NORMAL" + +# If you use reverse proxy you must set OPENVAS_REVERSE_PROXY daemon arg +# otherwise you will get the below error. +# --------------------------------------------------------------- +# The request contained an unknown or invalid Host header. +# If you are trying to access GSA via its hostname or a proxy, +# make sure GSA is set up to allow it. +# --------------------------------------------------------------- + +# Reverse Proxy Settings ( e.g. --allow-header-host=subdomain.example.com ) +OPENVAS_REVERSE_PROXY="--allow-header-host=" + diff --git a/community/greenbone-security-assistant/gsad.initd b/community/greenbone-security-assistant/gsad.initd index e643c24483..b6109dec1a 100644 --- a/community/greenbone-security-assistant/gsad.initd +++ b/community/greenbone-security-assistant/gsad.initd @@ -1,16 +1,21 @@ #!/sbin/openrc-run -#Copyright 2016 Alpine Linux +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -# $Id$ -command_args="${GSAD_LISTEN} ${GSAD_PORT} ${MANAGER_LISTEN} ${MANAGER_PORT} ${GSAD_EXTRA_ARGS}" -name="Greenbone Security Assistant (GSA)" -command=/usr/sbin/gsad +: ${GSAD_USER:=gvm} +: ${GSAD_GROUP:=gvm} +: ${GSAD_TIMEOUT:=30} +name="Greenbone Security Assistant (GSA)" +command="/usr/bin/gsad" +command_args="${GSAD_OPTIONS} ${GSAD_LISTEN_ADDRESS} ${GSAD_LISTEN_PORT} ${GVMD_LISTEN_ADDRESS} ${GVMD_LISTEN_PORT} ${GSAD_GNUTLS_PRIORITIES}" +command_background="true" +command_user="${GSAD_USER}:${GSAD_GROUP}" pidfile="/run/gsad.pid" +retry="${GSAD_TIMEOUT}" depend() { after bootmisc - need net gvmd + need localmount net gvmd } diff --git a/community/greenbone-security-assistant/gsad.logrotate b/community/greenbone-security-assistant/gsad.logrotate index f0948cbea1..f80bba881c 100644 --- a/community/greenbone-security-assistant/gsad.logrotate +++ b/community/greenbone-security-assistant/gsad.logrotate @@ -1,11 +1,13 @@ -# logrotate for openvas -/var/log/openvas/gsad.log { - rotate 4 - weekly - compress - delaycompress - missingok - postrotate - /bin/kill -HUP `pidof gsad` - endscript +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 +# Daemon ignore HUP so we use 'copytruncate' instead of 'create' +# with safe file size to prevent losing log entries. + +/var/log/gvm/gsad.log { + compress + missingok + notifempty + sharedscripts + copytruncate + maxsize 10M } diff --git a/community/greenbone-security-assistant/remove-husky-git-hook.patch b/community/greenbone-security-assistant/remove-husky-git-hook.patch new file mode 100644 index 0000000000..f2c43a34e7 --- /dev/null +++ b/community/greenbone-security-assistant/remove-husky-git-hook.patch @@ -0,0 +1,24 @@ +diff --git a/gsa/package.json b/gsa/package.json +index 8b1987a..75aaadb 100644 +--- a/gsa/package.json ++++ b/gsa/package.json +@@ -82,7 +82,6 @@ + "@testing-library/react": "^9.1.1", + "@types/jest": "^24.0.18", + "eslint-config-prettier": "^6.1.0", +- "husky": "^2.7.0", + "jest-junit": "^8.0.0", + "jest-styled-components": "^6.3.3", + "lint-staged": "^8.2.1", +@@ -103,11 +102,6 @@ + "not ie < 11", + "not op_mini all" + ], +- "husky": { +- "hooks": { +- "pre-commit": "lint-staged" +- } +- }, + "lint-staged": { + "*.{js,json}": [ + "prettier --write", |