From 046839eba52ea2e9d7dc6cb0ec51781e8a6bf3e2 Mon Sep 17 00:00:00 2001 From: Raynor Date: Tue, 27 Dec 2022 22:20:53 +0000 Subject: [PATCH] Cleaned up some unneeded files. --- .devcontainer/devcontainer.json | 27 ------------------- docker-compose.sample.yml | 11 ++++++++ scripts/get-stream.sh | 46 --------------------------------- 3 files changed, 11 insertions(+), 73 deletions(-) delete mode 100644 .devcontainer/devcontainer.json create mode 100644 docker-compose.sample.yml delete mode 100644 scripts/get-stream.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 7ebbb56..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,27 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu -{ - "name": "Ubuntu", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/base:focal", - "features": { - "ghcr.io/devcontainers/features/git:1": {}, - "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/eitsupi/devcontainer-features/jq-likes:1": {} - } - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "uname -a", - - // Configure tool-specific properties. - // "customizations": {}, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} diff --git a/docker-compose.sample.yml b/docker-compose.sample.yml new file mode 100644 index 0000000..dc0cd7b --- /dev/null +++ b/docker-compose.sample.yml @@ -0,0 +1,11 @@ +version: "3.9 " + +services: + firehose-archive: + build: . + image: fakefirehose:latest + volumes: + - ../data:/data + - ./config:/config + restart: always + env_file: .env.production \ No newline at end of file diff --git a/scripts/get-stream.sh b/scripts/get-stream.sh deleted file mode 100644 index 5415c35..0000000 --- a/scripts/get-stream.sh +++ /dev/null @@ -1,46 +0,0 @@ -host=$1 -type=$2 -hashtag=$1 - -if [[ "$host" == "" ]] -then - echo "Empty host: $host" - exit 2 -fi - -while true -do - today=`date +"%Y%m%d"` - - case "$type" in - "federated") - fetch="https://$host/api/v1/streaming/public";; - "local") - fetch="https://$host/api/v1/streaming/public?local=true";; - - esac - - echo "Starting to stream $fetch in 5 seconds" - - sleep 5s; - - curl -X "GET" "$fetch" \ - --no-progress-meter | \ - tee -a "/data/$today.json" | \ - grep url | \ - sed 's/data://g' | \ - - while read -r line - do - - if [[ $line == *"uri"* ]] - then - url=`echo $line | jq .url| sed 's/\"//g'` - uri=`echo $line | jq .uri| sed 's/\"//g'` - - echo "STREAMING: $host $url" - echo $uri >> "/data/$today.uris.txt" - - fi - done -done \ No newline at end of file