Skip to content

Commit

Permalink
Version 1.1.0
Browse files Browse the repository at this point in the history
- Only works with https
- Better logging, both to console and files
- Uses http headers to set owner of new app, instead of API calls. Leads to higher stability.
  • Loading branch information
mountaindude committed Jan 13, 2017
1 parent 75bd839 commit d8791b1
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 161 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ By instantiating new apps from template apps (that follow the coding standards),
* When new apps are created, their reload scripts are either left intact, or replaced with a new script (there are two different REST endpoints for this).
If the script is replaced, the new script is retrieved from a URL - typically from a revision control system system such as Github.
* Create a custom property (by using the Sense QMC) called "AppIsTemplate". It should only exist for Apps. Possible values should be "Yes" and "No".
* As of version 1.1.0, the app duplicator only works using https. It's a bit more work setting up, but security is important. No shortcuts.


# Usage
Expand All @@ -57,7 +58,7 @@ You can use any tool capable of creating REST calls to test the service, includi
Standard curl is used below, the assumption is that the command is executed on the same server where the app duplicator service is running.

```sh
curl -X GET "http://localhost:8000/getTemplateList"
curl -X GET "https://localhost:8000/getTemplateList"
```

Returns a HTTP 200 response, with a JSON structure such as
Expand All @@ -83,7 +84,7 @@ When creating a new app that should get its load script from the file specified
The new app will be reloaded (using the new load script) before saved to disk.

```sh
curl -X GET "http://localhost:8000/duplicateNewScript?appName=My%20new%20app&templateAppId=11111111-2222-3333-4444-555555555555&ownerUserId=joe"
curl -X GET "https://localhost:8000/duplicateNewScript?appName=My%20new%20app&templateAppId=11111111-2222-3333-4444-555555555555&ownerUserId=joe"
```

Returns
Expand Down Expand Up @@ -124,7 +125,7 @@ The new app will be reloaded (using the load script from the template app) befor


```sh
curl -X GET "http://localhost:8000/duplicateKeepScript?appName=My%20new%20app&templateAppId=11111111-2222-3333-4444-555555555555&ownerUserId=joe"
curl -X GET "https://localhost:8000/duplicateKeepScript?appName=My%20new%20app&templateAppId=11111111-2222-3333-4444-555555555555&ownerUserId=joe"
```

The response from the service is exactly the same as for the /duplicateNewScript endpoint (see above).
Expand Down
11 changes: 9 additions & 2 deletions config/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
// Possible log levels are silly, debug, verbose, info, warn, error
"defaultLogLevel": "info",

// Paths to client certificates to use when connecting to Sense server
// Paths to client certificates to use when connecting to Sense server. Can be pem or pvk/cer
"clientCertPath": "/path/to/client/cert/client.pem",
"clientCertKeyPath": "/path/to/client/cert/client_key.pem",

// Paths to ssl certificate and key used to secure the communication to the duplicate server. Can be pem or pvk/cer
"sslCertPath": "/path/to/ssl/cert/client.cer",
"sslCertKeyPath": "/path/to/ssl/cert/client_key.pvk",

// URL where newly created apps' load scripts are retrieved from. Change to something more relevant than the sample code..
"loadScriptURL": "https://raw.githubusercontent.com/mountaindude/testdata/master/test-load-script-1.qvs",

Expand All @@ -20,6 +24,9 @@

// Newly created apps will be assigned to specific users. Next config option specifies what user directory this user belongs to.
// For example, if your Sense users full id looks like MYCOMPANY/username, MYCOMPANY would be listed below.
"senseUserDirectory": "MYCOMPANY"
"senseUserDirectory": "MYCOMPANY",

// Directory where log files are stored
"logDirectory": "/path/to/log/directory"

}
Loading

0 comments on commit d8791b1

Please sign in to comment.