Skip to content

Comments

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

Closed
Boy132 wants to merge 3 commits intopelican-dev:mainfrom
Boy132:fix/web-installer-session-driver
Closed

Write special env variables at the very end of the installer#699
Boy132 wants to merge 3 commits intopelican-dev:mainfrom
Boy132:fix/web-installer-session-driver

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.

@Boy132 Boy132 requested a review from lancepioch November 1, 2024 17:14
Copy link
Member

@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
Member

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
Member

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)

@Boy132 Boy132 closed this Nov 8, 2024
@Boy132 Boy132 deleted the fix/web-installer-session-driver branch November 8, 2024 22:39
@github-actions github-actions bot locked and limited conversation to collaborators Nov 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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