forked from mirror/fake-firehose
Moved to docker format
This commit is contained in:
parent
3ba88451bb
commit
8c00c00e5b
9 changed files with 63 additions and 7 deletions
27
.devcontainer/devcontainer.json
Normal file
27
.devcontainer/devcontainer.json
Normal 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
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
data/20221217.json
|
||||||
|
20221217.uris.txt
|
||||||
|
|
13
Dockerfile
Normal file
13
Dockerfile
Normal 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" ]
|
|
@ -5,7 +5,7 @@ fedibird.com
|
||||||
mstdn.social
|
mstdn.social
|
||||||
mindly.social
|
mindly.social
|
||||||
mastodonapp.uk
|
mastodonapp.uk
|
||||||
vivaldi.net
|
#vivaldi.net
|
||||||
mas.to
|
mas.to
|
||||||
mastodon.world
|
mastodon.world
|
||||||
mastodon.au
|
mastodon.au
|
10
docker-compose.yml
Normal file
10
docker-compose.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
version: "3.9 "
|
||||||
|
|
||||||
|
services:
|
||||||
|
fake-firehose:
|
||||||
|
build: .
|
||||||
|
image: fakefirehose:latest
|
||||||
|
volumes:
|
||||||
|
- ./data:/data
|
||||||
|
- ./config:/config
|
||||||
|
restart: always
|
|
@ -2,9 +2,9 @@ host=$1
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
today=`date +"%Y%m%d"`
|
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 | \
|
--no-progress-meter | \
|
||||||
tee -a "$today.json" | \
|
tee -a "/data/$today.json" | \
|
||||||
grep url | \
|
grep url | \
|
||||||
sed 's/data://g' | \
|
sed 's/data://g' | \
|
||||||
|
|
8
scripts/start-firehose.sh
Executable file
8
scripts/start-firehose.sh
Executable 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
|
|
@ -1,4 +0,0 @@
|
||||||
cat domains|grep -v "#"|while read -r host
|
|
||||||
do
|
|
||||||
./get-stream.sh $host &
|
|
||||||
done
|
|
Loading…
Reference in a new issue