I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.
if ufw is not installed by default be sure to install it first.
| -- create user (e.g. metabase) | |
| create user metabase with encrypted password 'password'; | |
| -- allow user connect to db | |
| grant connect on database site to metabase; | |
| -- allow user access to schema | |
| grant usage on schema public to metabase; | |
| -- grant select on existing tables |
| # redirect http to https | |
| set $redirect ""; | |
| if ($http_x_forwarded_proto != 'https') { | |
| set $redirect "1"; | |
| } | |
| if ($http_user_agent !~* ELB-HealthChecker) { | |
| set $redirect "${redirect}1"; | |
| } | |
| if ($http_host ~ "your-nifty-domain.com") { | |
| set $redirect "${redirect}1"; |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>com.coverallcrew.firewall</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>sh</string> | |
| <string>-c</string> |
| # Update, upgrade and install development tools: | |
| apt-get update | |
| apt-get -y upgrade | |
| apt-get -y install build-essential git-core curl libssl-dev \ | |
| libreadline5 libreadline5-dev \ | |
| zlib1g zlib1g-dev \ | |
| libmysqlclient-dev \ | |
| libcurl4-openssl-dev \ | |
| libxslt-dev libxml2-dev |
| # Add this to the end of your development.rb and add | |
| # | |
| # gem 'pry' | |
| # | |
| # to your Gemfile and run bundle to install. | |
| silence_warnings do | |
| begin | |
| require 'pry' | |
| IRB = Pry |
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: god | |
| # Required-Start: $all | |
| # Required-Stop: $all | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: God | |
| ### END INIT INFO |