Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
s-westphal committed Jan 19, 2024
1 parent ecfde61 commit 7141fed
Show file tree
Hide file tree
Showing 25 changed files with 79 additions and 301 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.base
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down Expand Up @@ -300,11 +300,11 @@ jobs:
docker build -f ./Dockerfile . -t grr-testing
docker run \
--add-host=host.docker.internal:host-gateway \
-v $(pwd):/ws \
-w /ws \
--entrypoint appveyor/e2e_tests/run_docker_compose_e2e_test.sh \
-v $(pwd):/github_workspace \
-w /github_workspace \
--entrypoint appveyor/e2e_tests/run_docker_compose_e2e_test.sh \
grr-testing \
(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' grr-linux-client)
$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' grr-linux-client)
- name: Stop docker-compose stack
if: always()
shell: bash
Expand Down
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,8 @@ RUN apt-get update && \
dh-make \
rpm

RUN pwd
RUN ls -lha
RUN ls -lha /

# Only available when building as part of Github Actions.
COPY ./_artifacts* /client_templates
COPY ./_installers* /client_templates

ENV VIRTUAL_ENV /usr/share/grr-server
ENV GRR_SOURCE /usr/src/grr
Expand Down
60 changes: 0 additions & 60 deletions Dockerfile.base

This file was deleted.

9 changes: 7 additions & 2 deletions Dockerfile.client
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ ENV INSTALLERS_DIR /client_installers

RUN apt-get update

RUN useradd -m appveyor2
RUN echo "[7] [01234] [ts/3] [appveyor2] [pts/3 ] [100.100.10.10 ] [100.100.10.10 ] [Thu Jan 01 00:00:00 1970 UTC]" > wtmp.txt && \
utmpdump /var/log/wtmp >> wtmp.txt && \
utmpdump --reverse < wtmp.txt > /var/log/wtmp && \
utmpdump /var/log/wtmp

ADD ./docker_config_files/client/ /configs
RUN ls /

RUN grr_client_build repack_multiple \
--templates ${TEMPLATE_DIR}/*/*.zip \
Expand All @@ -17,4 +22,4 @@ RUN grr_client_build repack_multiple \

RUN dpkg -i ${INSTALLERS_DIR}/grr.client/*.deb

ENTRYPOINT [ "fleetspeak-client" ]
ENTRYPOINT [ "fleetspeak-client" ]
44 changes: 0 additions & 44 deletions appveyor/e2e_tests/docker_compose_client_collection_test.py

This file was deleted.

44 changes: 32 additions & 12 deletions appveyor/e2e_tests/run_docker_compose_e2e_test.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,48 @@
#!/bin/bash
#
# Runs the e2e test in the docker-compose stack.
# Runs the e2e tests in the docker-compose stack.
#
# This script is executed in the grr docker container or in an
# environment with the grr src and develpment environemnt
# (grr-python-api, grr-test) availbale. And assumes the
# docker-compose stack to be running with exposed ports for
# the admin API and GRR database.
#
# Running this test (from the main folder):
# - Start the docker compose stack with:
# $ docker-compose up
#
# - Build and run the GRR docker container and set the entrypoint
# to this script:
# $ docker build -f ./Dockerfile . -t grr-dc-stack-testing
# $ docker run \
# --add-host=host.docker.internal:host-gateway \
# -v $(pwd):/github_workspace \
# -w /github_workspace \
# --entrypoint appveyor/e2e_tests/run_docker_compose_e2e_test.sh \
# grr-dc-stack-testing \
# (docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' grr-linux-client)

set -ex

readonly GRR_ADMIN_PASS="root"

# The IP address of the client inside the docker-compose stack.
readonly CLIENT_IP=${1}

readonly GRR_API="http://host.docker.internal:8000"

readonly FLAKY_TESTS_ARR=(\
TestCheckRunner.runTest \
# TODO(b/321210297): TSK pathtype is not working on Linux clients.
# TODO(b/321210297): TSK pathtype is not working on Linux clients, skip tests.
TestListDirectoryTSKLinux.runTest \
TestTransferLinux.testGetFileTSK \
TestRawFilesystemAccessUsesTskOnNonWindows.runTest \
)
# Convert array to string (comma-separated).
readonly FLAKY_TESTS="$(IFS=,;echo "${FLAKY_TESTS_ARR[*]}")"

readonly GRR_ADMIN_USER=test-user
readonly GRR_ADMIN_PASS=test-password

function fatal() {
>&2 echo "Error: ${1}"
exit 1
Expand All @@ -26,10 +51,9 @@ function fatal() {
# Install the grr tests
cd /usr/src/grr && pip install -e grr/test && cd -

# grr_config_updater add_user ${GRR_ADMIN_USER} \
# --password ${GRR_ADMIN_PASS} \
# --secondary_configs docker_config_files/testing/grr.testing.yaml

grr_config_updater add_user ${GRR_ADMIN_USER} \
--password ${GRR_ADMIN_PASS} \
--secondary_configs docker_config_files/testing/grr.testing.yaml

grr_end_to_end_tests --verbose \
--secondary_configs docker_config_files/testing/grr.testing.yaml \
Expand All @@ -50,7 +74,3 @@ fi
if [[ -z "$(cat e2e.log | grep -F '[ PASS ]')" ]]; then
fatal "Expected to find at least one passing test in the test log. It is possible no tests actually ran."
fi




4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ services:

linux-client:
build:
dockerfile: docker/client/Dockerfile.linux
dockerfile: Dockerfile.client
context: .
container_name: grr-linux-client
restart: always
Expand All @@ -162,7 +162,7 @@ services:
- fleetspeak-frontend
volumes:
- ./docker_config_files/client/:/configs/
- client_installers:/client_installers__
- client_installers:/client_installers
tty: true
stdin_open: true
networks:
Expand Down
12 changes: 0 additions & 12 deletions docker/.env

This file was deleted.

25 changes: 0 additions & 25 deletions docker/client/Dockerfile.linux

This file was deleted.

2 changes: 1 addition & 1 deletion docker_config_files/client/client.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ filesystem_handler: {
configuration_directory:"/configs/"
state_file:"/configs/textservices/fleetspeak-client.state"
}
streaming:true
streaming:true
Empty file.
41 changes: 7 additions & 34 deletions docker_config_files/client/grr.client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ ClientBuilder.template_dir: /client_templates
Client.server_urls:
- fleetspeak-frontend
Client.foreman_check_frequency: 10 # seconds
Logging.verbose: true
Logging.engines: file,stderr
Logging.path: /tmp/grr-client
Logging.filename: /tmp/grr-client/grr-client.log
Config.writeback: /tmp/grr-client/grr-client.local.yaml
Blobstore.implementation: DbBlobStore

Client.executable_signing_public_key: |
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx6YQNUwITzi7l+biDnwv
Expand All @@ -21,34 +16,12 @@ Client.executable_signing_public_key: |
je7ZmTVuwGEUR8snL2eqPqhM1UAvelbEF4IVG9E7A043Fhh7qVPxVGqKSkgfwXS0
0QIDAQAB
-----END PUBLIC KEY-----
PrivateKeys.executable_signing_private_key: |
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAx6YQNUwITzi7l+biDnwvn63Rg3vbfPZexL/0O1XzQw1Z7mFp
3uHtnSrkgDmqYIDXwxDXvn8Ck+k8dYt8SZCcJq4Jd/YkJXaUiM2E/2Y+Gv33ioVa
N7QRyVBGRldK7X6a9Z8tEBE8jF3mlzlO2Z16ZCgMLD1I6ZJpHfQFcDGJP7idHY1T
VHJ7j9YG8PObi2k9r5E9UBg6DcFD3Rqg5CP/OUtE56B7VW3y8q49c8pw+ZfiQaXd
11xMLuMOX9Brlsp/RqFC6wvM1RJc9oR08Bq8je7ZmTVuwGEUR8snL2eqPqhM1UAv
elbEF4IVG9E7A043Fhh7qVPxVGqKSkgfwXS00QIDAQABAoIBAQCi51KEWoTRN4aC
PMcpcJVfYnH5Kj/+5/yN596957T1elhuFRhQ3+KFgrEuG191HMxxAzY23uXYkNBf
TTBdylxPh2R8eOAnnWk3cxLZXrDAT4gDhCoIF6sHq7Obw7CEtvB0CKy5VockNZ5o
uD8pe8CZJsA//MWYqHmTEkC5ugG2dlde7FcYHsqVU7NlGHhz5UqPpzrgvdT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ging.engines: file,stderr
Logging.path: /tmp/grr-client
Logging.filename: /tmp/grr-client/grr-client.log

Target:Linux:
ClientBuilder.fleetspeak_client_config: /configs/client.config
Target:Windows:
Expand Down
2 changes: 1 addition & 1 deletion docker_config_files/client/textservices/grr_client.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ config: {
argv: "--config"
argv: "/configs/grr.client.yaml"
}
}
}
14 changes: 7 additions & 7 deletions docker_config_files/mysql/.env
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ADMIN_PASSWORD="admin"

MYSQL_ROOT_PASSWORD='root'
MYSQL_ROOT_PASSWORD="root"
MYSQL_ROOT_HOST="%"

FLEETSPEAK_DB='fleetspeak'
FLEETSPEAK_DB_USER='fleetspeak-user'
FLEETSPEAK_DB_PASSWORD='fleetspeak-password'
FLEETSPEAK_DB="fleetspeak"
FLEETSPEAK_DB_USER="fleetspeak-user"
FLEETSPEAK_DB_PASSWORD="fleetspeak-password"

GRR_DB='grr'
GRR_DB_USER='grru'
GRR_DB_PASSWORD='grrp'
GRR_DB="grr"
GRR_DB_USER="grru"
GRR_DB_PASSWORD="grrp"
2 changes: 1 addition & 1 deletion docker_config_files/mysql/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ CREATE DATABASE $FLEETSPEAK_DB;
GRANT ALL ON $FLEETSPEAK_DB.* TO '$FLEETSPEAK_DB_USER'@'$MYSQL_ROOT_HOST';
FLUSH PRIVILEGES;"

echo "** Finished creating DBs and users"
echo "** Finished creating DBs and users"
Loading

0 comments on commit 7141fed

Please sign in to comment.