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
Docker-compose up using the default docker-compose.yml file does not create mCaptcha container when using Oracle Linux Server 8.8 (Oracle Cloud) #89
Comments
Given the logs, it looks like PostgresSQL wasn't ready to accept connections quite yet. (depends_on doesn't wait for init to complete just the container to be running) then when the mcaptcha container started it wasn't ready and failed to resolve. I'd try standing up the other services explicitly first:
Then start the mcaptcha container:
If that doesn't work, I think we'll need to know what OS you're running on Oracle Cloud as some linux flavors have certain security features enabled that tends to break docker bridges. For example, in my Oracle Linux 9 server, I need to have SELinux run in permissive mode and disable Firewalld (in favor of a simpler, less opinionated firewall) in order to get things communicating well. Hope that helps! I'll likely see what I can contribute code-wise this weekend (I'm a lemmy instance admin looking to contribute on the issue mentioned above as well). |
I don't have a healthcheck for postgresql handy, but if you add a healthcheck to postgres version: "3.9"
services:
mcaptcha:
image: mcaptcha/mcaptcha:latest
ports:
- 7000:7000
environment:
DATABASE_URL: postgres://postgres:password@mcaptcha_postgres:5432/postgres # set password at placeholder
MCAPTCHA_REDIS_URL: redis://mcaptcha_redis/
RUST_LOG: debug
PORT: 7000
RUST_BACKTRACE: 1
depends_on:
mcaptcha_postgres:
condition: service_healthy ##added this, this container will then wait until postgres is healthy and only start then
mcaptcha_redis:
mcaptcha_postgres:
image: postgres:13.2
volumes:
- mcaptcha-data:/var/lib/postgresql/
environment:
POSTGRES_PASSWORD: password # change password
PGDATA: /var/lib/postgresql/data/mcaptcha/
healthcheck: ##todo
mcaptcha_redis:
image: mcaptcha/cache:latest
volumes:
mcaptcha-data: |
Thanks, logging on soon so will give it a try |
I tried this but a condition as part of depends on was deprecated in Docker V3: See Here Here is the new docker-compose.yml yaml file I have tried with this omitted, but with a postgres healthcheck included.
Ill keep working on it. |
Appreciate the response and the assistance, I did have firewalld stopped when originally testing but selinux was enabled, I disabled selinux and I still couldnt stand the 2 containers up first prior to then standing up mCaptcha, for some reason redis was failing to start due to issues with the tmpfs when selinux was disabled. I have since re-enabled it and redis starts again without issue. That said, I still keep running into the same faults with mCaptcha container failing to start due to the same error.
OS is:
Using an Oracle Cloud VM instance, I dont think I can change the OS to a main distribution, could you let me know how you get on over the weekend and see if you run into the same fault? |
That's annoying ... The easiest to do that is creating an entry point script and haven a check if it can connect there. Cheers |
Sounds good, thank you! |
Going to update the issue heading. I have had success getting mCaptcha set up on my own local Ubuntu home-server, using the exact same docker-compose.yml file I created with the healthcheck. Hurrah 😄 The fault with what I am experiencing with my Cloud VM is specific to that Oracle Fedora OS. I will also raise this to Oracle support to see if they have any tips for me. At somepoint I will need to host mCaptcha directly in the cloud. I will leave this issue open until I come back with a fix. This will help inform others if they have the same issue in the future. |
I have added in MCAPTCHA_SERVER_DOMAIN: (my server IP public IP goes here) to my docker-compose-yml file as per this issue #32 but it didn't fix anything when standing up the containers on my Oracle Linux Server OS. @realaravinth redis looks quite resource intensive is that right? Just looking at the specs here: https://docs.redis.com/latest/rs/installing-upgrading/install/plan-deployment/hardware-requirements/ Please would you be able to confirm? Wondering if my issue is due to not enough available memory. |
Hi, I haven't caught up with the thread yet, I'm in the middle of tests at my Uni but its so nice seeing people chip in to help each other 😊
Redis' memory usage depends on the amount of data you store on it, so technically you can get away with running it on a server with lesser resources. We are using only Redis to support large-scale deployment where a single mCaptcha instance will have to support multiple websites. So if your deployment is small-scale, I'd recommend going the embedded cache route. I have to improve documentation on using the embedded cache, but here's how you do it:
debug = true
source_code = "https://github.com/mCaptcha/mCaptcha"
commercial = false
allow_demo = true
allow_registration = true
[server]
# Please set a unique value, your mCaptcha instance's security depends on this being
# unique
cookie_secret = "Zae0OOxf^bOJ#zN^&k7VozgW&QAx%n02TQFXpRMG4cCU0xMzgu3dna@tQ9dvc&TlE6p*n#kXUdLZJCQsuODIV%r$@o4%770ePQB7m#dpV!optk01NpY0@615w5e2Br4d"
# The port at which you want authentication to listen to
# takes a number, choose from 1000-10000 if you dont know what you are doing
port = 7000
#IP address. Enter 0.0.0.0 to listen on all available addresses
ip= "0.0.0.0"
# enter your hostname, eg: example.com
domain = "localhost"
# Set true if you have setup TLS with a reverse proxy like Nginx.
# Does HTTPS redirect and sends additional headers that can only be used if
# HTTPS available to improve security
proxy_has_tls = false
#url_prefix = ""
[captcha]
# Please set a unique value, your mCaptcha instance's security depends on this being
# unique
salt = "asdl;kjfhjawehfpa;osdkjasdvjaksndfpoanjdfainsdfaijdsfajlkjdsaf;ajsdfweroire"
# garbage collection period to manage mCaptcha system
# leave untouched if you don't know what you are doing
gc = 30
runners = 4
queue_length = 2000
enable_stats = true
[captcha.default_difficulty_strategy]
avg_traffic_difficulty = 50000 # almost instant solution
peak_sustainable_traffic_difficulty = 3000000 # roughly 1.5s
broke_my_site_traffic_difficulty = 5000000 # greater than 3.5s
duration = 30 # cooldown period in seconds
[database]
# This section deals with the database location and how to access it
# Please note that at the moment, we have support for only postgresqa.
# Example, if you are Batman, your config would be:
# hostname = "batcave.org"
# port = "5432"
# username = "batman"
# password = "somereallycomplicatedBatmanpassword"
hostname = "localhost"
port = "5432"
username = "postgres"
password = "password"
name = "postgres"
pool = 4
database_type="postgres" # "postgres", "maria"
[smtp]
from = "admin@localhost"
reply = "admin@localhost"
url = "127.0.0.1"
port = 10025
username = "admin"
password = "password"
version: "3.9"
services:
mcaptcha:
image: mcaptcha/mcaptcha:latest
ports:
- 7000:7000
environment:
DATABASE_URL: postgres://postgres:password@mcaptcha_postgres:5432/postgres # set password at placeholder
RUST_LOG: debug
PORT: 7000
volumes:
- type: bind
source: ./config
target: /etc/mcaptcha/
depends_on:
- mcaptcha_postgres
mcaptcha_postgres:
image: postgres:13.2
volumes:
- mcaptcha-data:/var/lib/postgresql/
environment:
POSTGRES_PASSWORD: password # change password
PGDATA: /var/lib/postgresql/data/mcaptcha/
volumes:
mcaptcha-data: I should become free after tomorrow, if the issue still persists, I'll be available then :) |
Hi,
I am trying to set up mCaptcha on a Oracle Could VM instance. I only want to set up the default configuration for now whilst I learn about mCaptcha.
For some reason I keep hitting these errors when I run docker-compose up within the mCaptcha directory:
I dont know why this occuring, here is my docker-compose.yml file
Any help is appreciated
The text was updated successfully, but these errors were encountered: