Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-3082

CLI Installer may incorrectly set root_web_dir value

    Details

    • Type: Story
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.5.2
    • Fix Version/s: 4.6.0-b1
    • Component/s: Staff Interface
    • Labels:
      None

      Description

      The CLI installer cannot determine the document root to set as Blesta's "Root Web Directory" setting because php is unable to determine this value without the web server providing it.

      1. In the CLI installer, add an argument to set the document root, e.g. "docroot", which should be a valid absolute path
        • If the argument is not provided, the current behavior takes place, and the system determines the path from the current working directory
      2. Update the documentation/example for CLI installs to describe running the install script from the document root on the server
        • Also update the example in the install template in Blesta to specify the install command for CLI
      3. Update the system settings in Blesta to add a check next to the Root Web Directory setting that displays a note if Blesta thinks the value set is incorrect
      4. Update the System Status plugin to include a check on the system's Root Web Directory, and link to that page if it appears to be inaccurate
        • This value is important, so perhaps a value of 40 to 50 should be taken off for an invalid/inaccurate path

      When installing Blesta, we add a value to the settings table where settings.key="root_web_dir" to the document root. This setting is available in the UI under Settings > System > General for Root Web Dir.

      However, when installing via CLI, this path is incorrect if Blesta is not installed in the document root. For example, if we install Blesta at domain.com/billing/ and the path to this directory is /home/domain/public_html/billing/ this setting should be set to "/home/domain/public_html/" which is the document root. It is not necessarily the full path to Blesta.

      UI installer works fine, it's only an issue with the CLI installer.

      There are no Sub-Tasks for this issue.

        Activity

        admin Paul Phillips created issue -
        tyson Tyson Phillips (Inactive) made changes -
        Field Original Value New Value
        Rank Ranked higher
        tyson Tyson Phillips (Inactive) made changes -
        Sprint 4.6.0 Sprint 6 [ 81 ]
        tyson Tyson Phillips (Inactive) made changes -
        Rank Ranked higher
        tyson Tyson Phillips (Inactive) made changes -
        Sprint 4.6.0 Sprint 6 [ 81 ] 4.6.0 Sprint 5 [ 83 ]
        tyson Tyson Phillips (Inactive) made changes -
        Rank Ranked higher
        tyson Tyson Phillips (Inactive) made changes -
        Fix Version/s 4.5.3 [ 11120 ]
        tyson Tyson Phillips (Inactive) made changes -
        Assignee Tyson Phillips [ tyson ]
        tyson Tyson Phillips (Inactive) made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 43 minutes [ 2580 ]
        Worklog Id 12087 [ 12087 ]
        tyson Tyson Phillips (Inactive) made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        tyson Tyson Phillips (Inactive) made changes -
        Status In Progress [ 3 ] Open [ 1 ]
        Hide
        tyson Tyson Phillips (Inactive) added a comment -

        In CLI-mode, Blesta cannot determine the server's document root since that is only available by the web server. This is why the Root Web Directory setting exists in Blesta since CORE-716. Blesta can only determine its own root web directory. It relies on php to provide the relative script path (i.e. SCRIPT_NAME or PHP_SELF), and then removes that from the absolute root web directory to determine the document root. In CLI-mode, SCRIPT_NAME and PHP_SELF are relative to the current working directory. Therefore, the only way for Blesta to set the correct root_web_directory setting on CLI install is if it is installed from the server's document root.

        e.g.
        If Blesta is installed at /var/home/www/billing/, and the web document root is /var/home/www/, then you must cd to /var/home/www/ and run the install script from there:

        >cd /var/home/www/
        >php ./billing/index.php install
        

        ..only then would the root_web_dir be set accurately.

        What might be good to do is:

        • Update the documentation/example for CLI installs to describe running the install script from the document root on the server
          • Also update the example in the install template in Blesta to specify the install command
        • Update the system settings in Blesta to add a check next to the Root Web Directory setting that displays a note if Blesta thinks the value set is incorrect
          • Blesta should be able to recognize the correct Root Web Directory setting from the web server in the web browser, unless there are other configurations that could alter it
        • Update the System Status plugin to include a check on the system's Root Web Directory, and link to it if it appears to be inaccurate
        Show
        tyson Tyson Phillips (Inactive) added a comment - In CLI-mode, Blesta cannot determine the server's document root since that is only available by the web server. This is why the Root Web Directory setting exists in Blesta since CORE-716. Blesta can only determine its own root web directory. It relies on php to provide the relative script path (i.e. SCRIPT_NAME or PHP_SELF), and then removes that from the absolute root web directory to determine the document root. In CLI-mode, SCRIPT_NAME and PHP_SELF are relative to the current working directory. Therefore, the only way for Blesta to set the correct root_web_directory setting on CLI install is if it is installed from the server's document root. e.g. If Blesta is installed at /var/home/www/billing/ , and the web document root is /var/home/www/ , then you must cd to /var/home/www/ and run the install script from there: >cd / var /home/www/ >php ./billing/index.php install ..only then would the root_web_dir be set accurately. What might be good to do is: Update the documentation/example for CLI installs to describe running the install script from the document root on the server Also update the example in the install template in Blesta to specify the install command Update the system settings in Blesta to add a check next to the Root Web Directory setting that displays a note if Blesta thinks the value set is incorrect Blesta should be able to recognize the correct Root Web Directory setting from the web server in the web browser, unless there are other configurations that could alter it Update the System Status plugin to include a check on the system's Root Web Directory, and link to it if it appears to be inaccurate
        tyson Tyson Phillips (Inactive) made changes -
        Time Spent 43 minutes [ 2580 ] 2 hours, 9 minutes [ 7740 ]
        Worklog Id 12089 [ 12089 ]
        tyson Tyson Phillips (Inactive) made changes -
        Issue Type Bug [ 1 ] Story [ 7 ]
        tyson Tyson Phillips (Inactive) made changes -
        Description When installing Blesta, we add a value to the settings table where settings.key="root_web_dir" to the document root. This setting is available in the UI under Settings > System > General for Root Web Dir.

        However, when installing via CLI, this path is incorrect if Blesta is not installed in the document root. For example, if we install Blesta at domain.com/billing/ and the path to this directory is /home/domain/public_html/billing/ this setting should be set to "/home/domain/public_html/" which is the document root. It is not necessarily the full path to Blesta.

        UI installer works fine, it's only an issue with the CLI installer.
        The CLI installer cannot determine the document root to set as Blesta's "Root Web Directory" setting because php is unable to determine this value without the web server providing it.

        # In the CLI installer, add an argument to set the document root, e.g. "doc_root", which should be a valid absolute path
        #* If the argument is not provided, the current behavior takes place, and the system determines the path from the current working directory
        # Update the documentation/example for CLI installs

        ----

        When installing Blesta, we add a value to the settings table where settings.key="root_web_dir" to the document root. This setting is available in the UI under Settings > System > General for Root Web Dir.

        However, when installing via CLI, this path is incorrect if Blesta is not installed in the document root. For example, if we install Blesta at domain.com/billing/ and the path to this directory is /home/domain/public_html/billing/ this setting should be set to "/home/domain/public_html/" which is the document root. It is not necessarily the full path to Blesta.

        UI installer works fine, it's only an issue with the CLI installer.
        tyson Tyson Phillips (Inactive) made changes -
        Description The CLI installer cannot determine the document root to set as Blesta's "Root Web Directory" setting because php is unable to determine this value without the web server providing it.

        # In the CLI installer, add an argument to set the document root, e.g. "doc_root", which should be a valid absolute path
        #* If the argument is not provided, the current behavior takes place, and the system determines the path from the current working directory
        # Update the documentation/example for CLI installs

        ----

        When installing Blesta, we add a value to the settings table where settings.key="root_web_dir" to the document root. This setting is available in the UI under Settings > System > General for Root Web Dir.

        However, when installing via CLI, this path is incorrect if Blesta is not installed in the document root. For example, if we install Blesta at domain.com/billing/ and the path to this directory is /home/domain/public_html/billing/ this setting should be set to "/home/domain/public_html/" which is the document root. It is not necessarily the full path to Blesta.

        UI installer works fine, it's only an issue with the CLI installer.
        The CLI installer cannot determine the document root to set as Blesta's "Root Web Directory" setting because php is unable to determine this value without the web server providing it.

        # In the CLI installer, add an argument to set the document root, e.g. "doc_root", which should be a valid absolute path
        #* If the argument is not provided, the current behavior takes place, and the system determines the path from the current working directory
        # Update the documentation/example for CLI installs to describe running the install script from the document root on the server
        #* Also update the example in the install template in Blesta to specify the install command for CLI
        # Update the system settings in Blesta to add a check next to the Root Web Directory setting that displays a note if Blesta thinks the value set is incorrect
        # Update the System Status plugin to include a check on the system's Root Web Directory, and link to that page if it appears to be inaccurate
        #* This value is important, so perhaps a value of 40 to 50 should be taken off for an invalid/inaccurate path

        ----

        When installing Blesta, we add a value to the settings table where settings.key="root_web_dir" to the document root. This setting is available in the UI under Settings > System > General for Root Web Dir.

        However, when installing via CLI, this path is incorrect if Blesta is not installed in the document root. For example, if we install Blesta at domain.com/billing/ and the path to this directory is /home/domain/public_html/billing/ this setting should be set to "/home/domain/public_html/" which is the document root. It is not necessarily the full path to Blesta.

        UI installer works fine, it's only an issue with the CLI installer.
        tyson Tyson Phillips (Inactive) made changes -
        Sprint 4.6.0 Sprint 5 [ 83 ] 4.6.0 Sprint 6 [ 81 ]
        tyson Tyson Phillips (Inactive) made changes -
        Rank Ranked lower
        tyson Tyson Phillips (Inactive) made changes -
        Story Points 5
        tyson Tyson Phillips (Inactive) made changes -
        Assignee Tyson Phillips [ tyson ]
        tyson Tyson Phillips (Inactive) made changes -
        Assignee Tyson Phillips [ tyson ]
        Automated transition triggered when Tyson Phillips (Inactive) created a branch in Stash -
        Status Open [ 1 ] In Progress [ 3 ]
        tyson Tyson Phillips (Inactive) made changes -
        Time Spent 2 hours, 9 minutes [ 7740 ] 4 hours, 30 minutes [ 16200 ]
        Worklog Id 12110 [ 12110 ]
        tyson Tyson Phillips (Inactive) made changes -
        Description The CLI installer cannot determine the document root to set as Blesta's "Root Web Directory" setting because php is unable to determine this value without the web server providing it.

        # In the CLI installer, add an argument to set the document root, e.g. "doc_root", which should be a valid absolute path
        #* If the argument is not provided, the current behavior takes place, and the system determines the path from the current working directory
        # Update the documentation/example for CLI installs to describe running the install script from the document root on the server
        #* Also update the example in the install template in Blesta to specify the install command for CLI
        # Update the system settings in Blesta to add a check next to the Root Web Directory setting that displays a note if Blesta thinks the value set is incorrect
        # Update the System Status plugin to include a check on the system's Root Web Directory, and link to that page if it appears to be inaccurate
        #* This value is important, so perhaps a value of 40 to 50 should be taken off for an invalid/inaccurate path

        ----

        When installing Blesta, we add a value to the settings table where settings.key="root_web_dir" to the document root. This setting is available in the UI under Settings > System > General for Root Web Dir.

        However, when installing via CLI, this path is incorrect if Blesta is not installed in the document root. For example, if we install Blesta at domain.com/billing/ and the path to this directory is /home/domain/public_html/billing/ this setting should be set to "/home/domain/public_html/" which is the document root. It is not necessarily the full path to Blesta.

        UI installer works fine, it's only an issue with the CLI installer.
        The CLI installer cannot determine the document root to set as Blesta's "Root Web Directory" setting because php is unable to determine this value without the web server providing it.

        # In the CLI installer, add an argument to set the document root, e.g. "docroot", which should be a valid absolute path
        #* If the argument is not provided, the current behavior takes place, and the system determines the path from the current working directory
        # Update the documentation/example for CLI installs to describe running the install script from the document root on the server
        #* Also update the example in the install template in Blesta to specify the install command for CLI
        # Update the system settings in Blesta to add a check next to the Root Web Directory setting that displays a note if Blesta thinks the value set is incorrect
        # Update the System Status plugin to include a check on the system's Root Web Directory, and link to that page if it appears to be inaccurate
        #* This value is important, so perhaps a value of 40 to 50 should be taken off for an invalid/inaccurate path

        ----

        When installing Blesta, we add a value to the settings table where settings.key="root_web_dir" to the document root. This setting is available in the UI under Settings > System > General for Root Web Dir.

        However, when installing via CLI, this path is incorrect if Blesta is not installed in the document root. For example, if we install Blesta at domain.com/billing/ and the path to this directory is /home/domain/public_html/billing/ this setting should be set to "/home/domain/public_html/" which is the document root. It is not necessarily the full path to Blesta.

        UI installer works fine, it's only an issue with the CLI installer.
        tyson Tyson Phillips (Inactive) made changes -
        Time Spent 4 hours, 30 minutes [ 16200 ] 1 day, 30 minutes [ 30600 ]
        Worklog Id 12117 [ 12117 ]
        tyson Tyson Phillips (Inactive) made changes -
        Time Spent 1 day, 30 minutes [ 30600 ] 1 day, 48 minutes [ 31680 ]
        Worklog Id 12120 [ 12120 ]
        tyson Tyson Phillips (Inactive) made changes -
        Description The CLI installer cannot determine the document root to set as Blesta's "Root Web Directory" setting because php is unable to determine this value without the web server providing it.

        # In the CLI installer, add an argument to set the document root, e.g. "docroot", which should be a valid absolute path
        #* If the argument is not provided, the current behavior takes place, and the system determines the path from the current working directory
        # Update the documentation/example for CLI installs to describe running the install script from the document root on the server
        #* Also update the example in the install template in Blesta to specify the install command for CLI
        # Update the system settings in Blesta to add a check next to the Root Web Directory setting that displays a note if Blesta thinks the value set is incorrect
        # Update the System Status plugin to include a check on the system's Root Web Directory, and link to that page if it appears to be inaccurate
        #* This value is important, so perhaps a value of 40 to 50 should be taken off for an invalid/inaccurate path

        ----

        When installing Blesta, we add a value to the settings table where settings.key="root_web_dir" to the document root. This setting is available in the UI under Settings > System > General for Root Web Dir.

        However, when installing via CLI, this path is incorrect if Blesta is not installed in the document root. For example, if we install Blesta at domain.com/billing/ and the path to this directory is /home/domain/public_html/billing/ this setting should be set to "/home/domain/public_html/" which is the document root. It is not necessarily the full path to Blesta.

        UI installer works fine, it's only an issue with the CLI installer.
        The CLI installer cannot determine the document root to set as Blesta's "Root Web Directory" setting because php is unable to determine this value without the web server providing it.

        # In the CLI installer, add an argument to set the document root, e.g. "docroot", which should be a valid absolute path
        #* If the argument is not provided, the current behavior takes place, and the system determines the path from the current working directory
        # Update the documentation/example for CLI installs to describe running the install script from the document root on the server
        #* Also update the example in the install template in Blesta to specify the install command for CLI
        # Update the system settings in Blesta to add a check next to the Root Web Directory setting that displays a note if Blesta thinks the value set is incorrect
        # Update the System Status plugin to include a check on the system's Root Web Directory, and link to that page if it appears to be inaccurate
        #* -This value is important, so perhaps a value of 40 to 50 should be taken off for an invalid/inaccurate path-

        ----

        When installing Blesta, we add a value to the settings table where settings.key="root_web_dir" to the document root. This setting is available in the UI under Settings > System > General for Root Web Dir.

        However, when installing via CLI, this path is incorrect if Blesta is not installed in the document root. For example, if we install Blesta at domain.com/billing/ and the path to this directory is /home/domain/public_html/billing/ this setting should be set to "/home/domain/public_html/" which is the document root. It is not necessarily the full path to Blesta.

        UI installer works fine, it's only an issue with the CLI installer.
        Automated transition triggered when Tyson Phillips (Inactive) created pull request #643 in Stash -
        Status In Progress [ 3 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        jonathan Jonathan Reissmueller made changes -
        Time Spent 1 day, 48 minutes [ 31680 ] 1 day, 1 hour, 28 minutes [ 34080 ]
        Worklog Id 12132 [ 12132 ]
        Automated transition triggered when Tyson Phillips (Inactive) merged pull request #643 in Stash -
        Status In Review [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            tyson Tyson Phillips (Inactive)
            Reporter:
            admin Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              28/May/19

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 1 day, 2 hours, 17 minutes
              1d 2h 17m

                Agile