Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Auth Setup Wizard #discuss #270

Open
nelsonic opened this issue Feb 11, 2023 · 0 comments
Open

Feat: Auth Setup Wizard #discuss #270

nelsonic opened this issue Feb 11, 2023 · 0 comments
Labels
chore a tedious but necessary task often paying technical debt discuss Share your constructive thoughts on how to make progress with this issue documentation Improvements or additions to documentation help wanted If you can help make progress with this issue, please comment! T25m Time Estimate 25 Minutes tech-debt A feature/requirement implemented in a sub-optimal way & must be re-written technical A technical issue that requires understanding of the code, infrastructure or dependencies user-feedback Feedback from people using the App

Comments

@nelsonic
Copy link
Member

At present, when a required environment variable is not set, the auth (v1.6.6) app will not start.
Instead we see an error message of the form:

09:06:28.149 [error] ERROR: ADMIN_EMAIL Environment Variable is not set
** (FunctionClauseError) no function clause matching in Auth.Person.get_person_by_email/1

    The following arguments were given to Auth.Person.get_person_by_email/1:

        # 1
        nil

    Attempted function clauses (showing 1 out of 1):

        def get_person_by_email(email) when not (email == nil)

    (auth 1.6.7) lib/auth/person.ex:261: Auth.Person.get_person_by_email/1
    (auth 1.6.7) lib/auth/init/init.ex:76: Auth.Init.create_admin/0
    (auth 1.6.7) lib/auth/init/init.ex:30: Auth.Init.main/0

This is a lot better than the old (cryptic) error messages we had before envar but it's still lame. 🤦‍♀️
Someone new running the auth app on their localhost for the first time shouldn't see this kind of thing!!

What we should have instead is:

Story

As a prospective contributor or deployer of the auth project,
I want a Web UI-based Setup Wizard
that helpfully and progressively guides me
through the process of inputing the required values
So that I know what I need to do to get everything working!

Note: Progressive UI/UX is described in dwyl/product-roadmap#43

/init is nice but not enough ...

At present we have the following "init" page: https://authdemo.fly.dev/init #176
image

That informs people which environment variables are defined.
This was a make-shift page we created just for our own deployment needs.

But if more people are going to run and contribute to the auth app,
the "onboarding" for new devs needs to be significantly streamlined.

Only 2 Environment Variables Required to Startup

Of the environment variables currently listed on the /init page,
the only two that are really needed are DATABASE_URL and SECRET_KEY_BASE.
And even these two shouldn't be required to boot the auth app ... 💭
We have demo Apps running on Fly.io that don't use PostgreSQL and therefor don't need a DATABASE_URL ...
But given that auth will always have DB tables in order to work ...
and we know from experience of deploying to Fly.io (and on localhost)
that the mix ecto.setup or mix ecto.migrate fails when there is no DB, so the app simply won't boot.
So the DATABASE_URL and SECRET_KEY_BASE are probably "baseline" ... 🙄

OK, Let's operate under the assumption/understanding that these two are the only require environment variables.
And that everything else is defined progressively. i.e. when added they "unlock" features in the auth App.

Thoughts? 💭

@nelsonic nelsonic added help wanted If you can help make progress with this issue, please comment! chore a tedious but necessary task often paying technical debt T25m Time Estimate 25 Minutes discuss Share your constructive thoughts on how to make progress with this issue technical A technical issue that requires understanding of the code, infrastructure or dependencies tech-debt A feature/requirement implemented in a sub-optimal way & must be re-written documentation Improvements or additions to documentation user-feedback Feedback from people using the App labels Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore a tedious but necessary task often paying technical debt discuss Share your constructive thoughts on how to make progress with this issue documentation Improvements or additions to documentation help wanted If you can help make progress with this issue, please comment! T25m Time Estimate 25 Minutes tech-debt A feature/requirement implemented in a sub-optimal way & must be re-written technical A technical issue that requires understanding of the code, infrastructure or dependencies user-feedback Feedback from people using the App
Projects
Status: No status
Development

No branches or pull requests

1 participant