Skip to content

Commit

Permalink
Merge pull request #47 from corrad1nho/develop
Browse files Browse the repository at this point in the history
Version 0.8.0
  • Loading branch information
corrad1nho authored Dec 15, 2018
2 parents bf08e16 + b7404c8 commit afafce2
Show file tree
Hide file tree
Showing 16 changed files with 4,524 additions and 299 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,20 @@ Qomui has been my first ever programming experience and a practical challenge fo

### Changelog

#### version 0.8.0:
- [new] connection profiles
- [new] support for custom scripts
- [change] configurations for Airvpn are now downloaded directly
- [change] removed minimize option if system tray not available
- [change] download new Mullvad config/certificates
- [change] added scroll areas to some tabs
- [change] added options for profiles to tray menu
- [change] window state now recognized correctly
- [bugfix] improved stability and reliability of network detection
- [bugfix] manually imported WireGuard servers don't connect
- [bugfix] Qomui crashes when downloading Airvpn configs
- [bugfix] fixed Mullvad & Windscribe configs

#### version 0.7.4:
- [change] source and binary packages now provided by [OpenSuse Build Service](https://build.opensuse.org/)
- [change] added support for OpenSuse Leap 15 and OpenSuse Tumbleweed
Expand All @@ -107,13 +121,3 @@ Qomui has been my first ever programming experience and a practical challenge fo
- [bugfix] import may fail if directory for certificates/keys does not exist
- [bugifx] timestamp not updated after auto-updating servers

#### version 0.7.3:
- [change] firewall is reloaded on gui startup
- [change] checking for presence of other firewall services such as ufw when configuring firewall
- [change] selection box for protocols adjusts size
- [bugfix] previous iptables rules are now properly saved/restored
- [bugfix] sometimes external ip is displayed twice
- [bugfix] Qomui crashes when adding folder and provider not specified
- [bugfix] WireGuard dns-servers not set correctly when second tunnel in bypass active
- [bugfix] manually imported WireGuard configs are not added to server list - [issue #24](https://github.com/corrad1nho/qomui/issues/24)
- [bugfix] potential permission error for temporary files created during importing configs
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.4
0.8.0
9 changes: 6 additions & 3 deletions qomui/bypass.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,12 @@ def create_cgroup(user, group, interface, gw=None, gw_6=None, default_int=None)
with open("/proc/sys/net/ipv4/conf/all/rp_filter", 'w') as rp_edit_all:
rp_edit_all.write("2")

with open("/proc/sys/net/ipv4/conf/{}/rp_filter".format(interface), 'w') as rp_edit_int:
rp_edit_int.write("2")
logging.debug("Disabled reverse path filtering for {}".format(interface))
try:
with open("/proc/sys/net/ipv4/conf/{}/rp_filter".format(interface), 'w') as rp_edit_int:
rp_edit_int.write("2")
logging.debug("Disabled reverse path filtering for {}".format(interface))
except FileNotFoundError:
logging.error("Failed to disable reverse path filtering for {}".format(interface))

try:
check_call(["cgcreate", "-t", "{}:{}".format(user, group), "-a" "{}:{}".format(user, group), "-g", "net_cls:bypass_qomui"])
Expand Down
47 changes: 29 additions & 18 deletions qomui/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def __init__ (self, protocols=None, countries=None, providers=None, selected=0,
self.protocols = protocols
self.countries = countries
self.providers = providers
print(self.providers)
self.selected = selected
self.setupUi(self)
self.popBoxes()
Expand Down Expand Up @@ -72,6 +71,8 @@ def setupUi(self, profileEdit):
self.choiceTable.horizontalHeader().hide()
self.choiceTable.verticalHeader().hide()
self.verticalLayout.addWidget(self.choiceTable)
self.filterLine = QtWidgets.QLineEdit(profileEdit)
self.verticalLayout.addWidget(self.filterLine)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
spacerItem = QtWidgets.QSpacerItem(595, 17, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
Expand All @@ -81,8 +82,6 @@ def setupUi(self, profileEdit):
self.buttonBox.setObjectName("buttonBox")
self.horizontalLayout.addWidget(self.buttonBox)
self.verticalLayout.addLayout(self.horizontalLayout)


self.retranslateUi(profileEdit)
QtCore.QMetaObject.connectSlotsByName(profileEdit)

Expand All @@ -94,6 +93,7 @@ def retranslateUi(self, profileEdit):
_translate = QtCore.QCoreApplication.translate
profileEdit.setWindowTitle(_translate("profileEdit", "Edit profile"))
self.profileLine.setPlaceholderText(_translate("profileEdit", "Enter profile name"))
self.filterLine.setPlaceholderText("Enter keywords to filter server names: k1;k2;k3...")

def popBoxes(self):
for prot in self.protocols:
Expand All @@ -108,20 +108,24 @@ def popBoxes(self):
self.modeBox.setCurrentText(self.selected["mode"])
self.chooseProtocolBox.setCurrentText(self.selected["protocol"])
self.profileLine.setText(self.selected["name"])
if self.selected["filters"]:
self.filterLine.setText(";".join(self.selected["filters"]))


self.popchoiceTable()

def popchoiceTable(self):
self.choiceTable.clear()
self.choiceTable.clearSpans()
width = self.choiceTable.width()
n = len(self.countries)-1
n = len(self.countries)
np = len(self.providers)
cols = int(width / 120)
if cols == 0:
cols = 1
rows = int(n / cols) + (n % cols> 0)
np = len(self.providers)
rows = rows + int(np / cols) + (np % cols> 0) +2

n = n + len(self.providers)
rows = int(n / cols) + (n % cols> 0) + int(np / cols) + (np % cols> 0) + 3
self.choiceTable.setRowCount(rows)
self.choiceTable.setColumnCount(cols)
self.choiceTable.horizontalHeader().setSectionResizeMode(QtWidgets.QHeaderView.Stretch)
Expand All @@ -132,7 +136,8 @@ def popchoiceTable(self):
font.setBold(True)
item.setFont(font)
item.setText("Choose providers:")
self.choiceTable.setSpan(0,0,1,cols)
if cols >= 1:
self.choiceTable.setSpan(0,0,1,cols)
self.choiceTable.setItem(0,0,item)
r+=1
for provider in self.providers:
Expand All @@ -145,21 +150,23 @@ def popchoiceTable(self):
else:
item.setCheckState(QtCore.Qt.Unchecked)
self.choiceTable.setItem(r,c,item)
if c == cols:
if c == cols-1:
r += 1
c = 0
else:
c += 1

r += 1
c = 0
r+=1
item = QtWidgets.QTableWidgetItem()
item.setFont(font)
item.setText("Choose countries:")
self.choiceTable.setSpan(r,0,1,cols)
if cols >= 1:
self.choiceTable.setSpan(r,0,1,cols)
self.choiceTable.setItem(r,0,item)
r+=1
for country in self.countries:

for country in sorted(self.countries):
item = QtWidgets.QTableWidgetItem()
item.setText(country)
item.setData(QtCore.Qt.UserRole, "countries")
Expand All @@ -169,7 +176,7 @@ def popchoiceTable(self):
else:
item.setCheckState(QtCore.Qt.Unchecked)
self.choiceTable.setItem(r,c,item)
if c == cols:
if c == cols-1:
r += 1
c = 0
else:
Expand Down Expand Up @@ -199,6 +206,7 @@ def confirm(self):
profile_dict["countries"] = sorted(self.countries_selected)
profile_dict["mode"] = self.modeBox.currentText()
profile_dict["protocol"] = self.chooseProtocolBox.currentText()
profile_dict["filters"] = self.filterLine.text().split(";")[:-1]

if self.selected != 0:
profile_dict["number"] = self.selected["number"]
Expand Down Expand Up @@ -279,11 +287,11 @@ def setupUi(self, Form):
self.countryLabel.setIndent(20)
self.verticalLayout.addWidget(self.countryLabel)

spacerItem = QtWidgets.QSpacerItem(0, 0,
QtWidgets.QSizePolicy.Minimum,
QtWidgets.QSizePolicy.MinimumExpanding
)
self.verticalLayout.addItem(spacerItem)
self.filterLabel = QtWidgets.QLabel(Form)
self.filterLabel.setObjectName("filterLabel")
self.filterLabel.setWordWrap(True)
self.filterLabel.setIndent(20)
self.verticalLayout.addWidget(self.filterLabel)

self.delProfBt.clicked.connect(self.delete)
self.editProfBt.clicked.connect(self.edit)
Expand All @@ -308,6 +316,9 @@ def setText(self, profile):
self.providerLabel.setText("<b>Provider: </b>" + ', '.join(profile["providers"]))
self.countryLabel.setText("<b>Countries: </b>" + ', '.join(profile["countries"]))

if profile["filters"]:
self.filterLabel.setText("<b>Filter: </b>" + ', '.join(profile["filters"]))

def connect(self):
self.connect_profile.emit(self.profile["number"])

Expand Down
Loading

0 comments on commit afafce2

Please sign in to comment.