-
Notifications
You must be signed in to change notification settings - Fork 1
2. Application configuration
Magnet uses the Heroku-friendly Figaro gem to manage all its settings.
The provided sample configuration file shows all the available configuration options, described below.
$ cd config
$ cp application.yml.example application.yml
All the OAuth2 authentication flow is handled by Devise and OmniAuth; upon initialization (see devise.rb), Devise configures OmniAuth by reading client_id
and client_secret
for any supported provider from the proper enviroment variables. Here's the relevant configuration section in config/application.yml
:
# Twitter app configuration (see https://apps.twitter.com/)
twitter_title: 'Twitter'
twitter_app_id:
twitter_app_secret:
# Instagram app configuration (see https://instagram.com/developer/clients/manage/)
instagram_title: 'Instagram'
instagram_app_id:
instagram_app_secret:
# Tumblr app configuration (see https://www.tumblr.com/oauth/apps)
tumblr_title: 'Tumblr'
tumblr_app_id:
tumblr_app_secret:
# Facebook app configuration (see https://developers.facebook.com/apps/)
facebook_title: 'Facebook'
facebook_app_id:
facebook_app_secret:
OAuth2 callback URLs follow the standard Devise+OmniAuth naming convention; when registering your Magnet installation as an external application at Twitter, Facebook, Instagram or Tumblr, don't forget to set the callback URLs as follows:
- Twitter: `http://www.mysite.com/users/auth/twitter/callback
- Instagram: `http://www.mysite.com/users/auth/instagram/callback
- Facebook: `http://www.mysite.com/users/auth/facebook/callback
- Tumblr: `http://www.mysite.com/users/auth/tumblr/callback
NOTE: creating a new application and configuring the proper parameters in config/application.yml
is mandatory for any Social Network provider you want to support in your local Magnet installation.
To enable contents distribution to a ChromeCast device, you need to sign up for the Google Cast SDK Developer Console, then add a new application for your local Magnet installation.
The Magnet Chromecast Receiver Application is hosted inside the /public
folder, thus available at http://www.mysite.com/chromecast.html
.
Here's the relevant configuration section in config/application.yml
:
# Chromecast (see https://cast.google.com/publish/)
chromecast_app_id:
chromecast_app_namespace:
When responding to API requests, Magnet can optionally track events to GA; in this case, Redis is used by Sidekiq to decouple and enqueue event logging without blocking the active request thread.
Here's the relevant configuration section in config/application.yml
:
# GA configuration
enable_google_analytics: 'true' # use 'true', '1', 'false' or '0'
google_analytics_code: 'UA-XXXXXXXX-Y'
google_analytics_domain: 'magnet.dev'
To function properly, Magnet needs to know the public web URLs under which the Rails application is published:
-
web_host
: Public URL of the site (e.g.http://app.mysite.com
) -
api_host
: Public URL of theapi.
subdomain (e.g.http://api.mysite.com
) -
websocket_url
: Public URL name of the ActionCable websocket server (e.g.ws://localhost/cable
)
-
notification_mailer_sender
: Sender name and email address for outbound notification email sent to Magnet users -
disable_uploads
: set to disable the internal WebDAV server used by Magnet users to upload custom assets (javascripts, images, css) -
search_images_in_content
: set to enable scanning of URLs present in fetched posts, and understand if any is actually linking to an image. BE CAREFUL, an additional HTTP connection is made for any URL found inside a post!
Next: Running locally