Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest #2

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5235994
Allow external sources for shellcheck
slt Feb 3, 2021
ce0f4c3
Install docker compose v2
slt Nov 17, 2023
13dfc66
Update DAB Apps
deanstalker Mar 22, 2024
6888f8c
Merge branch 'master' into update-apps
deanstalker Mar 25, 2024
2907413
Fix executable bit for docker compose
deanstalker Mar 25, 2024
f1e7912
Use cimg/node for ci
deanstalker Mar 25, 2024
80de496
Update docker image for node
deanstalker Mar 25, 2024
b5cf6c0
Remove docker compose install, should be baked in the cimg already
deanstalker Mar 25, 2024
b0b7c95
Use asciinema apk package
deanstalker Mar 25, 2024
45c4fc1
Force install yq 3.4 to retain compatibility.
deanstalker Mar 25, 2024
fd4ecef
Fix compgen and goarch for darwin
deanstalker Mar 25, 2024
39c2752
Fix compgen (make it compatible with current golangci-lint and go
deanstalker Mar 25, 2024
524bcc6
Fix invalid deadline flag
deanstalker Mar 25, 2024
8698116
Fix up golangci-lint and compgen app
deanstalker Mar 25, 2024
4c5471c
Fix up golangci-lint and compgen app
deanstalker Mar 25, 2024
83bff13
Merge branch 'update-apps' of github.com:JumboInteractiveLimited/dab …
deanstalker Mar 25, 2024
870d2e6
Bump
deanstalker Mar 25, 2024
dd5b7ae
Bump
deanstalker Mar 25, 2024
a5005e5
Set docker build progress to plain
deanstalker Mar 25, 2024
3c860e3
Fix yq syntax to mikefarah's latest version, and not hte jq hacked
deanstalker Mar 25, 2024
e75524e
Fix dab apps list yq syntax
deanstalker Mar 25, 2024
4d5d100
Remove clean column from dab repo report
deanstalker Mar 25, 2024
acd81ff
Fix docker dependency check
deanstalker Mar 25, 2024
5ec1bc2
Fix column handling, should always be the same case as the referenced
deanstalker Mar 25, 2024
e5ed230
Debugging network recreate issue
deanstalker Mar 25, 2024
522b742
Fix expected Building text
deanstalker Mar 25, 2024
f1964a6
See if artifacts tell me anything about whoami failure
deanstalker Mar 25, 2024
4e14e31
Remove artifacts, didn't help with debugging
deanstalker Mar 26, 2024
eb7115d
Add docker-cli-buildx
slt Mar 11, 2024
bbbb755
Merge remote-tracking branch 'upstream/master' into update-apps
deanstalker May 28, 2024
3351a26
Update DAB Apps
deanstalker Mar 22, 2024
8329771
Use asciinema apk package
deanstalker Mar 25, 2024
23bf676
Force install yq 3.4 to retain compatibility.
deanstalker Mar 25, 2024
52c0d32
Bump
deanstalker Mar 25, 2024
12d35b6
Fix merge conflict artifacts
deanstalker May 29, 2024
143bebc
Fix docker compose plugin installation
deanstalker May 29, 2024
dda21d2
Remove --progress arg when building dab image
deanstalker May 29, 2024
63e37be
Use build to build dab
deanstalker May 29, 2024
ca85e60
Set docker compose version to 2.27.0
deanstalker May 29, 2024
acde179
Remove versions from docker-compose
deanstalker May 29, 2024
76d0a04
Reinstate python yq args
deanstalker May 29, 2024
b10ef90
Type in docker-compose node yml
deanstalker May 29, 2024
494dfe0
Fix mikefarah yq install and use v4.44.1
deanstalker May 29, 2024
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
53 changes: 25 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
version: 2.1

notify:
webhooks:
- url: 'https://webhooks.gitter.im/e/cc6aefa009b39156b845'

workflows:
version: 2

Expand Down Expand Up @@ -46,45 +42,36 @@ jobs:

Shfmt:
docker:
- image: golang:1.12
- image: mvdan/shfmt:v3-alpine
steps:
- checkout

- run:
name: install
command: go get mvdan.cc/sh/cmd/shfmt

- run:
name: check
command: shfmt -d -ln=posix -s .

GolangCI-Lint:
docker:
- image: golang:1.12
- image: golangci/golangci-lint:v1.57.1
steps:
- checkout

- run:
name: install
command: |
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.15.0

- run:
name: get deps
command: go mod download
command: cd completion && go mod download
environment:
GO111MODULE: 'on'

- run:
name: check
command: |
./scripts/compgen.sh
cd completion && golangci-lint run --deadline 4m --enable-all --disable dupl,lll,gochecknoglobals,gochecknoinits
cd completion && golangci-lint run --timeout 4m --enable-all --disable dupl,lll,gochecknoglobals,gochecknoinits,depguard,exhaustivestruct,exhaustruct,gomnd,varnamelen,nonamedreturns,wsl,ireturn,gofumpt


'Danger Automated Code Review':
docker:
- image: circleci/node:latest
- image: cimg/node:lts
steps:
- checkout

Expand All @@ -100,16 +87,22 @@ jobs:
- checkout

- run:
name: Install Docker Compose
name: Install Docker Compose v2
command: |
curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
curl -sSL "https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-$(uname -s)-$(uname -m)" -o ~/docker-compose
mkdir -p ~/.docker/cli-plugins
chmod +x ~/docker-compose
sudo mv ~/docker-compose /usr/local/bin/docker-compose
mv ~/docker-compose ~/.docker/cli-plugins/docker-compose

- run:
name: Build Image
command: ./scripts/build.sh

- run:
name: Create tmp folder
command:
mkdir -p /tmp

- run:
name: Smoke Tests
command: script -qec './scripts/test.sh'
Expand All @@ -119,6 +112,7 @@ jobs:

- store_test_results:
path: /tmp/dab/test_results

- run:
name: Clear test results
when: on_fail
Expand All @@ -133,6 +127,7 @@ jobs:

- store_test_results:
path: /tmp/dab/test_results

- run:
name: Clear test results
when: on_fail
Expand All @@ -145,11 +140,12 @@ jobs:
- checkout

- run:
name: Install Docker Compose
name: Install Docker Compose v2
command: |
curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
curl -sSL "https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-$(uname -s)-$(uname -m)" -o ~/docker-compose
mkdir -p ~/.docker/cli-plugins
chmod +x ~/docker-compose
sudo mv ~/docker-compose /usr/local/bin/docker-compose
mv ~/docker-compose ~/.docker/cli-plugins/docker-compose

- run:
name: UX Regression Tests
Expand All @@ -159,6 +155,7 @@ jobs:

- store_test_results:
path: /tmp/dab/test_results

- run:
name: Clear test results
when: on_fail
Expand All @@ -171,12 +168,12 @@ jobs:
- checkout

- run:
name: Install Docker Compose
name: Install Docker Compose v2
command: |
curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
curl -sSL "https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-$(uname -s)-$(uname -m)" -o ~/docker-compose
mkdir -p ~/.docker/cli-plugins
chmod +x ~/docker-compose
sudo mv ~/docker-compose /usr/local/bin/docker-compose

mv ~/docker-compose ~/.docker/cli-plugins/docker-compose

- run:
name: Profile
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.idea

/tests/vendor
/tests/node_modules
/completion/completion
Expand Down
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage for compiling shell completion binary.
FROM golang:1.12 AS completion
FROM golang:1.22 AS completion

WORKDIR $GOPATH/src/app/completion

Expand All @@ -17,10 +17,11 @@ RUN cd ../ \
&& ./compgen.sh

ENV CGO_ENABLED=0 \
GOARCH=386
GOARCH=amd64

RUN GOOS=linux go build -a -installsuffix cgo -ldflags='-w -s' -o /usr/bin/dab-completion-linux .
RUN GOOS=darwin go build -a -installsuffix cgo -ldflags='-w -s' -o /usr/bin/dab-completion-darwin .
RUN GOOS=darwin GOARCH=arm64 go build -a -installsuffix cgo -ldflags='-w -s' -o /usr/bin/dab-completion-m1 .


# This phase generates versioning artifacts from git.
Expand Down Expand Up @@ -69,15 +70,15 @@ LABEL org.label-schema.schema-version="1.0" \
# they are to be kept at a lower layer for caching.
RUN apk add --no-cache --virtual .toolchain \
python3-dev libffi-dev openssl-dev build-base \
&& apk add --no-cache docker-cli python3 py3-pip py3-cryptography \
&& apk add --no-cache asciinema docker-cli docker-cli-buildx docker-cli-compose python3 py3-pip py3-cryptography \
&& rm -f /usr/bin/dockerd /usr/bin/docker-containerd* \
&& pip3 install "docker-compose>=1.24.0,<1.25.0" asciinema \
&& apk del .toolchain \
&& rm -rf ~/.cache

# Misc tools required for scripts.
RUN apk add --no-cache git openssh tree util-linux jq nss-tools multitail ca-certificates highlight libintl entr postgresql-client task bash \
&& pip3 install yq \
&& wget -O /usr/bin/yq https://github.com/mikefarah/yq/releases/download/v4.44.1/yq_linux_amd64 \
&& chmod +x /usr/bin/yq \
&& echo "check_mail:0" >> /etc/multitail.conf \
&& chmod 666 /etc/passwd

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ The following projects are used to write dab:
- [docker-compose-gen][9]
- [yq][10]
- [jq][11]
- [docker-compose][12]
- [docker compose][12]
- [shellcheck][13]
- [complete][14]

Expand Down
2 changes: 1 addition & 1 deletion app/bin/dar-link-dest
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

export HOST_PWD=$PWD
export HOST_PWD="$PWD"
exec dab apps run "$(basename "$0")" "$@"
8 changes: 5 additions & 3 deletions app/bin/maybe_update_wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ file_hash() {
"${FILE_HASH_ALGO:-md5}sum" "$1" | cut -d' ' -f1
}

if [ "${DAB_AUTOUPDATE:-true}" = 'false' ] || [ "${DAB_AUTOUPDATE_WRAPPER:-true}" = 'false' ] || ! [ -f /tmp/wrapper ] || ! [ -f "$DAB/dab" ]; then
DAB_WRAPPER_FILENAME="$(basename "$DAB_WRAPPER_PATH")"

if [ "${DAB_AUTOUPDATE:-true}" = 'false' ] || [ "${DAB_AUTOUPDATE_WRAPPER:-true}" = 'false' ] || ! [ -f "/tmp/wrapper/$DAB_WRAPPER_FILENAME" ] || ! [ -f "$DAB/dab" ]; then
return 0
elif [ -r /tmp/wrapper ] && [ -r "$DAB/dab" ] && [ "$(file_hash "$DAB/dab")" != "$(file_hash /tmp/wrapper)" ]; then
if cat "$DAB/dab" >/tmp/wrapper; then
elif [ -r "/tmp/wrapper/$DAB_WRAPPER_FILENAME" ] && [ -r "$DAB/dab" ] && [ "$(file_hash "$DAB/dab")" != "$(file_hash "/tmp/wrapper/$DAB_WRAPPER_FILENAME")" ]; then
if cat "$DAB/dab" >"/tmp/wrapper/$DAB_WRAPPER_FILENAME"; then
warn "Dab wrapper script at $DAB_WRAPPER_PATH was updated!"
else
error "Dab wrapper script at $DAB_WRAPPER_PATH could NOT be automatically updated!"
Expand Down
2 changes: 1 addition & 1 deletion app/bin/query_user
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -eu

message="${1:-Are you sure you would like to proceed?}"
while true; do
# shellcheck disable=SC2039
# shellcheck disable=SC3045
read -r -p "$message " yn
case $yn in
[Yy]*) return 0 ;;
Expand Down
13 changes: 9 additions & 4 deletions app/docker/Dockerfile.ansible
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
FROM alpine:3.10.0

RUN apk add --no-cache --virtual build-dependencies \
gcc musl-dev libffi-dev openssl-dev python-dev \
gcc musl-dev libffi-dev openssl-dev python3-dev \
&& apk add --no-cache \
bash curl tar openssh-client sshpass git python py-boto py-dateutil \
bash curl tar openssh-client sshpass git python3 py-boto py-dateutil \
py-httplib2 py-jinja2 py-paramiko py-pip ca-certificates docker \
&& pip install python-keyczar docker-compose
&& python3 -m pip install --upgrade pip \
&& pip install python-keyczar

RUN DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} \
mkdir -p $DOCKER_CONFIG/cli-plugins
ADD https://github.com/docker/compose/releases/download/v2.25.0/docker-compose-linux-x86_64 $HOME/.docker/cli-plugins/docker-compose

RUN mkdir -p /etc/ansible /ansible/playbooks \
&& echo "[local]" >> /etc/ansible/hosts \
&& echo "localhost" >> /etc/ansible/hosts
WORKDIR /ansible/playbooks

ARG ANSIBLE_VERSION=2.7.1
ARG ANSIBLE_VERSION=2.11
ENV ANSIBLE_VERSION="${ANSIBLE_VERSION}" \
ANSIBLE_GATHERING=smart \
ANSIBLE_HOST_KEY_CHECKING=false \
Expand Down
3 changes: 2 additions & 1 deletion app/docker/Dockerfile.cartography
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM python:3

RUN pip install cartography
RUN python3 -m pip install --upgrade pip && \
pip install cartography

ENTRYPOINT ["/usr/local/bin/cartography","--neo4j-uri=bolt://neo4j:7687"]
5 changes: 4 additions & 1 deletion app/docker/Dockerfile.cyberchef
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
ARG NGINX_TAG=alpine
FROM "nginx:$NGINX_TAG"

ADD --chown=nginx:nginx https://gchq.github.io/CyberChef/cyberchef.htm /usr/share/nginx/html/index.html
WORKDIR /usr/share/nginx/html

RUN wget -qO- https://github.com/gchq/CyberChef/releases/download/v10.8.2/CyberChef_v10.8.2.zip \
| busybox unzip - && chown nginx:nginx * -R
4 changes: 2 additions & 2 deletions app/docker/Dockerfile.dive
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM centos:latest
FROM rockylinux:9

ARG DIVE_VERSION=0.4.1
ARG DIVE_VERSION=0.12.0
RUN yum install -y "https://github.com/wagoodman/dive/releases/download/v${DIVE_VERSION}/dive_${DIVE_VERSION}_linux_amd64.rpm"
ENTRYPOINT ["/usr/local/bin/dive"]
14 changes: 8 additions & 6 deletions app/docker/Dockerfile.fn
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ RUN apt-get update \
curl \
gnupg2 \
software-properties-common \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
&& add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable" \
&& install -m 0755 -d /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc \
&& chmod a+r /etc/apt/keyrings/docker.asc \
&& echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update \
&& apt-get install -y docker-ce \
&& apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin \
&& rm -rf /var/lib/apt/lists/*

COPY --from=download /usr/bin/fn /usr/bin/fn
Expand Down
3 changes: 1 addition & 2 deletions app/docker/Dockerfile.remote_syslog2
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM golang:latest

RUN go get -d -v github.com/papertrail/remote_syslog2 \
&& go install github.com/papertrail/remote_syslog2
RUN go install github.com/papertrail/remote_syslog2

COPY configs/remote_syslog2.yml /etc/log_files.yml

Expand Down
2 changes: 1 addition & 1 deletion app/docker/Dockerfile.sam
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM python:3

RUN pip install awscli aws-sam-cli
RUN pip install awscliv2 aws-sam-cli
2 changes: 1 addition & 1 deletion app/docker/Dockerfile.vault
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG VAULT_TAG=latest
FROM "vault:$VAULT_TAG"
FROM "hashicorp/vault:$VAULT_TAG"

COPY configs/vault.hcl /vault/config/

Expand Down
4 changes: 2 additions & 2 deletions app/docker/Dockerfile.xsstrike
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:latest

RUN apk add --no-cache ca-certificates python3 py3-pip git \
RUN apk add --no-cache ca-certificates python3 py3-pip git \
&& update-ca-certificates

ARG XSSTRIKE_VERSION=3.0.3
Expand All @@ -12,6 +12,6 @@ RUN mkdir -p /opt \
&& git checkout ${XSSTRIKE_VERSION} \
&& chmod +x xsstrike.py

RUN pip3 install -r /opt/xsstrike/requirements.txt
RUN pip3 install --break-system-packages -r /opt/xsstrike/requirements.txt

ENTRYPOINT ["/opt/xsstrike/xsstrike.py"]
14 changes: 7 additions & 7 deletions app/docker/configs/docker-gen/templates/telegraf.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
## Precision will NOT be used for service inputs. It is up to each individual
## service input to set the timestamp at the appropriate precision.
## Valid time units are "ns", "us" (or "µs"), "ms", "s".
precision = "s"
precision = "1s"

## Logging configuration:
## Run telegraf with debug log messages.
Expand Down Expand Up @@ -112,8 +112,8 @@
# timeout = "5s"

## HTTP Basic Auth
# username = "telegraf"
# password = "metricsmetricsmetricsmetrics"
username = "root"
password = "root"

## HTTP User-Agent
# user_agent = "telegraf"
Expand Down Expand Up @@ -508,7 +508,7 @@
#
# ## Whether to report for each container per-device blkio (8:0, 8:1...) and
# ## network (eth0, eth1, ...) stats or not
# perdevice = true
# perdevice_include = true
# ## Whether to report for each container total blkio and network stats or not
# total = false
# ## Which environment variables should we use as a tag
Expand Down Expand Up @@ -587,7 +587,7 @@
# HTTP/HTTPS request given an address a method and a timeout
[[inputs.http_response]]
## Server address (default http://localhost)
address = "http://tick:8888"
urls = ["http://tick:8888"]

## Set http_proxy (telegraf uses the system wide proxy settings if it's is not set)
# http_proxy = "http://localhost:8888"
Expand Down Expand Up @@ -922,7 +922,7 @@
###############################################################################

# Influx HTTP write listener
[[inputs.http_listener]]
[[inputs.http_listener_v2]]
## Address and port to host HTTP listener on
service_address = ":8086"

Expand Down Expand Up @@ -1006,7 +1006,7 @@

## Parses tags in the datadog statsd format
## http://docs.datadoghq.com/guides/dogstatsd/
parse_data_dog_tags = true
datadog_extensions = true

## Statsd data translation templates, more info can be read here:
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md#graphite
Expand Down
Loading