mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-08 18:47:52 +00:00
Merge pull request #1560 from nonlinear-chaos-order-etc-etal/openssl
qt: newer options added from docs + visual fixes
This commit is contained in:
commit
fbfc5ecda3
2
qt/i2pd_qt/.gitignore
vendored
2
qt/i2pd_qt/.gitignore
vendored
@ -8,4 +8,6 @@ Makefile*
|
|||||||
object_script.*
|
object_script.*
|
||||||
i2pd_qt_plugin_import.cpp
|
i2pd_qt_plugin_import.cpp
|
||||||
i2pd_qt.pro.autosave*
|
i2pd_qt.pro.autosave*
|
||||||
|
build*
|
||||||
|
nohup.out
|
||||||
|
|
||||||
|
@ -168,6 +168,23 @@ int ClientTunnelPane::appendClientTunnelForm(
|
|||||||
horizontalLayout_2->addItem(horizontalSpacer);
|
horizontalLayout_2->addItem(horizontalSpacer);
|
||||||
tunnelGridLayout->addLayout(horizontalLayout_2);
|
tunnelGridLayout->addLayout(horizontalLayout_2);
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
int cryptoType = tunnelConfig->getcryptoType();
|
||||||
|
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
|
||||||
|
ui.cryptoTypeLabel = new QLabel(gridLayoutWidget_2);
|
||||||
|
cryptoTypeLabel->setObjectName(QStringLiteral("cryptoTypeLabel"));
|
||||||
|
horizontalLayout_2->addWidget(cryptoTypeLabel);
|
||||||
|
ui.cryptoTypeLineEdit = new QLineEdit(gridLayoutWidget_2);
|
||||||
|
cryptoTypeLineEdit->setObjectName(QStringLiteral("cryptoTypeLineEdit"));
|
||||||
|
cryptoTypeLineEdit->setText(QString::number(cryptoType));
|
||||||
|
cryptoTypeLineEdit->setMaximumWidth(80);
|
||||||
|
QObject::connect(cryptoTypeLineEdit, SIGNAL(textChanged(const QString &)),
|
||||||
|
this, SLOT(updated()));
|
||||||
|
horizontalLayout_2->addWidget(cryptoTypeLineEdit);
|
||||||
|
QSpacerItem * horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
horizontalLayout_2->addItem(horizontalSpacer);
|
||||||
|
tunnelGridLayout->addLayout(horizontalLayout_2);
|
||||||
|
}
|
||||||
{
|
{
|
||||||
i2p::data::SigningKeyType sigType = tunnelConfig->getsigType();
|
i2p::data::SigningKeyType sigType = tunnelConfig->getsigType();
|
||||||
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
|
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
|
||||||
|
@ -53,6 +53,10 @@ private:
|
|||||||
QLabel * sigTypeLabel;
|
QLabel * sigTypeLabel;
|
||||||
QComboBox * sigTypeComboBox;
|
QComboBox * sigTypeComboBox;
|
||||||
|
|
||||||
|
//cryptoType
|
||||||
|
QLabel * cryptoTypeLabel;
|
||||||
|
QLineEdit * cryptoTypeLineEdit;
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
virtual void setGroupBoxTitle(const QString & title);
|
virtual void setGroupBoxTitle(const QString & title);
|
||||||
|
|
||||||
@ -61,6 +65,7 @@ private:
|
|||||||
typeLabel->setText(QApplication::translate("cltTunForm", "Client tunnel type:", 0));
|
typeLabel->setText(QApplication::translate("cltTunForm", "Client tunnel type:", 0));
|
||||||
destinationLabel->setText(QApplication::translate("cltTunForm", "Destination:", 0));
|
destinationLabel->setText(QApplication::translate("cltTunForm", "Destination:", 0));
|
||||||
portLabel->setText(QApplication::translate("cltTunForm", "Port:", 0));
|
portLabel->setText(QApplication::translate("cltTunForm", "Port:", 0));
|
||||||
|
cryptoTypeLabel->setText(QApplication::translate("cltTunForm", "Crypto type:", 0));
|
||||||
keysLabel->setText(QApplication::translate("cltTunForm", "Keys:", 0));
|
keysLabel->setText(QApplication::translate("cltTunForm", "Keys:", 0));
|
||||||
destinationPortLabel->setText(QApplication::translate("cltTunForm", "Destination port:", 0));
|
destinationPortLabel->setText(QApplication::translate("cltTunForm", "Destination port:", 0));
|
||||||
addressLabel->setText(QApplication::translate("cltTunForm", "Address:", 0));
|
addressLabel->setText(QApplication::translate("cltTunForm", "Address:", 0));
|
||||||
@ -86,6 +91,14 @@ protected:
|
|||||||
}
|
}
|
||||||
ctc->setport(portInt);
|
ctc->setport(portInt);
|
||||||
|
|
||||||
|
auto cryptoTypeStr=cryptoTypeLineEdit->text();
|
||||||
|
int cryptoTypeInt=cryptoTypeStr.toInt(&ok);
|
||||||
|
if(!ok){
|
||||||
|
highlightWrongInput(QApplication::tr("Bad crypto type, must be int.")+" "+cannotSaveSettings,cryptoTypeLineEdit);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ctc->setcryptoType(cryptoTypeInt);
|
||||||
|
|
||||||
ctc->setkeys(keysLineEdit->text().toStdString());
|
ctc->setkeys(keysLineEdit->text().toStdString());
|
||||||
|
|
||||||
ctc->setaddress(addressLineEdit->text().toStdString());
|
ctc->setaddress(addressLineEdit->text().toStdString());
|
||||||
|
@ -235,6 +235,23 @@ int ServerTunnelPane::appendServerTunnelForm(
|
|||||||
horizontalLayout_2->addItem(horizontalSpacer);
|
horizontalLayout_2->addItem(horizontalSpacer);
|
||||||
tunnelGridLayout->addLayout(horizontalLayout_2);
|
tunnelGridLayout->addLayout(horizontalLayout_2);
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
int cryptoType = tunnelConfig->getcryptoType();
|
||||||
|
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
|
||||||
|
ui.cryptoTypeLabel = new QLabel(gridLayoutWidget_2);
|
||||||
|
cryptoTypeLabel->setObjectName(QStringLiteral("cryptoTypeLabel"));
|
||||||
|
horizontalLayout_2->addWidget(cryptoTypeLabel);
|
||||||
|
ui.cryptoTypeLineEdit = new QLineEdit(gridLayoutWidget_2);
|
||||||
|
cryptoTypeLineEdit->setObjectName(QStringLiteral("cryptoTypeLineEdit"));
|
||||||
|
cryptoTypeLineEdit->setText(QString::number(cryptoType));
|
||||||
|
cryptoTypeLineEdit->setMaximumWidth(80);
|
||||||
|
QObject::connect(cryptoTypeLineEdit, SIGNAL(textChanged(const QString &)),
|
||||||
|
this, SLOT(updated()));
|
||||||
|
horizontalLayout_2->addWidget(cryptoTypeLineEdit);
|
||||||
|
QSpacerItem * horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
horizontalLayout_2->addItem(horizontalSpacer);
|
||||||
|
tunnelGridLayout->addLayout(horizontalLayout_2);
|
||||||
|
}
|
||||||
{
|
{
|
||||||
I2CPParameters& i2cpParameters = tunnelConfig->getI2cpParameters();
|
I2CPParameters& i2cpParameters = tunnelConfig->getI2cpParameters();
|
||||||
appendControlsForI2CPParameters(i2cpParameters, gridIndex);
|
appendControlsForI2CPParameters(i2cpParameters, gridIndex);
|
||||||
|
@ -65,6 +65,10 @@ private:
|
|||||||
QLabel * inPortLabel;
|
QLabel * inPortLabel;
|
||||||
QLineEdit * inPortLineEdit;
|
QLineEdit * inPortLineEdit;
|
||||||
|
|
||||||
|
//cryptoType
|
||||||
|
QLabel * cryptoTypeLabel;
|
||||||
|
QLineEdit * cryptoTypeLineEdit;
|
||||||
|
|
||||||
//accessList
|
//accessList
|
||||||
QLabel * accessListLabel;
|
QLabel * accessListLabel;
|
||||||
QLineEdit * accessListLineEdit;
|
QLineEdit * accessListLineEdit;
|
||||||
@ -101,6 +105,7 @@ private:
|
|||||||
portLabel->setText(QApplication::translate("srvTunForm", "Port:", 0));
|
portLabel->setText(QApplication::translate("srvTunForm", "Port:", 0));
|
||||||
keysLabel->setText(QApplication::translate("srvTunForm", "Keys:", 0));
|
keysLabel->setText(QApplication::translate("srvTunForm", "Keys:", 0));
|
||||||
inPortLabel->setText(QApplication::translate("srvTunForm", "InPort:", 0));
|
inPortLabel->setText(QApplication::translate("srvTunForm", "InPort:", 0));
|
||||||
|
cryptoTypeLabel->setText(QApplication::translate("srvTunForm", "Crypto type:", 0));
|
||||||
accessListLabel->setText(QApplication::translate("srvTunForm", "Access list:", 0));
|
accessListLabel->setText(QApplication::translate("srvTunForm", "Access list:", 0));
|
||||||
hostOverrideLabel->setText(QApplication::translate("srvTunForm", "Host override:", 0));
|
hostOverrideLabel->setText(QApplication::translate("srvTunForm", "Host override:", 0));
|
||||||
webIRCPassLabel->setText(QApplication::translate("srvTunForm", "WebIRC password:", 0));
|
webIRCPassLabel->setText(QApplication::translate("srvTunForm", "WebIRC password:", 0));
|
||||||
@ -129,6 +134,14 @@ protected:
|
|||||||
}
|
}
|
||||||
stc->setport(portInt);
|
stc->setport(portInt);
|
||||||
|
|
||||||
|
auto cryptoTypeStr=cryptoTypeLineEdit->text();
|
||||||
|
int cryptoTypeInt=cryptoTypeStr.toInt(&ok);
|
||||||
|
if(!ok){
|
||||||
|
highlightWrongInput(QApplication::tr("Bad crypto type, must be int.")+" "+cannotSaveSettings,cryptoTypeLineEdit);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
stc->setcryptoType(cryptoTypeInt);
|
||||||
|
|
||||||
stc->setkeys(keysLineEdit->text().toStdString());
|
stc->setkeys(keysLineEdit->text().toStdString());
|
||||||
|
|
||||||
auto str=inPortLineEdit->text();
|
auto str=inPortLineEdit->text();
|
||||||
|
@ -24,6 +24,18 @@ void TunnelConfig::saveI2CPParametersToStringStream(std::stringstream& out) {
|
|||||||
if (!i2cpParameters.getExplicitPeers().isEmpty()) //todo #947
|
if (!i2cpParameters.getExplicitPeers().isEmpty()) //todo #947
|
||||||
out << i2p::client::I2CP_PARAM_EXPLICIT_PEERS << "="
|
out << i2p::client::I2CP_PARAM_EXPLICIT_PEERS << "="
|
||||||
<< i2cpParameters.getExplicitPeers().toStdString() << "\n";
|
<< i2cpParameters.getExplicitPeers().toStdString() << "\n";
|
||||||
|
out << i2p::client::I2CP_PARAM_LEASESET_AUTH_TYPE << "="
|
||||||
|
<< i2cpParameters.get_i2cp_leaseSetAuthType().toStdString() << "\n";
|
||||||
|
out << i2p::client::I2CP_PARAM_LEASESET_ENCRYPTION_TYPE << "="
|
||||||
|
<< i2cpParameters.get_i2cp_leaseSetEncType().toStdString() << "\n";
|
||||||
|
out << i2p::client::I2CP_PARAM_LEASESET_PRIV_KEY << "="
|
||||||
|
<< i2cpParameters.get_i2cp_leaseSetPrivKey().toStdString() << "\n";
|
||||||
|
out << i2p::client::I2CP_PARAM_LEASESET_TYPE << "="
|
||||||
|
<< i2cpParameters.get_i2cp_leaseSetType().toStdString() << "\n";
|
||||||
|
out << i2p::client::I2CP_PARAM_STREAMING_ANSWER_PINGS << "="
|
||||||
|
<< (i2cpParameters.get_i2p_streaming_answerPings() ? "true" : "false") << "\n";
|
||||||
|
out << i2p::client::I2CP_PARAM_STREAMING_INITIAL_ACK_DELAY << "="
|
||||||
|
<< i2cpParameters.get_i2p_streaming_initialAckDelay().toStdString() << "\n";
|
||||||
out << "\n";
|
out << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,6 +44,7 @@ void ClientTunnelConfig::saveToStringStream(std::stringstream& out) {
|
|||||||
<< "port=" << port << "\n"
|
<< "port=" << port << "\n"
|
||||||
<< "destination=" << dest << "\n"
|
<< "destination=" << dest << "\n"
|
||||||
<< "destinationport=" << destinationPort << "\n"
|
<< "destinationport=" << destinationPort << "\n"
|
||||||
|
<< "cryptoType=" << getcryptoType() << "\n"
|
||||||
<< "signaturetype=" << sigType << "\n";
|
<< "signaturetype=" << sigType << "\n";
|
||||||
if(!keys.empty()) out << "keys=" << keys << "\n";
|
if(!keys.empty()) out << "keys=" << keys << "\n";
|
||||||
}
|
}
|
||||||
@ -41,9 +54,10 @@ void ServerTunnelConfig::saveToStringStream(std::stringstream& out) {
|
|||||||
out << "host=" << host << "\n"
|
out << "host=" << host << "\n"
|
||||||
<< "port=" << port << "\n"
|
<< "port=" << port << "\n"
|
||||||
<< "signaturetype=" << sigType << "\n"
|
<< "signaturetype=" << sigType << "\n"
|
||||||
<< "inport=" << inPort << "\n"
|
<< "inport=" << inPort << "\n";
|
||||||
<< "accesslist=" << accessList << "\n"
|
if(accessList.size()>0) { out << "accesslist=" << accessList << "\n"; }
|
||||||
<< "gzip=" << (gzip?"true":"false") << "\n"
|
out << "gzip=" << (gzip?"true":"false") << "\n"
|
||||||
|
<< "cryptoType=" << getcryptoType() << "\n"
|
||||||
<< "enableuniquelocal=" << (isUniqueLocal?"true":"false") << "\n"
|
<< "enableuniquelocal=" << (isUniqueLocal?"true":"false") << "\n"
|
||||||
<< "address=" << address << "\n"
|
<< "address=" << address << "\n"
|
||||||
<< "hostoverride=" << hostOverride << "\n"
|
<< "hostoverride=" << hostOverride << "\n"
|
||||||
|
@ -16,25 +16,49 @@ class I2CPParameters{
|
|||||||
QString outbound_quantity; //number of outbound tunnels. 5 by default
|
QString outbound_quantity; //number of outbound tunnels. 5 by default
|
||||||
QString crypto_tagsToSend; //number of ElGamal/AES tags to send. 40 by default; too low value may cause problems with tunnel building
|
QString crypto_tagsToSend; //number of ElGamal/AES tags to send. 40 by default; too low value may cause problems with tunnel building
|
||||||
QString explicitPeers; //list of comma-separated b64 addresses of peers to use, default: unset
|
QString explicitPeers; //list of comma-separated b64 addresses of peers to use, default: unset
|
||||||
|
QString i2p_streaming_initialAckDelay; //i2p.streaming.initialAckDelay -- milliseconds to wait before sending Ack. 200 by default
|
||||||
|
bool i2p_streaming_answerPings; //i2p.streaming.answerPings -- enable sending pongs. true by default
|
||||||
|
QString i2cp_leaseSetType; //i2cp.leaseSetType -- type of LeaseSet to be sent. 1, 3 or 5. 1 by default
|
||||||
|
QString i2cp_leaseSetEncType; //i2cp.leaseSetEncType -- comma separated encryption types to be used in LeaseSet type 3 or 5. Identity's type by default
|
||||||
|
QString i2cp_leaseSetPrivKey; //i2cp.leaseSetPrivKey -- decryption key for encrypted LeaseSet in base64. PSK or private DH
|
||||||
|
QString i2cp_leaseSetAuthType; //i2cp.leaseSetAuthType -- authentication type for encrypted LeaseSet. 0 - no authentication(default), 1 - DH, 2 - PSK
|
||||||
public:
|
public:
|
||||||
I2CPParameters(): inbound_length(),
|
I2CPParameters(): inbound_length(),
|
||||||
outbound_length(),
|
outbound_length(),
|
||||||
inbound_quantity(),
|
inbound_quantity(),
|
||||||
outbound_quantity(),
|
outbound_quantity(),
|
||||||
crypto_tagsToSend(),
|
crypto_tagsToSend(),
|
||||||
explicitPeers() {}
|
explicitPeers(),
|
||||||
|
i2p_streaming_initialAckDelay(),
|
||||||
|
i2p_streaming_answerPings(true),
|
||||||
|
i2cp_leaseSetType(),
|
||||||
|
i2cp_leaseSetEncType(),
|
||||||
|
i2cp_leaseSetPrivKey(),
|
||||||
|
i2cp_leaseSetAuthType() {}
|
||||||
const QString& getInbound_length(){return inbound_length;}
|
const QString& getInbound_length(){return inbound_length;}
|
||||||
const QString& getOutbound_length(){return outbound_length;}
|
const QString& getOutbound_length(){return outbound_length;}
|
||||||
const QString& getInbound_quantity(){return inbound_quantity;}
|
const QString& getInbound_quantity(){return inbound_quantity;}
|
||||||
const QString& getOutbound_quantity(){return outbound_quantity;}
|
const QString& getOutbound_quantity(){return outbound_quantity;}
|
||||||
const QString& getCrypto_tagsToSend(){return crypto_tagsToSend;}
|
const QString& getCrypto_tagsToSend(){return crypto_tagsToSend;}
|
||||||
const QString& getExplicitPeers(){return explicitPeers;}
|
const QString& getExplicitPeers(){return explicitPeers;}
|
||||||
|
const QString& get_i2p_streaming_initialAckDelay(){return i2p_streaming_initialAckDelay;}
|
||||||
|
bool get_i2p_streaming_answerPings(){return i2p_streaming_answerPings;}
|
||||||
|
const QString& get_i2cp_leaseSetType(){return i2cp_leaseSetType;}
|
||||||
|
const QString& get_i2cp_leaseSetEncType(){return i2cp_leaseSetEncType;}
|
||||||
|
const QString& get_i2cp_leaseSetPrivKey(){return i2cp_leaseSetPrivKey;}
|
||||||
|
const QString& get_i2cp_leaseSetAuthType(){return i2cp_leaseSetAuthType;}
|
||||||
void setInbound_length(QString inbound_length_){inbound_length=inbound_length_;}
|
void setInbound_length(QString inbound_length_){inbound_length=inbound_length_;}
|
||||||
void setOutbound_length(QString outbound_length_){outbound_length=outbound_length_;}
|
void setOutbound_length(QString outbound_length_){outbound_length=outbound_length_;}
|
||||||
void setInbound_quantity(QString inbound_quantity_){inbound_quantity=inbound_quantity_;}
|
void setInbound_quantity(QString inbound_quantity_){inbound_quantity=inbound_quantity_;}
|
||||||
void setOutbound_quantity(QString outbound_quantity_){outbound_quantity=outbound_quantity_;}
|
void setOutbound_quantity(QString outbound_quantity_){outbound_quantity=outbound_quantity_;}
|
||||||
void setCrypto_tagsToSend(QString crypto_tagsToSend_){crypto_tagsToSend=crypto_tagsToSend_;}
|
void setCrypto_tagsToSend(QString crypto_tagsToSend_){crypto_tagsToSend=crypto_tagsToSend_;}
|
||||||
void setExplicitPeers(QString explicitPeers_){explicitPeers=explicitPeers_;}
|
void setExplicitPeers(QString explicitPeers_){explicitPeers=explicitPeers_;}
|
||||||
|
void set_i2p_streaming_initialAckDelay(QString i2p_streaming_initialAckDelay_){i2p_streaming_initialAckDelay=i2p_streaming_initialAckDelay_;}
|
||||||
|
void set_i2p_streaming_answerPings(bool i2p_streaming_answerPings_){i2p_streaming_answerPings=i2p_streaming_answerPings_;}
|
||||||
|
void set_i2cp_leaseSetType(QString i2cp_leaseSetType_){i2cp_leaseSetType=i2cp_leaseSetType_;}
|
||||||
|
void set_i2cp_leaseSetEncType(QString i2cp_leaseSetEncType_){i2cp_leaseSetEncType=i2cp_leaseSetEncType_;}
|
||||||
|
void set_i2cp_leaseSetPrivKey(QString i2cp_leaseSetPrivKey_){i2cp_leaseSetPrivKey=i2cp_leaseSetPrivKey_;}
|
||||||
|
void set_i2cp_leaseSetAuthType(QString i2cp_leaseSetAuthType_){i2cp_leaseSetAuthType=i2cp_leaseSetAuthType_;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -58,12 +82,14 @@ class TunnelConfig {
|
|||||||
QString type;
|
QString type;
|
||||||
std::string name;
|
std::string name;
|
||||||
TunnelPane* tunnelPane;
|
TunnelPane* tunnelPane;
|
||||||
|
int cryptoType;
|
||||||
public:
|
public:
|
||||||
TunnelConfig(std::string name_, QString& type_, I2CPParameters& i2cpParameters_):
|
TunnelConfig(std::string name_, QString& type_, I2CPParameters& i2cpParameters_, int cryptoType_):
|
||||||
type(type_), name(name_), i2cpParameters(i2cpParameters_) {}
|
type(type_), name(name_), cryptoType(cryptoType_), i2cpParameters(i2cpParameters_) {}
|
||||||
virtual ~TunnelConfig(){}
|
virtual ~TunnelConfig(){}
|
||||||
const QString& getType(){return type;}
|
const QString& getType(){return type;}
|
||||||
const std::string& getName(){return name;}
|
const std::string& getName(){return name;}
|
||||||
|
int getcryptoType(){return cryptoType;}
|
||||||
void setType(const QString& type_){type=type_;}
|
void setType(const QString& type_){type=type_;}
|
||||||
void setName(const std::string& name_){name=name_;}
|
void setName(const std::string& name_){name=name_;}
|
||||||
I2CPParameters& getI2cpParameters(){return i2cpParameters;}
|
I2CPParameters& getI2cpParameters(){return i2cpParameters;}
|
||||||
@ -74,6 +100,7 @@ public:
|
|||||||
virtual ServerTunnelConfig* asServerTunnelConfig()=0;
|
virtual ServerTunnelConfig* asServerTunnelConfig()=0;
|
||||||
void setTunnelPane(TunnelPane* tp){this->tunnelPane = tp;}
|
void setTunnelPane(TunnelPane* tp){this->tunnelPane = tp;}
|
||||||
TunnelPane* getTunnelPane() {return tunnelPane;}
|
TunnelPane* getTunnelPane() {return tunnelPane;}
|
||||||
|
void setcryptoType(int cryptoType_){cryptoType=cryptoType_;}
|
||||||
private:
|
private:
|
||||||
I2CPParameters i2cpParameters;
|
I2CPParameters i2cpParameters;
|
||||||
};
|
};
|
||||||
@ -114,13 +141,14 @@ public:
|
|||||||
std::string keys_,
|
std::string keys_,
|
||||||
std::string address_,
|
std::string address_,
|
||||||
int destinationPort_,
|
int destinationPort_,
|
||||||
i2p::data::SigningKeyType sigType_): TunnelConfig(name_, type_, i2cpParameters_),
|
i2p::data::SigningKeyType sigType_,
|
||||||
|
int cryptoType_): TunnelConfig(name_, type_, i2cpParameters_, cryptoType_),
|
||||||
dest(dest_),
|
dest(dest_),
|
||||||
port(port_),
|
port(port_),
|
||||||
keys(keys_),
|
keys(keys_),
|
||||||
address(address_),
|
address(address_),
|
||||||
destinationPort(destinationPort_),
|
destinationPort(destinationPort_),
|
||||||
sigType(sigType_){}
|
sigType(sigType_) {}
|
||||||
std::string& getdest(){return dest;}
|
std::string& getdest(){return dest;}
|
||||||
int getport(){return port;}
|
int getport(){return port;}
|
||||||
std::string & getkeys(){return keys;}
|
std::string & getkeys(){return keys;}
|
||||||
@ -188,7 +216,8 @@ public:
|
|||||||
bool gzip_,
|
bool gzip_,
|
||||||
i2p::data::SigningKeyType sigType_,
|
i2p::data::SigningKeyType sigType_,
|
||||||
std::string address_,
|
std::string address_,
|
||||||
bool isUniqueLocal_): TunnelConfig(name_, type_, i2cpParameters_),
|
bool isUniqueLocal_,
|
||||||
|
int cryptoType_): TunnelConfig(name_, type_, i2cpParameters_, cryptoType_),
|
||||||
host(host_),
|
host(host_),
|
||||||
port(port_),
|
port(port_),
|
||||||
keys(keys_),
|
keys(keys_),
|
||||||
|
@ -31,7 +31,7 @@ void TunnelPane::setupTunnelPane(
|
|||||||
this->gridLayoutWidget_2=gridLayoutWidget_2;
|
this->gridLayoutWidget_2=gridLayoutWidget_2;
|
||||||
tunnelGridLayout = new QVBoxLayout(gridLayoutWidget_2);
|
tunnelGridLayout = new QVBoxLayout(gridLayoutWidget_2);
|
||||||
tunnelGridLayout->setObjectName(QStringLiteral("tunnelGridLayout"));
|
tunnelGridLayout->setObjectName(QStringLiteral("tunnelGridLayout"));
|
||||||
tunnelGridLayout->setContentsMargins(5, 5, 5, 5);
|
tunnelGridLayout->setContentsMargins(10, 25, 10, 10);
|
||||||
tunnelGridLayout->setSpacing(5);
|
tunnelGridLayout->setSpacing(5);
|
||||||
|
|
||||||
//header
|
//header
|
||||||
@ -185,6 +185,153 @@ void TunnelPane::appendControlsForI2CPParameters(I2CPParameters& i2cpParameters,
|
|||||||
tunnelGridLayout->addLayout(horizontalLayout_2);
|
tunnelGridLayout->addLayout(horizontalLayout_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
//explicitPeers -- list of comma-separated b64 addresses of peers to use, default: unset
|
||||||
|
const QString& value=i2cpParameters.getExplicitPeers();
|
||||||
|
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
|
||||||
|
horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
|
||||||
|
QLabel *_Label;
|
||||||
|
explicitPeersLabel = _Label = new QLabel(gridLayoutWidget_2);
|
||||||
|
_Label->setObjectName(QStringLiteral("_Label"));
|
||||||
|
horizontalLayout_2->addWidget(_Label);
|
||||||
|
QLineEdit *_LineEdit;
|
||||||
|
explicitPeersLineEdit = _LineEdit = new QLineEdit(gridLayoutWidget_2);
|
||||||
|
_LineEdit->setObjectName(QStringLiteral("_LineEdit"));
|
||||||
|
_LineEdit->setText(value);
|
||||||
|
_LineEdit->setMaximumWidth(80);
|
||||||
|
QObject::connect(_LineEdit, SIGNAL(textChanged(const QString &)),
|
||||||
|
this, SLOT(updated()));
|
||||||
|
horizontalLayout_2->addWidget(_LineEdit);
|
||||||
|
QSpacerItem * horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
horizontalLayout_2->addItem(horizontalSpacer);
|
||||||
|
tunnelGridLayout->addLayout(horizontalLayout_2);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
//i2p.streaming.initialAckDelay -- milliseconds to wait before sending Ack. 200 by default
|
||||||
|
const QString& value=i2cpParameters.get_i2p_streaming_initialAckDelay();
|
||||||
|
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
|
||||||
|
horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
|
||||||
|
QLabel *_Label;
|
||||||
|
i2p_streaming_initialAckDelayLabel = _Label = new QLabel(gridLayoutWidget_2);
|
||||||
|
_Label->setObjectName(QStringLiteral("_Label"));
|
||||||
|
horizontalLayout_2->addWidget(_Label);
|
||||||
|
QLineEdit *_LineEdit;
|
||||||
|
i2p_streaming_initialAckDelayLineEdit = _LineEdit = new QLineEdit(gridLayoutWidget_2);
|
||||||
|
_LineEdit->setObjectName(QStringLiteral("_LineEdit"));
|
||||||
|
_LineEdit->setText(value);
|
||||||
|
_LineEdit->setMaximumWidth(80);
|
||||||
|
QObject::connect(_LineEdit, SIGNAL(textChanged(const QString &)),
|
||||||
|
this, SLOT(updated()));
|
||||||
|
horizontalLayout_2->addWidget(_LineEdit);
|
||||||
|
QSpacerItem * horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
horizontalLayout_2->addItem(horizontalSpacer);
|
||||||
|
tunnelGridLayout->addLayout(horizontalLayout_2);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
//i2p.streaming.answerPings -- enable sending pongs. true by default
|
||||||
|
const bool value=i2cpParameters.get_i2p_streaming_answerPings();
|
||||||
|
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
|
||||||
|
horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
|
||||||
|
QCheckBox *_CheckBox;
|
||||||
|
i2p_streaming_answerPingsCheckBox = _CheckBox = new QCheckBox(gridLayoutWidget_2);
|
||||||
|
_CheckBox->setObjectName(QStringLiteral("_CheckBox"));
|
||||||
|
horizontalLayout_2->addWidget(_CheckBox);
|
||||||
|
_CheckBox->setChecked(value);
|
||||||
|
QObject::connect(_CheckBox, SIGNAL(toggled(bool)),
|
||||||
|
this, SLOT(updated()));
|
||||||
|
tunnelGridLayout->addLayout(horizontalLayout_2);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
//i2cp.leaseSetType -- type of LeaseSet to be sent. 1, 3 or 5. 1 by default
|
||||||
|
const QString& value=i2cpParameters.get_i2cp_leaseSetType();
|
||||||
|
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
|
||||||
|
horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
|
||||||
|
QLabel *_Label;
|
||||||
|
i2cp_leaseSetTypeLabel = _Label = new QLabel(gridLayoutWidget_2);
|
||||||
|
_Label->setObjectName(QStringLiteral("_Label"));
|
||||||
|
horizontalLayout_2->addWidget(_Label);
|
||||||
|
QLineEdit *_LineEdit;
|
||||||
|
i2cp_leaseSetTypeLineEdit = _LineEdit = new QLineEdit(gridLayoutWidget_2);
|
||||||
|
_LineEdit->setObjectName(QStringLiteral("_LineEdit"));
|
||||||
|
_LineEdit->setText(value);
|
||||||
|
_LineEdit->setMaximumWidth(80);
|
||||||
|
QObject::connect(_LineEdit, SIGNAL(textChanged(const QString &)),
|
||||||
|
this, SLOT(updated()));
|
||||||
|
horizontalLayout_2->addWidget(_LineEdit);
|
||||||
|
QSpacerItem * horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
horizontalLayout_2->addItem(horizontalSpacer);
|
||||||
|
tunnelGridLayout->addLayout(horizontalLayout_2);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
//i2cp.leaseSetEncType -- comma separated encryption types to be used in LeaseSet type 3 or 5. Identity's type by default
|
||||||
|
const QString& value=i2cpParameters.get_i2cp_leaseSetEncType();
|
||||||
|
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
|
||||||
|
horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
|
||||||
|
QLabel *_Label;
|
||||||
|
i2cp_leaseSetEncTypeLabel = _Label = new QLabel(gridLayoutWidget_2);
|
||||||
|
_Label->setObjectName(QStringLiteral("_Label"));
|
||||||
|
horizontalLayout_2->addWidget(_Label);
|
||||||
|
QLineEdit *_LineEdit;
|
||||||
|
i2cp_leaseSetEncTypeLineEdit = _LineEdit = new QLineEdit(gridLayoutWidget_2);
|
||||||
|
_LineEdit->setObjectName(QStringLiteral("_LineEdit"));
|
||||||
|
_LineEdit->setText(value);
|
||||||
|
_LineEdit->setMaximumWidth(80);
|
||||||
|
QObject::connect(_LineEdit, SIGNAL(textChanged(const QString &)),
|
||||||
|
this, SLOT(updated()));
|
||||||
|
horizontalLayout_2->addWidget(_LineEdit);
|
||||||
|
QSpacerItem * horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
horizontalLayout_2->addItem(horizontalSpacer);
|
||||||
|
tunnelGridLayout->addLayout(horizontalLayout_2);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
//i2cp.leaseSetPrivKey -- decryption key for encrypted LeaseSet in base64. PSK or private DH
|
||||||
|
const QString& value=i2cpParameters.get_i2cp_leaseSetPrivKey();
|
||||||
|
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
|
||||||
|
horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
|
||||||
|
QLabel *_Label;
|
||||||
|
i2cp_leaseSetPrivKeyLabel = _Label = new QLabel(gridLayoutWidget_2);
|
||||||
|
_Label->setObjectName(QStringLiteral("_Label"));
|
||||||
|
horizontalLayout_2->addWidget(_Label);
|
||||||
|
QLineEdit *_LineEdit;
|
||||||
|
i2cp_leaseSetPrivKeyLineEdit = _LineEdit = new QLineEdit(gridLayoutWidget_2);
|
||||||
|
_LineEdit->setObjectName(QStringLiteral("_LineEdit"));
|
||||||
|
_LineEdit->setText(value);
|
||||||
|
_LineEdit->setMaximumWidth(80);
|
||||||
|
QObject::connect(_LineEdit, SIGNAL(textChanged(const QString &)),
|
||||||
|
this, SLOT(updated()));
|
||||||
|
horizontalLayout_2->addWidget(_LineEdit);
|
||||||
|
QSpacerItem * horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
horizontalLayout_2->addItem(horizontalSpacer);
|
||||||
|
tunnelGridLayout->addLayout(horizontalLayout_2);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
//i2cp.leaseSetAuthType -- authentication type for encrypted LeaseSet. 0 - no authentication(default), 1 - DH, 2 - PSK
|
||||||
|
const QString& value=i2cpParameters.get_i2cp_leaseSetAuthType();
|
||||||
|
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
|
||||||
|
horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
|
||||||
|
QLabel *_Label;
|
||||||
|
i2cp_leaseSetAuthTypeLabel = _Label = new QLabel(gridLayoutWidget_2);
|
||||||
|
_Label->setObjectName(QStringLiteral("_Label"));
|
||||||
|
horizontalLayout_2->addWidget(_Label);
|
||||||
|
QLineEdit *_LineEdit;
|
||||||
|
i2cp_leaseSetAuthTypeLineEdit = _LineEdit = new QLineEdit(gridLayoutWidget_2);
|
||||||
|
_LineEdit->setObjectName(QStringLiteral("_LineEdit"));
|
||||||
|
_LineEdit->setText(value);
|
||||||
|
_LineEdit->setMaximumWidth(80);
|
||||||
|
QObject::connect(_LineEdit, SIGNAL(textChanged(const QString &)),
|
||||||
|
this, SLOT(updated()));
|
||||||
|
horizontalLayout_2->addWidget(_LineEdit);
|
||||||
|
QSpacerItem * horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
horizontalLayout_2->addItem(horizontalSpacer);
|
||||||
|
tunnelGridLayout->addLayout(horizontalLayout_2);
|
||||||
|
}
|
||||||
|
|
||||||
retranslateI2CPParameters();
|
retranslateI2CPParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include "QLineEdit"
|
#include "QLineEdit"
|
||||||
#include "QGroupBox"
|
#include "QGroupBox"
|
||||||
#include "QVBoxLayout"
|
#include "QVBoxLayout"
|
||||||
|
#include "QCheckBox"
|
||||||
|
|
||||||
#include "TunnelConfig.h"
|
#include "TunnelConfig.h"
|
||||||
|
|
||||||
@ -89,6 +90,27 @@ protected:
|
|||||||
QLabel * crypto_tagsToSendLabel;
|
QLabel * crypto_tagsToSendLabel;
|
||||||
QLineEdit * crypto_tagsToSendLineEdit;
|
QLineEdit * crypto_tagsToSendLineEdit;
|
||||||
|
|
||||||
|
QLabel * explicitPeersLabel;
|
||||||
|
QLineEdit * explicitPeersLineEdit;
|
||||||
|
|
||||||
|
QLabel * i2p_streaming_initialAckDelayLabel;
|
||||||
|
QLineEdit * i2p_streaming_initialAckDelayLineEdit;
|
||||||
|
|
||||||
|
QCheckBox * i2p_streaming_answerPingsCheckBox;
|
||||||
|
|
||||||
|
QLabel * i2cp_leaseSetTypeLabel;
|
||||||
|
QLineEdit * i2cp_leaseSetTypeLineEdit;
|
||||||
|
|
||||||
|
QLabel * i2cp_leaseSetEncTypeLabel;
|
||||||
|
QLineEdit * i2cp_leaseSetEncTypeLineEdit;
|
||||||
|
|
||||||
|
QLabel * i2cp_leaseSetPrivKeyLabel;
|
||||||
|
QLineEdit * i2cp_leaseSetPrivKeyLineEdit;
|
||||||
|
|
||||||
|
QLabel * i2cp_leaseSetAuthTypeLabel;
|
||||||
|
QLineEdit * i2cp_leaseSetAuthTypeLineEdit;
|
||||||
|
|
||||||
|
|
||||||
QString readTunnelTypeComboboxData();
|
QString readTunnelTypeComboboxData();
|
||||||
|
|
||||||
//should be created by factory
|
//should be created by factory
|
||||||
@ -105,6 +127,12 @@ public:
|
|||||||
i2cpParams.setOutbound_length(outbound_lengthLineEdit->text());
|
i2cpParams.setOutbound_length(outbound_lengthLineEdit->text());
|
||||||
i2cpParams.setOutbound_quantity(outbound_quantityLineEdit->text());
|
i2cpParams.setOutbound_quantity(outbound_quantityLineEdit->text());
|
||||||
i2cpParams.setCrypto_tagsToSend(crypto_tagsToSendLineEdit->text());
|
i2cpParams.setCrypto_tagsToSend(crypto_tagsToSendLineEdit->text());
|
||||||
|
i2cpParams.set_i2cp_leaseSetAuthType(i2cp_leaseSetAuthTypeLineEdit->text());
|
||||||
|
i2cpParams.set_i2cp_leaseSetEncType(i2cp_leaseSetEncTypeLineEdit->text());
|
||||||
|
i2cpParams.set_i2cp_leaseSetPrivKey(i2cp_leaseSetPrivKeyLineEdit->text());
|
||||||
|
i2cpParams.set_i2cp_leaseSetType(i2cp_leaseSetTypeLineEdit->text());
|
||||||
|
i2cpParams.set_i2p_streaming_answerPings(i2p_streaming_answerPingsCheckBox->isChecked());
|
||||||
|
i2cpParams.set_i2p_streaming_initialAckDelay(i2p_streaming_initialAckDelayLineEdit->text());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
@ -133,6 +161,13 @@ private:
|
|||||||
inbound_quantityLabel->setText(QApplication::translate("tunForm", "Number of inbound tunnels:", 0));;
|
inbound_quantityLabel->setText(QApplication::translate("tunForm", "Number of inbound tunnels:", 0));;
|
||||||
outbound_quantityLabel->setText(QApplication::translate("tunForm", "Number of outbound tunnels:", 0));;
|
outbound_quantityLabel->setText(QApplication::translate("tunForm", "Number of outbound tunnels:", 0));;
|
||||||
crypto_tagsToSendLabel->setText(QApplication::translate("tunForm", "Number of ElGamal/AES tags to send:", 0));;
|
crypto_tagsToSendLabel->setText(QApplication::translate("tunForm", "Number of ElGamal/AES tags to send:", 0));;
|
||||||
|
explicitPeersLabel->setText(QApplication::translate("tunForm", "List of comma-separated b64 addresses of peers to use:", 0));;
|
||||||
|
i2p_streaming_initialAckDelayLabel->setText(QApplication::translate("tunForm", "Milliseconds to wait before sending Ack:", 0));
|
||||||
|
i2p_streaming_answerPingsCheckBox->setText(QApplication::translate("tunForm", "Enable sending pongs", 0));
|
||||||
|
i2cp_leaseSetTypeLabel->setText(QApplication::translate("tunForm", "Type of LeaseSet to be sent. 1, 3 or 5:", 0));
|
||||||
|
i2cp_leaseSetEncTypeLabel->setText(QApplication::translate("tunForm", "Comma-separ. encr. types to be used in LeaseSet type 3 or 5:", 0));
|
||||||
|
i2cp_leaseSetPrivKeyLabel->setText(QApplication::translate("tunForm", "Decryption key for encrypted LeaseSet in base64. PSK or private DH:", 0));
|
||||||
|
i2cp_leaseSetAuthTypeLabel->setText(QApplication::translate("tunForm", "Auth type for encrypted LeaseSet. 0 - no auth, 1 - DH, 2 - PSK:", 0));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,8 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
|||||||
|
|
||||||
TARGET = i2pd_qt
|
TARGET = i2pd_qt
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
QMAKE_CXXFLAGS *= -std=c++11 -Wno-unused-parameter -Wno-maybe-uninitialized
|
QMAKE_CXXFLAGS *= -Wno-unused-parameter -Wno-maybe-uninitialized
|
||||||
|
CONFIG += strict_c++ c++11
|
||||||
|
|
||||||
DEFINES += USE_UPNP
|
DEFINES += USE_UPNP
|
||||||
|
|
||||||
|
@ -81,10 +81,10 @@ MainWindow::MainWindow(std::shared_ptr<std::iostream> logStream_, QWidget *paren
|
|||||||
onResize();
|
onResize();
|
||||||
|
|
||||||
ui->stackedWidget->setCurrentIndex(0);
|
ui->stackedWidget->setCurrentIndex(0);
|
||||||
ui->settingsScrollArea->resize(uiSettings->settingsContentsGridLayout->sizeHint().width()+10,380);
|
ui->settingsScrollArea->resize(uiSettings->settingsContentsQVBoxLayout->sizeHint().width()+10,380);
|
||||||
//QScrollBar* const barSett = ui->settingsScrollArea->verticalScrollBar();
|
//QScrollBar* const barSett = ui->settingsScrollArea->verticalScrollBar();
|
||||||
int w = 683;
|
int w = 683;
|
||||||
int h = 3060;
|
int h = 4250;
|
||||||
ui->settingsContents->setFixedSize(w, h);
|
ui->settingsContents->setFixedSize(w, h);
|
||||||
ui->settingsContents->setGeometry(QRect(0,0,w,h));
|
ui->settingsContents->setGeometry(QRect(0,0,w,h));
|
||||||
|
|
||||||
@ -159,12 +159,8 @@ MainWindow::MainWindow(std::shared_ptr<std::iostream> logStream_, QWidget *paren
|
|||||||
# define OPTION(section,option,defaultValueGetter) ConfigOption(QString(section),QString(option))
|
# define OPTION(section,option,defaultValueGetter) ConfigOption(QString(section),QString(option))
|
||||||
|
|
||||||
initFileChooser( OPTION("","conf",[](){return "";}), uiSettings->configFileLineEdit, uiSettings->configFileBrowsePushButton);
|
initFileChooser( OPTION("","conf",[](){return "";}), uiSettings->configFileLineEdit, uiSettings->configFileBrowsePushButton);
|
||||||
initFolderChooser( OPTION("","datadir",[]{return "";}), uiSettings->dataFolderLineEdit, uiSettings->dataFolderBrowsePushButton);
|
|
||||||
initFileChooser( OPTION("","tunconf",[](){return "";}), uiSettings->tunnelsConfigFileLineEdit, uiSettings->tunnelsConfigFileBrowsePushButton);
|
initFileChooser( OPTION("","tunconf",[](){return "";}), uiSettings->tunnelsConfigFileLineEdit, uiSettings->tunnelsConfigFileBrowsePushButton);
|
||||||
|
|
||||||
initFileChooser( OPTION("","pidfile",[]{return "";}), uiSettings->pidFileLineEdit, uiSettings->pidFileBrowsePushButton);
|
initFileChooser( OPTION("","pidfile",[]{return "";}), uiSettings->pidFileLineEdit, uiSettings->pidFileBrowsePushButton);
|
||||||
daemonOption=initNonGUIOption( OPTION("","daemon",[]{return "";}));
|
|
||||||
serviceOption=initNonGUIOption( OPTION("","service",[]{return "";}));
|
|
||||||
|
|
||||||
uiSettings->logDestinationComboBox->clear();
|
uiSettings->logDestinationComboBox->clear();
|
||||||
uiSettings->logDestinationComboBox->insertItems(0, QStringList()
|
uiSettings->logDestinationComboBox->insertItems(0, QStringList()
|
||||||
@ -176,20 +172,29 @@ MainWindow::MainWindow(std::shared_ptr<std::iostream> logStream_, QWidget *paren
|
|||||||
|
|
||||||
logFileNameOption=initFileChooser( OPTION("","logfile",[]{return "";}), uiSettings->logFileLineEdit, uiSettings->logFileBrowsePushButton);
|
logFileNameOption=initFileChooser( OPTION("","logfile",[]{return "";}), uiSettings->logFileLineEdit, uiSettings->logFileBrowsePushButton);
|
||||||
initLogLevelCombobox(OPTION("","loglevel",[]{return "";}), uiSettings->logLevelComboBox);
|
initLogLevelCombobox(OPTION("","loglevel",[]{return "";}), uiSettings->logLevelComboBox);
|
||||||
|
initCheckBox( OPTION("","logclftime",[]{return "false";}), uiSettings->logclftimeCheckBox);//"Write full CLF-formatted date and time to log (default: write only time)"
|
||||||
|
initFolderChooser( OPTION("","datadir",[]{return "";}), uiSettings->dataFolderLineEdit, uiSettings->dataFolderBrowsePushButton);
|
||||||
initIPAddressBox( OPTION("","host",[]{return "";}), uiSettings->routerExternalHostLineEdit, tr("Router external address -> Host"));
|
initIPAddressBox( OPTION("","host",[]{return "";}), uiSettings->routerExternalHostLineEdit, tr("Router external address -> Host"));
|
||||||
initTCPPortBox( OPTION("","port",[]{return "";}), uiSettings->routerExternalPortLineEdit, tr("Router external address -> Port"));
|
initTCPPortBox( OPTION("","port",[]{return "";}), uiSettings->routerExternalPortLineEdit, tr("Router external address -> Port"));
|
||||||
|
daemonOption=initNonGUIOption( OPTION("","daemon",[]{return "";}));
|
||||||
|
serviceOption=initNonGUIOption( OPTION("","service",[]{return "";}));
|
||||||
|
initStringBox( OPTION("","ifname4",[]{return "";}), uiSettings->ifname4LineEdit);//Network interface to bind to for IPv4
|
||||||
|
initStringBox( OPTION("","ifname6",[]{return "";}), uiSettings->ifname6LineEdit);//Network interface to bind to for IPv6
|
||||||
|
initCheckBox( OPTION("","nat",[]{return "true";}), uiSettings->natCheckBox);//If true, assume we are behind NAT. true by default
|
||||||
|
initCheckBox( OPTION("","ipv4",[]{return "true";}), uiSettings->ipv4CheckBox);//Enable communication through IPv4. true by default
|
||||||
initCheckBox( OPTION("","ipv6",[]{return "false";}), uiSettings->ipv6CheckBox);
|
initCheckBox( OPTION("","ipv6",[]{return "false";}), uiSettings->ipv6CheckBox);
|
||||||
initCheckBox( OPTION("","notransit",[]{return "false";}), uiSettings->notransitCheckBox);
|
initCheckBox( OPTION("","notransit",[]{return "false";}), uiSettings->notransitCheckBox);
|
||||||
initCheckBox( OPTION("","floodfill",[]{return "false";}), uiSettings->floodfillCheckBox);
|
initCheckBox( OPTION("","floodfill",[]{return "false";}), uiSettings->floodfillCheckBox);
|
||||||
initStringBox( OPTION("","bandwidth",[]{return "";}), uiSettings->bandwidthLineEdit);
|
initStringBox( OPTION("","bandwidth",[]{return "";}), uiSettings->bandwidthLineEdit);
|
||||||
|
initIntegerBox( OPTION("","share",[]{return "100";}), uiSettings->shareLineEdit, tr("Share"));//Max % of bandwidth limit for transit. 0-100. 100 by default
|
||||||
initStringBox( OPTION("","family",[]{return "";}), uiSettings->familyLineEdit);
|
initStringBox( OPTION("","family",[]{return "";}), uiSettings->familyLineEdit);
|
||||||
initIntegerBox( OPTION("","netid",[]{return "2";}), uiSettings->netIdLineEdit, tr("NetID"));
|
initIntegerBox( OPTION("","netid",[]{return "2";}), uiSettings->netIdLineEdit, tr("NetID"));
|
||||||
|
initCheckBox( OPTION("","ssu",[]{return "true";}), uiSettings->ssuCheckBox);//Enable SSU transport protocol (use UDP). true by default
|
||||||
|
initCheckBox( OPTION("","reservedrange",[]{return "true";}), uiSettings->reservedrange_checkbox);
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
initCheckBox( OPTION("","insomnia",[]{return "";}), uiSettings->insomniaCheckBox);
|
|
||||||
initNonGUIOption( OPTION("","svcctl",[]{return "";}));
|
initNonGUIOption( OPTION("","svcctl",[]{return "";}));
|
||||||
|
initCheckBox( OPTION("","insomnia",[]{return "";}), uiSettings->insomniaCheckBox);
|
||||||
initNonGUIOption( OPTION("","close",[]{return "";}));
|
initNonGUIOption( OPTION("","close",[]{return "";}));
|
||||||
#else
|
#else
|
||||||
uiSettings->insomniaCheckBox->setEnabled(false);
|
uiSettings->insomniaCheckBox->setEnabled(false);
|
||||||
@ -201,17 +206,22 @@ MainWindow::MainWindow(std::shared_ptr<std::iostream> logStream_, QWidget *paren
|
|||||||
initCheckBox( OPTION("http","auth",[]{return "";}), uiSettings->webconsoleBasicAuthCheckBox);
|
initCheckBox( OPTION("http","auth",[]{return "";}), uiSettings->webconsoleBasicAuthCheckBox);
|
||||||
initStringBox( OPTION("http","user",[]{return "i2pd";}), uiSettings->webconsoleUserNameLineEditBasicAuth);
|
initStringBox( OPTION("http","user",[]{return "i2pd";}), uiSettings->webconsoleUserNameLineEditBasicAuth);
|
||||||
initStringBox( OPTION("http","pass",[]{return "";}), uiSettings->webconsolePasswordLineEditBasicAuth);
|
initStringBox( OPTION("http","pass",[]{return "";}), uiSettings->webconsolePasswordLineEditBasicAuth);
|
||||||
|
initCheckBox( OPTION("http","strictheaders",[]{return "true";}), uiSettings->httpStrictHeadersCheckBox);//Enable strict host checking on WebUI. true by default
|
||||||
|
initStringBox( OPTION("http","hostname",[]{return "localhost";}), uiSettings->httpHostnameLineEdit);//Expected hostname for WebUI (default: localhost)
|
||||||
|
|
||||||
initCheckBox( OPTION("httpproxy","enabled",[]{return "";}), uiSettings->httpProxyEnabledCheckBox);
|
initCheckBox( OPTION("httpproxy","enabled",[]{return "";}), uiSettings->httpProxyEnabledCheckBox);
|
||||||
initIPAddressBox( OPTION("httpproxy","address",[]{return "";}), uiSettings->httpProxyAddressLineEdit, tr("HTTP proxy -> IP address"));
|
initIPAddressBox( OPTION("httpproxy","address",[]{return "";}), uiSettings->httpProxyAddressLineEdit, tr("HTTP proxy -> IP address"));
|
||||||
initTCPPortBox( OPTION("httpproxy","port",[]{return "4444";}), uiSettings->httpProxyPortLineEdit, tr("HTTP proxy -> Port"));
|
initTCPPortBox( OPTION("httpproxy","port",[]{return "4444";}), uiSettings->httpProxyPortLineEdit, tr("HTTP proxy -> Port"));
|
||||||
|
initCheckBox( OPTION("httpproxy","addresshelper",[]{return "true";}), uiSettings->httpProxyAddressHelperCheckBox);//Enable address helper (jump). true by default
|
||||||
initFileChooser( OPTION("httpproxy","keys",[]{return "";}), uiSettings->httpProxyKeyFileLineEdit, uiSettings->httpProxyKeyFilePushButton);
|
initFileChooser( OPTION("httpproxy","keys",[]{return "";}), uiSettings->httpProxyKeyFileLineEdit, uiSettings->httpProxyKeyFilePushButton);
|
||||||
|
|
||||||
initSignatureTypeCombobox(OPTION("httpproxy","signaturetype",[]{return "7";}), uiSettings->comboBox_httpPorxySignatureType);
|
initSignatureTypeCombobox(OPTION("httpproxy","signaturetype",[]{return "7";}), uiSettings->comboBox_httpPorxySignatureType);
|
||||||
initStringBox( OPTION("httpproxy","inbound.length",[]{return "3";}), uiSettings->httpProxyInboundTunnelsLenLineEdit);
|
initStringBox( OPTION("httpproxy","inbound.length",[]{return "3";}), uiSettings->httpProxyInboundTunnelsLenLineEdit);
|
||||||
initStringBox( OPTION("httpproxy","inbound.quantity",[]{return "5";}), uiSettings->httpProxyInboundTunnQuantityLineEdit);
|
initStringBox( OPTION("httpproxy","inbound.quantity",[]{return "5";}), uiSettings->httpProxyInboundTunnQuantityLineEdit);
|
||||||
initStringBox( OPTION("httpproxy","outbound.length",[]{return "3";}), uiSettings->httpProxyOutBoundTunnLenLineEdit);
|
initStringBox( OPTION("httpproxy","outbound.length",[]{return "3";}), uiSettings->httpProxyOutBoundTunnLenLineEdit);
|
||||||
initStringBox( OPTION("httpproxy","outbound.quantity",[]{return "5";}), uiSettings->httpProxyOutboundTunnQuantityLineEdit);
|
initStringBox( OPTION("httpproxy","outbound.quantity",[]{return "5";}), uiSettings->httpProxyOutboundTunnQuantityLineEdit);
|
||||||
|
initStringBox( OPTION("httpproxy","outproxy",[]{return "";}), uiSettings->httpProxyOutproxyLineEdit);//HTTP proxy upstream out proxy url (like http://false.i2p)
|
||||||
|
initStringBox( OPTION("httpproxy","i2cp.leaseSetType",[]{return "1";}), uiSettings->httpProxyI2cpLeaseSetTypeLineEdit);//Type of LeaseSet to be sent. 1, 3 or 5. 1 by default
|
||||||
|
initStringBox( OPTION("httpproxy","i2cp.leaseSetEncType",[]{return "";}), uiSettings->httpProxyI2cpLeaseSetEncTypeLineEdit);//Comma separated encryption types to be used in LeaseSet type 3 or 5
|
||||||
|
|
||||||
initCheckBox( OPTION("socksproxy","enabled",[]{return "";}), uiSettings->socksProxyEnabledCheckBox);
|
initCheckBox( OPTION("socksproxy","enabled",[]{return "";}), uiSettings->socksProxyEnabledCheckBox);
|
||||||
initIPAddressBox( OPTION("socksproxy","address",[]{return "";}), uiSettings->socksProxyAddressLineEdit, tr("Socks proxy -> IP address"));
|
initIPAddressBox( OPTION("socksproxy","address",[]{return "";}), uiSettings->socksProxyAddressLineEdit, tr("Socks proxy -> IP address"));
|
||||||
@ -224,10 +234,13 @@ MainWindow::MainWindow(std::shared_ptr<std::iostream> logStream_, QWidget *paren
|
|||||||
initStringBox( OPTION("socksproxy","outbound.quantity",[]{return "";}), uiSettings->socksProxyOutboundTunnQuantityLineEdit);
|
initStringBox( OPTION("socksproxy","outbound.quantity",[]{return "";}), uiSettings->socksProxyOutboundTunnQuantityLineEdit);
|
||||||
initIPAddressBox( OPTION("socksproxy","outproxy",[]{return "";}), uiSettings->outproxyAddressLineEdit, tr("Socks proxy -> Outproxy address"));
|
initIPAddressBox( OPTION("socksproxy","outproxy",[]{return "";}), uiSettings->outproxyAddressLineEdit, tr("Socks proxy -> Outproxy address"));
|
||||||
initTCPPortBox( OPTION("socksproxy","outproxyport",[]{return "";}), uiSettings->outproxyPortLineEdit, tr("Socks proxy -> Outproxy port"));
|
initTCPPortBox( OPTION("socksproxy","outproxyport",[]{return "";}), uiSettings->outproxyPortLineEdit, tr("Socks proxy -> Outproxy port"));
|
||||||
|
initStringBox( OPTION("socksproxy","i2cp.leaseSetType",[]{return "1";}), uiSettings->socksProxyI2cpLeaseSetTypeLineEdit);//Type of LeaseSet to be sent. 1, 3 or 5. 1 by default
|
||||||
|
initStringBox( OPTION("socksproxy","i2cp.leaseSetEncType",[]{return "";}), uiSettings->socksProxyI2cpLeaseSetEncTypeLineEdit);//Comma separated encryption types to be used in LeaseSet type 3 or 5
|
||||||
|
|
||||||
initCheckBox( OPTION("sam","enabled",[]{return "false";}), uiSettings->samEnabledCheckBox);
|
initCheckBox( OPTION("sam","enabled",[]{return "false";}), uiSettings->samEnabledCheckBox);
|
||||||
initIPAddressBox( OPTION("sam","address",[]{return "";}), uiSettings->samAddressLineEdit, tr("SAM -> IP address"));
|
initIPAddressBox( OPTION("sam","address",[]{return "";}), uiSettings->samAddressLineEdit, tr("SAM -> IP address"));
|
||||||
initTCPPortBox( OPTION("sam","port",[]{return "7656";}), uiSettings->samPortLineEdit, tr("SAM -> Port"));
|
initTCPPortBox( OPTION("sam","port",[]{return "7656";}), uiSettings->samPortLineEdit, tr("SAM -> Port"));
|
||||||
|
initCheckBox( OPTION("sam","singlethread",[]{return "true";}), uiSettings->samSingleThreadCheckBox);//If false every SAM session runs in own thread. true by default
|
||||||
|
|
||||||
initCheckBox( OPTION("bob","enabled",[]{return "false";}), uiSettings->bobEnabledCheckBox);
|
initCheckBox( OPTION("bob","enabled",[]{return "false";}), uiSettings->bobEnabledCheckBox);
|
||||||
initIPAddressBox( OPTION("bob","address",[]{return "";}), uiSettings->bobAddressLineEdit, tr("BOB -> IP address"));
|
initIPAddressBox( OPTION("bob","address",[]{return "";}), uiSettings->bobAddressLineEdit, tr("BOB -> IP address"));
|
||||||
@ -236,6 +249,7 @@ MainWindow::MainWindow(std::shared_ptr<std::iostream> logStream_, QWidget *paren
|
|||||||
initCheckBox( OPTION("i2cp","enabled",[]{return "false";}), uiSettings->i2cpEnabledCheckBox);
|
initCheckBox( OPTION("i2cp","enabled",[]{return "false";}), uiSettings->i2cpEnabledCheckBox);
|
||||||
initIPAddressBox( OPTION("i2cp","address",[]{return "";}), uiSettings->i2cpAddressLineEdit, tr("I2CP -> IP address"));
|
initIPAddressBox( OPTION("i2cp","address",[]{return "";}), uiSettings->i2cpAddressLineEdit, tr("I2CP -> IP address"));
|
||||||
initTCPPortBox( OPTION("i2cp","port",[]{return "7654";}), uiSettings->i2cpPortLineEdit, tr("I2CP -> Port"));
|
initTCPPortBox( OPTION("i2cp","port",[]{return "7654";}), uiSettings->i2cpPortLineEdit, tr("I2CP -> Port"));
|
||||||
|
//initCheckBox( OPTION("i2cp","singlethread",[]{return "true";}), uiSettings->i2cpSingleThreadCheckBox);//If false every I2CP session runs in own thread. true by default
|
||||||
|
|
||||||
initCheckBox( OPTION("i2pcontrol","enabled",[]{return "false";}), uiSettings->i2pControlEnabledCheckBox);
|
initCheckBox( OPTION("i2pcontrol","enabled",[]{return "false";}), uiSettings->i2pControlEnabledCheckBox);
|
||||||
initIPAddressBox( OPTION("i2pcontrol","address",[]{return "";}), uiSettings->i2pControlAddressLineEdit, tr("I2PControl -> IP address"));
|
initIPAddressBox( OPTION("i2pcontrol","address",[]{return "";}), uiSettings->i2pControlAddressLineEdit, tr("I2PControl -> IP address"));
|
||||||
@ -252,6 +266,9 @@ MainWindow::MainWindow(std::shared_ptr<std::iostream> logStream_, QWidget *paren
|
|||||||
initCheckBox( OPTION("reseed","verify",[]{return "";}), uiSettings->reseedVerifyCheckBox);
|
initCheckBox( OPTION("reseed","verify",[]{return "";}), uiSettings->reseedVerifyCheckBox);
|
||||||
initFileChooser( OPTION("reseed","file",[]{return "";}), uiSettings->reseedFileLineEdit, uiSettings->reseedFileBrowsePushButton);
|
initFileChooser( OPTION("reseed","file",[]{return "";}), uiSettings->reseedFileLineEdit, uiSettings->reseedFileBrowsePushButton);
|
||||||
initStringBox( OPTION("reseed","urls",[]{return "";}), uiSettings->reseedURLsLineEdit);
|
initStringBox( OPTION("reseed","urls",[]{return "";}), uiSettings->reseedURLsLineEdit);
|
||||||
|
initFileChooser( OPTION("reseed","zipfile",[]{return "";}), uiSettings->reseedZipFileLineEdit, uiSettings->reseedZipFileBrowsePushButton); //Path to local .zip file to reseed from
|
||||||
|
initUInt16Box( OPTION("reseed","threshold",[]{return "25";}), uiSettings->reseedThresholdNumberLineEdit, tr("reseedThreshold")); //Minimum number of known routers before requesting reseed. 25 by default
|
||||||
|
initStringBox( OPTION("reseed","proxy",[]{return "";}), uiSettings->reseedProxyLineEdit);//URL for https/socks reseed proxy
|
||||||
|
|
||||||
initStringBox( OPTION("addressbook","defaulturl",[]{return "";}), uiSettings->addressbookDefaultURLLineEdit);
|
initStringBox( OPTION("addressbook","defaulturl",[]{return "";}), uiSettings->addressbookDefaultURLLineEdit);
|
||||||
initStringBox( OPTION("addressbook","subscriptions",[]{return "";}), uiSettings->addressbookSubscriptionsURLslineEdit);
|
initStringBox( OPTION("addressbook","subscriptions",[]{return "";}), uiSettings->addressbookSubscriptionsURLslineEdit);
|
||||||
@ -265,6 +282,26 @@ MainWindow::MainWindow(std::shared_ptr<std::iostream> logStream_, QWidget *paren
|
|||||||
initStringBox( OPTION("trust","routers",[]{return "";}), uiSettings->lineEditTrustRouters);
|
initStringBox( OPTION("trust","routers",[]{return "";}), uiSettings->lineEditTrustRouters);
|
||||||
initCheckBox( OPTION("trust","hidden",[]{return "false";}), uiSettings->checkBoxTrustHidden);
|
initCheckBox( OPTION("trust","hidden",[]{return "false";}), uiSettings->checkBoxTrustHidden);
|
||||||
|
|
||||||
|
initCheckBox( OPTION("websockets","enabled",[]{return "false";}), uiSettings->checkBoxWebsocketsEnable); //Enable websocket server. Disabled by default
|
||||||
|
initIPAddressBox( OPTION("websockets","address",[]{return "127.0.0.1";}), uiSettings->websocketsAddressLineEdit, tr("Websockets -> IP address")); //Address to bind websocket server on. 127.0.0.1 by default
|
||||||
|
initTCPPortBox( OPTION("websockets","port",[]{return "7666";}), uiSettings->websocketsPortLineEdit, tr("Websockets -> Port")); //Port to bind websocket server on. 7666 by default
|
||||||
|
|
||||||
|
initIntegerBox( OPTION("exploratory","inbound.length",[]{return "2";}), uiSettings->exploratoryInboundTunnelsLengthNumberLineEdit, tr("exploratoryInboundTunnelsLength"));//Exploratory inbound tunnels length. 2 by default
|
||||||
|
initIntegerBox( OPTION("exploratory","inbound.quantity",[]{return "3";}), uiSettings->exploratoryInboundTunnelsQuantityNumberLineEdit, tr("exploratoryInboundTunnelsQuantity"));//Exploratory inbound tunnels quantity. 3 by default
|
||||||
|
initIntegerBox( OPTION("exploratory","outbound.length",[]{return "2";}), uiSettings->exploratoryOutboundTunnelsLengthNumberLineEdit, tr("exploratoryOutboundTunnelsLength"));//Exploratory outbound tunnels length. 2 by default
|
||||||
|
initIntegerBox( OPTION("exploratory","outbound.quantity",[]{return "3";}), uiSettings->exploratoryOutboundTunnelsQuantityNumberLineEdit, tr("exploratoryOutboundTunnelsQuantity"));//Exploratory outbound tunnels length. 3 by default
|
||||||
|
|
||||||
|
initCheckBox( OPTION("ntcp2","enabled",[]{return "true";}), uiSettings->checkBoxNtcp2Enable); //Enable NTCP2. Enabled by default
|
||||||
|
initCheckBox( OPTION("ntcp2","published",[]{return "false";}), uiSettings->checkBoxNtcp2Published); //Enable incoming NTCP2 connections. Disabled by default
|
||||||
|
initTCPPortBox( OPTION("ntcp2","port",[]{return "0";}), uiSettings->ntcp2PortLineEdit, tr("NTCP2 -> Port")); //Port to listen for incoming NTCP2 connections (default: auto)
|
||||||
|
initIPAddressBox( OPTION("ntcp2","addressv6",[]{return "::";}), uiSettings->ntcp2AddressV6LineEdit, tr("NTCP2 -> IPv6 address")); //External IPv6 for incoming connections
|
||||||
|
initStringBox( OPTION("ntcp2","proxy",[]{return "";}), uiSettings->lineEditNtcp2Proxy); //Specify proxy server for NTCP2. Should be http://address:port or socks://address:port
|
||||||
|
|
||||||
|
initCheckBox( OPTION("nettime","enabled",[]{return "false";}), uiSettings->checkBoxNettimeEnable); //Enable NTP sync. Disabled by default
|
||||||
|
initStringBox( OPTION("nettime","ntpservers",[]{return "pool.ntp.org";}), uiSettings->lineEditNetTimeNtpServers); //Comma-separated list of NTP servers. pool.ntp.org by default
|
||||||
|
initIntegerBox( OPTION("nettime","ntpsyncinterval",[]{return "72";}), uiSettings->nettimeNtpSyncIntervalNumberLineEdit, tr("nettimeNtpSyncInterval")); //NTP time sync interval in hours. 72 by default
|
||||||
|
|
||||||
|
initCheckBox( OPTION("persist","profiles",[]{return "true";}), uiSettings->checkBoxPersistProfiles);//Enable peer profile persisting to disk. Enabled by default
|
||||||
# undef OPTION
|
# undef OPTION
|
||||||
|
|
||||||
//widgetlocks.add(new widgetlock(widget,lockbtn));
|
//widgetlocks.add(new widgetlock(widget,lockbtn));
|
||||||
@ -287,6 +324,18 @@ MainWindow::MainWindow(std::shared_ptr<std::iostream> logStream_, QWidget *paren
|
|||||||
|
|
||||||
ui->tunnelsScrollAreaWidgetContents->setGeometry(QRect(0, 0, 621, 451));
|
ui->tunnelsScrollAreaWidgetContents->setGeometry(QRect(0, 0, 621, 451));
|
||||||
|
|
||||||
|
ui->tunnelsScrollAreaWidgetContents->setStyleSheet("QGroupBox { " \
|
||||||
|
" font: bold;" \
|
||||||
|
" border: 1px solid silver;" \
|
||||||
|
" border-radius: 6px;" \
|
||||||
|
" margin-top: 6px;" \
|
||||||
|
"}" \
|
||||||
|
"QGroupBox::title {" \
|
||||||
|
" subcontrol-origin: margin;" \
|
||||||
|
" left: 7px;" \
|
||||||
|
" padding: 0px 5px 0px 5px;" \
|
||||||
|
"}");
|
||||||
|
|
||||||
appendTunnelForms("");
|
appendTunnelForms("");
|
||||||
|
|
||||||
uiSettings->configFileLineEdit->setEnabled(false);
|
uiSettings->configFileLineEdit->setEnabled(false);
|
||||||
@ -666,7 +715,7 @@ void MainWindow::layoutTunnels() {
|
|||||||
int height=0;
|
int height=0;
|
||||||
ui->tunnelsScrollAreaWidgetContents->setGeometry(0,0,0,0);
|
ui->tunnelsScrollAreaWidgetContents->setGeometry(0,0,0,0);
|
||||||
for(std::map<std::string, TunnelConfig*>::iterator it = tunnelConfigs.begin(); it != tunnelConfigs.end(); ++it) {
|
for(std::map<std::string, TunnelConfig*>::iterator it = tunnelConfigs.begin(); it != tunnelConfigs.end(); ++it) {
|
||||||
const std::string& name=it->first;
|
//const std::string& name=it->first;
|
||||||
TunnelConfig* tunconf = it->second;
|
TunnelConfig* tunconf = it->second;
|
||||||
TunnelPane * tunnelPane=tunconf->getTunnelPane();
|
TunnelPane * tunnelPane=tunconf->getTunnelPane();
|
||||||
if(!tunnelPane)continue;
|
if(!tunnelPane)continue;
|
||||||
|
@ -104,7 +104,8 @@ class MainWindowItem : public QObject {
|
|||||||
QWidget* widgetToFocus;
|
QWidget* widgetToFocus;
|
||||||
QString requirementToBeValid;
|
QString requirementToBeValid;
|
||||||
public:
|
public:
|
||||||
MainWindowItem(ConfigOption option_, QWidget* widgetToFocus_, QString requirementToBeValid_) : option(option_), widgetToFocus(widgetToFocus_), requirementToBeValid(requirementToBeValid_) {}
|
MainWindowItem(ConfigOption option_, QWidget* widgetToFocus_, QString requirementToBeValid_) :
|
||||||
|
option(option_), widgetToFocus(widgetToFocus_), requirementToBeValid(requirementToBeValid_) {}
|
||||||
QWidget* getWidgetToFocus(){return widgetToFocus;}
|
QWidget* getWidgetToFocus(){return widgetToFocus;}
|
||||||
QString& getRequirementToBeValid() { return requirementToBeValid; }
|
QString& getRequirementToBeValid() { return requirementToBeValid; }
|
||||||
ConfigOption& getConfigOption() { return option; }
|
ConfigOption& getConfigOption() { return option; }
|
||||||
@ -115,7 +116,7 @@ public:
|
|||||||
std::string optName="";
|
std::string optName="";
|
||||||
if(!option.section.isEmpty())optName=option.section.toStdString()+std::string(".");
|
if(!option.section.isEmpty())optName=option.section.toStdString()+std::string(".");
|
||||||
optName+=option.option.toStdString();
|
optName+=option.option.toStdString();
|
||||||
//qDebug() << "loadFromConfigOption[" << optName.c_str() << "]";
|
qDebug() << "loadFromConfigOption[" << optName.c_str() << "]";
|
||||||
boost::any programOption;
|
boost::any programOption;
|
||||||
i2p::config::GetOptionAsAny(optName, programOption);
|
i2p::config::GetOptionAsAny(optName, programOption);
|
||||||
optionValue=programOption.empty()?boost::any(std::string(""))
|
optionValue=programOption.empty()?boost::any(std::string(""))
|
||||||
@ -280,6 +281,7 @@ public:
|
|||||||
virtual void installListeners(MainWindow *mainWindow);
|
virtual void installListeners(MainWindow *mainWindow);
|
||||||
virtual void loadFromConfigOption(){
|
virtual void loadFromConfigOption(){
|
||||||
MainWindowItem::loadFromConfigOption();
|
MainWindowItem::loadFromConfigOption();
|
||||||
|
qDebug() << "setting value for checkbox " << checkBox->text();
|
||||||
checkBox->setChecked(boost::any_cast<bool>(optionValue));
|
checkBox->setChecked(boost::any_cast<bool>(optionValue));
|
||||||
}
|
}
|
||||||
virtual void saveToStringStream(std::stringstream& out){
|
virtual void saveToStringStream(std::stringstream& out){
|
||||||
@ -543,6 +545,18 @@ private:
|
|||||||
void deleteTunnelForms();
|
void deleteTunnelForms();
|
||||||
void deleteTunnelFromUI(std::string tunnelName, TunnelConfig* cnf);
|
void deleteTunnelFromUI(std::string tunnelName, TunnelConfig* cnf);
|
||||||
|
|
||||||
|
template<typename Section>
|
||||||
|
std::string GetI2CPOption (const Section& section, const std::string& name, const std::string& value) const
|
||||||
|
{
|
||||||
|
return section.second.get (boost::property_tree::ptree::path_type (name, '/'), value);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename Section>
|
||||||
|
std::string GetI2CPOption (const Section& section, const std::string& name, const char* value) const
|
||||||
|
{
|
||||||
|
return section.second.get (boost::property_tree::ptree::path_type (name, '/'), std::string (value));
|
||||||
|
}
|
||||||
|
|
||||||
template<typename Section, typename Type>
|
template<typename Section, typename Type>
|
||||||
std::string GetI2CPOption (const Section& section, const std::string& name, const Type& value) const
|
std::string GetI2CPOption (const Section& section, const std::string& name, const Type& value) const
|
||||||
{
|
{
|
||||||
@ -563,6 +577,19 @@ private:
|
|||||||
param.setOutbound_quantity(QString(_OUTBOUND_TUNNELS_QUANTITY.c_str()));
|
param.setOutbound_quantity(QString(_OUTBOUND_TUNNELS_QUANTITY.c_str()));
|
||||||
std::string _TAGS_TO_SEND = options[I2CP_PARAM_TAGS_TO_SEND] = GetI2CPOption (section, I2CP_PARAM_TAGS_TO_SEND, DEFAULT_TAGS_TO_SEND);
|
std::string _TAGS_TO_SEND = options[I2CP_PARAM_TAGS_TO_SEND] = GetI2CPOption (section, I2CP_PARAM_TAGS_TO_SEND, DEFAULT_TAGS_TO_SEND);
|
||||||
param.setCrypto_tagsToSend(QString(_TAGS_TO_SEND.c_str()));
|
param.setCrypto_tagsToSend(QString(_TAGS_TO_SEND.c_str()));
|
||||||
|
std::string _i2cp_leaseSetAuthType = options[I2CP_PARAM_LEASESET_AUTH_TYPE] = GetI2CPOption (section, I2CP_PARAM_LEASESET_AUTH_TYPE, 0);
|
||||||
|
param.set_i2cp_leaseSetAuthType(QString(_i2cp_leaseSetAuthType.c_str()));
|
||||||
|
const char DEFAULT_LEASESET_ENCRYPTION_TYPE[] = "";
|
||||||
|
std::string _i2cp_leaseSetEncType = options[I2CP_PARAM_LEASESET_ENCRYPTION_TYPE] = GetI2CPOption (section, I2CP_PARAM_LEASESET_ENCRYPTION_TYPE, DEFAULT_LEASESET_ENCRYPTION_TYPE);//todo Identity's type by default
|
||||||
|
param.set_i2cp_leaseSetEncType(QString(_i2cp_leaseSetEncType.c_str()));
|
||||||
|
std::string _i2cp_leaseSetPrivKey = options[I2CP_PARAM_LEASESET_PRIV_KEY] = GetI2CPOption (section, I2CP_PARAM_LEASESET_PRIV_KEY, "");
|
||||||
|
param.set_i2cp_leaseSetPrivKey(QString(_i2cp_leaseSetPrivKey.c_str()));
|
||||||
|
std::string _i2cp_leaseSetType = options[I2CP_PARAM_LEASESET_TYPE] = GetI2CPOption (section, I2CP_PARAM_LEASESET_TYPE, DEFAULT_LEASESET_TYPE);
|
||||||
|
param.set_i2cp_leaseSetType(QString(_i2cp_leaseSetType.c_str()));
|
||||||
|
std::string _i2p_streaming_answerPings= options[I2CP_PARAM_STREAMING_ANSWER_PINGS] = GetI2CPOption (section, I2CP_PARAM_STREAMING_ANSWER_PINGS, DEFAULT_ANSWER_PINGS);
|
||||||
|
param.set_i2p_streaming_answerPings((_i2p_streaming_answerPings.compare("true")==0)||(_i2p_streaming_answerPings.compare("yes")==0));
|
||||||
|
std::string _i2p_streaming_initialAckDelay = options[I2CP_PARAM_STREAMING_INITIAL_ACK_DELAY] = GetI2CPOption (section, I2CP_PARAM_STREAMING_INITIAL_ACK_DELAY, DEFAULT_INITIAL_ACK_DELAY);
|
||||||
|
param.set_i2p_streaming_initialAckDelay(QString(_i2p_streaming_initialAckDelay.c_str()));
|
||||||
options[I2CP_PARAM_MIN_TUNNEL_LATENCY] = GetI2CPOption(section, I2CP_PARAM_MIN_TUNNEL_LATENCY, DEFAULT_MIN_TUNNEL_LATENCY);//TODO include into param
|
options[I2CP_PARAM_MIN_TUNNEL_LATENCY] = GetI2CPOption(section, I2CP_PARAM_MIN_TUNNEL_LATENCY, DEFAULT_MIN_TUNNEL_LATENCY);//TODO include into param
|
||||||
options[I2CP_PARAM_MAX_TUNNEL_LATENCY] = GetI2CPOption(section, I2CP_PARAM_MAX_TUNNEL_LATENCY, DEFAULT_MAX_TUNNEL_LATENCY);//TODO include into param
|
options[I2CP_PARAM_MAX_TUNNEL_LATENCY] = GetI2CPOption(section, I2CP_PARAM_MAX_TUNNEL_LATENCY, DEFAULT_MAX_TUNNEL_LATENCY);//TODO include into param
|
||||||
}
|
}
|
||||||
@ -580,6 +607,17 @@ private:
|
|||||||
param.setOutbound_quantity(QString::number(_OUTBOUND_TUNNELS_QUANTITY));
|
param.setOutbound_quantity(QString::number(_OUTBOUND_TUNNELS_QUANTITY));
|
||||||
const int _TAGS_TO_SEND = DEFAULT_TAGS_TO_SEND;
|
const int _TAGS_TO_SEND = DEFAULT_TAGS_TO_SEND;
|
||||||
param.setCrypto_tagsToSend(QString::number(_TAGS_TO_SEND));
|
param.setCrypto_tagsToSend(QString::number(_TAGS_TO_SEND));
|
||||||
|
const int _i2cp_leaseSetAuthType = 0;
|
||||||
|
param.set_i2cp_leaseSetAuthType(QString::number(_i2cp_leaseSetAuthType));
|
||||||
|
const QString _i2cp_leaseSetEncType = "0,4"; //todo Identity's type by default
|
||||||
|
param.set_i2cp_leaseSetEncType(_i2cp_leaseSetEncType);
|
||||||
|
param.set_i2cp_leaseSetPrivKey("");
|
||||||
|
const int _i2cp_leaseSetType = DEFAULT_LEASESET_TYPE;
|
||||||
|
param.set_i2cp_leaseSetType(QString::number(_i2cp_leaseSetType));
|
||||||
|
bool _i2p_streaming_answerPings= DEFAULT_ANSWER_PINGS;
|
||||||
|
param.set_i2p_streaming_answerPings(_i2p_streaming_answerPings);
|
||||||
|
const int _i2p_streaming_initialAckDelay = DEFAULT_INITIAL_ACK_DELAY;
|
||||||
|
param.set_i2p_streaming_initialAckDelay(QString::number(_i2p_streaming_initialAckDelay));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -613,6 +651,7 @@ private:
|
|||||||
std::string keys = "";
|
std::string keys = "";
|
||||||
std::string address = "127.0.0.1";
|
std::string address = "127.0.0.1";
|
||||||
int destinationPort = 0;
|
int destinationPort = 0;
|
||||||
|
int cryptoType = 0;
|
||||||
i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA256_P256;
|
i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA256_P256;
|
||||||
// I2CP
|
// I2CP
|
||||||
I2CPParameters i2cpParameters;
|
I2CPParameters i2cpParameters;
|
||||||
@ -624,7 +663,8 @@ private:
|
|||||||
keys,
|
keys,
|
||||||
address,
|
address,
|
||||||
destinationPort,
|
destinationPort,
|
||||||
sigType);
|
sigType,
|
||||||
|
cryptoType);
|
||||||
|
|
||||||
saveAllConfigs(true, name);
|
saveAllConfigs(true, name);
|
||||||
}
|
}
|
||||||
@ -643,6 +683,7 @@ private:
|
|||||||
i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA256_P256;
|
i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA256_P256;
|
||||||
std::string address = "127.0.0.1";
|
std::string address = "127.0.0.1";
|
||||||
bool isUniqueLocal = true;
|
bool isUniqueLocal = true;
|
||||||
|
int cryptoType = 0;
|
||||||
|
|
||||||
// I2CP
|
// I2CP
|
||||||
I2CPParameters i2cpParameters;
|
I2CPParameters i2cpParameters;
|
||||||
@ -659,7 +700,8 @@ private:
|
|||||||
gzip,
|
gzip,
|
||||||
sigType,
|
sigType,
|
||||||
address,
|
address,
|
||||||
isUniqueLocal);
|
isUniqueLocal,
|
||||||
|
cryptoType);
|
||||||
|
|
||||||
|
|
||||||
saveAllConfigs(true, name);
|
saveAllConfigs(true, name);
|
||||||
@ -712,6 +754,7 @@ private:
|
|||||||
// optional params
|
// optional params
|
||||||
std::string keys = section.second.get (I2P_CLIENT_TUNNEL_KEYS, "");
|
std::string keys = section.second.get (I2P_CLIENT_TUNNEL_KEYS, "");
|
||||||
std::string address = section.second.get (I2P_CLIENT_TUNNEL_ADDRESS, "127.0.0.1");
|
std::string address = section.second.get (I2P_CLIENT_TUNNEL_ADDRESS, "127.0.0.1");
|
||||||
|
int cryptoType = section.second.get<int>(I2P_CLIENT_TUNNEL_CRYPTO_TYPE, 0);
|
||||||
int destinationPort = section.second.get<int>(I2P_CLIENT_TUNNEL_DESTINATION_PORT, 0);
|
int destinationPort = section.second.get<int>(I2P_CLIENT_TUNNEL_DESTINATION_PORT, 0);
|
||||||
std::cout << "had read tunnel destinationPort: " << destinationPort << std::endl;
|
std::cout << "had read tunnel destinationPort: " << destinationPort << std::endl;
|
||||||
i2p::data::SigningKeyType sigType = section.second.get (I2P_CLIENT_TUNNEL_SIGNATURE_TYPE, i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA256_P256);
|
i2p::data::SigningKeyType sigType = section.second.get (I2P_CLIENT_TUNNEL_SIGNATURE_TYPE, i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA256_P256);
|
||||||
@ -726,7 +769,8 @@ private:
|
|||||||
keys,
|
keys,
|
||||||
address,
|
address,
|
||||||
destinationPort,
|
destinationPort,
|
||||||
sigType);
|
sigType,
|
||||||
|
cryptoType);
|
||||||
}
|
}
|
||||||
else if (type == I2P_TUNNELS_SECTION_TYPE_SERVER
|
else if (type == I2P_TUNNELS_SECTION_TYPE_SERVER
|
||||||
|| type == I2P_TUNNELS_SECTION_TYPE_HTTP
|
|| type == I2P_TUNNELS_SECTION_TYPE_HTTP
|
||||||
@ -746,6 +790,7 @@ private:
|
|||||||
i2p::data::SigningKeyType sigType = section.second.get (I2P_SERVER_TUNNEL_SIGNATURE_TYPE, i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA256_P256);
|
i2p::data::SigningKeyType sigType = section.second.get (I2P_SERVER_TUNNEL_SIGNATURE_TYPE, i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA256_P256);
|
||||||
std::string address = section.second.get<std::string> (I2P_SERVER_TUNNEL_ADDRESS, "127.0.0.1");
|
std::string address = section.second.get<std::string> (I2P_SERVER_TUNNEL_ADDRESS, "127.0.0.1");
|
||||||
bool isUniqueLocal = section.second.get(I2P_SERVER_TUNNEL_ENABLE_UNIQUE_LOCAL, true);
|
bool isUniqueLocal = section.second.get(I2P_SERVER_TUNNEL_ENABLE_UNIQUE_LOCAL, true);
|
||||||
|
int cryptoType = section.second.get<int>(I2P_CLIENT_TUNNEL_CRYPTO_TYPE, 0);
|
||||||
|
|
||||||
// I2CP
|
// I2CP
|
||||||
std::map<std::string, std::string> options;
|
std::map<std::string, std::string> options;
|
||||||
@ -779,7 +824,8 @@ private:
|
|||||||
gzip,
|
gzip,
|
||||||
sigType,
|
sigType,
|
||||||
address,
|
address,
|
||||||
isUniqueLocal);
|
isUniqueLocal,
|
||||||
|
cryptoType);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LogPrint (eLogWarning, "Clients: Unknown section type=", type, " of ", name, " in ", tunConf);//TODO show err box and disable the tunn gui
|
LogPrint (eLogWarning, "Clients: Unknown section type=", type, " of ", name, " in ", tunConf);//TODO show err box and disable the tunn gui
|
||||||
|
Loading…
Reference in New Issue
Block a user