diff --git a/.env.production.sample b/.env.production.sample index e1274c1..b4ca2c6 100644 --- a/.env.production.sample +++ b/.env.production.sample @@ -8,6 +8,10 @@ SECRET_KEY_BASE= DATABASE_URL=postgresql://postgres@postgres/postgres REDIS_URL=redis://redis:6379 +## ID of the "demo" asciicast displayed on the homepage. +## Default: first public asciicast +# HOME_ASCIICAST_ID=1 + ### E-mail delivery ## Outgoing mail hostname, used by namshi/smtp container. diff --git a/config/cfg.rb b/config/cfg.rb index ce32928..4b9a52a 100644 --- a/config/cfg.rb +++ b/config/cfg.rb @@ -12,7 +12,7 @@ module Asciinema attribute :s3_region, String attribute :carrierwave_storage_dir_prefix, String, default: 'uploads/' attribute :google_analytics_id, String - attribute :home_asciicast_id, Integer + attribute :home_asciicast_id, String attribute :secret_key_base, String attribute :admin_ids, Array[Integer] attribute :smtp_settings, Hash @@ -20,7 +20,7 @@ module Asciinema def home_asciicast if home_asciicast_id - Asciicast.find(home_asciicast_id) + Asciicast.find_by_id_or_secret_token!(home_asciicast_id) else Asciicast.non_private.order(:id).first end