mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 06:09:09 -04:00
Add I2P BOB support to libretroashare and RetroShare GUI
This commit is contained in:
parent
9ff81b9e93
commit
a3ee85a30d
31 changed files with 4150 additions and 959 deletions
|
@ -149,6 +149,8 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
|
|||
connect(ui.node_input, SIGNAL(textChanged(QString)), this, SLOT(updateCheckLabels()));
|
||||
connect(ui.reuse_existing_node_CB, SIGNAL(toggled(bool)), this, SLOT(updateCheckLabels()));
|
||||
|
||||
connect(ui.cbUseBob, SIGNAL(clicked(bool)), this, SLOT(useBobChecked(bool)));;
|
||||
|
||||
entropy_timer = new QTimer ;
|
||||
entropy_timer->start(20) ;
|
||||
QObject::connect(entropy_timer,SIGNAL(timeout()),this,SLOT(grabMouse())) ;
|
||||
|
@ -240,7 +242,7 @@ void GenCertDialog::mouseMoveEvent(QMouseEvent *e)
|
|||
|
||||
void GenCertDialog::setupState()
|
||||
{
|
||||
bool adv_state = ui.adv_checkbox->isChecked();
|
||||
bool adv_state = ui.adv_checkbox->isChecked();
|
||||
|
||||
if(!adv_state)
|
||||
{
|
||||
|
@ -300,6 +302,7 @@ void GenCertDialog::setupState()
|
|||
ui.hiddenaddr_label->setVisible(hidden_state);
|
||||
ui.hiddenport_label->setVisible(hidden_state);
|
||||
ui.hiddenport_spinBox->setVisible(hidden_state);
|
||||
ui.cbUseBob->setVisible(hidden_state);
|
||||
|
||||
if(mEntropyOk && mAllFieldsOk)
|
||||
{
|
||||
|
@ -379,7 +382,22 @@ void GenCertDialog::updateCheckLabels()
|
|||
else
|
||||
ui.randomness_check_LB->setPixmap(QPixmap(IMAGE_BAD)) ;
|
||||
|
||||
setupState();
|
||||
setupState();
|
||||
}
|
||||
|
||||
void GenCertDialog::useBobChecked(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
ui.hiddenaddr_input->setPlaceholderText(tr("I2P instance address with BOB enabled"));
|
||||
ui.hiddenaddr_label->setText(tr("I2P instance address"));
|
||||
|
||||
ui.hiddenport_spinBox->setEnabled(false);
|
||||
} else {
|
||||
ui.hiddenaddr_input->setPlaceholderText(tr("hidden service address"));
|
||||
ui.hiddenaddr_label->setText(tr("hidden address"));
|
||||
|
||||
ui.hiddenport_spinBox->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
bool GenCertDialog::importIdentity()
|
||||
|
@ -454,15 +472,13 @@ void GenCertDialog::genPerson()
|
|||
{
|
||||
std::string hl = ui.hiddenaddr_input->text().toStdString();
|
||||
uint16_t port = ui.hiddenport_spinBox->value();
|
||||
if (!RsInit::SetHiddenLocation(hl, port)) /* parses it */
|
||||
{
|
||||
/* Message Dialog */
|
||||
QMessageBox::warning(this,
|
||||
tr("Invalid hidden node"),
|
||||
tr("Please enter a valid address of the form: 31769173498.onion:7800 or [52 characters].b32.i2p"),
|
||||
QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
bool useBob = ui.cbUseBob->isChecked();
|
||||
|
||||
if (useBob && hl.empty())
|
||||
hl = "127.0.0.1";
|
||||
|
||||
RsInit::SetHiddenLocation(hl, port, useBob); /* parses it */
|
||||
|
||||
isHiddenLoc = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ private slots:
|
|||
void switchReuseExistingNode();
|
||||
void grabMouse();
|
||||
void updateCheckLabels();
|
||||
void useBobChecked(bool checked);
|
||||
|
||||
private:
|
||||
void initKeyList();
|
||||
|
|
|
@ -450,6 +450,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbUseBob">
|
||||
<property name="text">
|
||||
<string>Use BOB</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="9" column="2">
|
||||
|
|
|
@ -487,6 +487,20 @@ void NotifyQt::notifyChatLobbyTimeShift(int shift)
|
|||
emit chatLobbyTimeShift(shift) ;
|
||||
}
|
||||
|
||||
void NotifyQt::notifyConnectionWithoutCert()
|
||||
{
|
||||
{
|
||||
QMutexLocker m(&_mutex) ;
|
||||
if(!_enabled)
|
||||
return ;
|
||||
}
|
||||
|
||||
#ifdef NOTIFY_DEBUG
|
||||
std::cerr << "notifyQt: Received notifyConnectionWithoutCert" << std::endl;
|
||||
#endif
|
||||
emit connectionWithoutCert();
|
||||
}
|
||||
|
||||
void NotifyQt::handleChatLobbyTimeShift(int /*shift*/)
|
||||
{
|
||||
return ; // we say nothing. The help dialog of lobbies explains this already.
|
||||
|
|
|
@ -52,6 +52,7 @@ class NotifyQt: public QObject, public NotifyClient
|
|||
virtual void notifyOwnAvatarChanged() ;
|
||||
virtual void notifyChatLobbyEvent(uint64_t /* lobby id */, uint32_t /* event type */, const RsGxsId & /*nickname*/, const std::string& /* any string */) ;
|
||||
virtual void notifyChatLobbyTimeShift(int time_shift) ;
|
||||
void notifyConnectionWithoutCert();
|
||||
|
||||
virtual void notifyOwnStatusMessageChanged() ;
|
||||
virtual void notifyDiskFull(uint32_t loc,uint32_t size_in_mb) ;
|
||||
|
@ -143,6 +144,7 @@ class NotifyQt: public QObject, public NotifyClient
|
|||
void chatLobbyInviteReceived() ;
|
||||
void deferredSignatureHandlingRequested() ;
|
||||
void chatLobbyTimeShift(int time_shift) ;
|
||||
void connectionWithoutCert();
|
||||
|
||||
/* Notify from GUI */
|
||||
void chatFontChanged();
|
||||
|
|
|
@ -519,6 +519,21 @@ ServerPage QPlainTextEdit#plainTextEdit {
|
|||
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFFD7, stop:1 #FFFFB2);
|
||||
}
|
||||
|
||||
ServerPage QPlainTextEdit#hiddenpageInHelpPlainTextEdit {
|
||||
border: 1px solid #DCDC41;
|
||||
border-radius: 6px;
|
||||
background: #FFFFD7;
|
||||
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFFD7, stop:1 #FFFFB2);
|
||||
}
|
||||
|
||||
ServerPage QPlainTextEdit#pteBobSimple {
|
||||
border: 1px solid #DCDC41;
|
||||
border-radius: 6px;
|
||||
background: #FFFFD7;
|
||||
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFFD7, stop:1 #FFFFB2);
|
||||
}
|
||||
|
||||
|
||||
/* ProfileManager */
|
||||
|
||||
ProfileManager > QFrame#headerFrame {
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -22,9 +22,8 @@
|
|||
#ifndef SERVERPAGE_H
|
||||
#define SERVERPAGE_H
|
||||
|
||||
#include <retroshare-gui/configpage.h>
|
||||
#include "ui_ServerPage.h"
|
||||
#include "RsAutoUpdatePage.h"
|
||||
|
||||
#include <inttypes.h>
|
||||
/* get OS-specific definitions for:
|
||||
* struct sockaddr_storage
|
||||
|
@ -35,11 +34,18 @@
|
|||
#include <winsock2.h>
|
||||
#endif
|
||||
|
||||
#include <services/autoproxy/rsautoproxymonitor.h>
|
||||
#include <services/autoproxy/p3i2pbob.h>
|
||||
|
||||
#include <retroshare-gui/configpage.h>
|
||||
#include <retroshare-gui/RsAutoUpdatePage.h>
|
||||
|
||||
|
||||
class QNetworkReply;
|
||||
class QNetworkAccessManager;
|
||||
class BanListPeer;
|
||||
|
||||
class ServerPage: public ConfigPage
|
||||
class ServerPage: public ConfigPage, public autoProxyCallback
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -89,7 +95,40 @@ private slots:
|
|||
void handleNetworkReply(QNetworkReply *reply);
|
||||
void updateInProxyIndicator();
|
||||
|
||||
// i2p bob
|
||||
void startBOB();
|
||||
void restartBOB();
|
||||
void stopBOB();
|
||||
void getNewKey();
|
||||
void loadKey();
|
||||
void enableBob(bool checked);
|
||||
void tunnelSettingsChanged(int);
|
||||
|
||||
void toggleBobAdvancedSettings(bool checked);
|
||||
|
||||
void syncI2PProxyPortNormal(int i);
|
||||
void syncI2PProxyPortBob(int i);
|
||||
|
||||
void syncI2PProxyAddrNormal(QString);
|
||||
void syncI2PProxyAddrBob(QString);
|
||||
|
||||
void connectionWithoutCert();
|
||||
|
||||
// autoProxyCallback interface
|
||||
public:
|
||||
void taskFinished(taskTicket *&ticket);
|
||||
|
||||
private:
|
||||
void loadCommon();
|
||||
void saveCommon();
|
||||
void saveBob();
|
||||
void updateStatusBob();
|
||||
|
||||
void setUpBobElements();
|
||||
void enableBobElements(bool enable);
|
||||
|
||||
void updateInProxyIndicatorResult(bool success);
|
||||
|
||||
// ban list
|
||||
void addPeerToIPTable(QTableWidget *table, int row, const BanListPeer &blp);
|
||||
bool removeCurrentRowFromBlackList(sockaddr_storage& collected_addr,int& masked_bytes);
|
||||
|
@ -105,9 +144,12 @@ private:
|
|||
Ui::ServerPage ui;
|
||||
|
||||
QNetworkAccessManager *manager ;
|
||||
int mOngoingConnectivityCheck;
|
||||
|
||||
bool mIsHiddenNode;
|
||||
bool mIsHiddenNode;
|
||||
uint32_t mHiddenType;
|
||||
bobSettings mBobSettings;
|
||||
bool mBobAccessible; // keeps track wether bob is accessable or not to en/disable the corresponding buttons
|
||||
};
|
||||
|
||||
#endif // !SERVERPAGE_H
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue