sekai-soft / guide-nitter-self-hosting

A guide for self-hosting a Nitter instance
MIT License
122 stars 8 forks source link

nitter instance only - seems to be running and setup was fine but can't access link? #5

Closed ILudw1g closed 5 months ago

ILudw1g commented 6 months ago

no errors, and seems to be running, but when i try to access http://localhost:8080 there's nothing there.

has anyone ran into this before?

ILudw1g commented 6 months ago

i think im not configuring the nitter.example file correctly, could anyone help out what to exactly fill in the server section?

i believe the rest is probably fine

KTachibanaM commented 6 months ago

You can run the docker compose command without the -d option and post the log outputs here for debugging as well.

Also the repo was updated to use a customized nitter.conf file so if you do a git pull now, you should also copy your nitter.example.conf as nitter.conf

ILudw1g commented 6 months ago

if i rename nitter.example.conf to nitter.conf and run "docker compose -f docker-compose.nitter.yml up -d --scale nitter-auth=0", it comes back with an error, it needs to be nitter.example.conf for me.

and if i see the logs (with nitter.example.conf) they just come back with this and stay on restarted status Untitledd

the redis one seems to be running fine though

ILudw1g commented 6 months ago

image

KTachibanaM commented 6 months ago

Looks like it failed to parse the nitter-guest_accounts.json file.. Can you rerun the credential generation step?

Ericktz commented 6 months ago

the same thing happens to me, it seems that it does not ride well... I get that it is not possible to connect to redis.

Could it be that there is a problem with the ports? currently on my port 80, there is apache2. i also have multiple xposter errors

image
KTachibanaM commented 6 months ago

@Ericktz Port 80 shouldn't matter if you are running the default setup (e.g. the one with tailscale) because the setup does not expose any port on the docker host. I think this might be a transient issue and you can try rerunning the stack. As for the xposter error, I added this container recently but forgot to update readme. You should be able to remove the error by running docker compose up -d --scale nitter-auth=0 --scale nitter-xposter=0 --scale nitter-xposter-bsky=0 (add --scale nitter-xposter-bsky=0 to the end of the original command)

ILudw1g commented 6 months ago

ive tried on two different machines, the credential step goes fine on both machines, no error or anything, then i get the giant command to paste in the terminal after it finishes. so im not sure if it's anything to do with that.

ILudw1g commented 6 months ago

also i see it mentions port 8080 in the readme, but the nitterexample.conf as port 80 in it.

maybe im customising nitter.conf wrong? is it just the "address" that needs changing to your localhost/ip? and i guess the port to 8080?

KTachibanaM commented 6 months ago

Yeah you do need to follow the giant command to paste in order to write the actual credentials file.

The 8080 port mentioned in the README is for the without-tailscale setup. The example nitter config should work out of box with the with-tailscale setup. The port 80 in the example config only applies to the nitter process running within the container, and it needs to bind to port 80 in order for tailscale networking to work.

ILudw1g commented 6 months ago

by "follow the giant command to paste in order to write the actual credentials file", you just mean copy and paste that entire message into the terminal right? i did do that, and i made a "nitter-guest_accounts.json" file with the big text in it.

does that sound right? maybe i should try a different account,

i see, then on the nitter.conf i just need to change the port to 8080 or something else to make it work without tailscale, right?

am i missing anything else or anything else i should be changing? for the nitter instance only

KTachibanaM commented 6 months ago

Yes it sounds like you have the correct nitter-guest_accounts.json file, perhaps you could try another throwaway account just in case?

If port 80 kept not working for you, you could try port 8080. Change the port = config in nitter.conf to 8080 and also change the port binding in docker-compose.nitter.yml to "8080:8080" instead of "8080:80". For a setup without tailscale it doesn't need to bind to port 80 anyway.

ILudw1g commented 6 months ago

so the nitter.conf file, ive changed the port to 8080 and in the docker-compose.nitter.yml to 8080:8080, but still the same thing.

is there anything else i need to change on the nitter.conf file? like where do i put my ip or any other important details i might've missed?

if it helps, in docker the nitter-1 instance is always on restarting status, the redis one is on "running" and seems fine

KTachibanaM commented 6 months ago

Screenshots of logs would be helpful. You can remove the -d from the command and you'll be able to stream the logs in terminal

ILudw1g commented 6 months ago

same as above..

image

KTachibanaM commented 6 months ago

Can you take a look at the credentials json file. Does it look like a valid one to you (don't post it here of course).

ILudw1g commented 6 months ago

is it perhaps that it doesnt work on an rpi? that is what im using it on, rpi5.

i tried one, with a new account twitter account on win10 and in it ran and i was able to access it. used the exact same folder and command to run the container on the rpi and back to giving errors..

ILudw1g commented 6 months ago

tried on win10 and again it worked fine.. just, the exact same folder and files don't seem to work on my rpi, which is where i would need it to run on..

is it because im using pivpn wireguard on my rpi? i can see the rpi is connected to the vpn, but im not sure if that would effect anything. any ideas?

ILudw1g commented 6 months ago

inintially on the rpi when you run the container and its starting up you can even see the published ports 8080:8080, but then that disapears too and just see this in the logs.
image

ILudw1g commented 6 months ago

could it be that port 8080 is already in use on the rpi or something? im not experienced enough to fully understand. just trying to see where the problem could lie.

KTachibanaM commented 6 months ago

Can you do a docker compose pull on the folder? The error looks like to me it's still using an old version of the image which doesn't support arm64. Unfortunately I don't have a rpi5 to test your exact setup though.

ILudw1g commented 6 months ago

ah, did a docker compose pull before doing anything else, and it worked. thanks a lot for that. does docker compose esentially pull the latest "compatible" images that it needs?

additionally, i gave it a try (my main use for it is rss), i used the instance for my rss feed, and i got this in the logs, rate limit.. do you know if anything can be done about that, or is this a brick wall? image

KTachibanaM commented 6 months ago

Yeah the docker compose pull fetches the latest image.

From the timestamps of the logs it looks like you are polling rss too frequently. I'd suggest that you adjust your rss reader/script to call nitter less frequently (I'd add at least 10 + a random amount of seconds between calls)

ILudw1g commented 6 months ago

yeah, its a feed of.. 100s. i guess it pulls it all at the same time, every 15 minutes.

sure thanks, i will look into adding a delay between each fetch in the feed. 10 seconds you said? I'll try go with that initially.

ILudw1g commented 6 months ago

also not sure if it's worth mentioning, but the nitter instance on docker does show as unhealthy. image

KTachibanaM commented 6 months ago

don't think the state matters as long as you can access the instance

ILudw1g commented 6 months ago

ive asked the rss reader dev if its possible to add delays between each fetch, he said it isnt for him.

in that case, is it possible to adjust my personally hosted instance to remove the rate limit?

or if there are any other suggestions i would apprecaite it, because in the last few days of using my own instance, just once this morning it actually came back with an item from the feed. just one item in days...

KTachibanaM commented 6 months ago

I don't think you can avoid the NItter rate limit because it comes from Twitter-side. My only suggestion would be to change to another rss reader.

ILudw1g commented 6 months ago

yeah sure, i might have to, the one i was using was monitorss, able to host your own.

i understand rate limit is twitter-side, but when i was using the nitter instances that were publicly available, it never happened to this extend. i mean 1 feed in days..? at least half of the feeds on public instances would come through

KTachibanaM commented 6 months ago

The public instances beforehand had a lot of guest accounts so it might be why you were not getting rate limited, but with the recent development, it's no longer possible to obtain new guest accounts, and hence you need to manually sign up for burner accounts, which is significantly harder to do manually or automate.

My suggestion is still to use an alternative approach to crawl Nitter's RSS feeds. From the screenshot you posted earilier, the situation could be 1) the application you uses to crawl RSS feed (monitorss) polls Nitter without any delay or backoff, which is honestly bad web scraping practice 2) your Nitter instance might be actually abused by other malicious bots that you could be unaware of since the nitter-only setup does expose port 8080 on the host, and depending on your Docker/server setup, the Nitter instance could be accessible to anyone on the Internet, malicious bots included.

ILudw1g commented 6 months ago

is there a way to make it more secure? i dont think its that though.

yeah it doesnt add any delays it looks like, and i checked with the dev there is no way to add delay. so might look into another one or just give up ; D

KTachibanaM commented 6 months ago

I'm actually playing with an idea of spinning up an nginx proxy in front of the instance so that all web or rss requests need to be authenticated (for web it's a basic auth, for rss it's a query parameter), but that's still wip

ILudw1g commented 6 months ago

sure. by the way do you know an rss reader that can add delays? ill have to see what i can do, even then im not sure if itll work

KTachibanaM commented 6 months ago

I am not sure, but I added an nginx instance with password protections for the nitter only setup https://github.com/sekai-soft/freebird/blob/master/docs/i-only-want-a-nitter-instance-and-without-tailscale.md . This could potentially help you weed out malicious bots at least (if there is any). You need to do a git pull and additionally do step 4 and 5.