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

WSL Rework Discussion #1957

Open
2 tasks done
svpernova09 opened this issue Feb 28, 2024 · 9 comments
Open
2 tasks done

WSL Rework Discussion #1957

svpernova09 opened this issue Feb 28, 2024 · 9 comments

Comments

@svpernova09
Copy link
Contributor

svpernova09 commented Feb 28, 2024

Goal

Continuing work in #1949 by @MichaelBelgium and integrating #1956 from @karmendra

Complete

Complete is a fully functional Homestead-like Ubuntu 22.04 system with associated documentation.

Branch and Status

Work is being done on the wsl-rework branch. I've tested a fresh bento/ubuntu-22.04 Vagrant box and run sudo ./bin/wsl-init installed the base system as expected.

  • Do not install PostgreSQL in wsl-init, should probably be a feature. Thoughts?
  • Ensure our shell variables make it down into the subshell when we run bash scripts/features/php8.3.sh
  • [ ]
@karmendra
Copy link

karmendra commented Feb 29, 2024

Hi @svpernova09,

Regarding PostgreSQL, I am of the opinion that it shouldn't be part of wsl install as in amd64.sh of laravel/settler it installs and then disable the service # Disable to lower initial overhead. We would rather install it as a feature. Also my opinion is biased by the fact that I am a heavy user of MySql.

@MichaelBelgium
Copy link

Agree about PostgreSQL being a feature

Ensure our shell variables make it down into the subshell when we run bash scripts/features/php8.3.sh

What is this for if i may ask?

@MichaelBelgium
Copy link

@svpernova09 Correct me if I'm wrong but I think we also need an apache feature script, Nginx gets installed in wsl-init but if there's gonna be an site with type "apache" or "apache-proxy", the apache type or apache-proxy will be used but there's no webserver

sudo systemctl enable apache2

This line will fail in both site type scripts for WSL

@svpernova09
Copy link
Contributor Author

svpernova09 commented Mar 1, 2024

Hi @svpernova09,

Regarding PostgreSQL, I am of the opinion that it shouldn't be part of wsl install as in amd64.sh of laravel/settler it installs and then disable the service # Disable to lower initial overhead. We would rather install it as a feature. Also my opinion is biased by the fact that I am a heavy user of MySql.

Right, PostgreSQL has been moved to a feature and remove from wsl-init.

Agree about PostgreSQL being a feature

Ensure our shell variables make it down into the subshell when we run bash scripts/features/php8.3.sh

What is this for if i may ask?

I've been burned in the past with running bash scripts within bash scripts and want to do a quick test to ensure variables persist as expected.

@svpernova09 Correct me if I'm wrong but I think we also need an apache feature script, Nginx gets installed in wsl-init but if there's gonna be an site with type "apache" or "apache-proxy", the apache type or apache-proxy will be used but there's no webserver

sudo systemctl enable apache2

This line will fail in both site type scripts for WSL

I don't think we need a feature. We could install and disable it which is what settler does today.

@karmendra
Copy link

karmendra commented Mar 1, 2024

@svpernova09 , I created a new PR with my changes #1958. Please merge this instead of #1956 I closed this PR. Thanks.

@karmendra
Copy link

Hi, Just catching up, hope you guys are doing well, what are our next steps with this, let me know if I can help with something to take this further, got some free time next week. Thanks

@MichaelBelgium
Copy link

Would it be an idea to revert #1933 so that we can have mailpit on WSL?

@svpernova09
Copy link
Contributor Author

svpernova09#3

@MichaelBelgium
Copy link

Hey guys,

Got a solid test out of the wsl-rework branch on Ubuntu 20.04, 22.04 and deploying works perfectly.
I did do a few finishing touches in #1979

Few extra notes:

  • I actually deployed it also on Ubuntu 24.04 and it worked. We could perhaps mention/edit it so it supports 24.04 too.
  • I've had the idea of restoring backups automaticly and I think it can be added sooner or later. It's basicly reading the .backups folder and then asking if the user wants to restore a backup for a database in this loop

foreach ($settings['databases'] as $db) {
$create_cmd = '';
$query = "CREATE DATABASE IF NOT EXISTS {$db} DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci";
$create_cmd = 'mariadb -u homestead -psecret -e "'.$query.'"';
// run command to create the database
$shell_output = shell_exec($create_cmd);
if (! is_null($shell_output)) {
print_r($shell_output);
}
}

Would be a good idea i think.

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

No branches or pull requests

3 participants