Skip to content

Commit

Permalink
ZNTA-2225 - still require hibernate search base sys prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Huang committed Oct 3, 2017
1 parent 1ddf365 commit 29656ef
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## 4.4.0
##### Infrastructure Changes
Zanata now requires a system propery 'zanata.home' as the root for all its file system storage needs.
Previously defined 'zanata.file.directory' and 'hibernate.search.default.indexBase' will still work.
But if you omit them, they will be derived from 'zanata.home' as sub directories.
Previously defined 'zanata.file.directory' will still work.
But if you omit it, it will be derived from 'zanata.home' as sub directories.

##### Changes
* [ZNTA-2184](https://zanata.atlassian.net/browse/ZNTA-2225) - Define zanata.home system property and derive other properties from it
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/system-admin/configuration/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ Zanata will store some files on file system. You will need to define a system pr
The value should be a path that has read and write permission from jboss user. You can define individual system properties for each storage below or they will derive from above zanata.home directory (e.g. as sub directory).

- zanata.file.directory
- hibernate.search.default.indexBase

You can also define a system property for Javamelody (the server monitoring tool Zanata uses)
You can also define a system property for Javamelody (the server monitoring tool Zanata uses) and for Hibernate search index. It's recommended you define them as sub directory of zanata.home.
```xml
<system-properties>
...
<property name="javamelody.storage-directory" value="${zanata.home}/stats"/>
<property name="hibernate.search.default.indexBase" value="${zanata.home}/indexes"/>
...
</system-properties>
```
Expand Down
1 change: 1 addition & 0 deletions server/docker/conf/zanata-config.cli
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ batch
# ==== system properties /system-property=foo:add(value=bar) ====
/system-property="zanata.home":add(value="${user.home}/zanata")
/system-property="javamelody.storage-directory":add(value="${zanata.home}/stats")
/system-property="hibernate.search.default.indexBase":add(value="${zanata.home}/indexes")
/system-property="jboss.as.management.blocking.timeout":add(value="1000")
/system-property="zanata.security.authpolicy.internal":add(value="zanata.internal")
/system-property="zanata.security.authpolicy.openid":add(value="zanata.openid")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,15 @@ public class SystemPropertyConfigStore implements ConfigStore {
"zanata.email.defaultfromaddress";
public static final String KEY_DOCUMENT_FILE_STORE =
"zanata.file.directory";
// this is used by hibernate search so we still need to define it.
private static final String KEY_HIBERNATE_SEARCH_INDEX_BASE =
"hibernate.search.default.indexBase";
// unfortunately we can't derive javamelody directory from zanata.home because it's used inside javamelody
private static final String KEY_JAVAMELODY_STORAGE_DIRECTORY =
"javamelody.storage-directory";
private static final String KEY_ZANATA_HOME = "zanata.home";
private static final Set<String> REQUIRED_PROP_KEYS = ImmutableSet
.of(KEY_ZANATA_HOME, KEY_JAVAMELODY_STORAGE_DIRECTORY);
.of(KEY_ZANATA_HOME, KEY_JAVAMELODY_STORAGE_DIRECTORY, KEY_HIBERNATE_SEARCH_INDEX_BASE);

/**
* Server-wide switch to enable/disable OAuth support
Expand Down Expand Up @@ -130,7 +131,7 @@ public String getDocumentFileStorageLocation() {
}

public String getHibernateSearchIndexBase() {
return System.getProperty(KEY_HIBERNATE_SEARCH_INDEX_BASE, new File(getZanataHome(), "indexes").getAbsolutePath());
return System.getProperty(KEY_HIBERNATE_SEARCH_INDEX_BASE);
}

public String getZanataHome() {
Expand Down

0 comments on commit 29656ef

Please sign in to comment.