Skip to content
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

Auth code2 #234

Closed
wants to merge 106 commits into from
Closed

Auth code2 #234

wants to merge 106 commits into from

Conversation

ethanstrominger
Copy link
Member

@ethanstrominger ethanstrominger commented Dec 30, 2023

What changes did you make?

  • local build - .env.docker - renamed .env.dev-sample to .env.docker-example as .env.docker-example distinguishes from .env.local. Also, added some vars that aren't used but will be in another branch to avoid conflict
  • local build - .gitignore - added files
  • buld - .pre-comit-config.yml - required to be able to run pre-commit. hadolint step froze and flake8-usepath resulted in fatal pre-commit error
  • local build - app..dockerignore - added filees
  • local build - app/.env.local-example - created separate file for slightliy different values from .env.docker-example
  • build - app/entrypoint.sh - commented in python manage.py migrate. Otherwise, when you do buildrun.sh without doing migrate.sh it will fail.
  • allauth - app/peopledepot/settings.py - mostly implementation formula. Added ACCOUNT_EMAIL_VERIFICATION="none" since Cognito does it.
  • allauth - app/peopledepot - urls.py - changes to customize SSO login and logout
  • allauth - app/requirements.txt - added allauth
  • allauth - app/templates/account/login.html - redirect to amazon-cognito/login. This should be revisited.
  • allauth - apps/templates/admin/login.html - provide an alternate message if user with no staff access tries admin/login.
  • allauth - app/templates/socialaccount/login.html - customize the SSO login page.
  • local build - docker-compose.yml - changed .env.dev to .env.docker for clarity
  • local build - docs/how-to/CONTRIBUTING.md - changed .env.dev to .env.docker for clarity
  • localbuid - docs/how-to/run-local.md - how to for running local
  • local build - docs/tools/scripts.md - changed .env.dev to .env.docker for clarity
  • local build => scripts to support local build
    • scripts/activate.sh
    • scripts/loadenv.sh
    • scripts/setupscriptpath.sh
    • script/start-local.sh

Why did you make the changes (we will use this info to test)?

Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)

Visuals before changes are applied

image

Visuals after changes are applied

image

@fyliu
Copy link
Member

fyliu commented Jan 3, 2024

@ethanstrominger For the pre-commit hooks that gave you errors, it looks like it's just something to do with your particular system environment or macOS. I added them back and the automated pre-commit checks are all still passing.

Like we discussed, you can skip hooks by setting SKIP environment variable like SKIP=hadolint,flake8 pre-commit run --all. Seems like --all-files and --all do the same thing so I switched my usage to --all recently. I looked but didn't find a good way to disable flake8 plugins other than just not including them in the config file.

Copy link
Member

@fyliu fyliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I have so far. The local build might be missing a couple of steps on how to set up the venv unless the start-local.sh takes care of that.

@@ -12,6 +12,6 @@ then
fi

# python manage.py flush --no-input
# python manage.py migrate
python manage.py migrate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not necessary to run this since the buildrun.sh script also calls migrate (actually in the run.sh that it calls)

Comment on lines +22 to +24
```
brew install pre-commit
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent this block 1 more space to the right to put it "within" the numbered list item. Otherwise, markdown treats this as another object at the same level and tthe next number starts at 1 again like below.
2024-01-02 22 19 31 fang-i7 b214e5c2df2d

Docker, do the following steps. WARNING: If you run into issues you will get limited support.

Run these commands from the app directory:
1. From the terminal:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add a blank line before the numbered list so that 1. shows up in a separate line. There's a few things that got changed when I ran mdformat locally. I can commit the changes if you're okay with it.

@@ -25,4 +25,4 @@ These scripts assume you are using bash.

1. **createsuperuser.sh** - creates a default superuser.

1. This assumes that `DJANGO_SUPERUSER_USERNAME` and `DJANGO_SUPERUSER_PASSWORD` are set in `.env.dev`
1. This assumes that `DJANGO_SUPERUSER_USERNAME` and `DJANGO_SUPERUSER_PASSWORD` are set in `.env.docker`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it's .env.docker and .env.local. Eventually we could have a .env.production, which also uses docker. We'll think about that when we get there.

3. From the terminal in the app directory, run:
```
source ../scripts/setscriptpath.sh
source start-local.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I ran this I got an error message about not finding the file. I checked that the script path is in $PATH
Screenshot 2024-01-02 230643

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I ran ../scripts/start-local.sh it complains about loadenv.sh not found.
Screenshot 2024-01-02 231640

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User login page (KB requirement)
3 participants