Skip to content

Commit

Permalink
add secret to setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed May 3, 2023
1 parent d1ecf63 commit ac4cdaf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ customer, or [purchasing Keygen EE][sales].

## Developing

### Secrets

To generate a secret key for the application, run:

```bash
export SECRET_KEY_BASE="$(openssl rand -hex 64)"
```

To setup database encryption secrets, run:

```bash
export ENCRYPTION_DETERMINISTIC_KEY="$(openssl rand -base64 32)"
export ENCRYPTION_PRIMARY_KEY="$(openssl rand -base64 32)"
export ENCRYPTION_KEY_DERIVATION_SALT="$(openssl rand -base64 32)"
```

### Setup

To install dependencies, run:
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
config.hosts.concat(
[ENV.fetch('KEYGEN_HOST'), *ENV['KEYGEN_HOSTS'].split(',')].then { |host|
[ENV.fetch('KEYGEN_HOST'), *ENV.fetch('KEYGEN_HOSTS', '').split(',')].then { |host|
host.uniq.compact_blank.map { _1.downcase.strip }
},
)
Expand Down
9 changes: 0 additions & 9 deletions lib/tasks/keygen/setup.rake
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ namespace :keygen do
mode = (args.extras[1] || ENV.fetch('KEYGEN_MODE') { 'singleplayer' }).downcase
config = {}

# General config
config['KEYGEN_HOST'] = host = ENV.fetch('KEYGEN_HOST') {
print 'Enter your domain: '
gets
}

# TODO(ezekg) Cloudflare R2 and AWS S3 config

# Variable config
case edition
when 'CE'
puts 'Setting up CE edition...'
Expand Down

0 comments on commit ac4cdaf

Please sign in to comment.