Require fewer secrets for local dev#216
Merged
mxmeinhold merged 4 commits intodevelopfrom Oct 7, 2020
Merged
Conversation
Set up ldap 'mock' to allow for testing without access to actual ldap, and for mocking out fake accounts to test various features
devinmatte
approved these changes
Oct 7, 2020
Member
devinmatte
left a comment
There was a problem hiding this comment.
This looks great! We should do the same on a few other projects to enable easier local dev after we've graduated
Collaborator
Author
|
That's the plan, once I remember to get around to it. |
mbillow
reviewed
Oct 7, 2020
| You can use an existing database, like the instance used for the dev branch, use a database on another server, or spin up a container using docker or podman. | ||
| To get setup using docker, run | ||
| ```bash | ||
| docker run --name packet-postgres -e POSTGRES_PASSWORD=mysecretpassword -d -p 5432:5432 postgres |
Member
There was a problem hiding this comment.
Any reason to not just toss this into a docker-compose file, like I did for self-service?
Collaborator
Author
There was a problem hiding this comment.
I use podman, so docker-compose is not something I default to yet.
mbillow
reviewed
Oct 7, 2020
| After the container starts up, you should be able to connect with the connection string `postgresql://postgres:mysecretpassword@localhost:5432/postgres`, which is the default connection string in `config.env.py`. | ||
| Once the container is up, run the following to set up the database tables. | ||
| ```bash | ||
| flask db upgrade |
Member
There was a problem hiding this comment.
We should really get in the habit of having the application itself run migrations automatically when it starts. I'm not sure there is any reason not to.
This was referenced Jan 24, 2021
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR gets most of the way to enabling secretless local development, but not quite.
I haven't wrapped SSO to enable developing completely offline, but this PR adds:
SSO will need a wrapper or overrides for the core methods, similar to LDAPWrapper, which is beyond what I'm prepared to do at the moment.
This should make hacktoberfest somewhat simpler, as well as making it easier to work in codespaces (though this is still heavily limited by sso).