Skip to content

Conversation

@Altahrim
Copy link
Collaborator

@Altahrim Altahrim commented Sep 18, 2025

Summary

Add SSL/TLS support for PostgreSQL

Checklist

@Altahrim Altahrim added this to the Nextcloud 33 milestone Sep 18, 2025
@Altahrim Altahrim self-assigned this Sep 18, 2025
@Altahrim Altahrim added the 2. developing Work in progress label Sep 18, 2025
@AndyScherzinger
Copy link
Member

/backport to stable32

@AndyScherzinger
Copy link
Member

/backport to stable31

@AndyScherzinger
Copy link
Member

/backport to stable30

Copy link
Contributor

@szaimen szaimen left a comment

Choose a reason for hiding this comment

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

Can we maybe add some CI that tests this automatically?

@Altahrim Altahrim added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Sep 19, 2025
@Altahrim Altahrim marked this pull request as ready for review September 19, 2025 13:20
@Altahrim Altahrim requested a review from a team as a code owner September 19, 2025 13:20
@Altahrim Altahrim requested review from ArtificialOwl, come-nc and salmart-dev and removed request for a team September 19, 2025 13:20
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Copy link
Collaborator

@kesselb kesselb left a comment

Choose a reason for hiding this comment

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

🐘

@Altahrim Altahrim merged commit 52acc5e into master Sep 22, 2025
213 of 218 checks passed
@Altahrim Altahrim deleted the feat/pgsql-ssl branch September 22, 2025 12:29
@backportbot
Copy link

backportbot bot commented Sep 22, 2025

The backport to stable30 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable30
git pull origin stable30

# Create the new backport branch
git checkout -b backport/55170/stable30

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 58839144

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/55170/stable30

Error: Failed to push branch backport/55170/stable30: remote: {"auth_status":"auth_error","body":"Invalid username or token. Password authentication is not supported for Git operations."}
fatal: Authentication failed for 'https://github.com/nextcloud/server.git/'


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@AndyScherzinger
Copy link
Member

/backport to stable30

@nfk
Copy link

nfk commented Sep 30, 2025

@Altahrim and @AndyScherzinger thanks for this feature! What is the best way to bootstrap a NC instance with posgres SSL connection?

SSL parameters are no exposed into the install part

protected function configure(): void {
$this
->setName('maintenance:install')
->setDescription('install Nextcloud')
->addOption('database', null, InputOption::VALUE_REQUIRED, 'Supported database type', 'sqlite')
->addOption('database-name', null, InputOption::VALUE_REQUIRED, 'Name of the database')
->addOption('database-host', null, InputOption::VALUE_REQUIRED, 'Hostname of the database', 'localhost')
->addOption('database-port', null, InputOption::VALUE_REQUIRED, 'Port the database is listening on')
->addOption('database-user', null, InputOption::VALUE_REQUIRED, 'Login to connect to the database')
->addOption('database-pass', null, InputOption::VALUE_OPTIONAL, 'Password of the database user', null)
->addOption('database-table-space', null, InputOption::VALUE_OPTIONAL, 'Table space of the database (oci only)', null)
->addOption('disable-admin-user', null, InputOption::VALUE_NONE, 'Disable the creation of an admin user')
->addOption('admin-user', null, InputOption::VALUE_REQUIRED, 'Login of the admin account', 'admin')
->addOption('admin-pass', null, InputOption::VALUE_REQUIRED, 'Password of the admin account')
->addOption('admin-email', null, InputOption::VALUE_OPTIONAL, 'E-Mail of the admin account')
->addOption('data-dir', null, InputOption::VALUE_REQUIRED, 'Path to data directory', \OC::$SERVERROOT . '/data');
}

$dbSetup->initialize($options);

@kesselb
Copy link
Collaborator

kesselb commented Sep 30, 2025

I think it should work to prepare an additional pgsql_ssl.config.php in config directory with only the pgsql ssl configuration.

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#multiple-merged-configuration-files for more details.

@skjnldsv skjnldsv modified the milestones: Nextcloud 33, Nextcloud 32 Oct 2, 2025
@nfk
Copy link

nfk commented Oct 2, 2025

I think it should work to prepare an additional pgsql_ssl.config.php in config directory with only the pgsql ssl configuration.

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#multiple-merged-configuration-files for more details.

@kesselb I confirm is working well, still some issues with my certificate but NC see the psqld ssl config. Thanks for the quick reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants