MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.88k stars 497 forks source link

DietPi-Software | Re-allow to install webserver, database and PHP independently from menu #2406

Open DarrenSchwartz opened 5 years ago

DarrenSchwartz commented 5 years ago

Creating a bug report/issue:

Required Information:

G_DIETPI_VERSION_CORE=6 G_DIETPI_VERSION_SUB=19 G_DIETPI_VERSION_RC=7 G_GITBRANCH=master G_GITOWNER=Fourdee

Additional Information (if applicable):

Steps to reproduce:

  1. Install Certbot, without having installed a web server.
  2. Run dietpi-letsencrypt.

Expected behaviour:

Actual behaviour:

Extra details:

MichaIng commented 5 years ago

@noGitForYou Thanks for your suggestion.

However I think it is fine as it is, for the following reason:

What I have in mind for the future of DietPi-LetsEncrypt is the following:

What is actually true and not ideal from my point of view is, that one cannot select a webserver independently currently. You can select a whole webserver stack instead (e.g. LAMP), that includes PHP and a database. In most cases you anyway want/need a whole webserver stack, but there might be cases where the webserver along would be sufficient. But to allow that, we also need to review the install script. since it currently expects at least PHP the be installed, AFAIK.

DarrenSchwartz commented 5 years ago

@MichaIng Thanks for your detailed reply. I think your plan for the future makes good sense. Your last comment highlights where my real concern lies. First I got the error from dietpi-letsencrypt about not having a web server installed, and I would have happily installed Lighttpd manually from dietpi-software, but didn't want the whole stack. Especially since installing a whole stack gives a somewhat cryptic warning message that makes you worry about screwing up your config.

It seems that if you view the software list using the command line with dietpi-software list instead of dietpi-software, there is an option to just install Lighttpd and PHP together (software ID 84), but it is not visible as an option in dietpi-software. Also no entry for just installing the server without PHP. I guess its not the end of the world to install a whole stack, I'm just a minimalist by nature and I don't need the database or PHP.

MichaIng commented 5 years ago

@noGitForYou To address your initial suggestion a bid, I added some more info to the DietPi-Software error prompt, if no webserver was found: https://github.com/Fourdee/DietPi/commit/550c5495c559b64bb03b7db00c69cfdcb54834a6

I hope things are a bid clearer by this.


About the webserver topc:

The initial intention was to clean up the menu and make it easier for users to fast find and select the stack they require. If we show the webservers and databases as well in the menu, the whole webserver category will look somehow messy, also due to the chosen install IDs (which we do not want to rearrange, every time out software offer changes). So I think either the stacks or only the individual webservers, databases and PHP (no stacks then) should show up.

What you can always do to install only a single software ID: dietpi-software install 84 But currently, webservers will always install PHP as hard coded dependency.


Okay some thoughts:

@Fourdee What do you think?

DarrenSchwartz commented 5 years ago

@MichaIng I think your change to the dietpi-letsencrypt error handling is a simple and sufficient solution for the letsencrypt installation issue.

As for the web server dependency issue, I guess it's important not to over complicate the config, so if PHP comes along for the ride, I could get over it. Will leave it to you guys to decide whether the benefit outweighs the extra work.

Some of my discomfort comes from this error message when selecting a stack for installation:

DietPi will automatically install a webserver stack (based on your webserver Preference) when any software that requires a webserver is selected for installation (eg: ownCloud, Pi-hole etc). It is highly recommended that you allow DietPi to do this for you, ensuring compatibility and stability across DietPi installed programs. Please only select a webserver stack if you specifically require it, and, no other webserver stack is installed. TLDR: You do NOT need to select a webserver stack for installation with DietPi. Its all automatic.

So I had to select a stack because dietpi-letsencrypt did not automatically install the required web server (and the web server is not available individually for install in dietpi-software). Then this error message makes me worry that I'm screwing up my config by installing a stack manually. Maybe it's just a confusion with the wording of the error message?

Food for thought: maybe instead of selecting a stack in the "software optimized" list, the user could specify a database preference on the preceeding dietpi-software menu (the main dietpi-software menu where you specify web server preference). Then instead of a stack, dietpi-software could just install the required components when needed based on the user's preference (I think this is along the lines of what you mention above by removing the stacks and giving individual software choices).

Fourdee commented 5 years ago

@MichaIng

So I had to select a stack because dietpi-letsencrypt did not automatically install the required web server (and the web server is not available individually for install in dietpi-software).

Webserver stack should be a pre-req for Certbot, to be consistent with what users expect from our install system.

, I think we can switch/revert from webserver stack to individual webserver, database and PHP selection.

I believe this will open a can of worms and increase our support level. I'd personally prefer to only allow users to install a web-server stack that we pre-define.

Hmm, these should not install PHP/SQL unless they are specified.

        aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
              aSOFTWARE_REQUIRES_PHP[$software_id]=1
           aSOFTWARE_REQUIRES_SQLITE[$software_id]=1

EDIT: If I remember correctly, we enabled for all, need to go through them and check if we can remove any?

MichaIng commented 5 years ago

@Fourdee Jep, databases can already be skipped, PHP currently not, if webserver selected. The auto pre-req selection will select PHP with any webserver automatically, doubled, since all webservers have aSOFTWARE_REQUIRES_PHP[$software_id]=1 as well.

Webserver stack should be a pre-req for Certbot, to be consistent with what users expect from our install system.

At least currently Minio S3 object server is handled separately without any webserver. So DietPi-LetsEncrypt will not show any error, if this is installed.

However, issue should be solved with: https://github.com/Fourdee/DietPi/issues/2363#issuecomment-449649984

I believe this will open a can of worms and increase our support level.

Not sure. I mean most users do not only install a webserver for their own manually built website, where they might need/expect PHP. Usually one installs a forum, wordpress, cloud or such a thing, which then installs everything according the dependency arrays anyway. However, currently the webserver installers expect PHP, so some coding required to separate this, more a midterm project, if any.

Another idea is moving all the webserver stuff to the other Linux software menu, making it more consistently one which contains software, that one usually doesn't want/need to install as standalone applications. With webserver choice system, database/PHP dependency arrays, everything is then correctly selected anyway 🤔.