ソースを参照

Add key generation script + keys folder

tags/v0.1.0
Matt Baer 5年前
コミット
e392b3a040
3個のファイルの変更30行の追加0行の削除
  1. +25
    -0
      keys.sh
  2. +1
    -0
      keys/.gitignore
  3. +4
    -0
      keys/README.md

+ 25
- 0
keys.sh ファイルの表示

@@ -0,0 +1,25 @@
#!/bin/bash
#
# keys.sh generates keys used for the encryption of certain user data. Because
# user data becomes unrecoverable without these keys, the script and won't
# overwrite any existing keys unless you explicitly delete them.
#

# Generate cookie encryption and authentication keys
if [[ ! -e "$(pwd)/keys/cookies_enc.aes256" ]]; then
dd of=$(pwd)/keys/cookies_enc.aes256 if=/dev/urandom bs=32 count=1
else
echo "cookies key already exists! rm keys/cookies_enc.aes256 if you understand the consquences."
fi
if [[ ! -e "$(pwd)/keys/cookies_auth.aes256" ]]; then
dd of=$(pwd)/keys/cookies_auth.aes256 if=/dev/urandom bs=32 count=1
else
echo "cookies authentication key already exists! rm keys/cookies_auth.aes256 if you understand the consquences."
fi

# Generate email encryption key
if [[ ! -e "$(pwd)/keys/email_enc.aes256" ]]; then
dd of=$(pwd)/keys/email_enc.aes256 if=/dev/urandom bs=32 count=1
else
echo "email key already exists! rm keys/email_enc.aes256 if you understand the consquences."
fi

+ 1
- 0
keys/.gitignore ファイルの表示

@@ -0,0 +1 @@
*.aes256

+ 4
- 0
keys/README.md ファイルの表示

@@ -0,0 +1,4 @@
Keys
====

Contains keys for encrypting database and session data. Generate necessary keys by running (from the root of the project) `./keys.sh`.

読み込み中…
キャンセル
保存