-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated installation/setup instructions
- Loading branch information
Showing
6 changed files
with
125 additions
and
69 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Noa OAuth2 Server Setup | ||
|
||
### Create Resource Owner Credentials file | ||
|
||
Edit `seeds/ro_quickstart.creds` file and add the end user | ||
credentials - one line per user. The format is `signin-name:password`. | ||
|
||
You might want to keep a copy of this somewhere else in case you end up | ||
recreating this Noa try-out setup. | ||
|
||
### Seed Noa Setup | ||
|
||
Before you can start using this setup, you need to bootstrap | ||
it with Ecto migration and a set of authorization providers, | ||
OAuth2 clients, definitions of protected resources | ||
(with scope and registered redirect URIs etc). The definitions are | ||
available in `seeds/demo_seed_data.yml` file. | ||
|
||
``` | ||
./noa_docker_seed.sh | ||
``` | ||
|
||
This will use docker-compose to bring up a Postgresql database, Noa | ||
and perform the seeding activities. Upon completion this creates | ||
`seed_output.txt` file. Keep this file around. It contains | ||
the authorization provider URLs and for OAuth2 client IDs. | ||
|
||
> OOTB the secret for the OAuth2 clients created during | ||
> this seeding process is the same as their name. You can | ||
> explicitly specify it by adding `client_secret: value`. | ||
> When you are initially trying out, simply go with the | ||
> OOTB setup and use the client name as the `client_secret`, | ||
> `rs1client1` for example. | ||
|
||
The OAuth2 clients in the `yml` file are already setup with | ||
callback `redirect_uri` for Noa Playground, Google OAuth2 | ||
Playground as well as Postman. | ||
|
||
> http://localhost:4004 | ||
> https://developers.google.com/oauthplayground | ||
> https://www.getpostman.com/oauth2/callback | ||
|
||
All setup ready to go. | ||
|
||
### Trying out this Noa instance | ||
|
||
You can setup your own OAuth2 Playground by following instructions in | ||
[Noa Playground](https://github.com/handnot2/noa_playground). | ||
|
||
### Getting rid of Noa setup | ||
|
||
First make sure that the docker containers are stopped and removed. | ||
Then use `sudo` to remove the Noa tryout directory. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,49 @@ | ||
#!/bin/sh | ||
|
||
NOA_HOME=${HOME}/.noa | ||
|
||
if [ ! -d ${NOA_HOME}/pgdc/pgdata ]; | ||
if [ -f seed_output.txt ]; | ||
then | ||
echo "Run noa_docker_setup.sh before using this." | ||
echo "This is supposed to be run once after setup." | ||
echo "noa_docker_seed.sh can be run only once." | ||
echo "If you faced problems earlier and are trying" | ||
echo "run again, it is better to remove this directory" | ||
echo "and start over. Just keep a copy of seeds/ro_quickstart.creds" | ||
echo "somewhere else you can quickly copy it over when you" | ||
echo "start afresh. Just make sure that any partially created" | ||
echo "Docker containers are removed." | ||
exit 1 | ||
fi | ||
|
||
echo "> Bringing up Postgresql" | ||
sudo docker-compose up -d db | ||
|
||
echo "> Twiddling while postgres starts up" | ||
sleep 6 | ||
|
||
echo "> Bringup up Noa" | ||
sudo docker-compose up -d noa | ||
|
||
echo "> Bit more twiddling" | ||
sleep 5 | ||
|
||
echo "> Performing Ecto migration" | ||
sudo docker-compose exec noa bin/noa migrate | ||
|
||
echo "> Seeding data" | ||
sudo docker-compose exec noa bin/noa seed seeds/demo_seed_data.yml > \ | ||
${NOA_HOME}/seed_output.txt | ||
seed_output.txt | ||
|
||
echo "> Done. Hopefully things worked without any issues!" | ||
echo "> The seed results are made available in" | ||
echo "> ${NOA_HOME}/seed_output.txt file. Keep this file." | ||
echo "> You will need it later." | ||
echo "" | ||
echo "Next Steps:" | ||
echo "1. Run: sudo docker-compose down" | ||
echo "2. Bring it back up again: sudo docker-compose up -d" | ||
echo " Noa should be up and running. Confirm this." | ||
echo "3. Run: sudo docker-compose logs noa" | ||
echo "1. Run: sudo docker-compose logs noa" | ||
echo " You should see that Phoenix is listening on port 4000" | ||
echo "4. Time to fire up Noa Playground to checkout your own OAuth2 server" | ||
echo "2. Keep the generated seed_output.txt file. It has information" | ||
echo " you need to work with Noa." | ||
echo "3. Time to fire up Noa Playground to checkout your own OAuth2 server." | ||
echo " Head over to https://github.com/handnot2/noa_playground" | ||
echo " for further instructions on Noa Playground." | ||
echo "" | ||
echo "At this point you can use the standard docker-compose commands" | ||
echo "to work with this setup." | ||
echo "" | ||
echo "If you want to stop Noa, just run: sudo docker-compose down." | ||
echo "Use ./noa_docker_cleanup.sh to wipe off this Noa setup." | ||
echo "If you want to wipe off this setup use sudo rm -rf shell command." |