Skip to content
Snippets Groups Projects
Commit a3ae1dde authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

Rename config options ('duniter.p2p.enable' and 'duniter.stats.enable')

parent a5ce21e6
No related branches found
No related tags found
No related merge requests found
Showing
with 52 additions and 77 deletions
......@@ -126,14 +126,18 @@ duniter.blockchain.enable: true
# Force blockchain reload - WARNING: all user events will be resetted to 'unread'
#
#duniter.blockchain.reload: true
#duniter.blockchain.reload.from: 50999
#
# Duniter node address
#
duniter.host: g1.duniter.org
duniter.port: 10901
#
#duniter.useSsl: true
#duniter.network.timeout: 5000
#
# Should maintain stats on index rows count ?
#
#duniter.stats.enable: false
#
# ---------------------------------- Duniter4j security module -------------------
#
......@@ -150,14 +154,7 @@ duniter.security.enable: true
#
# Should synchronize data from an existing ES node ?
#
duniter.data.sync.enable: true
duniter.data.sync.host: g1.data.duniter.fr
duniter.data.sync.port: 443
#
# Should maintain stats on data ?
#
duniter.data.stats.enable: true
#duniter.p2p.enable: false
# ---------------------------------- Duniter4j Mail module -----------------------
#
......@@ -196,7 +193,7 @@ duniter.mail.enable: false
#
# Websocket port (usefull for listen changes)
#
duniter.ws.port: 9400
duniter.ws.port: 9400-9410
# ---------------------------------- Duniter4j Subscription module -------------------
#
......
......@@ -15,7 +15,7 @@
# Use a descriptive name for your cluster:
#
# cluster.name: my-application
cluster.name: duniter4j-es-assembly-test-2
cluster.name: duniter4j-es-assembly-test
#
# ------------------------------------ Node ------------------------------------
#
......@@ -133,11 +133,15 @@ duniter.blockchain.enable: true
duniter.host: g1.duniter.org
duniter.port: 10901
#duniter.useSsl: true
duniter4j.network.timeout: 10000
#
# Should maintain stats on index rows count ?
#
#duniter.stats.enable: false
#
# ---------------------------------- Duniter4j security module -------------------
#
# Allow admin actions
# Keyring for the ES node
#
duniter.keyring.salt: 'abc'
duniter.keyring.password: 'def'
......@@ -158,15 +162,7 @@ duniter.security.enable: true
#
# Should synchronize data from an existing ES node ?
#
duniter.data.sync.enable: false
#duniter.data.sync.enable: true
duniter.data.sync.host: localhost
duniter.data.sync.port: 9200
#
# Should maintain stats on data ?
#
duniter.data.stats.enable: true
#duniter.p2p.enable: false
# ---------------------------------- Duniter4j Mail module -----------------------
#
......@@ -176,8 +172,8 @@ duniter.mail.enable: false
#
# Mail: SMTP server configuration (host and port)
#
duniter.mail.smtp.host: localhost
duniter.mail.smtp.port: 25
#duniter.mail.smtp.host: localhost
#duniter.mail.smtp.port: 25
#
# Mail: SMTP server SSL security
#
......@@ -192,13 +188,10 @@ duniter.mail.smtp.port: 25
# Mail: 'from' address
#
#duniter.mail.from: no-reply@domain.com
duniter.mail.from: 'no-reply@duniter.fr'
#
# Mail: admin address
#
#duniter.mail.admin: user@domain.com
#duniter.mail.admin: blavenie@EIS-DEV
duniter.mail.admin: 'benoit.lavenier@e-is.pro'
#
# Mail: subject prefix
#
......@@ -227,7 +220,7 @@ duniter.subscription.enable: true
#
# Email subscription: Hour in day to trigger daily email subscription (default: 3 AM)
#
duniter.subscription.email.hourOfDay: 3
#duniter.subscription.email.hourOfDay: 3
#
# Email subscription: URL to a Cesium site, for links in the email content (default: https://g1.duniter.fr)
#
......
......@@ -102,7 +102,7 @@ public class PluginInit extends AbstractLifecycleComponent<PluginInit> {
}
}
else if (pluginSettings.enableBlockchain() && pluginSettings.reloadBlockchainIndices() && pluginSettings.reloadBlockchainIndicesFrom() <= 0) {
else if (pluginSettings.enableBlockchainSync() && pluginSettings.reloadBlockchainIndices() && pluginSettings.reloadBlockchainIndicesFrom() <= 0) {
if (logger.isWarnEnabled()) {
logger.warn("/!\\ Reloading blockchain indices...");
}
......@@ -139,7 +139,7 @@ public class PluginInit extends AbstractLifecycleComponent<PluginInit> {
protected void doAfterStart() {
// Synchronize blockchain
if (pluginSettings.enableBlockchain()) {
if (pluginSettings.enableBlockchainSync()) {
Peer peer = pluginSettings.checkAndGetPeer();
......
......@@ -190,7 +190,7 @@ public class PluginSettings extends AbstractLifecycleComponent<PluginSettings> {
return settings.getAsBoolean("duniter.indices.reload", false);
}
public boolean enableBlockchain() {
public boolean enableBlockchainSync() {
return settings.getAsBoolean("duniter.blockchain.enable", false);
}
......@@ -202,10 +202,6 @@ public class PluginSettings extends AbstractLifecycleComponent<PluginSettings> {
return settings.getAsInt("duniter.blockchain.reload.from", 0);
}
public boolean reloadPeerIndices() {
return settings.getAsBoolean("duniter.peer.reload", false);
}
public File getTempDirectory() {
return Configuration.instance().getTempDirectory();
}
......@@ -214,10 +210,6 @@ public class PluginSettings extends AbstractLifecycleComponent<PluginSettings> {
return settings.getAsInt("duniter.network.timeout", 30000 /*30s*/);
}
public int getPeerDownTimeout() {
return settings.getAsInt("duniter.peer.down.timeout", 10*60*1000 /*10min*/);
}
public int getNetworkMaxConnections() {
return settings.getAsInt("duniter.network.maxConnections", 100);
}
......@@ -274,18 +266,6 @@ public class PluginSettings extends AbstractLifecycleComponent<PluginSettings> {
return settings.getAsBoolean("duniter.security.enable", true);
}
public boolean enableDataSync() {
return settings.getAsBoolean("duniter.data.sync.enable", false);
}
public String getDataSyncHost() {
return settings.get("duniter.data.sync.host", "data.duniter.fr");
}
public int getDataSyncPort() {
return settings.getAsInt("duniter.data.sync.port", 80);
}
public String getWebSocketHost() {
return settings.get("network.host", "locahost");
}
......@@ -303,7 +283,7 @@ public class PluginSettings extends AbstractLifecycleComponent<PluginSettings> {
}
public boolean enableDocStats() {
return settings.getAsBoolean("duniter.data.stats.enable", false);
return settings.getAsBoolean("duniter.stats.enable", false);
}
/* protected methods */
......
......@@ -69,7 +69,7 @@ public abstract class AbstractBlockchainListenerService extends AbstractService
TimeValue processingInterval) {
super(loggerName, client, settings, cryptoService);
this.listenerId = loggerName;
this.enable = pluginSettings.enableBlockchain();
this.enable = pluginSettings.enableBlockchainSync();
this.threadPool = threadPool;
this.bulkSize = pluginSettings.getIndexBulkSize();
......
......@@ -22,23 +22,16 @@ package org.duniter.elasticsearch.subscription;
* #L%
*/
import org.duniter.elasticsearch.dao.BlockDao;
import org.duniter.elasticsearch.rest.security.RestSecurityController;
import org.duniter.elasticsearch.service.BlockchainService;
import org.duniter.elasticsearch.service.PeerService;
import org.duniter.elasticsearch.subscription.dao.SubscriptionIndexDao;
import org.duniter.elasticsearch.subscription.dao.execution.SubscriptionExecutionDao;
import org.duniter.elasticsearch.subscription.service.SubscriptionService;
import org.duniter.elasticsearch.subscription.service.SynchroService;
import org.duniter.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.cluster.health.ClusterHealthStatus;
import org.elasticsearch.common.component.AbstractLifecycleComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.inject.Injector;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.RestRequest;
/**
* Created by blavenie on 17/06/16.
......@@ -111,12 +104,12 @@ public class PluginInit extends AbstractLifecycleComponent<PluginInit> {
// Start subscription services
if (pluginSettings.enableSubscription()) {
injector.getInstance(SubscriptionService.class).startScheduling();
injector.getInstance(SubscriptionService.class)
.startScheduling();
}
// Start synchro service
if (pluginSettings.enableDataSync()) {
// Start synchronization service
if (pluginSettings.enableP2PSync()) {
injector.getInstance(SynchroService.class)
.startScheduling();
}
......
......@@ -26,7 +26,6 @@ package org.duniter.elasticsearch.subscription;
import org.duniter.core.util.crypto.KeyPair;
import org.elasticsearch.common.component.*;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.inject.Singleton;
/**
* Access to configuration options
......@@ -119,11 +118,11 @@ public class PluginSettings extends AbstractLifecycleComponent<PluginSettings> {
/* -- delegate methods -- */
public boolean reloadIndices() {
return delegate.reloadIndices();
return delegate.reloadAllIndices();
}
public boolean enableDataSync() {
return delegate.enableDataSync();
public boolean enableP2PSync() {
return delegate.enableP2PSync();
}
public boolean getMailEnable() {
......
......@@ -22,7 +22,6 @@ package org.duniter.elasticsearch.user;
* #L%
*/
import org.duniter.elasticsearch.PluginSettings;
import org.duniter.elasticsearch.service.DocStatService;
import org.duniter.elasticsearch.threadpool.ThreadPool;
import org.duniter.elasticsearch.user.dao.page.RegistryCommentDao;
......@@ -31,7 +30,6 @@ import org.duniter.elasticsearch.user.dao.page.RegistryRecordDao;
import org.duniter.elasticsearch.user.model.UserEvent;
import org.duniter.elasticsearch.user.service.*;
import org.duniter.elasticsearch.user.model.UserEventCodes;
import org.elasticsearch.cluster.health.ClusterHealthStatus;
import org.elasticsearch.common.component.AbstractLifecycleComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.inject.Injector;
......@@ -167,8 +165,9 @@ public class PluginInit extends AbstractLifecycleComponent<PluginInit> {
protected void doAfterStart() {
// Synchronize
if (pluginSettings.enableDataSync()) {
injector.getInstance(SynchroService.class).startScheduling();
if (pluginSettings.enableP2PSync()) {
injector.getInstance(SynchroService.class)
.startScheduling();
}
// Notify admin
......
......@@ -82,14 +82,27 @@ public class PluginSettings extends AbstractLifecycleComponent<PluginSettings> {
return delegate.getDefaultStringAnalyzer();
}
public boolean reloadIndices() {
public boolean reloadAllIndices() {
return delegate.reloadAllIndices();
}
public boolean enableDataSync() {
return delegate.enableDataSync();
public boolean reloadBlockchainIndices() {
return delegate.reloadBlockchainIndices();
}
public int reloadBlockchainIndicesFrom() {
return delegate.reloadBlockchainIndicesFrom();
}
public boolean enableDocStats() {
return delegate.enableDocStats();
}
public boolean enableP2PSync() {
return settings.getAsBoolean("duniter.p2p.enable", false);
}
public boolean getMailEnable() {
return settings.getAsBoolean("duniter.mail.enable", Boolean.TRUE);
}
......@@ -149,7 +162,7 @@ public class PluginSettings extends AbstractLifecycleComponent<PluginSettings> {
}
public boolean enableBlockchainSync() {
return delegate.enableBlockchain();
return delegate.enableBlockchainSync();
}
public String getKeyringSalt() {
......@@ -168,6 +181,7 @@ public class PluginSettings extends AbstractLifecycleComponent<PluginSettings> {
return delegate.getKeyringSecretKey();
}
public void addI18nBundleName(String bundleName) {
delegate.addI18nBundleName(bundleName);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment