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

Minimal requirements check #31

Closed
Pryx opened this issue Apr 16, 2018 · 7 comments
Closed

Minimal requirements check #31

Pryx opened this issue Apr 16, 2018 · 7 comments
Assignees

Comments

@Pryx
Copy link
Collaborator

Pryx commented Apr 16, 2018

We should check (ideally both before install and in administration every time) for minimal requirements - #18 will surely need CURL to work and we should check if mail() function exists and is working. Maybe send testing email with "Welcome" information right after install? I don't think server memory or max script run time will be problem (yet). Also maybe checking write permission before trying to write config file could be nice. If anyone has more ideas what to check, let me know.

@Pryx Pryx added this to the 1.1.0 milestone Apr 16, 2018
@Pryx Pryx self-assigned this Apr 16, 2018
@jhuesser
Copy link
Contributor

jhuesser commented Jun 7, 2018

Maybe it's anoying for a user to get all the mails. So you could test if mail() is present with sending it to a dummy address.

$to      = '[email protected]';
$subject = 'the subject';
$message = 'hello';
if(mail($to, $subject, $message){
   echo "mail() enabled"; //but mail will not be delivered
} else {
  echo "mail() disabled";
}

@Pryx
Copy link
Collaborator Author

Pryx commented Jun 7, 2018

I wanted to send email as a second layer of checking - the mail server can be misconfigured and the mail function would still return true, which would be a problem for users who forget their passwords for example 🙂

@jhuesser
Copy link
Contributor

jhuesser commented Jun 7, 2018

Ah, yeah then it's the best to send a mail to the user.

@petrk94
Copy link

petrk94 commented Jun 7, 2018

If
PHP 5.4 or newer
MYSQL 5.5 or newer
MYSQL user with table creation permissions
Write access to webroot (installer is going to create a config file)

are the requirements, it were not hard (for me) to write a bash script to check this and write the results in a file

@Pryx
Copy link
Collaborator Author

Pryx commented Jun 7, 2018

AFAIK this all can also be checked in PHP without any major problems, I just didn't have the time to write the script yet. Now my finals are almost over so I expect to look into it sometime soon 🙂

@petrk94
Copy link

petrk94 commented Jun 7, 2018

@Pryx ah ok, I could write that short script, but if you make it in PHP directly, than it make more sense^^
Just, I cant PHP, but love that this cool software come from my home country and so I follow the developments :)

@thnilsen
Copy link
Contributor

thnilsen commented Nov 6, 2018

Would something like this do for basic prerequsite checks during installation?

The example checks the following three points:

  • PHP version (>=5.4.0)
  • If mysqlnd library is installed by checking if one of its unique functions are available.
  • If the process has write access to the web folder.

Other checks can be easily added if needed.
Check for dbname,dbuser and dbpass validity would have to be handled differently and after the form has been posted..

I haven't commited the update yet, so the diff to install.php is:
install.php.diff.txt

The end result looks like this
prereq

This should fix #35 as well.

thnilsen added a commit to thnilsen/server-status that referenced this issue Nov 8, 2018
Pryx pushed a commit that referenced this issue Nov 21, 2018
* Add prerequisite checks to install script. - #31

* Add option to use existing URL for privacy policy. #41

- Also moved the gitbug icon to the left of the footer as it looked like it was part of the imprint/policy link.
- Fixed Imprint & Privacy policy text so that it will be translated.

* Admin page is redirected to wrong URL on save. Fix #67
@Pryx Pryx closed this as completed Nov 21, 2018
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

4 participants