Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/docker-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile${{ matrix.flavor == 'debian' && '.debian' || '' }}
file: ./build/docker/Dockerfile${{ matrix.flavor == 'debian' && '.debian' || '' }}
tags: crowdsecurity/crowdsec:test${{ matrix.flavor == 'full' && '' || '-' }}${{ matrix.flavor == 'full' && '' || matrix.flavor }}
target: ${{ matrix.flavor == 'debian' && 'full' || matrix.flavor }}
platforms: linux/amd64
Expand All @@ -57,17 +57,17 @@ jobs:
with:
version: 0.5.24
enable-cache: true
cache-dependency-glob: "./docker/test/uv.lock"
cache-dependency-glob: "./build/docker/test/uv.lock"

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: "./docker/test/.python-version"
python-version-file: "./build/docker/test/.python-version"

# running serially to reduce test flakiness
- name: Lint and run the tests
run: |
cd docker/test
cd build/docker/test
uv sync --all-extras --dev --locked
uv run ruff check
uv run basedpyright
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish-docker-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:
paths:
- 'pkg/**'
- 'cmd/**'
- 'mk/**'
- 'docker/docker_start.sh'
- 'docker/config.yaml'
- 'build/**'
- 'build/docker/Dockerfile'
- 'build/docker/Dockerfile.debian'
- 'build/docker/config.yaml'
- 'build/docker/docker_start.sh'
- '.github/workflows/publish-docker-master.yml'
- '.github/workflows/publish-docker.yml'
- 'Dockerfile'
- 'Dockerfile.debian'
- 'go.mod'
- 'go.sum'
- 'Makefile'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile${{ inputs.debian && '.debian' || '' }}
file: ./build/docker/Dockerfile${{ inputs.debian && '.debian' || '' }}
push: ${{ inputs.push }}
tags: ${{ steps.slim.outputs.tags }}
target: slim
Expand All @@ -112,7 +112,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile${{ inputs.debian && '.debian' || '' }}
file: ./build/docker/Dockerfile${{ inputs.debian && '.debian' || '' }}
push: ${{ inputs.push }}
tags: ${{ steps.full.outputs.tags }}
target: full
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update_docker_hub_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- master
paths:
- 'docker/README.md'
- 'build/docker/README.md'

jobs:
update-docker-hub-readme:
Expand All @@ -26,4 +26,4 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}
repository: crowdsecurity/crowdsec
short-description: "Crowdsec - An open-source, lightweight agent to detect and respond to bad behaviours."
readme-filepath: "./docker/README.md"
readme-filepath: "./build/docker/README.md"
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include mk/platform.mk
include mk/gmsl
include build/mk/platform.mk
include build/mk/gmsl

# By default, this build requires the C++ re2 library to be installed.
#
Expand Down Expand Up @@ -399,4 +399,4 @@ else
include test/bats.mk
endif

include mk/help.mk
include build/mk/help.mk
4 changes: 2 additions & 2 deletions Dockerfile → build/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/co

COPY --from=build /go/bin/yq /usr/local/bin/crowdsec /usr/local/bin/cscli /usr/local/bin/
COPY --from=build /etc/crowdsec /staging/etc/crowdsec
COPY --from=build /go/src/crowdsec/docker/docker_start.sh /
COPY --from=build /go/src/crowdsec/docker/config.yaml /staging/etc/crowdsec/config.yaml
COPY --from=build /go/src/crowdsec/build/docker/docker_start.sh /
COPY --from=build /go/src/crowdsec/build/docker/config.yaml /staging/etc/crowdsec/config.yaml
COPY --from=build /var/lib/crowdsec /staging/var/lib/crowdsec
RUN yq -n '.url="http://0.0.0.0:8080"' | install -m 0600 /dev/stdin /staging/etc/crowdsec/local_api_credentials.yaml

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.debian → build/docker/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ RUN apt-get update && \

COPY --from=build /go/bin/yq /usr/local/bin/crowdsec /usr/local/bin/cscli /usr/local/bin/
COPY --from=build /etc/crowdsec /staging/etc/crowdsec
COPY --from=build /go/src/crowdsec/docker/docker_start.sh /
COPY --from=build /go/src/crowdsec/docker/config.yaml /staging/etc/crowdsec/config.yaml
COPY --from=build /go/src/crowdsec/build/docker/docker_start.sh /
COPY --from=build /go/src/crowdsec/build/docker/config.yaml /staging/etc/crowdsec/config.yaml
RUN yq -n '.url="http://0.0.0.0:8080"' | install -m 0600 /dev/stdin /staging/etc/crowdsec/local_api_credentials.yaml && \
yq eval -i ".plugin_config.group = \"nogroup\"" /staging/etc/crowdsec/config.yaml

Expand Down
4 changes: 2 additions & 2 deletions docker/README.md → build/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ You can build your custom images with Dockerfile and Dockerfile-debian.
For example, if you need a Debian version without plugin notifiers:

```console
$ docker build -f Dockerfile.debian --target slim .
$ docker build -f build/docker/Dockerfile.debian --target slim .
```

The supported values for target are: full, geoip, plugins, slim.

Note: for crowdsec versions < 1.5.0, the syntax is

```console
$ docker build -f Dockerfile.debian --build-arg=BUILD_ENV=slim .
$ docker build -f build/docker/Dockerfile.debian --build-arg=BUILD_ENV=slim .
```


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions mk/platform.mk → build/mk/platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ ifeq ($(OS), Windows_NT)
EXT = .exe
else
SYSTEM ?= $(shell uname -s | tr '[A-Z]' '[a-z]')
include mk/platform/unix_common.mk
include build/mk/platform/unix_common.mk
endif

ifneq ("$(wildcard mk/platform/$(SYSTEM).mk)", "")
include mk/platform/$(SYSTEM).mk
ifneq ("$(wildcard build/mk/platform/$(SYSTEM).mk)", "")
include build/mk/platform/$(SYSTEM).mk
else
include mk/platform/linux.mk
include build/mk/platform/linux.mk
endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.