Skip to content

Commit

Permalink
Remove unused Envfile variables (forem#5474)
Browse files Browse the repository at this point in the history
* Remove unused variables from Envfile

* Remove unused Twitter variables from Envfile

* Also remove GITHUB_TOKEN

* Change Twitter token screenshot URL
  • Loading branch information
citizen428 authored and benhalpern committed Jan 14, 2020
1 parent 65c9989 commit 256448f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 74 deletions.
15 changes: 0 additions & 15 deletions Envfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,9 @@ variable :REDIS_SIDEKIQ_URL, :String, default: "redis://localhost:6379"
# (https://developer.github.com/v3/guides/basics-of-authentication/)
variable :GITHUB_KEY, :String, default: "Optional"
variable :GITHUB_SECRET, :String, default: "Optional"
variable :GITHUB_TOKEN, :String, default: "Optional"

# Twitter for normal twitter access
# (https://developer.twitter.com/en/docs/basics/authentication/guides/access-tokens)
variable :TWITTER_ACCESS_TOKEN, :String, default: "Optional"
variable :TWITTER_ACCESS_TOKEN_SECRET, :String, default: "Optional"
variable :TWITTER_KEY, :String, default: "Optional"
variable :TWITTER_SECRET, :String, default: "Optional"

Expand Down Expand Up @@ -103,10 +100,6 @@ variable :CLOUDINARY_SECURE, :String, default: "Optional"
variable :HCTI_API_USER_ID, :String, default: "Optional"
variable :HCTI_API_KEY, :String, default: "Optional"

# Dacast for streaming
# (https://www.dacast.com/video-api-documentation/)
variable :DACAST_STREAM_CODE, :String, default: "Optional"

# Fastly for edge caching
# (https://docs.fastly.com/api/)
variable :FASTLY_API_KEY, :String, default: "Optional"
Expand All @@ -120,7 +113,6 @@ variable :HONEYCOMB_API_KEY, :String, default: ""
# (https://developers.google.com/analytics/devguides/reporting/core/v4)
variable :GA_SERVICE_ACCOUNT_JSON, :String, default: "Optional"
variable :GA_TRACKING_ID, :String, default: "Optional"
variable :GA_OPTIMIZE_ID, :String, default: "Optional"

# Mailchimp for mails
# (https://mailchimp.com/developer/)
Expand Down Expand Up @@ -163,17 +155,10 @@ variable :TWITCH_CLIENT_ID, :String, default: "Optional"
variable :TWITCH_CLIENT_SECRET, :String, default: "Optional"
variable :TWITCH_WEBHOOK_SECRET, :String, default: "Optional"

# Trending tags on home page
variable :TRENDING_TAGS, :String, default: "git,beginners"

# For calling the Stack Exchange API
# (https://api.stackexchange.com/docs)
variable :STACK_EXCHANGE_APP_KEY, :String, default: ""

##### Legacy test related env vars ######
variable :FACEBOOK_PIXEL_ID, :String, default: "Optional"
variable :SMARTY_STREETS_WEB_KEY, :String, default: "Optional"

group :production do
variable :SECRET_KEY_BASE, :String

Expand Down
3 changes: 0 additions & 3 deletions config/sample_application.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
GITHUB_KEY:
GITHUB_SECRET:
GITHUB_TOKEN:

TWITTER_ACCESS_TOKEN:
TWITTER_ACCESS_TOKEN_SECRET:
TWITTER_KEY:
TWITTER_SECRET:

Expand Down
32 changes: 2 additions & 30 deletions docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,31 +71,6 @@ then
export GITHUB_SECRET="$INPUT_KEY"
fi

echo -n "| Please indicate your GITHUB_TOKEN : "
read INPUT_KEY
if [ ! -z "$INPUT_KEY" ]
then
export GITHUB_TOKEN="$INPUT_KEY"
fi

echo "|---"
echo "| Setting up TWITTER keys"
echo "| (OPTIONAL, leave blank and press enter to skip)"
echo "|---"
echo -n "| Please indicate your TWITTER_ACCESS_TOKEN : "
read INPUT_KEY
if [ ! -z "$INPUT_KEY" ]
then
export TWITTER_ACCESS_TOKEN="$INPUT_KEY"
fi

echo -n "| Please indicate your TWITTER_ACCESS_TOKEN_SECRET : "
read INPUT_KEY
if [ ! -z "$INPUT_KEY" ]
then
export TWITTER_ACCESS_TOKEN_SECRET="$INPUT_KEY"
fi

echo -n "| Please indicate your TWITTER_KEY : "
read INPUT_KEY
if [ ! -z "$INPUT_KEY" ]
Expand Down Expand Up @@ -152,10 +127,10 @@ echo "# To run a simple demo, with some dummy data (replace <?> with the actual
echo "# './docker-run.sh DEMO -e ALGOLIASEARCH_APPLICATION_ID=<?> -e ALGOLIASEARCH_SEARCH_ONLY_KEY=<?> -e ALGOLIASEARCH_API_KEY=<?>'"
echo "#"
echo "# Finally to run a working demo, you will need to provide either..."
echo "# './docker-run.sh .... -e GITHUB_KEY=<?> -e GITHUB_SECRET=<?> -e GITHUB_TOKEN=<?>"
echo "# './docker-run.sh .... -e GITHUB_KEY=<?> -e GITHUB_SECRET=<?>"
echo "#"
echo "# And / Or ..."
echo "# './docker-run.sh .... -e TWITTER_ACCESS_TOKEN=<?> -e TWITTER_ACCESS_TOKEN_SECRET=<?> -e TWITTER_KEY=<?> -e TWITTER_SECRET=<?>"
echo "# './docker-run.sh .... -e TWITTER_KEY=<?> -e TWITTER_SECRET=<?>"
echo "#"
echo "# Note that all of this can also be configured via ENVIRONMENT variables prior to running the script"
echo "#"
Expand Down Expand Up @@ -265,10 +240,7 @@ ENV_FORWARDING_LIST=(
# login via GITHUB
"GITHUB_KEY"
"GITHUB_SECRET"
"GITHUB_TOKEN"
# login via TWITTER
"TWITTER_ACCESS_TOKEN"
"TWITTER_ACCESS_TOKEN_SECRET"
"TWITTER_KEY"
"TWITTER_SECRET"
# PUSHER integration
Expand Down
21 changes: 2 additions & 19 deletions docs/backend/auth-github.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,5 @@ keys. Then you'll need to provide these keys to the Rails application.
```

![github-2](https://user-images.githubusercontent.com/22895284/51085862-49337b80-173f-11e9-8503-f8251d07f458.png)

4. You will need a personal token as well. From the same dashboard, navigate to
**Personal access tokens** and generate a new token.

![github-3](https://user-images.githubusercontent.com/22895284/51085863-49337b80-173f-11e9-81bf-1c1e38035a7a.png)

5. Fill in the token description and generate the token. You don't need to
select any of the scopes.

6. Be sure that you copy the token right away because it is the only time you
will see it. Change it accordingly.

```shell
Personal access tokens -> GITHUB_TOKEN
```

![github-4](https://user-images.githubusercontent.com/22895284/51085865-49cc1200-173f-11e9-86a8-7e7e1db408a0.png)

7. Done.

4. Done.
12 changes: 5 additions & 7 deletions docs/backend/auth-twitter.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ application.

1. [Sign in](https://developer.twitter.com/apps) to your Twitter account.


2. In order to get the API keys, you will have to
[apply for a developer account](https://developer.twitter.com/en/apply-for-access). Click the **Apply** button.
[apply for a developer account](https://developer.twitter.com/en/apply-for-access).
Click the **Apply** button.

![twitter-up-1](https://user-images.githubusercontent.com/22895284/51078779-53139b00-16bb-11e9-911c-f232e229872a.png)

Expand Down Expand Up @@ -70,8 +70,8 @@ application.

![twitter-5](https://user-images.githubusercontent.com/22895284/51078801-9a9a2700-16bb-11e9-9bd9-76c9ca1ba526.png)

7. Review the [Twitter Developer
Terms](https://developer.twitter.com/en/developer-terms/agreement-and-policy.html)
7. Review the
[Twitter Developer Terms](https://developer.twitter.com/en/developer-terms/agreement-and-policy.html)
and agree to do nothing sketchy.

![twitter-6](https://user-images.githubusercontent.com/22895284/51078802-9a9a2700-16bb-11e9-8789-53720bcfc9d9.png)
Expand All @@ -89,8 +89,6 @@ application.
```text
API key -> TWITTER_KEY
API secret key -> TWITTER_SECRET
Access Token -> TWITTER_ACCESS_TOKEN
Access Token Secret -> TWITTER_ACCESS_TOKEN_SECRET
```
![twitter-8](https://user-images.githubusercontent.com/22895284/51078804-9a9a2700-16bb-11e9-8b9e-0c882ae47f21.png)
![twitter-8](https://user-images.githubusercontent.com/47985/72329507-72d30a00-36e7-11ea-83ac-ebea5d41ba39.png)

0 comments on commit 256448f

Please sign in to comment.