Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ For example [http://localhost:80/](http://localhost:80/) might do the trick if t

The default login for this startup method is: **rtdi / rtdi!io**

The better start command is to mount two host directories into the container, the rtdiconfig directory where all settings made when configuring the connector will be stored permanently and the security directory for web server specific settings like user database and SSL certificates.
The better start command is to mount two host directories into the container, the `/home/dir/rulesservice` (choose yours) directory where all settings related to the rules service are stored (with the sub directories `settings` for the Kafka connection details and `definitions` with the rule files) and the `/home/dir/security` directory for web server specific settings like user database and SSL certificates.

docker run -d -p 80:8080 -p 443:8443 --rm \
-v /home/dir/rulesservice:/apps/rulesservice \
Expand All @@ -59,7 +59,14 @@ The better start command is to mount two host directories into the container, th



For proper start commands, especially https and security related, see the [ConnectorRootApp](https://github.com/rtdi/ConnectorRootApp) project, this application is based on.
For more details, especially https and security related, see the [ConnectorRootApp](https://github.com/rtdi/ConnectorRootApp) project, this application is based on.

if the `settings` or `definitions` directories should point to somewhere else, the `context.xml` of the tomcat webserver can get additional environments in the `<Context>` root node:

```
<Environment name="rulesettings" value="c:/apps/rulesservice/settings" type="java.lang.String" override="false"/>
<Environment name="rulegroups" value="c:/apps/rulesservice/definitions" type="java.lang.String" override="false"/>
```


### Step 1: Connect to Kafka
Expand Down
1 change: 1 addition & 0 deletions WebContent/ui5/Config.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ return Controller.extend("io.rtdi.bigdata.rulesservice.ui5.Config", {
"Content-Type": "application/json;charset=utf-8"
}
post.loadData("../rest/config", json, true, "POST", false, true, headers);
model.loadData("../rest/config");
},
});
});
Expand Down
5 changes: 0 additions & 5 deletions WebContent/ui5/Config.view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
inverted="true"
icon="{= %{/schemaregconnected} ? 'sap-icon://sys-enter-2' : 'sap-icon://error' }"
state="{= %{/schemaregconnected} ? 'Success' : 'Error' }" />
<ObjectStatus
text="Service"
inverted="true"
icon="{= %{/servicerunning} ? 'sap-icon://sys-enter-2' : 'sap-icon://error' }"
state="{= %{/servicerunning} ? 'Success' : 'Error' }" />
</HBox>
<Title text="Properties file" visible="{/admin}" />
<ce:CodeEditor id="properties" value="{/properties}" height="300px" type="properties" visible="{/admin}" />
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/io/rtdi/bigdata/rulesservice/RulesService.java
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@ public List<TopicRule> saveTopicRules(List<TopicRule> input) {

public void saveConfig(ServiceSettings input) throws IOException {
String properties = input.getProperties();
if (!settingsdir.toFile().exists()) {
settingsdir.toFile().mkdirs();
}
Files.writeString(settingsdir.resolve("kafka.properties"), properties, StandardCharsets.UTF_8);
close();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,15 @@ public static List<RuleFileName> getAllRuleFiles(Path rootdir, String subjectnam
}

public static List<RuleFileName> getAllRuleFiles(Path rootdir) {
File[] subjectnamedirs = rootdir.toFile().listFiles();
List<RuleFileName> ret = new ArrayList<>();
for (File f : subjectnamedirs) {
if (f.isDirectory()) {
ret.addAll(getAllRuleFiles(rootdir, f.getName()));
if (rootdir.toFile().exists()) {
File[] subjectnamedirs = rootdir.toFile().listFiles();
if (subjectnamedirs != null && subjectnamedirs.length > 0) {
for (File f : subjectnamedirs) {
if (f.isDirectory()) {
ret.addAll(getAllRuleFiles(rootdir, f.getName()));
}
}
}
}
return ret;
Expand Down