Skip to content

Commit 038d5ee

Browse files
authored
Restrict metabase user to tables (#1132)
* Automatically configure registry in portainer Creates a single authneticated dockerhub registry that lets pulling private images (i.e. updating service's image (that is private) in portainer shall work now) * closes #1089 * Update * Imrpove wait for it installation * Fix portainer makefile wrong options #1125 * fix * spacing * Restrict metabase user to set of tables * closes #1113 * configuration * Add readme
1 parent f3796d2 commit 038d5ee

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

services/metabase/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## How to deploy first time
2+
3+
Before deploying metabase first time, make sure that postgres is configured:
4+
1. Generate SQL commands via `make configure_metabase.sql`
5+
2. Execute SQL commands from the script in psql shell
6+
* you can get one via adminer or by directly connecting to container and executing `psql -U <user> -d <db>`
7+
8+
This can be automated via https://github.com/ITISFoundation/osparc-ops-environments/issues/827
Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
CREATE USER ${METABASE_POSTGRES_USER} WITH PASSWORD '${METABASE_POSTGRES_PASSWORD}';
22

3-
-- relies on readonly role aldready existing in the database
4-
GRANT ${POSTGRES_DB}_readonly TO ${METABASE_POSTGRES_USER};
3+
/*
4+
Access to simcore database
5+
*/
6+
7+
GRANT CONNECT ON DATABASE ${POSTGRES_DB} TO ${METABASE_POSTGRES_USER};
8+
9+
-- https://stackoverflow.com/questions/17338621/what-does-grant-usage-on-schema-do-exactly
10+
GRANT USAGE ON SCHEMA public TO ${METABASE_POSTGRES_USER};
11+
12+
GRANT SELECT ON TABLE ${METABASE_POSTGRES_ALLOWED_SIMCORE_TABLES} TO ${METABASE_POSTGRES_USER};
13+
14+
/*
15+
Metabase database to store its data
16+
*/
517

618
CREATE DATABASE ${METABASE_POSTGRES_DB}
719
WITH OWNER ${METABASE_POSTGRES_USER};

0 commit comments

Comments
 (0)