OFBiz
  1. OFBiz
  2. OFBIZ-4793

unify admin port and key setting: single point of definition in start.properties

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: Trunk
    • Component/s: framework
    • Labels:
      None
    • Environment:

      WXP SP3 Sun SDK 1.6.0_30

      Description

      Hi

      If someone wants to change the admin password or port, he would have to change currently many files (-- build.xml, various .bat and .sh --). In order to avoid this error-prone pratice, I suggest to centralize the definition of the admin kay and port at 2 single points: the framework/start/src/org/ofbiz/base/start/start.properties and the
      framework/start/src/org/ofbiz/base/start/jetty.properties
      Rgds

        Activity

        Hide
        Jacques Le Roux added a comment -

        Hi Francis,

        You are right, I don't expect much confusion (since we can still search) but good point, I will remove that

        Show
        Jacques Le Roux added a comment - Hi Francis, You are right, I don't expect much confusion (since we can still search) but good point, I will remove that
        Hide
        Francis ANDRE added a comment -

        Jacques

        IMHO, it is likely to leads to some obscur troubles to add those lines

        String adminPortStr = getProp(props, "ofbiz.admin.port", "0");
        adminKey = getProp(props, "ofbiz.admin.key", "NA");

        String adminPortStr = getProp(props, "ofbiz.admin.port", "10523");
        adminKey = getProp(props, "ofbiz.admin.key", "so3du5kasd5dn");

        because it put the value of the admin port and key in the code instead in letting it only as a configuration property. If oneday someone comments out the admin port/key in the start.properties, he won't understand where are coming those values since there are in the code.

        Francis

        Show
        Francis ANDRE added a comment - Jacques IMHO, it is likely to leads to some obscur troubles to add those lines String adminPortStr = getProp(props, "ofbiz.admin.port", "0"); adminKey = getProp(props, "ofbiz.admin.key", "NA"); String adminPortStr = getProp(props, "ofbiz.admin.port", "10523"); adminKey = getProp(props, "ofbiz.admin.key", "so3du5kasd5dn"); because it put the value of the admin port and key in the code instead in letting it only as a configuration property. If oneday someone comments out the admin port/key in the start.properties, he won't understand where are coming those values since there are in the code. Francis
        Hide
        Jacques Le Roux added a comment -

        Missed config.java in r1324989, added at r1324990

        Show
        Jacques Le Roux added a comment - Missed config.java in r1324989, added at r1324990
        Hide
        Jacques Le Roux added a comment - - edited

        Thanks Francis,

        Your patch is in at revision: 1324989

        In config.java, I also added the default values I suggested.

        Show
        Jacques Le Roux added a comment - - edited Thanks Francis, Your patch is in at revision: 1324989 In config.java, I also added the default values I suggested.
        Hide
        Jacques Le Roux added a comment - - edited

        Francis,

        Yes I know, but I mean instead of

        String adminPortStr = getProp(props, "ofbiz.admin.port", "0");
        adminKey = getProp(props, "ofbiz.admin.key", "NA");

        String adminPortStr = getProp(props, "ofbiz.admin.port", "10523");
        adminKey = getProp(props, "ofbiz.admin.key", "so3du5kasd5dn");

        Show
        Jacques Le Roux added a comment - - edited Francis, Yes I know, but I mean instead of String adminPortStr = getProp(props, "ofbiz.admin.port", "0"); adminKey = getProp(props, "ofbiz.admin.key", "NA"); String adminPortStr = getProp(props, "ofbiz.admin.port", "10523"); adminKey = getProp(props, "ofbiz.admin.key", "so3du5kasd5dn");
        Hide
        Francis ANDRE added a comment -

        Jacques

        This is already the case:
        Start.java@177 calls Config.getInstance(args); which calls Config.getConfigFileName(firstArg); which reads the start.properties as return "org/ofbiz/base/start/" + command + ".properties";

        Show
        Francis ANDRE added a comment - Jacques This is already the case: Start.java@177 calls Config.getInstance(args); which calls Config.getConfigFileName(firstArg); which reads the start.properties as return "org/ofbiz/base/start/" + command + ".properties";
        Hide
        Jacques Le Roux added a comment -

        Hi Francis,

        It looks good to me

        All,

        Should we not also change the default values in start.java, using those that are in the properties file?

        Show
        Jacques Le Roux added a comment - Hi Francis, It looks good to me All, Should we not also change the default values in start.java, using those that are in the properties file?

          People

          • Assignee:
            Jacques Le Roux
            Reporter:
            Francis ANDRE
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development