We need to generate secret key for development environment.
mix phoenix.gen.secret
# ednkXywWll1d2svDEpbA39R5kfkc9l96j0+u7A8MgKM+pbwbeDsuYB8MP2WUW1hf
Let's generate User model and controller.
This is the process of setting up erlang, rebar3, and cowboy for a Hello World, starting with a clean Debian 8 install.
Update apt and install deps:
root@046edcaea45a:~# apt-get update
root@046edcaea45a:~# apt-get install erlang erlang-dev gcc
root@046edcaea45a:~# wget https://s3.amazonaws.com/rebar3/rebar3
root@046edcaea45a:~# mkdir ~/bin/
root@046edcaea45a:~# mv rebar3 ~/bin/
root@046edcaea45a:~# chmod +x ~/bin/rebar3
#openssl | |
require 'openssl' | |
require 'base64' | |
require "digest" | |
include OpenSSL | |
def aes256_encrypt(key, data) | |
key = Digest::SHA256.digest(key) if(key.kind_of?(String) && 32 != key.bytesize) | |
aes = OpenSSL::Cipher.new('AES-256-CBC') | |
aes.encrypt |