2727 */
2828public class AppConfig {
2929
30+ /**
31+ * This is set purely for development purposes so that an app can be created without specifying an app name.
32+ */
33+ public static final String DEFAULT_APP_NAME = "my-app" ;
34+
35+ /**
36+ * These are assumed as sensible defaults in a development environment, where teams often use admin/admin for the
37+ * admin login. They are of course expected to change in a real environment.
38+ */
39+ public static final String DEFAULT_USERNAME = "admin" ;
40+ public static final String DEFAULT_PASSWORD = "admin" ;
41+
42+ /**
43+ * This is set purely for development purposes so that an app can be configured without specifying a port. The
44+ * v1/rest-apis endpoint will select an open port if none is provided, but some work is then required to figure out
45+ * what that port is before modules are loaded.
46+ */
47+ public static final Integer DEFAULT_PORT = 8003 ;
48+
3049 /**
3150 * The default path from which modules will be loaded into a modules database.
3251 */
@@ -35,20 +54,21 @@ public class AppConfig {
3554 public final static String DEFAULT_HOST = "localhost" ;
3655 public final static String DEFAULT_GROUP = "Default" ;
3756
38- private String name ;
57+ private String name = DEFAULT_APP_NAME ;
3958 private String host = DEFAULT_HOST ;
4059
4160 // Username/password combo for using the client REST API - e.g. to load modules
42- private String restAdminUsername ;
43- private String restAdminPassword ;
61+ private String restAdminUsername = DEFAULT_USERNAME ;
62+ private String restAdminPassword = DEFAULT_PASSWORD ;
4463 private SSLContext restSslContext ;
4564 private SSLHostnameVerifier restSslHostnameVerifier ;
4665 private Authentication restAuthentication = Authentication .DIGEST ;
4766
48- private Integer restPort ;
67+ private Integer restPort = DEFAULT_PORT ;
4968 private Integer testRestPort ;
5069
51- // These can all be set to override the default names
70+ // These can all be set to override the default names that are generated off of the "name" attribute.
71+ private String groupName = DEFAULT_GROUP ;
5272 private String restServerName ;
5373 private String testRestServerName ;
5474 private String contentDatabaseName ;
@@ -60,8 +80,6 @@ public class AppConfig {
6080 private List <String > modulePaths ;
6181 private ConfigDir configDir ;
6282
63- private String groupName = DEFAULT_GROUP ;
64-
6583 // Passed into the TokenReplacer that subclasses of AbstractCommand use
6684 private Map <String , String > customTokens = new HashMap <>();
6785
0 commit comments