Browse Source

(bad) test for panelcli integration

boyska 5 years ago
parent
commit
5cab65d85f
4 changed files with 19 additions and 1 deletions
  1. 7 0
      docker-compose.yml
  2. 6 0
      docker/dbconf-perms.sql
  3. 3 1
      docker/dbconf.sql
  4. 3 0
      dodo.py

+ 7 - 0
docker-compose.yml

@@ -72,5 +72,12 @@ services:
         image: jumanjiman/rsyslog:latest
         container_name: feedati_syslog
 
+    panel:
+        image: feedati/feedspanel:latest
+        build:
+            context:
+                ./panel/
+        container_name: feedati_panel
+
 volumes:
     postgres_data:

+ 6 - 0
docker/dbconf-perms.sql

@@ -0,0 +1,6 @@
+-- these commands must be given AFTER `panelcli setup` has been run
+-- and ttrss has created its tables
+-- having a 'ALTER DEFAULT PRIVILEGES IN SCHEMA public' might be a little cleaner than this
+GRANT USAGE ON SCHEMA users TO apache;
+GRANT SELECT ON TABLE users.users TO apache;
+GRANT SELECT ON ALL TABLES IN SCHEMA public TO panel;

+ 3 - 1
docker/dbconf.sql

@@ -1,4 +1,6 @@
 CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
 CREATE USER ttrss WITH PASSWORD 'ttpass';
 CREATE USER panel WITH PASSWORD 'panelpass';
-GRANT CREATE ON DATABASE feeds  TO 'panel';
+GRANT CREATE ON DATABASE feeds  TO panel;
+GRANT CREATE ON DATABASE feeds  TO ttrss;
+CREATE USER apache WITH PASSWORD 'apachepass';

+ 3 - 0
dodo.py

@@ -81,6 +81,9 @@ def task_dbprepare():
                     'env PGPASSWORD=superpass psql -h 127.0.0.1 -f  - -d feeds superadmin < docker/dbconf.sql',
                     r'docker exec -i $(docker ps -aqf name=feedati_db) '
                     'env PGPASSWORD=ttpass psql -h 127.0.0.1 -f - -d feeds ttrss < docker/ttrss.sql',
+                    'docker run feedati/feedspanel -db-pass panelpass -db-addr db:5432 batch',
+                    r'env PGPASSWORD=ttpass psql -h 127.0.0.1 -f - -d feeds ttrss <<< '
+                    '"GRANT SELECT ON TABLE users.users TO \'apache\'"',
                     'echo DB RESTORED',
                     ],
         'teardown': [(stop, [])],