diff --git a/lib/micropub/github.rb b/lib/micropub/github.rb index 786588e..35af077 100644 --- a/lib/micropub/github.rb +++ b/lib/micropub/github.rb @@ -24,7 +24,7 @@ module Micropub path: path, message: "Posting a post", content: post.post_content, - branch: "api_test", + branch: ENV.fetch("GITHUB_BRANCH", "master"), ) end diff --git a/lib/micropub/webserver.rb b/lib/micropub/webserver.rb index e4d51bc..2ca2e29 100644 --- a/lib/micropub/webserver.rb +++ b/lib/micropub/webserver.rb @@ -10,7 +10,7 @@ module Micropub github = Github.new - endpoints = Indieauth::Endpoints.new(ENV["SITE_URL"]) + endpoints = Indieauth::Endpoints.new(ENV.fetch("SITE_URL")) token = Indieauth::Token.new(endpoints.token_endpoint) get '/' do @@ -24,7 +24,7 @@ module Micropub end post "/micropub/main" do - if token.validate(ENV["INDIEAUTH_TOKEN"]) + if token.validate(ENV.fetch("INDIEAUTH_TOKEN")) post = Post.new(params) if github.post!(post)