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

Add ability to connect to PostgreSQL via unix socket #734

Merged
merged 3 commits into from
Aug 15, 2022
Merged

Add ability to connect to PostgreSQL via unix socket #734

merged 3 commits into from
Aug 15, 2022

Conversation

ratsclub
Copy link
Contributor

@ratsclub ratsclub commented Aug 12, 2022

This is related to #733

  • read the CONTRIBUTING guidelines
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

@ratsclub ratsclub changed the title Add ability to connect to PostgreSQL via socket Add ability to connect to PostgreSQL via unix socket Aug 12, 2022
@juanfont
Copy link
Owner

@vtrf would if be possible some details in https://github.com/juanfont/headscale/blob/main/config-example.yaml, to explain how to use this? I guess an extra line in line 116 clarifying that port should be blank for the socket, and host should be the path to it :)

@ratsclub
Copy link
Contributor Author

@juanfont Is this enough or should I go more in depth about the option?

@@ -116,6 +116,9 @@ db_path: /var/lib/headscale/db.sqlite
# # Postgres config
# db_type: postgres
# db_host: localhost

# This should be set when using a TCP connection, set it to '0' or keep it unset if
# connecting through a unix socket.
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
# connecting through a unix socket.

@@ -116,6 +116,9 @@ db_path: /var/lib/headscale/db.sqlite
# # Postgres config
# db_type: postgres
# db_host: localhost

# This should be set when using a TCP connection, set it to '0' or keep it unset if
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
# This should be set when using a TCP connection, set it to '0' or keep it unset if

@@ -116,6 +116,9 @@ db_path: /var/lib/headscale/db.sqlite
# # Postgres config
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
# # Postgres config
# # Postgres config
# If using a Unix socket to connect to Postgres, set the socket path in the 'host' field and leave 'port' blank.

@juanfont juanfont added this to the v0.17.0 milestone Aug 15, 2022
@juanfont
Copy link
Owner

@vtrf can you have a look at the suggestions?

@ratsclub ratsclub requested a review from juanfont August 15, 2022 14:56
Copy link
Owner

@juanfont juanfont left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@juanfont juanfont merged commit e1a95e2 into juanfont:main Aug 15, 2022
@ratsclub ratsclub deleted the postgres-connection-string branch August 15, 2022 18:02
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.

2 participants