Repository navigation
Closed
Labels
Description
The Deployment Documentation is not very detailed and some points are missing or not explained well. I will list the problems here and then improve the documentations.
Generate Data Issue:
generate_datadoes not work as reported here: Homepage is all blank #1914
Storage URL issue
- This is wrong:
AWS_S3_ENDPOINT_URL=http://<IP ADDRESS>/, it should beAWS_S3_ENDPOINT_URL=http://<IP ADDRESS>:9000
Minio version issue
- I had to make a small change in the
docker-compose.ymlfile to configure minio --- changemc config host add minio_dockertomc alias set minio_docker
Using IP instead of domain issues
- When you haven't connected a domain to the deployment, the activation emails have
example.cominstead of the IP.
This could be fixed by updating the Site record manually from django shell
from django.contrib.sites.models import Site
site = Site.objects.get(id=1)
site.domain = "<IP>:8000"
site.name = "Codabench"
site.save()
- It is not clear from the current documentation that when you connect a domain, how the site settings change and uses domain instead of
example.com. We should clarify this in the documentation and also add more details about connecting a domain.
Bring from email to .env
- We have used static emails in the code e.g. activation emails uses .env for
FROM_EMAILbut reset password uses[email protected]to send emails. There is a PR about it and we should finalize it (Add CONTACT_EMAIL and remove references to [email protected] #1818)
Improvements:
- we should suggest to change the minio key and password because using
testkeyandtestpasswordseems risky - we should add documentation about configuring mail-server to the deployment documentation
- we should create a readme file for Google Clound that documents each step in detail for Google Cloud only. Later on we can add such docs for other platforms too like Azure, Amazon etc
Configuring a mail server
To test email sending you can use this code in shell. This uses the email settings from the env
from django.core.mail import send_mail
send_mail(
"Hostinger Email Test",
"This is a test email sent from Django via Hostinger SMTP.",
"[email protected]",
["[email protected]"],
)
To bypass the env setting and use new settings use the following code. This is useful when you want to check first the email configuration and then add to .env
from django.core.mail import get_connection, send_mail
connection = get_connection(
backend='django.core.mail.backends.smtp.EmailBackend',
host='smtp.titan.email',
port=465,
username='[email protected]',
password='<PASSWORD>',
use_ssl=True,
use_tls=False
)
send_mail(
subject="Test Email",
message="This is a test from Django via Hostinger SMTP.",
from_email="[email protected]",
recipient_list=["[email protected]"],
connection=connection
)
Activity
ihsaan-ullah commentedon Jul 10, 2025
ihsaan-ullah commentedon Jul 11, 2025
@ObadaS for some reason the db is deleted from my deployment on Google Cloud. I had to run
migratecommand again to fix this. Do you know if there is any script/task that deletes the db for some reason or could this be a cloud VM problem?ObadaS commentedon Jul 11, 2025
We have this file that resets the database, but it also runs migrate afterward. Since you had to run it again, I guess it's not possible that it was ran in the first place.
curious-broccoli commentedon Jul 11, 2025
the wiki says that (if necessary) you should open the port 8000, but you actually want to open the caddy ports I think: 80, 443
ObadaS commentedon Jul 15, 2025
I tested it,
example.comdoesn't get changed to the site domain even if I put a different one. There must be a different setting that can be changed to changeexample.cominto the actual site domain name.ObadaS commentedon Jul 16, 2025
I did some more tests, it seems that instead of doing that :
We can just modify this file
codabench/src/apps/profiles/views.py
Line 99 in d98abf9
to :
It will work for instances which uses domain names (localhost included) as well as IP addresses.
I am not sure why the current implementation is showing example.com instead of the domain name.
I'm also not sure if we need to change other files for other kind of emails that people could receive containing the link to the website.
curious-broccoli commentedon Jul 22, 2025
consider if the productions settings should be the default in the .env https://github.com/codalab/codabench/blob/develop/src/settings/production.py
curious-broccoli commentedon Jul 22, 2025
I also think that using settings.DOMAIN_NAME is better. it seems that the sites framework is meant for cases where django serves multiple domains
ihsaan-ullah commentedon Jul 22, 2025
Very productive thread. Thanks a lot @curious-broccoli and @ObadaS for the contribution. We will improve the documentation soon and will incorporate all the points mentioned.
Didayolo commentedon Jul 23, 2025
Hi all,
I mention it because it is related, I updated Codabench installation and How to deploy Codabench pages. I mainly made them clearer (separating local setup and online deployment between these two), and added instructions and warning about SSL and about changing the default usernames and passwords.