Commit db21a1fe authored by Valéry Tschopp's avatar Valéry Tschopp

clean up

parent 7d05a025
require 'sinatra'
require 'aws-sdk-s3'
# read envionment
S3_BUCKET_NAME = ENV['S3_BUCKET_NAME']
S3_ENDPOINT = ENV['S3_ENDPOINT']
#XXX
AWS_ACCESS_KEY_ID = ENV['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = ENV['AWS_SECRET_ACCESS_KEY']
# must be 'us-east-1' !
AWS_REGION = 'us-east-1'
credentials = Aws::Credentials.new(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
s3 = Aws::S3::Client.new(
endpoint: S3_ENDPOINT,
region: 'us-east-1',
region: AWS_REGION,
credentials: credentials,
force_path_style: true,
ssl_verify_peer: true,
compute_checksums: false,
# disable header "Expect: 100-continue"
http_continue_timeout: nil,
)
signer = Aws::S3::Presigner.new({client: s3})
configure do
enable :logging
use Rack::CommonLogger
end
get "/" do
#XXX: try logger
#XXX: try logger. DOESN'T WORK FOR FUCK'S SAKE
logger.info "S3_BUCKET_NAME: #{S3_BUCKET_NAME}"
logger.info "S3_ENDPOINT: #{S3_ENDPOINT}"
if is_s3_connection_working(s3)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment