Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Configuration App

ZeroC0D3 Engineer edited this page Mar 1, 2018 · 2 revisions

Configuration

Rails Configuration

  1. Clone this repository

Amazon Web Service (AWS)

  1. Configure AWS at config/aws.yml
default: &default
  access_key_id: '[access_key_id]'
  secret_access_key: '[secret_access_key]'
  bucket: '[bucket_name]'
  revision: '0.0.10.6'

  region: '[aws_region]'
  account: '[account_id]'
  input_bucket: '[input_bucket]'
  output_bucket: '[output_bucket]'
  pipeline_id: '[pipeline_id]'

development:
  <<: *default

staging:
  <<: *default

production:
  <<: *default

MySQL [Optional]

  1. Configure MySQL at config/database.yml
#################################
#   MySQL                       #
#################################
default: &default
  adapter: mysql2
  encoding: utf8
  pool: 5
  socket: /tmp/mysql.sock

development:
  <<: *default
  host: 127.0.0.1
  port: 3306
  username: zeroc0d3_team
  password: zeroc0d3_team
  database: rb_deploy

test:
  <<: *default
  host: 127.0.0.1
  port: 3306
  username: zeroc0d3_team
  password: zeroc0d3_team
  database: rb_deploy

staging:
  <<: *default
  host: 127.0.0.1
  port: 3306
  username: zeroc0d3_team
  password: zeroc0d3_team
  database: rb_deploy

production:
  <<: *default
  host: 192.168.0.100
  port: 3307
  username: zeroc0d3_team
  password: <%= ENV['ZEROC0D3_DATABASE_PASSWORD'] %>
  database: rb_deploy_pro

PostgreSQL [Optional]

  1. Configure PostgreSQL at config/database.yml
#################################
#   PostgreSQL                  #
#################################
default: &default
  adapter: postgresql
  encoding: utf8
  pool: 10 

development:
  <<: *default
  host: 127.0.0.1
  port: 5432
  username: zeroc0d3_team
  password: zeroc0d3_team
  database: rb_deploy

test:
  <<: *default
  host: 127.0.0.1
  port: 5432
  username: zeroc0d3_team
  password: zeroc0d3_team
  database: rb_deploy

staging:
  <<: *default
  host: 127.0.0.1
  port: 5432
  username: zeroc0d3_team
  password: zeroc0d3_team
  database: rb_deploy

production:
  <<: *default
  host: 192.168.0.100
  port: 5433
  username: zeroc0d3_team
  password: <%= ENV['ZEROC0D3_DATABASE_PASSWORD'] %>
  database: rb_deploy_pro

SQLite [Optional]

  1. Configure SQLite at config/database.yml
#################################
#   SQLite                      #
#################################
default: &default
  adapter: sqlite3
  pool: 5
  timeout: 5000

development:
  <<: *default
  database: db/rb_deploy.db

test:
  <<: *default
  database: db/rb_deploy.db

staging:
  <<: *default
  database: db/rb_deploy.db

production:
  <<: *default
  database: db/rb_deploy_pro.db

MongoDB

  1. Configure MongoDB at config/mongoid.yml
production:
  clients:
    default:
      database: rb_deploy_pro
      hosts:
        - 127.0.0.1:27017
      options:
  options:

Pushr

  1. Configure Pushr at config/pushr-[environment].yml
- type: Pushr::ConfigurationApns
  app: pushr-[environment]
  enabled: true
  connections: 1
  sandbox: true
  certificate: apn-certs/[environment].pem
  certificate_password: [password]

Secrets Key

  1. Configure Secret at config/secrets.yml
# Be sure to restart your server when you modify this file.

# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!

# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
# You can use `rake secret` to generate a secure secret key.

# Make sure the secrets in this file are kept private
# if you're sharing your code publicly.

development:
  secret_key_base: [secret_key]

test:
  secret_key_base: [secret_key]

staging:
  secret_key_base: [secret_key]

# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
  secret_key_base: [secret_key]
  secret_token: [secret_token]

Sidekiq

  1. Configure Sidekiq at config/sidekiq.yml
:concurrency: 5
:pidfile: tmp/pids/sidekiq.pid
:logfile: ./log/sidekiq.log

development:
  :concurrency: 10
test:
  :concurrency: 10
staging:
  :concurrency: 10
production:
  :concurrency: 20

:queues:
  - default

Yourub

  1. Configure Yourub at config/yourub.yml
yourub_defaults: &yourub_defaults
developer_key: '[developer_key]'
youtube_api_service_name: 'youtube'
youtube_api_version: 'v3'
application_name: 'yourub'
application_version: '0.1'
log_level: WARN

development:
  <<: *yourub_defaults

test:
  <<: *yourub_defaults

staging:
  <<: *yourub_defaults

production:
  <<: *yourub_defaults

Dot Env

  1. Configure Dot Environment [root]/.env (dot env)
AWS_SES_USERNAME=
AWS_SES_PASSWORD=

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
FOG_REGION=
FOG_DIRECTORY=

FACEBOOK_KEY=
FACEBOOK_SECRET=

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

ANDROID_GCM_KEY=
IOS_PUSH_CERTIFICATE=
IOS_PUSH_PASSPHRASE=
IOS_PUSH_GATEWAY=

MEMCACHE_HOST=192.168.0.100
REDIS_IP_ADDRESS=localhost
REDIS_PORT=6379

FTP_HOST=assets.zeroc0d3lab.com
FTP_USER=zeroc0d3
FTP_FOLDER=zerc0d3_team
FTP_PASSWORD=zeroc0d3_team

Faye

  1. Configure Faye at [root]/faye.ru
require 'faye'
require File.expand_path('../../current/config/initializers/faye.rb', __FILE__)

class ServerAuth

  def incoming(message, callback)
    if message['channel'] !~ %r{^/meta/}
      if message['ext']['authToken'] != FAYE[:token]
        message['error'] = 'Invalid authentication token.'
      end
    end

    callback.call(message)
  end

end

Faye::WebSocket.load_adapter('thin')

server = Faye::RackAdapter.new(mount: "/#{ FAYE[:mount] }", timeout: 25)
server.add_extension(ServerAuth.new)
run server

Secret Token

  1. Generate secret key for config/secret.yml
bundle exec bin/rake secret

Dependencies

  1. Install dependency
bundle install

Web Server

  1. Web Server Configuration (USER CONFIGURATION @ rb_deploy.c)
  • Puma
int CONF_WEB_SERVER = 2;       // Default Running Webserver (1 = Unicorn, 2 = Puma / default)
  • Unicorn
int CONF_WEB_SERVER = 1;       // Default Running Webserver (1 = Unicorn, 2 = Puma / default)
Clone this wiki locally