mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-28 10:18:51 +00:00
Don't require ADMIN_EMAIL
This commit is contained in:
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@@ -58,7 +58,6 @@ jobs:
|
||||
unit-test:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
ADMIN_EMAIL: firezone@localhost
|
||||
MIX_ENV: test
|
||||
POSTGRES_HOST: localhost
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -14,7 +14,10 @@ defmodule FzHttp.Repo.Migrations.AddRoleToUsers do
|
||||
# Make existing admin the admin if exists. Admin is most likely the first created user.
|
||||
flush()
|
||||
|
||||
admin_email = System.fetch_env!("ADMIN_EMAIL")
|
||||
execute "UPDATE users SET role = 'admin' WHERE email = '#{admin_email}'"
|
||||
admin_email = System.get_env("ADMIN_EMAIL")
|
||||
|
||||
if admin_email do
|
||||
execute "UPDATE users SET role = 'admin' WHERE email = '#{admin_email}'"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user