-
Notifications
You must be signed in to change notification settings - Fork 39
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
Docker image #129
Comments
@dantownsend This is a great idea because |
@sinisaos Yeah, I'm excited about the possibilities. |
Working on this, some issues as I go:
|
Happy to take a look, my ideas weren't exactly well refined haha. Remind me in a few days if I haven't had a look yet and I can aim to give some feedback |
@Skelmis Sorry, I totally missed your original comment. It sounds like you made good progress. I'm aware that table reflection doesn't work great at the moment for array columns - it's something I need to look into. As for authentication, we could do something like:
It might be that we provide several options to the user. Option 2 might actually be easiest as a default option. from piccolo.apps.user.tables import BaseUser
from piccolo.engine.sqlite import SQLiteEngine
from piccolo_api.session_auth.tables import SessionsBase
from piccolo_admin.endpoints import create_admin
DB = SQLiteEngine('piccolo_admin_auth.sqlite')
class User(BaseUser, db=DB):
...
class Sessions(SessionsBase, db=DB):
...
admin = create_admin(auth_table=User, session_table=Sessions)
Ah, good point - I think that's an easy fix, will create a ticket in Piccolo to add that! |
@dl-lim Thanks for creating the PR and your interest in this. I think it is a cool feature. |
@Skelmis Here's a PR adding an engine option to TableStorage: |
@dantownsend That works. I played around with this a bit. I created an admin user with a separate Sqlite database and after that Piccolo auth works. I used the code from @Skelmis PR code. Here is the github repo. Maybe will be useful. |
@sinisaos That's amazing, thanks! Do you think it's best to have a dedicated repo for it, or add it to the main Some observations from your repo, which we can add next:
As Piccolo Admin has so many options, we need some way of the user providing these in the future. We could have a bunch of environment variables, but should also consider having a YAML or JSON file which the user can add to a volume. Ideally we would have a simple UI which guides the user through the configuration, and then outputs the JSON file, or writes it to the SQLite database. |
@dantownsend Thank you very much.
I think a dedicated repo will be a better solution, just like Piccolo Docker
I agree with you, but I don't have much experience with Docker. In the repo I posted I just want to show that your idea with adding the admin user to a separate Sqlite db, works (after that we can use the Piccolo Admin session auth). |
@sinisaos OK, lets put in a separate repo for now then. Do you want to transfer your repo to the Piccolo org, or should we start a new one? |
@dantownsend I've done the transfer and the new repo is here. I hope that's okay. If not, just rename it, remove it, or do whatever you think is best. |
It would be really cool if we had a Docker image for Piccolo Admin.
It would have environment variables such as:
PG_HOST
,PG_PASSWORD
etc to tell it how to connect to Postgres.To determine which tables to connect to, it would either use a config file mounted in a volume, or would accept another environment variable called
PICCOLO_TABLES
. For examplePICCOLO_TABLES=article,post
.Since Piccolo now has powerful schema reflection abilities, we can generate the Piccolo
Table
classes automatically.It would open up Piccolo admin to a much wider user base (including non-Python users).
The text was updated successfully, but these errors were encountered: