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

fix: store password as scram-sha-256 #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tomohirohiratsuka
Copy link

Hi,

I encountered an issue during the installation process where the chirpstack_as and chirpstack_ns roles cannot access PostgreSQL. The problem appears to be related to password encryption methods.

The shell script expects the role passwords to be md5 encrypted. However, the RPi OS Bookworm installs PostgreSQL 15 by default, as shown below:

apt-cache policy postgresql
postgresql:
  Installed: 15+248
  Candidate: 15+248
  Version table:
 *** 15+248 500
        500 http://deb.debian.org/debian bookworm/main arm64 Packages
        500 http://deb.debian.org/debian bookworm/main armhf Packages
        100 /var/lib/dpkg/status

PostgreSQL 15 uses scram-sha-256 as the default encryption method.
https://www.postgresql.org/docs/15/runtime-config-connection.html#GUC-PASSWORD-ENCRYPTION

However, the init_sql.sql script sets the password using md5 encryption:
https://github.com/RAKWireless/rak_common_for_gateway/blob/master/chirpstack/init_sql.sql#L15

To address this inconsistency, there are two potential solutions:

Specify the PostgreSQL version to one that uses md5 encryption by default.
Update the password storage method to scram-sha-256 to match the latest PostgreSQL version.
This PR aims to set the role passwords using scram-sha-256 encryption. I would appreciate the maintainers' opinions on this approach.

Thank you.

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.

1 participant