Commit 2ee0ffbf authored by Matija Obreza's avatar Matija Obreza
Browse files

Using setting data.dir as base for local file storage

parent f480faea
......@@ -18,5 +18,4 @@ db.showSql=false
db.hbm2ddl=true
hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
download.files.dir=/data/genesys/temp
file.repository.dir=/data/genesys/persistent/repository
data.dir=/data/genesys/
......@@ -90,8 +90,8 @@ public class WorldClimUpdater implements InitializingBean {
// http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/bio_2-5m_bil.zip
// http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/alt_2-5m_bil.zip
@Value("${download.files.dir}")
private String downloadDir;
@Value("${worldclim.dir}")
private String worldclimDir;
private File worldClimDir;
......@@ -110,7 +110,7 @@ public class WorldClimUpdater implements InitializingBean {
@Override
public void afterPropertiesSet() throws Exception {
this.worldClimDir = new File(downloadDir, "worldclim");
this.worldClimDir = new File(worldclimDir);
this.worldClimDir.mkdirs();
}
......
......@@ -16,11 +16,14 @@
package org.genesys2.spring.config;
import static org.elasticsearch.node.NodeBuilder.*;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.settings.ImmutableSettings;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.data.elasticsearch.client.NodeClientFactoryBean;
@Configuration
@Profile({ "dev" })
......@@ -35,11 +38,15 @@ public class ElasticsearchConfigDev {
@Value("${elasticsearch.enable.http}")
private boolean enableHttp;
@Value("${elasticsearch.data.path}")
private String dataPath;
@Bean
public NodeClientFactoryBean ncfb() {
NodeClientFactoryBean ncfb = new NodeClientFactoryBean(true);
ncfb.setClusterName(clusterName);
ncfb.setEnableHttp(enableHttp);
return ncfb;
public NodeClient nodeClient() {
ImmutableSettings.Builder settings = ImmutableSettings.settingsBuilder().put("http.enabled",
String.valueOf(this.enableHttp)).put("path.home", this.dataPath);
return (NodeClient) nodeBuilder().settings(settings).clusterName(this.clusterName).local(true).node()
.client();
}
}
......@@ -48,7 +48,8 @@ captcha.siteKey=${captcha.publicKey}
captcha.publicKey=6Lfb5w4TAAAAAI6pD_4l5uIwXEaUJ6KQmhU9cyjx
# paths
download.files.dir=./data/
data.dir=./data
worldclim.dir=${data.dir}/worldclim
# ITPGRFA Easy-SMTA account (if you have one)
itpgrfa.easysmta.url=https://mls.planttreaty.org/itt/index.php?r=extsys/userinfo
......@@ -148,6 +149,7 @@ elasticsearch.enable.http=true
# Connect to external ES nodes. Comma separated list of hostname:port
# elasticsearch.cluster.nodes=localhost:9300,otherhost:9300
elasticsearch.cluster.nodes=
elasticsearch.data.path=${data.dir}/elastic
transifex.project=genesys-dev
transifex.username=Alexandr19011990
......@@ -166,7 +168,7 @@ transifex.content.template=<html xmlns="http://www.w3.org/1999/xhtml">\
# File repository
file.repository.dir=${download.files.dir}/repository
file.repository.dir=${data.dir}/repository
# File repository S3 parameter values
s3.accessKey=
......
......@@ -38,7 +38,9 @@ captcha.publicKey=B
lucene.indexDir=./lucene/
# paths
download.files.dir=./data/
data.dir=./data
elasticsearch.data.path=${data.dir}/elastic
file.repository.dir=${data.dir}/repository
# ITPGRFA Easy-SMTA account (if you have one)
itpgrfa.easysmta.url=https://mls.planttreaty.org/itt/index.php?r=extsys/userinfo
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment