Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can someone update how to get this running? #206

Open
therealjr opened this issue Nov 1, 2022 · 9 comments
Open

Can someone update how to get this running? #206

therealjr opened this issue Nov 1, 2022 · 9 comments
Assignees

Comments

@therealjr
Copy link

I want to pick this project back up but I cannot get the docker containers to run. I edited Dockerfile inside of captchouli to:

RUN go install github.com/bakape/captchouli/cmd/captchouli@latest

However now I get the error:

can't load package: package github.com/bakape/captchouli/cmd/captchouli@latest: cannot use path@version syntax in GOPATH mode The command '/bin/sh -c go install github.com/bakape/captchouli/cmd/captchouli@latest' returned a non-zero code: 1

@therealjr
Copy link
Author

therealjr commented Nov 1, 2022

FROM debian:buster-slim

install prereqs, utils for bootstrapping watcher

RUN apt-get update && apt-get install -y golang libopencv-dev git
netcat-openbsd psmisc &&
rm -rf /var/lib/apt/lists/*

make a new user so we don't run as root

RUN useradd -r captchouli
WORKDIR /home/captchouli
RUN chown -R captchouli /home/captchouli

preemptively make the supporting directory so docker won't

attempt to make a new directory owned by root (aids when

attempting to persist .captchouli)

RUN mkdir -p .captchouli/images
RUN chown -R captchouli .captchouli

install captchouli

USER captchouli
RUN export GO111MODULE=on
RUN go mod init captchouli
RUN go install github.com/bakape/captchouli/cmd/captchouli

setup entrypoint and port

COPY entrypoint.sh .
COPY captchouli.sh .
EXPOSE 8512

entrypoint switches back to the captchouli user but needs to

start with root privileges

USER root
ENTRYPOINT ["sh", "./entrypoint.sh"]

@therealjr
Copy link
Author

I'm still running into multiple other issues. Could @DangerOnTheRanger update this please?

@DangerOnTheRanger DangerOnTheRanger self-assigned this Nov 2, 2022
@DangerOnTheRanger
Copy link
Owner

Thanks for raising this issue - while I have much less free time these days, I'm very glad to see there's still interest in Maniwani.

It might be worth considering removing captchouli entirely; the github project is now marked as archived/read-only, and all 5 forks seem to be behind. I can't take over as maintainer either (my current job prevents me from publishing/contributing code licensed under the AGPL, which is the license captchouli uses). bakape/captchouli#42 also seems like a critical issue - something could be done about it, but at a glance it seems like fixing that workaround would take some serious effort.

I'm not aware of any similar anime-backed CAPTCHA like captchouli at the moment, but if a similar project existed I'd welcome a PR to add support for it to Maniwani.

@natto1784
Copy link

@therealjr, If you still want to build it despite the exploit mentioned by @DangerOnTheRanger in bakape/captchouli#42, you can do so by doing this

diff --git a/build-helpers/captchouli/Dockerfile b/build-helpers/captchouli/Dockerfile
index 89db27f..0a0dfd9 100644
--- a/build-helpers/captchouli/Dockerfile
+++ b/build-helpers/captchouli/Dockerfile
@@ -14,7 +14,9 @@ RUN mkdir -p .captchouli/images
 RUN chown -R captchouli .captchouli
 # install captchouli
 USER captchouli
-RUN go get github.com/bakape/captchouli/cmd/captchouli
+RUN go mod init github.com/bakape/captchouli/v2
+RUN go install github.com/bakape/captchouli/cmd/captchouli
 # setup entrypoint and port
 COPY entrypoint.sh .
 COPY captchouli.sh .

@natto1784
Copy link

natto1784 commented Nov 17, 2022

As a side note let me hijack this thread and say that the main Dockerfile would not build since psycopg2 requires pg_config which should be available in the libpq-dev but I have not tested it yet for more errors.
Or maybe it is just an arm thing since it requires aarch64-linux-gnu-gcc as well

@therealjr
Copy link
Author

@DangerOnTheRanger https://github.com/Leomotors/anime-captcha Would you be able to integrate this into this site? If you can get this patched up and I can work on maintaining this software.

@therealjr
Copy link
Author

@natto1784 thanks for the info

@sankar-nath
Copy link

@natto1784 I had that issue when I tried it on my local but I was able to build the Manwani image when I ran it on a cloud9 instance on AWS

@therealjr
Copy link
Author

@natto1784 Hey thanks for you advice on how to get it running before. I'm getting a new error that I have posted elsewhere on this github page. But for anyone tracking this I will also post it here. The error is:

2023/09/22 18:36:44 captchouli: initializing tag=izayoi_sakuya explicitness=[safe, questionable, explicit]
image fetch: 1 panic: captchouli: error initializing image pool for tag izayoi_sakuya: &{%!w(string=object) %!w(*reflect.rtype=&{24 8 2828168306 2 8 8 23 0xbd8e60 0x933b3d 124572 167936}) %!w(int64=1) %!w(string=) %!w(string=)}

goroutine 1 [running]:
main.main()
/home/captchouli/go/pkg/mod/github.com/bakape/[email protected]/cmd/captchouli/main.go:52 +0x307

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants