You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
324 B

  1. class SetupLocalAccountService
  2. def call(user, username)
  3. user.build_account
  4. user.account.username = username
  5. user.account.domain = nil
  6. keypair = OpenSSL::PKey::RSA.new(2048)
  7. user.account.private_key = keypair.to_pem
  8. user.account.public_key = keypair.public_key.to_pem
  9. user.save!
  10. end
  11. end