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

Write special env variables at the very end of the installer #699

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Boy132
Copy link
Member

@Boy132 Boy132 commented Nov 1, 2024

Closes #696

This makes sure that "special" env variables (in this case the SESSION_DRIVER) are only written to the .env file at the very end of the installer.
The SESSION_DRIVER variable is the only variable that directly affects the installer when being changed.

Copy link
Contributor

@RMartinOscar RMartinOscar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

->hidden(fn (Get $get) => $get('env_general.SESSION_DRIVER') != 'redis' && $get('env_general.QUEUE_CONNECTION') != 'redis' && $get('env_general.CACHE_STORE') != 'redis'),

->hidden(fn (Get $get) => $get('env_special.SESSION_DRIVER') != 'redis' && $get('env_general.QUEUE_CONNECTION') != 'redis' && $get('env_special.CACHE_STORE') != 'redis'), 

ToggleButtons::make('env_general.CACHE_STORE')

ToggleButtons::make('env_special.CACHE_STORE') 

We have to change those too

@Boy132
Copy link
Member Author

Boy132 commented Nov 1, 2024

->hidden(fn (Get $get) => $get('env_general.SESSION_DRIVER') != 'redis' && $get('env_general.QUEUE_CONNECTION') != 'redis' && $get('env_general.CACHE_STORE') != 'redis'),

->hidden(fn (Get $get) => $get('env_special.SESSION_DRIVER') != 'redis' && $get('env_general.QUEUE_CONNECTION') != 'redis' && $get('env_special.CACHE_STORE') != 'redis'), 

ToggleButtons::make('env_general.CACHE_STORE')

ToggleButtons::make('env_special.CACHE_STORE') 

We have to change those too

Hidden check is fixed. And the cache driver is fine, it doesn't need special treatment.

@RMartinOscar
Copy link
Contributor

RMartinOscar commented Nov 1, 2024

I had the same 500 as before when hitting next in the db step with redis selected as cache store it errors immediately i can't even fill in the redis host & pass so it uses no password cause no redis env is set yet.
This is fixed with my proposed changes.

Using redis which is on something else but localhost will also throw

@Boy132
Copy link
Member Author

Boy132 commented Nov 6, 2024

I had the same 500 as before when hitting next in the db step with redis selected as cache store it errors immediately i can't even fill in the redis host & pass so it uses no password cause no redis env is set yet. This is fixed with my proposed changes.

Using redis which is on something else but localhost will also throw

Please try again and if you still get a 500 post the error.
The error you linked is also from the session driver and not the cache.

@RMartinOscar
Copy link
Contributor

RMartinOscar commented Nov 7, 2024

I had the same 500 as before when hitting next in the db step with redis selected as cache store it errors immediately i can't even fill in the redis host & pass so it uses no password cause no redis env is set yet. This is fixed with my proposed changes.

Using redis which is on something else but localhost will also throw

Please try again and if you still get a 500 post the error. The error you linked is also from the session driver and not the cache.

https://paste.pelistuff.com/kin4
I only selected cache store in the first step

@lancepioch
Copy link
Member

We should validate the Redis connection too and make sure it works before saving it in the .env, good catch!

@Boy132
Copy link
Member Author

Boy132 commented Nov 7, 2024

I had the same 500 as before when hitting next in the db step with redis selected as cache store it errors immediately i can't even fill in the redis host & pass so it uses no password cause no redis env is set yet. This is fixed with my proposed changes.

Using redis which is on something else but localhost will also throw

Please try again and if you still get a 500 post the error. The error you linked is also from the session driver and not the cache.

https://paste.pelistuff.com/kin4 I only selected cache store in the first step

Yeah so that's a totally different error...

We should validate the Redis connection too and make sure it works before saving it in the .env, good catch!

The redis connection is validated - in the Redis step.

The problem is the SoftwareVersionService that gets called when we run the config clear command. (I assume that's because of dependency injection)

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

Successfully merging this pull request may close these issues.

[Installer] Database type should not be persisted until after all the db info is submitted
3 participants