RichardKnop / go-oauth2-server

A standalone, specification-compliant, OAuth2 server written in Golang.
Mozilla Public License 2.0
2.12k stars 315 forks source link

could you provide more documentation or a sample for the "docker compose" section? #41

Closed fschwiet closed 6 years ago

fschwiet commented 6 years ago

Sorry I'm a docker newb trying to get an environment setup that will let me run end-to-end tests of a web application. I am excited to use docker to create a test environment where I can put in a real SMTP and OAuth2 server to verify interactions with such services.

I have all the services running except OAuth2 :(. Sorry I could really follow the instructions. I tried the naive thing in my docker-compose file:

services:
  ...
  go-oauth2:
    image: "richardknop/go-oauth2-server"
    ports:
     - "8082:8080"    

and I get the following output:

go-oauth2_1      | Postgres is up - executing command: 
go-oauth2_1      | NAME:
go-oauth2_1      |    go-oauth2-server - Go OAuth 2.0 Server
go-oauth2_1      | 
go-oauth2_1      | USAGE:
go-oauth2_1      |    go-oauth2-server [global options] command [command options] [arguments...]
go-oauth2_1      | 
go-oauth2_1      | VERSION:
go-oauth2_1      |    0.0.0
go-oauth2_1      | 
go-oauth2_1      | AUTHOR:
go-oauth2_1      |    Richard Knop <risoknop@gmail.com>
go-oauth2_1      | 
go-oauth2_1      | COMMANDS:
go-oauth2_1      |      migrate    run migrations
go-oauth2_1      |      loaddata   load data from fixture
go-oauth2_1      |      runserver  run web server
go-oauth2_1      |      help, h    Shows a list of commands or help for one command
go-oauth2_1      | 
go-oauth2_1      | GLOBAL OPTIONS:
go-oauth2_1      |    --configBackend value  (default: "etcd")
go-oauth2_1      |    --help, -h             show help
go-oauth2_1      |    --version, -v          print the version

I'm guessing it didn't work because usually CLI apps give the help output when they don't know what to do. Once I get it running I'll need to figure out how to setup test users.

fschwiet commented 6 years ago

Oh, ok, I see you do have a docker-compose.yml at the top of your repository.

It looks like its using postgres as a database. The testings section of readme.md mentions an in-memory database. I think for my purposes (having a locally running OAuth2 server running to test authentication on a website) the in-memory version is sufficient.

It looks like etcd is used to securely write configuration information to the oauth2 server. Maybe I need this, I don't really care about doing things securely.

I just want to run a temporary oauth2 server, and have some hard-coded user accounts created that can be used to authenticate against the server. This isn't really an issue with your software, and not really a target scenario, so I should close the issue and figure it out. If you can give any pointers I'm listening.