The bingo card ran inside the asxpio container, dispatched by Host. Give the public site its own repo, image and deploy so it can be released and mirrored independently of asxp.io. Editing stays in the asxp.io admin, which keeps owning the schema and the photo pipeline; this app only reads the shared bingo tables and the bingo/ photos, through a read-only DB role and MinIO user. Tests load a snapshot of the asxpio-built schema (test/schema.sql). Assisted-by: Claude:opus-5
20 lines
546 B
Ruby
20 lines
546 B
Ruby
require 'aws-sdk-s3'
|
|
|
|
# Read-only access to the photos in the asxpio bucket.
|
|
module S3
|
|
module_function
|
|
|
|
def client
|
|
@client ||= Aws::S3::Client.new(
|
|
region: ENV.fetch('S3_REGION', 'us-east-1'),
|
|
endpoint: ENV.fetch('S3_ENDPOINT'),
|
|
access_key_id: ENV.fetch('S3_ACCESS_KEY'),
|
|
secret_access_key: ENV.fetch('S3_SECRET_KEY'),
|
|
force_path_style: true
|
|
)
|
|
end
|
|
|
|
def get(key)
|
|
client.get_object(bucket: ENV.fetch('S3_BUCKET'), key: key).body.read.b # body is a UTF-8 StringIO
|
|
end
|
|
end
|