Skip to content

Commit

Permalink
Merge commits #7516f65,#ee4741e,#72592c8
Browse files Browse the repository at this point in the history
  • Loading branch information
freQniK committed Sep 6, 2023
1 parent c0804c1 commit 72981e4
Show file tree
Hide file tree
Showing 9 changed files with 219 additions and 127 deletions.
67 changes: 58 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
CHANGELOG
========================

# v1.7.10 (06/09/2023)

* NEW: Subscription type chooser interface (hourly/bandwidth)
* NEW: Slider for hourly subscription on range of 1-30 days
* NEW: Label for subscription expirary on subscription card (meile.kv)
* NEW: compute_consumed_hours() routine in widgets.py
* NEW: GetHourAllocation() routine in sentinel.py
* ADD: INACTIVE_DIALOG_BG_COLOR in konstants.py MeileColors class
* ADD: user defined TIMEOUT for HTTPRequests adapter
* UPDATE: SubsFinalResult data to include hour subscription data and expirary data
* UPDATE: add variable to root.get_data_used(..., root.expirary_date) (meile.kv)
* UPDATE: Check in get_subscriptions() if sub is hourly, if so compute nodeQuota list
* UPDATE: Error reporting on connection issues to user on Linux (from Windows branch)
* UPDATE: Allocated/Consumed labels to handle hours allocated, hours consumed, based on timestamp of subscription and now()
* UPDATE: Bandwidth meter reports percent of hours consumed on updated on regular inteval for time based subscriptions
* UPDATE: subscribe() in wallet.py to handle hourly subscriptions
* CHANGE: Size of location pin
* FIX: Last country card in left pane being cut off by bottom navbar
* REMOVE: FullImage/2 from meile.kv and interfaces.py
* REMOVE: \<SelectableLabel\>, \<RV\> from meile.kv

# v1.7.7 (18/08/2023)

* UPDATE: Sentinel Network Upgrade edition

# v1.7.2

* NEW: Unsubscribe functions in HandleWalletFunctions()
* NEW: Check for active or pending sessions before unsub
* NEW: Click subscription card to prompt user to unsubscribe
Expand All @@ -12,9 +38,11 @@ CHANGELOG
* FIX: Sort by Price. Bug was created when prices switched from udvpn to dvpn.

# v1.7.1

* FIX: Disconnect bug by removing wg99.conf from config dir

# v1.7.0

* NEW: Added DEC, SCRT token options to FIAT gateway
* NEW: Dynamic Token QTYs based on market
* NEW: GetCoinPriceAPI() Class for resolving coin prices
Expand All @@ -23,6 +51,7 @@ CHANGELOG
* CHANGE: (Windows) modified DNS resolution timem to 4s

# v1.6.3 (27/04/2023)

* ADD: DNSRequests Adapter
* NEW: 70% map, 30% country nodes cards
* NEW: Map pin marker to yellow pin
Expand All @@ -41,6 +70,7 @@ CHANGELOG
* UPDATE: Load existing subs for faster processing

# v1.5.1 (22/03/2023)

* NEW: sentinelcli 0.3.0
* NEW: v2ray support added
* NEW: v2ray 5.1.0 binary added
Expand All @@ -58,8 +88,8 @@ CHANGELOG
* FIX: IBC Coin listing crash
* FIX: Node version reporting


# v1.4.1 (29/01/2023)

* NEW: Toast Message for Rating sent or errored out
* NEW: Version control in Help Screen
* NEW: Mac OS X App Bundle Release
Expand All @@ -69,7 +99,8 @@ CHANGELOG
* UPDATE: Sentinel-CLI for CosmWasm Sentinel Network Upgrade
* UPDATE: Packager Installer installs App Bundle to Desktop
* UPDATE: Improved HTTPs requests using requests adapter
# v1.4.0 (17/01/2023)

# v1.4.0 (17/01/2023)
* NEW: First Windows Binary Release (Pre-release)
* NEW: gsudo Packaged with Windows binary
* NEW: Wireguard binary packaged with Meile binary
Expand All @@ -84,6 +115,7 @@ CHANGELOG
* CHANGE: Icon logo for Kivy and for Task Bar and Desktop Icon

# v1.3.0 (06/12/2022)

* NEW: Unicode Support for Moniker names
* NEW: Rating scores in subscription tab
* NEW: City names in subscription tabs
Expand All @@ -99,14 +131,15 @@ CHANGELOG
* CHANGE: Housekeeping by adding src/typedef/konstants.py
* CHANGE: Housekeeping in wallet.py and sentinel.py


# v1.2.3 (13/11/2022)

* NEW: Persisent real-time bandwidth when switching between nodes
* CHANGE: Handling of CONNECTED boolean
* FIX: Issue #28
* FIX: Issue #29

# v1.2.2 (12/11/2022)

* NEW: Real-time bandwidth usage for current session, snapshot taken every two minutes.
* NEW: Dependency *psutil* added - needed for bandwidth usage
* NEW: Unicode Handling in wallet passphrase and other textfields
Expand All @@ -117,28 +150,30 @@ CHANGELOG
* FIX: Multiple spelling and grammatical errors. Thanks to *cryptomole*

# v1.2.1 (23/10/2022)

* NEW: Clickable Pin map with total node listings
* NEW: Refresh button in wallet screen
* NEW: Copy button for seed phrase on wallet restore/create
* NEW: Visible and draggable scrollbar on nodes
* NEW: Purchase up to 10,000 dvpn at a time
* CHANGE: Lowered surcharges on FIAT payment
* CHANGE: Check to see if warpd is running and exit if clicked on warp
again
again
* CHANGE: Removed elevation from node cards as shadow rendering is broken
in Kivy 1.1.1
in Kivy 1.1.1
* CHANGE: Padding on "wallet" in the fiat interface (binary release only)
* CHANGE: Using rpc.mathnodes.com:443 for subs fixing country block of
port 4444
port 4444
* FIX: Connection switch bug that displayed random on in nodes when
refreshing leading to confusion
refreshing leading to confusion
* FIX: Poor resize of screen with node cards. Resizes fast and clean
* FIX: Offline node consumed/allocated data progress bar and status text
* FIX: Divide by 0 bug and convert 0.00B to float
* FIX: Switch set to off if user cancels connection
* FIX: Handles unicode characters in wallet entry

# v1.1.0 (20/09/2022)

* NEW: Cloudflare DoH (DNS-over-HTTPS) WARP integration
* NEW: Hover focus on node listings
* NEW: Sort by Price (dpvn) or Moniker
Expand All @@ -148,62 +183,76 @@ refreshing leading to confusion
* FIX: Minor bugs

# v1.0.1 (01/09/2022)

* NEW: .deb package for virtual machine guest OSes
* FIX: Binary release fix for FIAT Gateway

# v1.0.0 (30/8/2022)

* NEW: Fiat Gateway
* CHANGE: Added CryptoCompare API alongside CoinGecko for additional DVPN price in FIAT gateway
* NEW: Automatic DNS resolve configuration for MacOS and Linux. Resolves to cloudflar if host HNS does not work
* FIX: No wallet subscription crash
* FIX: Major/Minor bug fixes for stability

# v0.9.5-beta.1 (20/08/2022)

* NEW: Ping
* FIX: pexpect timeout exception handling

# v0.9.4-beta.4 (06/08/2022)

* CHANGE: No longer needed to run as sudo/root.
* CHANGE: Propmpts user for system password when connecting/disconnecting

# v0.9.4-beta.3 (06/08/2022)

* ENHANCEMENT: Better UX on sub cards with added info

# v0.9.4-beta.2 (03/08/2022)

* NEW: Gnome-menu launcher and icon (ran as sudo) for .deb package
* ENHANCEMENT: Faster load times with option to refresh
* FIX: Subscription button text color
* FIX: Bug that created multiple nodes screen causing confusion

# v0.9.4-beta.1 (30/07/2022)

* NEW: Refresh Icon with Latency Selector
* NEW: TextField with currently connected node name
* FIX: Protected shield icon in pip install
* FIX: Minor bugs

# v0.9.3-beta.6 (28/07/2022)

* FIX: Disconnect Issues on some platforms

# v0.9.3-beta.5 (27/07/2022)

* NEW: Shield Icon in App Bar to Notify User is Connected
* FIX: Image stretching on subscriptions.

# v0.9.3-beta.4 (24/07/2022)

* FIX: Bug when parsing wallet create/restore output

# v0.9.3-beta.3 (22/07/2022)

* NEW: Extra console debug messages
* FIX: Wallet Balance retrieval error. Now displays dialog if unable to process wallet balances
* FIX: Crash on null price in Solar DVPN Node 15

# v0.9.3-beta.2 (20/07/2022)

* FIX: Error parsing JSON line when subscribing on certain machines/os

# v0.9.3-beta.1 (18/07/2022)

* NEW: 100% DeepPurple / Amber Theme
* FIX: Multiple bug fixes and crashes

# v0.9.2-alpha.1 (11/07/2022)

* NEW: Meile ICON logo in app and window bar
* NEW: Filter out dVPN nodes with version < 0.3.0
* FIX: Check to see if user is sudo/root. Issues on some linux with users not having network device permissions causing a panic when connecting
Expand All @@ -213,13 +262,13 @@ refreshing leading to confusion
* CHANGE: Removed tkinter support in favor of smaller screen library
* CHANGE: Determine actual user and place config files in ~/.meile-gui


# v0.9.1-alpha.1 (04/07/2022)

* NEW: Main app now runs on main thread
* NEW: Sub threads for other routines
* NEW: Packaged sentinel-cli 0.1.9 in build. No need to install independently
* FIX: Minor fixes and improvements


# v0.9.0-alpha.1 (02/07/2022)

* Initial Release
Binary file modified src/.DS_Store
Binary file not shown.
7 changes: 5 additions & 2 deletions src/adapters/HTTPRequests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ def send(self, request, **kwargs):


class MakeRequest():
def __init__(self, TIMEOUT=DEFAULT_TIMEOUT):
self.timeout = TIMEOUT

def hadapter(self):
retries = Retry(
total=2,
Expand All @@ -31,6 +34,6 @@ def hadapter(self):
#adapter = HTTPAdapter(max_retries=retries)
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
http = requests.Session()
http.mount("http://", TimeoutHTTPAdapter(max_retries=retries))
http.mount("https://", TimeoutHTTPAdapter(max_retries=retries))
http.mount("http://", TimeoutHTTPAdapter(max_retries=retries, timeout=self.timeout))
http.mount("https://", TimeoutHTTPAdapter(max_retries=retries, timeout=self.timeout))
return http
41 changes: 37 additions & 4 deletions src/cli/sentinel.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import re
import requests
from urllib3.exceptions import InsecureRequestWarning
from datetime import datetime

from treelib import Tree

Expand Down Expand Up @@ -82,8 +83,13 @@ def get_nodes(self, latency, *kwargs):
if version not in NodeKeys.NodeVersions:
continue

# Gigabyte Prices
d[NodeKeys.NodesInfoKeys[2]] = self.return_denom(d[NodeKeys.NodesInfoKeys[2]])
d[NodeKeys.NodesInfoKeys[2]] = self.parse_coin_deposit(d[NodeKeys.NodesInfoKeys[2]])

# Hourly Prices
d[NodeKeys.NodesInfoKeys[3]] = self.return_denom(d[NodeKeys.NodesInfoKeys[3]])
d[NodeKeys.NodesInfoKeys[3]] = self.parse_coin_deposit(d[NodeKeys.NodesInfoKeys[3]])

if OurWorld.CZ in d[NodeKeys.NodesInfoKeys[4]]:
d[NodeKeys.NodesInfoKeys[4]] = OurWorld.CZ_FULL
Expand Down Expand Up @@ -214,7 +220,7 @@ def get_subscriptions(self, ADDRESS):
SubsResult[k].append(v.lstrip().rstrip())

k=0
print(SubsResult)
#print(SubsResult)
for snaddress in SubsResult[NodeKeys.SubsInfoKeys[4]]:
try:
NodeData = self.NodeTree.get_node(snaddress).data
Expand All @@ -228,13 +234,20 @@ def get_subscriptions(self, ADDRESS):
NodeKeys.FinalSubsKeys[5] : None,
NodeKeys.FinalSubsKeys[6] : "0.00GB",
NodeKeys.FinalSubsKeys[7] : "0.00B",
NodeKeys.FinalSubsKeys[8] : "None"
NodeKeys.FinalSubsKeys[8] : "None",
NodeKeys.FinalSubsKeys[9] : SubsResult[NodeKeys.SubsInfoKeys[2]][k],
NodeKeys.FinalSubsKeys[10]: SubsResult[NodeKeys.SubsInfoKeys[6]][k]
})
print("Sub not found in list")
k += 1
continue

nodeQuota = self.GetQuota(SubsResult[NodeKeys.SubsInfoKeys[0]][k])
if int(SubsResult[NodeKeys.SubsInfoKeys[6]][k]) > 0:
nodeQuota = self.GetHourAllocation(SubsResult[NodeKeys.SubsInfoKeys[6]][k], SubsResult[NodeKeys.SubsInfoKeys[2]][k])

else:
nodeQuota = self.GetQuota(SubsResult[NodeKeys.SubsInfoKeys[0]][k])

if nodeQuota:
SubsFinalResult.append({
NodeKeys.FinalSubsKeys[0] : SubsResult[NodeKeys.SubsInfoKeys[0]][k],
Expand All @@ -245,7 +258,9 @@ def get_subscriptions(self, ADDRESS):
NodeKeys.FinalSubsKeys[5] : NodeData[NodeKeys.NodesInfoKeys[4]],
NodeKeys.FinalSubsKeys[6] : nodeQuota[0],
NodeKeys.FinalSubsKeys[7] : nodeQuota[1],
NodeKeys.FinalSubsKeys[8] : NodeData[NodeKeys.NodesInfoKeys[9]]
NodeKeys.FinalSubsKeys[8] : NodeData[NodeKeys.NodesInfoKeys[9]],
NodeKeys.FinalSubsKeys[9] : SubsResult[NodeKeys.SubsInfoKeys[2]][k],
NodeKeys.FinalSubsKeys[10]: SubsResult[NodeKeys.SubsInfoKeys[6]][k]
})
k += 1

Expand Down Expand Up @@ -274,6 +289,24 @@ def GetQuota(self, id):
return nodeQuota


def GetHourAllocation(self, hours, idate):
nodeQuota = []
nodeQuota.append(str(hours) + "hrs")
inactive_date = idate.lstrip().rstrip().split('.')[0]
inactive_date = datetime.strptime(inactive_date, '%Y-%m-%d %H:%M:%S')
now = datetime.now()
subdelta = inactive_date - now
remaining_hours = round(float(subdelta.total_seconds())/3600,3)
consumed = float(int(hours) - remaining_hours)
if consumed < 0:
consumed = 0
if remaining_hours <= 0:
return None
else:
print(f"inactive_date: {idate}, time_remaining: {remaining_hours}, time_consumed: {consumed}")
nodeQuota.append(str(round(consumed,2)) + "hrs")
return nodeQuota

def disconnect(v2ray):
if v2ray:
try:
Expand Down
Loading

0 comments on commit 72981e4

Please sign in to comment.