Skip to content

Commit

Permalink
[DPE-5915] Reduce pgdate permissions (#759)
Browse files Browse the repository at this point in the history
* Reduce pgdate permissions

* Disable indico tests
  • Loading branch information
dragomirp authored Nov 7, 2024
1 parent 6f10bb9 commit ef6baf7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ def _create_pgdata(self, container: Container):
"""Create the PostgreSQL data directory."""
if not container.exists(self.pgdata_path):
container.make_dir(
self.pgdata_path, permissions=0o770, user=WORKLOAD_OS_USER, group=WORKLOAD_OS_GROUP
self.pgdata_path, permissions=0o750, user=WORKLOAD_OS_USER, group=WORKLOAD_OS_GROUP
)
# Also, fix the permissions from the parent directory.
container.exec([
Expand Down
1 change: 1 addition & 0 deletions tests/integration/new_relations/test_new_relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ async def test_discourse(ops_test: OpsTest):


@pytest.mark.group(1)
@pytest.mark.unstable
@markers.amd64_only # indico charm not available for arm64
async def test_indico_datatabase(ops_test: OpsTest) -> None:
"""Tests deploying and relating to the Indico charm."""
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1773,7 +1773,7 @@ def test_create_pgdata(harness):
container.exists.return_value = False
harness.charm._create_pgdata(container)
container.make_dir.assert_called_once_with(
"/var/lib/postgresql/data/pgdata", permissions=504, user="postgres", group="postgres"
"/var/lib/postgresql/data/pgdata", permissions=488, user="postgres", group="postgres"
)
container.exec.assert_called_once_with([
"chown",
Expand Down

0 comments on commit ef6baf7

Please sign in to comment.