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

Installation instructions #1

Open
itnavigate opened this issue Jun 4, 2024 · 4 comments
Open

Installation instructions #1

itnavigate opened this issue Jun 4, 2024 · 4 comments

Comments

@itnavigate
Copy link

As a new Magento developer, I'm not sure how to install this.

I am proficient with *NIX CLI and Docker (where I'm currently running my Magento 2 instance).

I guess that I need to clone this repo into a directory in the ..../magento tree somwhere, but where please?

@maaarghk
Copy link
Owner

maaarghk commented Jun 4, 2024

Hi, it is sufficient to just:

composer require maaarghk/magento-jwt-refresh-service

In general you'll have a better time if you never add extension author's code to your magento/app directory, try to always manage it with composer. Some of the paid extensions make you jump through hoops for this but it's worth it to not check in code that is not yours to version control / upgrade just by updating your composer config.

BTW: I haven't tested this on the latest version of Magento - the site I run it on is currently on 2.4.6-p3

@maaarghk
Copy link
Owner

maaarghk commented Jun 4, 2024

repo.magento.com shouldn't really come into it - could just be bad timing and a blip at the webserver on their end.

As off-topic advice (which I don't think is relevant to the error message) you can (and in my opinion should when you're using docker) put auth.json in the same directory as composer.json, and run composer as the magento user. Not sure about your docker workflow - but, if you're bind mounting a local directory owned by your local user, then it's just annoying to suddenly have files owned by root in your vendor directory, not to mention it may actually stop the php-fpm process being able to read them if the vendored files have 640 permissions and the daemon drops privileges to the magento user. As well as that, having the auth.json saved to /root/.composer or whatever will only last as long as the container, and it is likely that the container gets destroyed and recreated when you do things like change environment variables. Having it in the magento root directory means you won't get prompted to re-enter your repo.magento.com authentication credentials every time this happens.

@itnavigate
Copy link
Author

Hmm.... I deleted my error message post(before I saw that you had replied), as it self resolved, so your comment appears to be correct.
Thanks for the auth.json tip. I am indeed bind mounting a local directory, and it certainly causes issues.
after my recent "run as root" incident, I need to rebuild the instance to get the permission back correct and php-fpm running properly. But this is why I Docker :-)
If you have a copy of my deleted error message in your email, please feel free to put it back in here for posterity. I don'tmhave a copy of it.

@itnavigate
Copy link
Author

I can report that this works with version 2.4.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants