songtianlun
d728d7f50e
- Created BatchGenerateWeatherArtsJob to process eligible cities and generate weather art. - Introduced GenerateWeatherArtJob for generating weather art and image attachment. - Added AiService for obtaining prompts and generating images with OpenAI API. - Implemented WeatherService to fetch current weather data from the QWeather API. - Updated Gemfile with necessary gems (whenever, ruby-openai, httparty, down, aws-sdk-s3). This commit introduces a system to create and store weather art images for various cities based on current weather conditions, leveraging external APIs for data and image generation.
50 lines
2.2 KiB
YAML
50 lines
2.2 KiB
YAML
test:
|
|
service: Disk
|
|
root: <%= Rails.root.join("tmp/storage") %>
|
|
|
|
local:
|
|
service: Disk
|
|
root: <%= Rails.root.join("storage") %>
|
|
|
|
# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
|
|
# amazon:
|
|
# service: S3
|
|
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
|
|
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
|
|
# region: us-east-1
|
|
# bucket: your_own_bucket-<%= Rails.env %>
|
|
amazon_dev:
|
|
service: S3
|
|
access_key_id: <%= ENV.fetch("AWS_ACCESS_KEY_ID", Rails.application.credentials.dig(:aws_dev, :access_key_id)) %>
|
|
secret_access_key: <%= ENV.fetch("AWS_SECRET_ACCESS_KEY_ID", Rails.application.credentials.dig(:aws_dev, :secret_access_key)) %>
|
|
region: <%= ENV.fetch("AWS_REGION", Rails.application.credentials.dig(:aws_dev, :region)) %>
|
|
bucket: <%= ENV.fetch("AWS_BUCKET", Rails.application.credentials.dig(:aws_dev, :bucket)) %>
|
|
endpoint: <%= ENV.fetch("AWS_ENDPOINT", Rails.application.credentials.dig(:aws_dev, :endpoint)) %>
|
|
|
|
amazon:
|
|
service: S3
|
|
access_key_id: <%= ENV.fetch("AWS_ACCESS_KEY_ID", Rails.application.credentials.dig(:aws, :access_key_id)) %>
|
|
secret_access_key: <%= ENV.fetch("AWS_SECRET_ACCESS_KEY_ID", Rails.application.credentials.dig(:aws, :secret_access_key)) %>
|
|
region: <%= ENV.fetch("AWS_REGION", Rails.application.credentials.dig(:aws, :region)) %>
|
|
bucket: <%= ENV.fetch("AWS_BUCKET", Rails.application.credentials.dig(:aws, :bucket)) %>
|
|
endpoint: <%= ENV.fetch("AWS_ENDPOINT", Rails.application.credentials.dig(:aws, :endpoint)) %>
|
|
|
|
# Remember not to checkin your GCS keyfile to a repository
|
|
# google:
|
|
# service: GCS
|
|
# project: your_project
|
|
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
|
|
# bucket: your_own_bucket-<%= Rails.env %>
|
|
|
|
# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
|
|
# microsoft:
|
|
# service: AzureStorage
|
|
# storage_account_name: your_account_name
|
|
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
|
|
# container: your_container_name-<%= Rails.env %>
|
|
|
|
# mirror:
|
|
# service: Mirror
|
|
# primary: local
|
|
# mirrors: [ amazon, google, microsoft ]
|