2020-05-28 13:24:55 +00:00
|
|
|
|
RuCaptcha.configure do
|
|
|
|
|
# Color style, default: :colorful, allows: [:colorful, :black_white]
|
|
|
|
|
# self.style = :colorful
|
|
|
|
|
# Custom captcha code expire time if you need, default: 2 minutes
|
2021-11-15 09:19:40 +00:00
|
|
|
|
self.expires_in = 60.minutes
|
2020-05-28 13:24:55 +00:00
|
|
|
|
# [Requirement / 重要]
|
|
|
|
|
# Store Captcha code where, this config more like Rails config.cache_store
|
|
|
|
|
# default: Read config info from `Rails.application.config.cache_store`
|
|
|
|
|
# But RuCaptcha requirements cache_store not in [:null_store, :memory_store, :file_store]
|
|
|
|
|
# 默認:會從 Rails 配置的 cache_store 里面讀取相同的配置信息,並嘗試用可以運行的方式,用於存儲驗證碼字符
|
|
|
|
|
# 但如果是 [:null_store, :memory_store, :file_store] 之类的,你可以通過下面的配置項單獨給 RuCaptcha 配置 cache_store
|
|
|
|
|
self.cache_store = :file_store
|
|
|
|
|
# 如果想要 disable cache_store 的 warning,就設置為 true,default false
|
|
|
|
|
# self.skip_cache_store_check = true
|
|
|
|
|
# Chars length, default: 5, allows: [3 - 7]
|
|
|
|
|
# self.length = 5
|
|
|
|
|
# enable/disable Strikethrough.
|
|
|
|
|
# self.strikethrough = true
|
|
|
|
|
# enable/disable Outline style
|
|
|
|
|
# self.outline = false
|
2022-10-13 05:06:24 +00:00
|
|
|
|
# eSpeak
|
|
|
|
|
self.espeak do |espeak|
|
|
|
|
|
# Amplitude, 0 to 200
|
|
|
|
|
espeak.amplitude = 80..120
|
|
|
|
|
|
|
|
|
|
# Word gap. Pause between words
|
|
|
|
|
espeak.gap = 80
|
|
|
|
|
|
|
|
|
|
# Pitch adjustment, 0 to 99
|
|
|
|
|
espeak.pitch = 30..70
|
|
|
|
|
|
|
|
|
|
# Use voice file of this name from espeak-data/voices
|
|
|
|
|
espeak.voice = 'en-us'
|
|
|
|
|
end
|
2021-11-15 09:19:40 +00:00
|
|
|
|
end
|