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

How to resolve the circular dependency with auth_plug? #170

Closed
tadasajon opened this issue Dec 28, 2021 · 2 comments
Closed

How to resolve the circular dependency with auth_plug? #170

tadasajon opened this issue Dec 28, 2021 · 2 comments
Assignees
Labels
awaiting-review An issue or pull request that needs to be reviewed chore a tedious but necessary task often paying technical debt discuss Share your constructive thoughts on how to make progress with this issue question A question needs to be answered before progress can be made on this issue technical A technical issue that requires understanding of the code, infrastructure or dependencies

Comments

@tadasajon
Copy link

First, let me make it clear that what I am trying to do is deploy this auth app at my own domain: https://authix.org.

This code base depends on auth_plug, as can be determined from mix.exs:

{:auth_plug, "~> 1.4.7"},

But the instructions for auth_plug are clear that in order for it to work you have to first get an AUTH_API_KEY: https://github.com/dwyl/auth_plug#2-get-your-auth_api_key-

But, the instructions for getting the AUTH_API_KEY tell me to go to URL where the auth app is deployed and get an AUTH_API_KEY.

But that is circular because what I am trying to do is to deploy this auth app to a domain in the first place. How can I get the AUTH_API_KEY if I can't deploy the app that gives me the AUTH_API_KEY?

Should I just make up an AUTH_API_KEY? Should I just get an AUTH_API_KEY from https://dwylauth.herokuapp.com even though I don't want anything to do with that domain and am trying to deploy the auth app to https://authix.org?

Is it the intention of the authors of this auth app that it should be possible for someone to deploy it to a domain of their own choosing?

@nelsonic nelsonic added discuss Share your constructive thoughts on how to make progress with this issue question A question needs to be answered before progress can be made on this issue technical A technical issue that requires understanding of the code, infrastructure or dependencies labels Jan 5, 2022
@nelsonic nelsonic added chore a tedious but necessary task often paying technical debt in-progress An issue or pull request that is being worked on by the assigned person labels Jan 28, 2022
@nelsonic nelsonic self-assigned this Jan 28, 2022
@nelsonic
Copy link
Member

Once PR #175 is merged auth app will start without having an AUTH_API_KEY environment variable defined.
(i.e. the dependency on auth_plug will not block the start-up of auth)
And running iex -S mix follow by Auth.Init.main() will create all the necessary records to get started.
That will produce an AUTH_API_KEY which can be exported and then everything should work.

@nelsonic nelsonic assigned SimonLab and unassigned nelsonic Jan 31, 2022
@nelsonic nelsonic added awaiting-review An issue or pull request that needs to be reviewed and removed in-progress An issue or pull request that is being worked on by the assigned person labels Jan 31, 2022
@nelsonic
Copy link
Member

I think this resolved now.
When you deploy an instance of the auth App to a new hosting provider
and visit auth.yourdomain.com/init you will see the init page, e.g: https://authdev.herokuapp.com/init

The /init page will inform you if the AUTH_API_KEY environment variable is defined.

if the AUTH_API_KEY environment variable is not defined,
then it will be output in the logs for the admin to export.
when the AUTH_API_KEY environment variable has been exported (or otherwise made available),
and the auth App is restarted so that it can pickup the variable.
then everything will work as expected and you can start using the auth App.

Hope this adequately addresses the OP. 🤞
@tadasajon please re-open and comment if not. 💬
Thanks! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review An issue or pull request that needs to be reviewed chore a tedious but necessary task often paying technical debt discuss Share your constructive thoughts on how to make progress with this issue question A question needs to be answered before progress can be made on this issue technical A technical issue that requires understanding of the code, infrastructure or dependencies
Projects
None yet
Development

No branches or pull requests

3 participants