Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fde9b9c0b8 | ||
|
|
7904647254 | ||
|
|
b0a06aac63 | ||
|
|
0e5a5b468c | ||
|
|
098bbe8878 |
No files matched your search
-14
@@ -161,20 +161,6 @@ RUN git checkout --quiet --detach b4b2c785308b1ce785b6155c7fe5f16879080193 \
|
|||||||
# ubuntu 26.04, 2026-09-27
|
# ubuntu 26.04, 2026-09-27
|
||||||
FROM ubuntu@sha256:f144425ff09be612d6d9ad965196e9cdc23dae1f42110a8a11a3e9a8198759f7
|
FROM ubuntu@sha256:f144425ff09be612d6d9ad965196e9cdc23dae1f42110a8a11a3e9a8198759f7
|
||||||
|
|
||||||
# The image's own labels, in place of the ones it would inherit from
|
|
||||||
# Ubuntu's. script/docker and script/cibuild pass the build arguments;
|
|
||||||
# a build that passes none labels the image unknown rather than leave
|
|
||||||
# Ubuntu's values.
|
|
||||||
ARG VERSION=unknown
|
|
||||||
ARG CREATED=unknown
|
|
||||||
ARG REVISION=unknown
|
|
||||||
LABEL org.opencontainers.image.title="smallwebwaf" \
|
|
||||||
org.opencontainers.image.description="A web application firewall for self-hosted web apps: sww rproxy in front of an app, and sww waf, which decides." \
|
|
||||||
org.opencontainers.image.version="${VERSION}" \
|
|
||||||
org.opencontainers.image.created="${CREATED}" \
|
|
||||||
org.opencontainers.image.revision="${REVISION}" \
|
|
||||||
org.opencontainers.image.source="https://git.eeqj.de/sneak/smallwebwaf"
|
|
||||||
|
|
||||||
# runit's install creates its _runit-log user with minsysusers, which
|
# runit's install creates its _runit-log user with minsysusers, which
|
||||||
# reads this file in place of runit's /usr/lib/sysusers.d/runit.conf.
|
# reads this file in place of runit's /usr/lib/sysusers.d/runit.conf.
|
||||||
# runit's line leaves out the shell, and minsysusers prints a Perl
|
# runit's line leaves out the shell, and minsysusers prints a Perl
|
||||||
|
|||||||
@@ -9,10 +9,6 @@
|
|||||||
ARG SWW_IMAGE=smallwebwaf
|
ARG SWW_IMAGE=smallwebwaf
|
||||||
FROM ${SWW_IMAGE}
|
FROM ${SWW_IMAGE}
|
||||||
|
|
||||||
# Its own title and description, in place of the smallwebwaf image's.
|
|
||||||
LABEL org.opencontainers.image.title="smallwebwaf-example-app" \
|
|
||||||
org.opencontainers.image.description="An example app built on the smallwebwaf image."
|
|
||||||
|
|
||||||
# Packages the app needs, from the nixpkgs in the image.
|
# Packages the app needs, from the nixpkgs in the image.
|
||||||
RUN nix-env -iA nixpkgs.busybox
|
RUN nix-env -iA nixpkgs.busybox
|
||||||
|
|
||||||
|
|||||||
@@ -31,12 +31,10 @@ import (
|
|||||||
// this package: Go's resolver counts the queries under way in one
|
// this package: Go's resolver counts the queries under way in one
|
||||||
// sync.WaitGroup for the whole process, and the process fails when
|
// sync.WaitGroup for the whole process, and the process fails when
|
||||||
// queries from two bubbles, or from a bubble and from outside one, are
|
// queries from two bubbles, or from a bubble and from outside one, are
|
||||||
// under way at once. The one test outside a bubble is parallel, so it
|
// under way at once. TestMain has the resolver make its configuration,
|
||||||
// starts only once every test that is not parallel has ended; no other
|
// which it makes on its first query, outside every bubble, since the
|
||||||
// parallel test of this package queries a resolver. TestMain has the
|
// configuration holds a channel, which the bubble it was made in would
|
||||||
// resolver make its configuration, which it makes on its first query,
|
// keep to itself.
|
||||||
// outside every bubble, since the configuration holds a channel, which
|
|
||||||
// the bubble it was made in would keep to itself.
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// zone and otherZone are the DNSBL zones the tests name.
|
// zone and otherZone are the DNSBL zones the tests name.
|
||||||
@@ -527,9 +525,8 @@ func TestAtMost100000VerdictsKeptTheOneFetchedLongestAgoDroppedFirst(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint:paralleltest // one at a time, as the comment at the top of this file says
|
||||||
func TestQueriesGoToTheResolverSWWDNSBLResolverNames(t *testing.T) {
|
func TestQueriesGoToTheResolverSWWDNSBLResolverNames(t *testing.T) {
|
||||||
t.Parallel()
|
|
||||||
|
|
||||||
resolver := &resolverStandIn{answers: map[string]answer{
|
resolver := &resolverStandIn{answers: map[string]answer{
|
||||||
listedName: {addrs: []string{listing}},
|
listedName: {addrs: []string{listing}},
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -20,13 +20,8 @@ main() {
|
|||||||
# the version a build stage derives from the .git in the context.
|
# the version a build stage derives from the .git in the context.
|
||||||
version="$(git describe --tags --always --dirty 2>/dev/null || true)"
|
version="$(git describe --tags --always --dirty 2>/dev/null || true)"
|
||||||
[ -n "$version" ] || version="unknown"
|
[ -n "$version" ] || version="unknown"
|
||||||
revision="$(git rev-parse HEAD 2>/dev/null || true)"
|
|
||||||
[ -n "$revision" ] || revision="unknown"
|
|
||||||
created="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
|
||||||
docker build --no-cache \
|
docker build --no-cache \
|
||||||
--build-arg VERSION="$version" \
|
--build-arg VERSION="$version" \
|
||||||
--build-arg REVISION="$revision" \
|
|
||||||
--build-arg CREATED="$created" \
|
|
||||||
-t "$("$SCRIPT_DIR/projectname")" .
|
-t "$("$SCRIPT_DIR/projectname")" .
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,13 +16,8 @@ main() {
|
|||||||
# the version a build stage derives from the .git in the context.
|
# the version a build stage derives from the .git in the context.
|
||||||
version="$(git describe --tags --always --dirty 2>/dev/null || true)"
|
version="$(git describe --tags --always --dirty 2>/dev/null || true)"
|
||||||
[ -n "$version" ] || version="unknown"
|
[ -n "$version" ] || version="unknown"
|
||||||
revision="$(git rev-parse HEAD 2>/dev/null || true)"
|
|
||||||
[ -n "$revision" ] || revision="unknown"
|
|
||||||
created="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
|
||||||
docker build --no-cache \
|
docker build --no-cache \
|
||||||
--build-arg VERSION="$version" \
|
--build-arg VERSION="$version" \
|
||||||
--build-arg REVISION="$revision" \
|
|
||||||
--build-arg CREATED="$created" \
|
|
||||||
-t "$("$SCRIPT_DIR/projectname")" .
|
-t "$("$SCRIPT_DIR/projectname")" .
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-5
@@ -14,13 +14,16 @@ set -eu
|
|||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
|
||||||
ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
|
ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
|
||||||
|
|
||||||
PUBLISH_IMAGE="git.eeqj.de/sneak/smallwebwaf"
|
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
if [ -z "${DOCKER_HOST:-}" ]; then
|
||||||
|
echo "script/publish: DOCKER_HOST is not set; set it to the Docker host that builds the image, such as ssh://user@build.example.com" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "${PUBLISH_IMAGE:-}" ]; then
|
||||||
|
echo "script/publish: PUBLISH_IMAGE is not set; set it to the image name in the registry, such as registry.example.com/smallwebwaf" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# we don't set DOCKER_HOST here because the caller is expected to have
|
|
||||||
# either already set it, or used 'docker context' to make 'docker
|
|
||||||
# <whatever>' "just work".
|
|
||||||
cd "$ROOT"
|
cd "$ROOT"
|
||||||
|
|
||||||
# Own line: a failing command substitution inside an argument does
|
# Own line: a failing command substitution inside an argument does
|
||||||
|
|||||||
Reference in new issue
Block a user