Made some progress
This commit is contained in:
parent
9c4856bdb1
commit
709c6685a9
61 changed files with 570 additions and 37 deletions
14
app/services/setup_local_account_service.rb
Normal file
14
app/services/setup_local_account_service.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
class SetupLocalAccountService
|
||||
def call(user, username)
|
||||
user.build_account
|
||||
|
||||
user.account.username = username
|
||||
user.account.domain = nil
|
||||
|
||||
keypair = OpenSSL::PKey::RSA.new(2048)
|
||||
user.account.private_key = keypair.to_pem
|
||||
user.account.public_key = keypair.public_key.to_pem
|
||||
|
||||
user.save!
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue