From dcd57934fbb62d9d8416544b6ea8341011451600 Mon Sep 17 00:00:00 2001 From: AEtherC0r3 Date: Mon, 13 Mar 2017 18:16:07 +0200 Subject: [PATCH 1/2] Add OpenID test documentation * Write a paragraph that informs contributors about the openID test accounts that are available and provide instructions on how to enable them in development (#1315) in CONTRIBUTING.md * Add missing environment variable for openID logins via openSUSE (OSEM_SUSE_KEY, OSEM_SUSE_SECRET) in dotenv.example --- CONTRIBUTING.md | 12 ++++++++++++ INSTALL.md | 2 ++ dotenv.example | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 62c0bf27..ec8376ce 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -169,6 +169,18 @@ config.ichain_force_test_username = "testuser" # set email of 'testuser' config.ichain_force_test_attributes = {:email => "testuser@example.com"} ``` + +### Using OpenID in developement +OSEM supports [OpenID](https://openid.net/) logins via [OmniAuth](https://github.com/omniauth/omniauth) and related provider specific gems. OmniAuth provides the ablity to define per-provider mock accounts for testing. The supported providers are Facebook, Google, openSUSE and GitHub. If you want to use the OSEM provided mock accounts you need to set the appropriate `OSEM_PROVIDER_KEY` and `OSEM_PROVIDER_SECRET` environment variables to a non empty string in the `.env` file. + +e.g. +``` +OSEM_GITHUB_KEY='sample' +OSEM_GITHUB_SECRET='sample' +``` + +If you don't already have a `.env` file you can use the `dotenv.example` as a template. + ## Labels for issues and PRs ...and what they mean! diff --git a/INSTALL.md b/INSTALL.md index 02b496eb..5629272d 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -43,6 +43,8 @@ There are a couple of environment variables you can set to configure OSEM. Check | OSEM_FACEBOOK_SECRET | *string* | OMNIAUTH Developer Secret for Facebook | OSEM_GITHUB_KEY | *string* | OMNIAUTH Developer Key for GitHub | OSEM_GITHUB_SECRET | *string* | OMNIAUTH Developer Secret for GitHub +| OSEM_SUSE_KEY | *string* | OMNIAUTH Developer Key for openSUSE +| OSEM_SUSE_SECRET | *string* | OMNIAUTH Developer Secret for openSUSE | OSEM_SMTP_ADDRESS | smtp.opensuse.org | The smtp server to use | OSEM_SMTP_PORT | *int* | The port on the smtp server | OSEM_SMTP_USERNAME | *string* | The user for the smtp server diff --git a/dotenv.example b/dotenv.example index ec2715ea..0c852658 100644 --- a/dotenv.example +++ b/dotenv.example @@ -37,6 +37,10 @@ OSEM_FACEBOOK_SECRET='' OSEM_GITHUB_KEY='' OSEM_GITHUB_SECRET='' +# OMNIAUTH Developer KEY/Secret for SUSE/openSUSE +OSEM_SUSE_KEY='' +OSEM_SUSE_SECRET='' + # STRIPE Publishable/Secret keys # test keys for development mode, live for production mode STRIPE_PUBLISHABLE_KEY='' From 3f46fed0b209b637072b57e63965b8418240bf04 Mon Sep 17 00:00:00 2001 From: AEtherC0r3 Date: Sat, 25 Mar 2017 23:19:59 +0200 Subject: [PATCH 2/2] Remove reference to secrets.yml in INSTALL.md INSTALL.md references two methods for enabling openID 1) adding the provider's API keys in config/secrets.yml and 2) adding the provider's API keys as environment variable in the relevant .env files The first method is not acceptable anymore, so it is no longer mentioned --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 5629272d..9cbfafcc 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -71,7 +71,7 @@ $ bundle exec rake logo:reprocess ``` ### openID -In order to use [openID](http://openid.net/) logins for your OSEM installation you need to register your application with the providers ([Google](https://code.google.com/apis/console#:access), [GitHub](https://github.com/settings/applications/new) or [Facebook](https://developers.facebook.com/)) and enter their API keys, changing the existing sample values, in `config/secrets.yml` file, or in your environment variables found in *.env.production* file. +In order to use [openID](http://openid.net/) logins for your OSEM installation you need to register your application with the providers ([Google](https://code.google.com/apis/console#:access), [GitHub](https://github.com/settings/applications/new) or [Facebook](https://developers.facebook.com/)) and enter their API keys in the environment variables found in your *.env* file(s). ## Recurring Jobs Open a separate terminal and go into the directory where the rails app is present, and type the following to start the delayed_jobs worker for sending email notifications.