Skip to content

Commit 1558341

Browse files
authored
Merge pull request #52 from GalaxyPay/dev
chore: release v3.2.1
2 parents 23a6463 + 3a3cef6 commit 1558341

File tree

13 files changed

+56
-60
lines changed

13 files changed

+56
-60
lines changed

.github/workflows/go.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,5 +266,5 @@ jobs:
266266
uses: ncipollo/release-action@v1
267267
with:
268268
allowUpdates: true
269-
tag: v3.2.0
269+
tag: v3.2.1
270270
artifacts: "Output/*"

FUNC.iss

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "FUNC"
5-
#define MyAppVersion "3.2.0"
5+
#define MyAppVersion "3.2.1"
66
#define MyAppPublisher "Galaxy Pay, LLC"
77
#define MyAppPublisherURL "https://galaxy-pay.com"
88
#define MyPublishPath "publish"

FUNC/Controllers/GoalController.cs

+18-11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System.Formats.Tar;
2+
using System.IO.Compression;
13
using System.Runtime.InteropServices;
24
using FUNC.Models;
35
using Microsoft.AspNetCore.Mvc;
@@ -66,6 +68,7 @@ public async Task<ActionResult<string>> GoalUpdate(Models.Release model)
6668
{
6769
try
6870
{
71+
string? url = null;
6972
if (IsWindows())
7073
{
7174
string workspaceName = "GalaxyPay";
@@ -81,9 +84,7 @@ public async Task<ActionResult<string>> GoalUpdate(Models.Release model)
8184
{
8285
release = await client.Repository.Release.Get(workspaceName, repositoryName, model.Name);
8386
}
84-
var url = release?.Assets.FirstOrDefault(a => a.Name == "node.tar.gz")?.BrowserDownloadUrl;
85-
if (url == null) return BadRequest();
86-
await Utils.ExecCmd($"curl -L -o {Utils.appDataDir}/node.tar.gz {url}");
87+
url = release?.Assets.FirstOrDefault(a => a.Name == "node.tar.gz")?.BrowserDownloadUrl;
8788
}
8889
else if (IsLinux())
8990
{
@@ -95,7 +96,6 @@ public async Task<ActionResult<string>> GoalUpdate(Models.Release model)
9596
var client = new GitHubClient(new ProductHeaderValue(repositoryName));
9697
var latestInfo = await client.Repository.Release.GetLatest(workspaceName, repositoryName);
9798

98-
string? url = null;
9999
if (RuntimeInformation.OSArchitecture == Architecture.Arm64)
100100
{
101101
url = latestInfo.Assets.FirstOrDefault(a => a.Name.Contains("node_stable_linux-arm64")
@@ -106,8 +106,6 @@ public async Task<ActionResult<string>> GoalUpdate(Models.Release model)
106106
url = latestInfo.Assets.FirstOrDefault(a => a.Name.Contains("node_stable_linux-amd64")
107107
&& a.Name.EndsWith("tar.gz"))?.BrowserDownloadUrl;
108108
}
109-
if (url == null) return BadRequest();
110-
await Utils.ExecCmd($"wget -L -O {Utils.appDataDir}/node.tar.gz {url}");
111109
}
112110
else if (IsMacOS())
113111
{
@@ -119,14 +117,23 @@ public async Task<ActionResult<string>> GoalUpdate(Models.Release model)
119117
var client = new GitHubClient(new ProductHeaderValue(repositoryName));
120118
var latestInfo = await client.Repository.Release.GetLatest(workspaceName, repositoryName);
121119

122-
string? url = latestInfo.Assets.FirstOrDefault(a => a.Name.Contains("node_stable_darwin")
120+
url = latestInfo.Assets.FirstOrDefault(a => a.Name.Contains("node_stable_darwin")
123121
&& a.Name.EndsWith("tar.gz"))?.BrowserDownloadUrl;
124-
if (url == null) return BadRequest();
125-
await Utils.ExecCmd($"curl -L -o {Utils.appDataDir}/node.tar.gz {url}");
126122
}
127123

128-
await Utils.ExecCmd($"tar -zxf {Utils.appDataDir}/node.tar.gz -C {Utils.appDataDir} bin");
129-
await Utils.ExecCmd($"rm {Utils.appDataDir}/node.tar.gz");
124+
string filePath = Path.Combine(Utils.appDataDir, "node.tar.gz");
125+
using var httpClient = new HttpClient();
126+
using var s = await httpClient.GetStreamAsync(url);
127+
using FileStream fs = new(filePath, System.IO.FileMode.OpenOrCreate);
128+
await s.CopyToAsync(fs);
129+
fs.Dispose();
130+
131+
using FileStream rfs = new(filePath, System.IO.FileMode.Open, FileAccess.Read);
132+
using GZipStream gz = new(rfs, CompressionMode.Decompress, leaveOpen: true);
133+
await TarFile.ExtractToDirectoryAsync(gz, Utils.appDataDir, true);
134+
rfs.Dispose();
135+
136+
System.IO.File.Delete(filePath);
130137

131138
return Ok();
132139
}

FUNC/Controllers/RetiController.cs

+26-34
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System.Formats.Tar;
2+
using System.IO.Compression;
13
using System.Runtime.InteropServices;
24
using FUNC.Models;
35
using Microsoft.AspNetCore.Mvc;
@@ -179,45 +181,35 @@ private static async Task DownloadExtractReti()
179181

180182
Directory.CreateDirectory(Path.Combine(Utils.appDataDir, "reti"));
181183

184+
var pattern = (IsWindows() ? "windows-amd64.zip"
185+
: IsLinux() ? (RuntimeInformation.OSArchitecture == Architecture.Arm64 ? "linux-arm64.tar.gz" : "linux-amd64.tar.gz")
186+
: IsMacOS() ? (RuntimeInformation.OSArchitecture == Architecture.Arm64 ? "darwin-arm64.tar.gz" : "darwin-amd64.tar.gz")
187+
: null) ?? throw new Exception("Binary Not Found");
188+
var asset = latest.Assets.FirstOrDefault(a => a.Name.EndsWith(pattern)) ?? throw new Exception("Binary Not Found");
189+
190+
string filePath = Path.Combine(Utils.appDataDir, asset.Name);
191+
string destDir = Path.Combine(Utils.appDataDir, "reti");
192+
using var httpClient = new HttpClient();
193+
using var s = await httpClient.GetStreamAsync(asset.BrowserDownloadUrl);
194+
using FileStream fs = new(filePath, System.IO.FileMode.OpenOrCreate);
195+
await s.CopyToAsync(fs);
196+
fs.Dispose();
197+
182198
if (IsWindows())
183199
{
184-
var url = (latest.Assets.FirstOrDefault(a => a.Name.EndsWith("windows-amd64.zip"))?.BrowserDownloadUrl)
185-
?? throw new Exception("Binary Not Found");
186-
await Utils.ExecCmd($"curl -L -o {Utils.appDataDir}/reti.zip {url}");
187-
await Utils.ExecCmd($"tar -xf {Utils.appDataDir}/reti.zip -C {Path.Combine(Utils.appDataDir, "reti")}");
200+
DirectoryInfo di = new(destDir);
201+
foreach (FileInfo file in di.GetFiles()) file.Delete();
202+
ZipFile.ExtractToDirectory(filePath, destDir);
188203
}
189-
else if (IsLinux())
204+
else
190205
{
191-
string? url = null;
192-
if (RuntimeInformation.OSArchitecture == Architecture.Arm64)
193-
{
194-
url = latest.Assets.FirstOrDefault(a => a.Name.EndsWith("linux-arm64.tar.gz"))?.BrowserDownloadUrl
195-
?? throw new Exception("Binary Not Found");
196-
}
197-
else
198-
{
199-
url = latest.Assets.FirstOrDefault(a => a.Name.EndsWith("linux-amd64.tar.gz"))?.BrowserDownloadUrl
200-
?? throw new Exception("Binary Not Found");
201-
}
202-
await Utils.ExecCmd($"wget -L -O {Utils.appDataDir}/reti.tar.gz {url}");
203-
await Utils.ExecCmd($"tar -zxf {Utils.appDataDir}/reti.tar.gz -C {Path.Combine(Utils.appDataDir, "reti")}");
204-
}
205-
else if (IsMacOS())
206-
{
207-
string? url = null;
208-
if (RuntimeInformation.OSArchitecture == Architecture.Arm64)
209-
{
210-
url = latest.Assets.FirstOrDefault(a => a.Name.EndsWith("darwin-arm64.tar.gz"))?.BrowserDownloadUrl
211-
?? throw new Exception("Binary Not Found");
212-
}
213-
else
214-
{
215-
url = latest.Assets.FirstOrDefault(a => a.Name.EndsWith("darwin-amd64.tar.gz"))?.BrowserDownloadUrl
216-
?? throw new Exception("Binary Not Found");
217-
}
218-
await Utils.ExecCmd($"curl -L -o {Utils.appDataDir}/reti.tar.gz {url}");
219-
await Utils.ExecCmd($"tar -zxf {Utils.appDataDir}/reti.tar.gz -C {Path.Combine(Utils.appDataDir, "reti")}");
206+
using FileStream rfs = new(filePath, System.IO.FileMode.Open, FileAccess.Read);
207+
using GZipStream gz = new(rfs, CompressionMode.Decompress, leaveOpen: true);
208+
await TarFile.ExtractToDirectoryAsync(gz, destDir, true);
209+
rfs.Dispose();
220210
}
211+
212+
System.IO.File.Delete(filePath);
221213
}
222214
}
223215
}

FUNC/Node.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using FUNC.Models;
1+
using System.Formats.Tar;
2+
using FUNC.Models;
23
using Newtonsoft.Json.Linq;
34
using static System.OperatingSystem;
45

@@ -9,7 +10,7 @@ public class Node
910
private static async Task ExtractTemplate(string name)
1011
{
1112
string templatePath = Path.Combine(AppContext.BaseDirectory, "Templates", $"{name}.tar");
12-
await Utils.ExecCmd($"tar -xf \"{templatePath}\" -C {Utils.NodeDataParent(name)}");
13+
await TarFile.ExtractToDirectoryAsync(templatePath, Utils.NodeDataParent(name), true);
1314
}
1415

1516
public static async Task<NodeStatus> Get(string name)

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Here's how to do it:
127127

128128
- This should **ONLY** be done on a local network - **DO NOT** open these ports to the internet
129129

130-
- If you want to be able to use WalletConnect wallets (e.g. Defly, Pera) while accessing the site via IP, you'll need to use port 3537 which serves the site with a self-signed cert over HTTPS. You'll also need "Allow Insecure Content" for the site in your browser settings so that it can communicate to your node over HTTP.
130+
- If you want to be able to use WalletConnect wallets (e.g. Defly, Pera) or "copy to clipboard" buttons while accessing the site remotely, you'll need to use port 3537 which serves the site with a self-signed cert over HTTPS. You'll also need "Allow Insecure Content" for the site in your browser settings so that it can communicate to your node over HTTP.
131131

132132
## Build (for Developers)
133133

create-package-deb.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
rm -r Output
22

3-
PKG=Output/func_3.2.0_linux-$1
3+
PKG=Output/func_3.2.1_linux-$1
44

55
mkdir -p $PKG/lib/systemd/system
66
mkdir -p $PKG/opt/func

create-package-pkg.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ pkgbuild --root publish \
55
--install-location /opt/func \
66
--scripts pkg/scripts \
77
--identifier func.app \
8-
Output/func_3.2.0_darwin-$1.pkg
8+
Output/func_3.2.1_darwin-$1.pkg

deb/amd64/control

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: func
2-
Version: 3.2.0
2+
Version: 3.2.1
33
Section: base
44
Priority: optional
55
Architecture: amd64

deb/arm64/control

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: func
2-
Version: 3.2.0
2+
Version: 3.2.1
33
Section: base
44
Priority: optional
55
Architecture: arm64

webui/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "func-webui",
3-
"version": "3.2.0",
3+
"version": "3.2.1",
44
"scripts": {
55
"dev": "vite",
66
"build": "vite build",

webui/src/components/Node.vue

+1-3
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,7 @@ const algodClient = computed(() => {
330330
watch(
331331
() => algodStatus.value,
332332
(val) => {
333-
if (!val?.["last-version"].includes("/925a464")) {
334-
store.isIncentiveReady = true;
335-
}
333+
if (val?.["last-round"] >= 46512890) store.isIncentiveReady = true;
336334
}
337335
);
338336

webui/src/components/Settings.vue

-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ async function getVersion() {
123123
if (!init) {
124124
init = true;
125125
updateNodeLatest(true);
126-
} else {
127-
throw Error("Download Failed");
128126
}
129127
}
130128

0 commit comments

Comments
 (0)