Skip to content

Update localhost refs #959

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

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Update localhost refs #959

wants to merge 16 commits into from

Conversation

LDiazN
Copy link
Contributor

@LDiazN LDiazN commented May 12, 2025

Update all clickhouse localhost refs in backend to use a configuration parameter instead.

It's set up such that if no such configuration is provided, it defaults to the old behaviour of having localhost hardcoded

The following config file requires an update:

analysis.conf

# Managed by ansible, see roles/ooni-backend/tasks/main.yml
# [s3bucket]
# bucket_name = ooni-data-eu-fra-test
# aws_access_key_id =
# aws_secret_access_key =

[backup]
# space separated
table_names = citizenlab fastpath jsonl

# New
[DB]
uri = clickhouse url here

Closes #954

Related to ooni/devops#242

@LDiazN LDiazN requested a review from hellais May 12, 2025 10:15
@LDiazN LDiazN self-assigned this May 12, 2025
@LDiazN LDiazN marked this pull request as ready for review May 12, 2025 10:41
Copy link
Member

@hellais hellais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only support setting db-uri using CLI flag

return

cp = ConfigParser()
with conf_file.open("r") as f:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest dropping all this config file handling stuff and only allow setting db-uri via the CLI flag --db-uri.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason is that we are potentially adding some extra code paths that can be tricky to debug if something is not working as intended.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we set up the flag --db-uri when deployed? I originally used the conf file because it's where we specify configurations in Ansible

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

Successfully merging this pull request may close these issues.

Update all references to clickhouse://localhost with a configurable db_uri
2 participants