From f06978659b4ff4e18e9547ebd4af514d56123cfb Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Fri, 2 Aug 2013 00:08:37 -0400 Subject: Installer: Nicer pre-installation test --- templates/installer/check-requirements.html | 54 +++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 templates/installer/check-requirements.html (limited to 'templates/installer') diff --git a/templates/installer/check-requirements.html b/templates/installer/check-requirements.html new file mode 100644 index 00000000..fea6fed8 --- /dev/null +++ b/templates/installer/check-requirements.html @@ -0,0 +1,54 @@ +
+

Pre-installation tests

+ + + + + + + {% set errors = 0 %} + {% set warnings = 0 %} + {% for test in tests %} + + + + + + {% endfor %} +
CategoryTestResult
{{ test.category }}{{ test.name }} + {% if test.result %} + + {% else %} + {% if test.required %} + {% set errors = errors + 1 %} + + {% else %} + {% set warnings = warnings + 1 %} + + {% endif %} + {% endif %} +
+ {% if errors or warnings %} +

There were {{ errors }} error(s) and {{ warnings }} warning(s).

+ + {% if errors %} +

Clik here to ignore errors and attempt installing anyway (not recommended).

+ {% else %} +

Clik here to proceed with installation.

+ {% endif %} + {% else %} +

There were no errors or warnings. Good!

+

Clik here to proceed with installation.

+ {% endif %} +
-- cgit v1.3 From 9e7fbf927c67797269062a3b5f827a92ac822e12 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Fri, 2 Aug 2013 16:19:20 -0400 Subject: Installer improvements --- install.php | 176 +++------------------------- templates/installer/check-requirements.html | 10 +- 2 files changed, 21 insertions(+), 165 deletions(-) (limited to 'templates/installer') diff --git a/install.php b/install.php index b1395d3e..82ba5b8b 100644 --- a/install.php +++ b/install.php @@ -524,6 +524,13 @@ if ($step == 0) { 'result' => is_writable('inc/instance-config.php'), 'required' => false, 'message' => 'Tinyboard does not have permission to make changes to inc/instance-config.php. To complete the installation, you will be asked to manually copy and paste code into the file instead.' + ), + array( + 'category' => 'Misc', + 'name' => 'Tinyboard installed using git', + 'result' => is_dir('.git.'), + 'required' => false, + 'message' => 'Tinyboard is still beta software and it\'s not going to come out of beta any time soon. As there are often many months between releases yet changes and bug fixes are very frequent, it\'s recommended to use the git repository to maintain your Tinyboard installation. Using git makes upgrading much easier.' ) ); @@ -542,167 +549,16 @@ if ($step == 0) { // Basic config $page['title'] = 'Configuration'; - function create_salt() { - return substr(base64_encode(sha1(rand())), 0, rand(25, 31)); - } - - $page['body'] = ' -
-
- Database - - - - - - - - - - - - - - - - - -
-

The following is all later configurable. For more options, edit your configuration files after installing.

-
- Cookies - - - - - -
- -
- Flood control - - - - - - - - - - - - - - - - - -
- -
- Images - - - - - - - - - - - - - - -
- -
- Display - - - - - - - - -
+ $config['cookies']['salt'] = substr(base64_encode(sha1(rand())), 0, 30); + $config['secure_trip_salt'] = substr(base64_encode(sha1(rand())), 0, 30); -
- Directories - - - - - - - - - - - -
- -
- Miscellaneous - - -
- -

- -

-
- '; - - - echo Element('page.html', $page); + echo Element('page.html', array( + 'body' => Element('installer/config.html', array( + 'config' => $config + )), + 'title' => 'Configuration', + 'config' => $config + )); } elseif ($step == 3) { $instance_config = '{{ test.name }} {% if test.result %} - + {% else %} {% if test.required %} {% set errors = errors + 1 %} - + {% else %} {% set warnings = warnings + 1 %} - + {% endif %} {% endif %} @@ -34,9 +34,9 @@ {% for test in tests if not test.result%}
  • {% if test.required %} - Error: + Error: {% else %} - Warning: + Warning: {% endif %} {{ test.message }}
  • -- cgit v1.3 From 6ecda16be3a69b42ae6d6149e0eaa9578015a21a Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Fri, 2 Aug 2013 22:06:32 -0400 Subject: Forgot to commit this --- templates/installer/config.html | 95 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 templates/installer/config.html (limited to 'templates/installer') diff --git a/templates/installer/config.html b/templates/installer/config.html new file mode 100644 index 00000000..193bb98b --- /dev/null +++ b/templates/installer/config.html @@ -0,0 +1,95 @@ +
    +
    + Database (MySQL) + + + + + + + + + + + + + + +
    +

    The following is all later configurable. For more options, edit your configuration files after installing.

    +
    + Cookies + + + + + +
    + +
    + Flood control + + + + + + + + + + + + + + + + + +
    + +
    + Images + + + + + + + + + + + + + + +
    + +
    + Display + + + + + + + + +
    + +
    + Directories + + +
    + +
    + Miscellaneous + + +
    + +

    + +

    +
    -- cgit v1.3