8000 Fix unknown unknown by ondj · Pull Request #221 · NUKIB/misp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix unknown unknown #221

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

Merged
merged 2 commits into from
May 21, 2025
Merged
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
4 changes: 4 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ jobs:
cp .github/workflows/test/.test-env.sh ./.env_s3
MISP_IMAGE=${{ env.REGISTRY_IMAGE }} docker compose up --detach --quiet-pull
python3 .github/workflows/wait.py http://127.0.0.1:8080 # Wait until MISP container is ready

- name: Show MISP container logs
if: always()
run: |
docker ps -a
docker logs misp

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test/test_minio.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#/bin/bash -e
#/bin/bash

# Script for testing MinIO connection:
# - Spins up a MinIO container and creates a bucket
Expand All @@ -9,6 +9,8 @@
# MinIO container is put on same bridge network as MISP
# MinIO client (mc) and MISP REST API is used

set -e

MINIO_ROOT_USER=$1
MINIO_ROOT_PASSWORD=$2
BUCKET_NAME=$3
Expand All @@ -29,6 +31,7 @@ curl -o ./mc -# https://dl.min.io/client/mc/release/linux-${MINIO_ARCH}/mc && ch

echo "Create bucket"
MINIO_IP=$(docker inspect minio --format="{{ .NetworkSettings.Networks.$NETWORK.IPAddress }}")
python3 .github/workflows/wait.py --ignore-http-error http://$MINIO_IP:9000
echo "Minio IP" $MINIO_IP
./mc alias set minio http://$MINIO_IP:9000 $MINIO_ROOT_USER $MINIO_ROOT_PASSWORD
./mc mb minio/$BUCKET_NAME
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/wait.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@
import time
import argparse
import urllib.request
from http.client import HTTPResponse
import urllib.error

parser = argparse.ArgumentParser()
parser.add_argument("url")
parser.add_argument("--ignore-http-error", action="store_true")
args = parser.parse_args()

max_tries = 30
while True:
try:
resp: HTTPResponse = urllib.request.urlopen(args.url, timeout=1)
if 200 <= resp.getcode() < 300:
break
else:
raise Exception("Invalid response code {}".format(resp.getcode()))
try:
urllib.request.urlopen(args.url, timeout=1)
except urllib.error.HTTPError:
if args.ignore_http_error:
break
raise
break
except Exception as e:
max_tries -= 1
if max_tries == 0:
Expand Down
0