This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
# Prevent CSRF attacks by raising an exception. | |
# For APIs, you may want to use :null_session instead. | |
protect_from_forgery with: :exception | |
protected | |
def current_user | |
@current_user ||= session[:user_id] and User.find(session[:user_id]['$oid']) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is an example of the kind of things you can do in a configuration file. | |
# All flags used by the client can be configured here. Run Let's Encrypt with | |
# "--help" to learn more about the available options. | |
# Use a 4096 bit RSA key instead of 2048 | |
rsa-key-size = 4096 | |
# Always use the staging/testing server | |
# server = https://acme-staging.api.letsencrypt.org/directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1) Create your private key (any password will do, we remove it below) | |
$ cd ~/.ssh | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/active_admin.rb | |
# ...rest of the initializer here... | |
module AdminPageLayoutOverride | |
def build(*args) | |
# you can move the call to super at the end, if you wish | |
# to insert things at the begining of the page | |
super |