Merge branch 'main' into glitch-soc/merge-upstream

Conflicts:
- `package.json`:
  Not a real conflict, upstream dependency updated textually too close to a
  glitch-soc-only dependency.
  Updated the upstream dependency.
This commit is contained in:
Claire
2022-04-27 08:48:21 +02:00
10 changed files with 216 additions and 126 deletions

View File

@@ -2,6 +2,14 @@ class AddInstanceActor < ActiveRecord::Migration[5.2]
class Account < ApplicationRecord
# Dummy class, to make migration possible across version changes
validates :username, uniqueness: { scope: :domain, case_sensitive: false }
before_create :generate_keys
def generate_keys
keypair = OpenSSL::PKey::RSA.new(2048)
self.private_key = keypair.to_pem
self.public_key = keypair.public_key.to_pem
end
end
def up