- Postgresql
- Reddis
UPS is used for address validation, and shipping estimations
FedEx is used for shipping estimations
Aws S3 is used for image storage
Authorize.net is used for payments processing
SECRET_KEY_BASE
: Random entropy for railsUPS_KEY
: UPS API Key for applicationUPS_USERNAME
: UPS username for accountUPS_PASSWORD
: UPS password for accountFEDEX_KEY
: FexEx API Key for applicationFEDEX_METER_NUMBER
: FedEx Meter Number for ApplicationFEDEX_ACCOUNT
: FedEx id for accountFEDEX_PASSWORD
: FedEx password for accountAUTHORIZENET_KEY
: Authorize.net API key for ApplicationAUTHORIZENET_LOGIN
: Authorize.net Login id for ApplicationAUTHORIZENET_GATEWAY
: Authorize.net Gateway to useAWS_ACCESS_KEY_ID
: AWS IAM Access IDAWS_SECRET_ACCESS_KEY
: AWS IAM SecretAWS_REGION
: AWS Region S3 Bucket is inS3_BUCKET
: S3 Bucket NameIMAGE_ASSETS_URL
: See Image hosting recommendations
along with postgresql and reddis environment variables in the same format as Heroku
Once database is setup seeds must be run, even in production, to function correctly.
All seeds are completed in one transaction, so if any of the seeding scripts fail to function nothing will be written to the database.
The seed file will adjust behaviour depending on RAILS_ENV
When run in production it will populate the Country table with 148 countries See db/country_seeds.rb, and populate the registrar table with the TLBAA, ITLA, and the TLCA See db/registrar_seeds.rb. It will also create basic Roles and permissions see db/role_permission_seeds.rb These are temporary
Will show interactive prompt to clear database, then seed same as production, and create several of each other model.
Will clear database with truncation without prompt, then seed same as prodduction along with creating test users
We use an nginx host to serve images from S3 and resize images. Semenhub-Dashboard will use the IMAGE_ASSETS_URL
as a format string with the desired width, so it should have a %d
You will first need to mount the S3 bucket on your server, we used S3FS for fuse
We have our server setup file setup like this
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/s3-images;
index index.html index.htm index.nginx-debian.html;
server_name assets.example.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location ~ ^/img([0-9]+)(?:/(.*))?$ {
alias /var/www/semenhub-images/$2;
image_filter_buffer 10M;
image_filter resize $1 -;
}
}
where /var/www/s3-images
is the S3 Bucket mount point, and assets.example.com
is the domain.
this kind of nginx setup is very low performance, and should be behind a caching server of some kind.
See Image Controller to see how image.url
is set, and see Image Model to see how url formatting is performed