Skip to content

Instantly share code, notes, and snippets.

@packrat386
Last active April 25, 2022 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save packrat386/226d19e41f26e01409b831894fb9f63f to your computer and use it in GitHub Desktop.
Save packrat386/226d19e41f26e01409b831894fb9f63f to your computer and use it in GitHub Desktop.
nitter in docker in systemd
[Unit]
Description=Create docker network for nitter
Conflicts=umount.target
Requires=systemd-udevd.service
After=systemd-udevd.service
Before=nitter-server.service
Before=nitter-redis.service
[Service]
Type=oneshot
ExecStart=docker network create -d bridge nitter-network
ExecStop=docker network rm nitter-network
TimeoutSec=60
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
[Unit]
Description=nitter redis db
After=docker.service
Requires=docker.service
After=nitter-docker-network.service
Requires=nitter-docker-network.service
[Service]
TimeoutStartSec=5
ExecStartPre=docker pull redis:latest
ExecStart=docker run --name nitter-redis --rm --network nitter-network redis:latest
ExecStop=docker stop nitter-redis
Restart=always
RestartSec=10s
[Install]
WantedBy=multi-user.target
[Unit]
Description=nitter web server
After=docker.service
Requires=docker.service
After=nitter-docker-network.service
Requires=nitter-docker-network.service
After=nitter-redis.service
Requires=nitter-redis.service
[Service]
TimeoutStartSec=5
ExecStartPre=docker pull zedeus/nitter:latest
ExecStart=docker run --name nitter-server --rm -p 127.0.0.1:8080:8080 -v /etc/nitter/nitter.conf:/src/nitter.conf --network nitter-network zedeus/nitter:latest
ExecStop=docker stop nitter-server
Restart=always
RestartSec=10s
[Install]
WantedBy=multi-user.target
[Server]
address = "0.0.0.0"
port = 8080
https = false # disable to enable cookies when not using https
httpMaxConnections = 100
staticDir = "./public"
title = "nitter"
hostname = "nitter.net"
[Cache]
listMinutes = 240 # how long to cache list info (not the tweets, so keep it high)
rssMinutes = 10 # how long to cache rss queries
redisHost = "nitter-redis" # Change to "nitter-redis" if using docker-compose
redisPort = 6379
redisPassword = ""
redisConnections = 20 # connection pool size
redisMaxConnections = 30
# max, new connections are opened when none are available, but if the pool size
# goes above this, they're closed when released. don't worry about this unless
# you receive tons of requests per second
[Config]
hmacKey = "replaceme" # random key for cryptographic signing of video urls
base64Media = true # use base64 encoding for proxied media urls
enableRSS = true # set this to false to disable RSS feeds
enableDebug = false # enable request logs and debug endpoints
proxy = "" # http/https url, SOCKS proxies are not supported
proxyAuth = ""
tokenCount = 10
# minimum amount of usable tokens. tokens are used to authorize API requests,
# but they expire after ~1 hour, and have a limit of 187 requests.
# the limit gets reset every 15 minutes, and the pool is filled up so there's
# always at least $tokenCount usable tokens. again, only increase this if
# you receive major bursts all the time
# Change default preferences here, see src/prefs_impl.nim for a complete list
[Preferences]
theme = "Nitter"
replaceTwitter = "nitter.net"
replaceYouTube = ""
replaceReddit = "teddit.net"
replaceInstagram = ""
proxyVideos = true
hlsPlayback = false
infiniteScroll = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment