Skip to content

Commit

Permalink
Workaround for Ombi v3.0.4680 [not respecting APIKey alone when making
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawn Grimes committed Oct 5, 2019
1 parent 1128baf commit a639dec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SLACK_API_TOKEN=YOUR_SLACK_BOT_OAUTH_TOKEN_HERE
OMBI_API_KEY=YOUR_OMBI_API_KEY_HERE
OMBI_URL=YOUR_OMBI_URL_HERE
OMBI_URL=YOUR_OMBI_URL_HERE
API_USERNAME=USERNAME_FOR_OMBI
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ $ bundle install

1. create a file in the /config called `.env`
1. copy from `.env.example` and replace with your values (leave slack one empty for now)
2. Set API_USERNAME to a user in your Ombi environment that has requests permissions.

2. Start the server

Expand Down
3 changes: 2 additions & 1 deletion web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

OMBI_URL = ENV["OMBI_URL"]
OMBI_API_KEY = ENV["OMBI_API_KEY"]
OMBI_API_USERNAME = ENV["API_USERNAME"]

module OmbiBot
class Web < Sinatra::Base
Expand All @@ -21,7 +22,7 @@ class Web < Sinatra::Base
}.to_json
res = HTTParty.post(
"#{OMBI_URL}/api/v1/Request/movie",
headers: {"ApiKey" => OMBI_API_KEY, "Content-Type" => "application/json"},
headers: {"UserName" => OMBI_API_USERNAME, "ApiKey" => OMBI_API_KEY, "Content-Type" => "application/json"},
body: body,
)
return res.parsed_response["message"]
Expand Down

0 comments on commit a639dec

Please sign in to comment.