1
0
Fork 0

Moved to docker format

This commit is contained in:
raynor 2022-12-17 18:55:34 -05:00
parent 3ba88451bb
commit 8c00c00e5b
9 changed files with 63 additions and 7 deletions

View File

@ -0,0 +1,27 @@
// 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"
}

2
.gitignore vendored
View File

@ -1 +1,3 @@
.DS_Store
data/20221217.json
20221217.uris.txt

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
# syntax=docker/dockerfile:1
FROM ubuntu
RUN apt update && apt dist-upgrade -y
RUN apt install -y \
jq \
curl \
nano \
vim
COPY ./scripts /scripts
WORKDIR /scripts
RUN chmod +x /scripts/*
ENTRYPOINT [ "/scripts/start-firehose.sh" ]

View File

@ -5,7 +5,7 @@ fedibird.com
mstdn.social
mindly.social
mastodonapp.uk
vivaldi.net
#vivaldi.net
mas.to
mastodon.world
mastodon.au

10
docker-compose.yml Normal file
View File

@ -0,0 +1,10 @@
version: "3.9 "
services:
fake-firehose:
build: .
image: fakefirehose:latest
volumes:
- ./data:/data
- ./config:/config
restart: always

View File

@ -2,9 +2,9 @@ host=$1
while true
do
today=`date +"%Y%m%d"`
curl -X "GET" "https://$host/api/v1/streaming/public" \
curl -X "GET" "https://$host/api/v1/streaming/public?&local=true" \
--no-progress-meter | \
tee -a "$today.json" | \
tee -a "/data/$today.json" | \
grep url | \
sed 's/data://g' | \

8
scripts/start-firehose.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
cat /config/domains|grep -v "#"|while read -r host
do
/scripts/get-stream.sh $host &
done
while true; do sleep 1; done

View File

@ -1,4 +0,0 @@
cat domains|grep -v "#"|while read -r host
do
./get-stream.sh $host &
done