Avoiding captcha #44

Open
opened 2024-10-16 20:06:16 +00:00 by root · 11 comments

I set up a local instance with docker but sometimes it is stuck loading.
So I use 4get.ca.
Can avoid to do captcha all the times?

I set up a [local instance](https://git.lolcat.ca/lolcat/4get/issues/19) with docker but sometimes it is stuck loading. So I use 4get.ca. Can avoid to do captcha all the times?

i'd debug the loading instead, if i were you. my dockerized instance is several times faster than 4get.ca.

i'd debug the loading instead, if i were you. my dockerized instance is several times faster than 4get.ca.
Author

Any suggestion to how debug? Right now it's stuck.

Any suggestion to how debug? Right now it's stuck.
Owner

It times out because the IP you used for requesting results is blocked, that's just something duckduckgo does. Use the qwant scraper if you need bing results

It times out because the IP you used for requesting results is blocked, that's just something duckduckgo does. Use the qwant scraper if you need bing results
Author

It's down completely.
I have this from time to time.

It is stuck when connecting to local host.

It's down completely. I have this from time to time. It is stuck when connecting to local host.

is the docker container restarting during this downtime? check docker ps to see how its doing, if it restarted on its own recently, etc.

if the docker container looks fine, enter it using docker exec -it {container_name} sh and see if apache's doing okay (curl localhost etc.). if it works inside the container but not outside, see if everything's binding correctly.

i can't think at the moment of any other reason why it would periodically be totally inaccessible from the host machine, but i figured out how docker worked like a week ago so take my opinion lightly.

is the docker container restarting during this downtime? check `docker ps` to see how its doing, if it restarted on its own recently, etc. if the docker container looks fine, enter it using `docker exec -it {container_name} sh` and see if apache's doing okay (curl localhost etc.). if it works inside the container but not outside, see if everything's binding correctly. i can't think at the moment of any other reason why it would periodically be totally inaccessible from the host machine, but i figured out how docker worked like a week ago so take my opinion lightly.
Author

docker ps shows tor container unhealthy.
I restarted it and it is unhealthy again.
Before I had this problem and it fixed himself in days.

docker inspect <id>
                        "ExitCode": -1,
                        "Output": "Health check exceeded timeout (15s):   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n\r  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\r  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0\r  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0\r  0     0    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0\r  0     0    0     0    0     0      0      0 --:--:--  0:00:04 --:--:--     0\r  0     0    0     0    0     0      0      0 --:--:--  0:00:05 --:--:--     0\r  0     0    0     0    0     0      0      0 --:--:--  0:00:06 --:--:--     0\r  0     0    0     0    0     0      0      0 --:--:--  0:00:07 --:--:--     0\r  0     0    0     0    0     0      0      0 --:--:--  0:00:08 --:--:--     0\r  0     0    0     0    0     0      0      0 --:--:--  0:00:09 --:--:--     0\r  0     0    0     0    0     0      0      0 --:--:--  0:00:10 --:--:--     0\r  0     0    0     0    0     0      0      0 --:--:--  0:00:11 --:--:--     0\r  0     0    0     0    0     0      0      0 --:--:--  0:00:12 --:--:--     0\r  0     0    0     0    0     0      0      0 --:--:--  0:00:13 --:--:--     0\r  0     0    0     0    0     0      0      0 --:--:--  0:00:14 --:--:--     0"

I do not know much about docker do I need to reboot maybe?

`docker ps` shows tor container unhealthy. I restarted it and it is unhealthy again. Before I had this problem and it fixed himself in days. ``` docker inspect <id> "ExitCode": -1, "Output": "Health check exceeded timeout (15s): % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- 0:00:04 --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- 0:00:06 --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- 0:00:07 --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- 0:00:08 --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- 0:00:10 --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- 0:00:11 --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- 0:00:12 --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- 0:00:13 --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- 0:00:14 --:--:-- 0" ``` I do not know much about docker do I need to reboot maybe?

4get apparently packages it's own tor image, i guess.

the included healthcheck for that image is

HEALTHCHECK &{["CMD-SHELL" "curl -x socks5h://127.0.0.1:9050 'https://check.torproject.org/api/ip' | grep -qm1 -E '\"IsTor\"\\s*:\\s*true'"] "1m0s" "15s" "20s" "0s" '\x00'}

which... seems pretty reasonable? [spoiler]exits w 1 on my machine though, and i'm too gay and behind on my data structures project (what the FUCK is a 2d bintree?) to bother debugging rn.[/spoiler]

if it sometimes passes, then is there any reason you'd periodically not be able to make a connection to torproject.org within 15 seconds?

@lolcat maybe page thowaway, this is more his thing

[4get apparently packages it's own tor image, i guess.](https://hub.docker.com/r/luuul/tor) the included healthcheck for that image is ``` HEALTHCHECK &{["CMD-SHELL" "curl -x socks5h://127.0.0.1:9050 'https://check.torproject.org/api/ip' | grep -qm1 -E '\"IsTor\"\\s*:\\s*true'"] "1m0s" "15s" "20s" "0s" '\x00'} ``` which... seems pretty reasonable? [spoiler][exits w `1` on my machine though](https://pomf2.lain.la/f/asadtqns.txt), and i'm too gay and behind on my data structures project (what the FUCK is a 2d bintree?) to bother debugging rn.[/spoiler] if it sometimes passes, then is there any reason you'd periodically not be able to make a connection to torproject.org within 15 seconds? @lolcat maybe page thowaway, this is more his thing
Owner

@throwaway

tell me @root , does the homepage work when duckduckgo scraper fails? Cause I set it to timeout after 30 seconds, so maybe it's just really slow and you're blocked from duckduckgo.

@throwaway tell me @root , does the homepage work when duckduckgo scraper fails? Cause I set it to timeout after 30 seconds, so maybe it's just really slow and you're blocked from duckduckgo.
Author

4get apparently packages it's own tor image, i guess.

Yes I use that.

does the homepage work when duckduckgo scraper fails?

No I cannot open settings or the homepage etc.

>4get apparently packages it's own tor image, i guess. Yes I use that. >does the homepage work when duckduckgo scraper fails? No I cannot open settings or the homepage etc.
Collaborator

Hello!

Just to be on the same page, you should try deleting all 4get containers and recreate them. The following command will delete all containers on your system, if you're using docker for other stuff you can just delete the containers manually

docker container rm `docker container ls -aq`

then in the folder with your compose file, you can run docker-compose up
this might be enough to solve you issues

Any suggestion to how debug? Right now it's stuck.

Yes, you can look at the error log. By 4get does not have logs enabled. To enable logging, you can run the following

# the command "docker ps -qf ancestor=luuul/4get" will return the container id of 4get
# if this doesn't work let me know! Or you can replace this subcommand with the actual container id from docker ps 

# enable logging temporarily
docker exec  `docker ps -qf ancestor=luuul/4get` sed -i -e '/CustomLog/d' -e '/ErrorLog/d' /etc/apache2/httpd.conf
docker exec  `docker ps -qf ancestor=luuul/4get` httpd -k restart
docker exec  `docker ps -qf ancestor=luuul/4get` tail -f /var/log/apache2/error_log

these lines will

  1. remove lines that disable logging
  2. restart httpd
  3. tail -f the latest entries in /var/log/apache2/error_log

this is only temporary because the docker entrypoint will copy the http or https file that is present inside the container to /etc/apache2/httpd.conf when the container starts. In other words, if you run docker compose down and docker compose up the file will be the default (with error logging disabled)

you should now see the latest items in your error log.

you can confirm the configuration in another terminal with

docker exec  `docker ps -qf ancestor=luuul/4get` cat /etc/apache2/httpd.conf

you'll notice the lines

CustomLog /dev/null common
ErrorLog /dev/null

are no longer present

Let me know if there are issues present! If there are, please paste your compose file

Hello! Just to be on the same page, you should try deleting all 4get containers and recreate them. The following command will delete all containers on your system, if you're using docker for other stuff you can just delete the containers manually ``` docker container rm `docker container ls -aq` ``` then in the folder with your compose file, you can run `docker-compose up` this might be enough to solve you issues > Any suggestion to how debug? Right now it's stuck. Yes, you can look at the error log. By 4get does not have logs enabled. To enable logging, you can run the following ``` # the command "docker ps -qf ancestor=luuul/4get" will return the container id of 4get # if this doesn't work let me know! Or you can replace this subcommand with the actual container id from docker ps # enable logging temporarily docker exec `docker ps -qf ancestor=luuul/4get` sed -i -e '/CustomLog/d' -e '/ErrorLog/d' /etc/apache2/httpd.conf docker exec `docker ps -qf ancestor=luuul/4get` httpd -k restart docker exec `docker ps -qf ancestor=luuul/4get` tail -f /var/log/apache2/error_log ``` these lines will 1. remove lines that disable logging 2. restart httpd 3. tail -f the latest entries in /var/log/apache2/error_log this is only temporary because the docker entrypoint will copy the http or https file that is present inside the container to /etc/apache2/httpd.conf when the container starts. In other words, if you run `docker compose down` and `docker compose up` the file will be the default (with error logging disabled) you should now see the latest items in your error log. you can confirm the configuration in another terminal with ``` docker exec `docker ps -qf ancestor=luuul/4get` cat /etc/apache2/httpd.conf ``` you'll notice the lines ``` CustomLog /dev/null common ErrorLog /dev/null ``` are no longer present Let me know if there are issues present! If there are, please paste your compose file
Author

After running docker system prune that removed 800 mb it is fine.

If some invitation or something to avoid captcha can be provided anyway I think that it can be useful.
I do no think that I will run 4get on all my devices.

After running `docker system prune` that removed 800 mb it is fine. If some invitation or something to avoid captcha can be provided anyway I think that it can be useful. I do no think that I will run 4get on all my devices.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lolcat/4get#44
No description provided.