Skip to content

Commit

Permalink
Merge pull request #52 from GalaxyPay/dev
Browse files Browse the repository at this point in the history
chore: release v3.2.1
  • Loading branch information
acfunk authored Jan 17, 2025
2 parents 23a6463 + 3a3cef6 commit 1558341
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,5 +266,5 @@ jobs:
uses: ncipollo/release-action@v1
with:
allowUpdates: true
tag: v3.2.0
tag: v3.2.1
artifacts: "Output/*"
2 changes: 1 addition & 1 deletion FUNC.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "FUNC"
#define MyAppVersion "3.2.0"
#define MyAppVersion "3.2.1"
#define MyAppPublisher "Galaxy Pay, LLC"
#define MyAppPublisherURL "https://galaxy-pay.com"
#define MyPublishPath "publish"
Expand Down
29 changes: 18 additions & 11 deletions FUNC/Controllers/GoalController.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Formats.Tar;
using System.IO.Compression;
using System.Runtime.InteropServices;
using FUNC.Models;
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -66,6 +68,7 @@ public async Task<ActionResult<string>> GoalUpdate(Models.Release model)
{
try
{
string? url = null;
if (IsWindows())
{
string workspaceName = "GalaxyPay";
Expand All @@ -81,9 +84,7 @@ public async Task<ActionResult<string>> GoalUpdate(Models.Release model)
{
release = await client.Repository.Release.Get(workspaceName, repositoryName, model.Name);
}
var url = release?.Assets.FirstOrDefault(a => a.Name == "node.tar.gz")?.BrowserDownloadUrl;
if (url == null) return BadRequest();
await Utils.ExecCmd($"curl -L -o {Utils.appDataDir}/node.tar.gz {url}");
url = release?.Assets.FirstOrDefault(a => a.Name == "node.tar.gz")?.BrowserDownloadUrl;
}
else if (IsLinux())
{
Expand All @@ -95,7 +96,6 @@ public async Task<ActionResult<string>> GoalUpdate(Models.Release model)
var client = new GitHubClient(new ProductHeaderValue(repositoryName));
var latestInfo = await client.Repository.Release.GetLatest(workspaceName, repositoryName);

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

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

await Utils.ExecCmd($"tar -zxf {Utils.appDataDir}/node.tar.gz -C {Utils.appDataDir} bin");
await Utils.ExecCmd($"rm {Utils.appDataDir}/node.tar.gz");
string filePath = Path.Combine(Utils.appDataDir, "node.tar.gz");
using var httpClient = new HttpClient();
using var s = await httpClient.GetStreamAsync(url);
using FileStream fs = new(filePath, System.IO.FileMode.OpenOrCreate);
await s.CopyToAsync(fs);
fs.Dispose();

using FileStream rfs = new(filePath, System.IO.FileMode.Open, FileAccess.Read);
using GZipStream gz = new(rfs, CompressionMode.Decompress, leaveOpen: true);
await TarFile.ExtractToDirectoryAsync(gz, Utils.appDataDir, true);
rfs.Dispose();

System.IO.File.Delete(filePath);

return Ok();
}
Expand Down
60 changes: 26 additions & 34 deletions FUNC/Controllers/RetiController.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Formats.Tar;
using System.IO.Compression;
using System.Runtime.InteropServices;
using FUNC.Models;
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -179,45 +181,35 @@ private static async Task DownloadExtractReti()

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

var pattern = (IsWindows() ? "windows-amd64.zip"
: IsLinux() ? (RuntimeInformation.OSArchitecture == Architecture.Arm64 ? "linux-arm64.tar.gz" : "linux-amd64.tar.gz")
: IsMacOS() ? (RuntimeInformation.OSArchitecture == Architecture.Arm64 ? "darwin-arm64.tar.gz" : "darwin-amd64.tar.gz")
: null) ?? throw new Exception("Binary Not Found");
var asset = latest.Assets.FirstOrDefault(a => a.Name.EndsWith(pattern)) ?? throw new Exception("Binary Not Found");

string filePath = Path.Combine(Utils.appDataDir, asset.Name);
string destDir = Path.Combine(Utils.appDataDir, "reti");
using var httpClient = new HttpClient();
using var s = await httpClient.GetStreamAsync(asset.BrowserDownloadUrl);
using FileStream fs = new(filePath, System.IO.FileMode.OpenOrCreate);
await s.CopyToAsync(fs);
fs.Dispose();

if (IsWindows())
{
var url = (latest.Assets.FirstOrDefault(a => a.Name.EndsWith("windows-amd64.zip"))?.BrowserDownloadUrl)
?? throw new Exception("Binary Not Found");
await Utils.ExecCmd($"curl -L -o {Utils.appDataDir}/reti.zip {url}");
await Utils.ExecCmd($"tar -xf {Utils.appDataDir}/reti.zip -C {Path.Combine(Utils.appDataDir, "reti")}");
DirectoryInfo di = new(destDir);
foreach (FileInfo file in di.GetFiles()) file.Delete();
ZipFile.ExtractToDirectory(filePath, destDir);
}
else if (IsLinux())
else
{
string? url = null;
if (RuntimeInformation.OSArchitecture == Architecture.Arm64)
{
url = latest.Assets.FirstOrDefault(a => a.Name.EndsWith("linux-arm64.tar.gz"))?.BrowserDownloadUrl
?? throw new Exception("Binary Not Found");
}
else
{
url = latest.Assets.FirstOrDefault(a => a.Name.EndsWith("linux-amd64.tar.gz"))?.BrowserDownloadUrl
?? throw new Exception("Binary Not Found");
}
await Utils.ExecCmd($"wget -L -O {Utils.appDataDir}/reti.tar.gz {url}");
await Utils.ExecCmd($"tar -zxf {Utils.appDataDir}/reti.tar.gz -C {Path.Combine(Utils.appDataDir, "reti")}");
}
else if (IsMacOS())
{
string? url = null;
if (RuntimeInformation.OSArchitecture == Architecture.Arm64)
{
url = latest.Assets.FirstOrDefault(a => a.Name.EndsWith("darwin-arm64.tar.gz"))?.BrowserDownloadUrl
?? throw new Exception("Binary Not Found");
}
else
{
url = latest.Assets.FirstOrDefault(a => a.Name.EndsWith("darwin-amd64.tar.gz"))?.BrowserDownloadUrl
?? throw new Exception("Binary Not Found");
}
await Utils.ExecCmd($"curl -L -o {Utils.appDataDir}/reti.tar.gz {url}");
await Utils.ExecCmd($"tar -zxf {Utils.appDataDir}/reti.tar.gz -C {Path.Combine(Utils.appDataDir, "reti")}");
using FileStream rfs = new(filePath, System.IO.FileMode.Open, FileAccess.Read);
using GZipStream gz = new(rfs, CompressionMode.Decompress, leaveOpen: true);
await TarFile.ExtractToDirectoryAsync(gz, destDir, true);
rfs.Dispose();
}

System.IO.File.Delete(filePath);
}
}
}
5 changes: 3 additions & 2 deletions FUNC/Node.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FUNC.Models;
using System.Formats.Tar;
using FUNC.Models;
using Newtonsoft.Json.Linq;
using static System.OperatingSystem;

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

public static async Task<NodeStatus> Get(string name)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Here's how to do it:

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

- 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.
- 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.

## Build (for Developers)

Expand Down
2 changes: 1 addition & 1 deletion create-package-deb.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
rm -r Output

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

mkdir -p $PKG/lib/systemd/system
mkdir -p $PKG/opt/func
Expand Down
2 changes: 1 addition & 1 deletion create-package-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ pkgbuild --root publish \
--install-location /opt/func \
--scripts pkg/scripts \
--identifier func.app \
Output/func_3.2.0_darwin-$1.pkg
Output/func_3.2.1_darwin-$1.pkg
2 changes: 1 addition & 1 deletion deb/amd64/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: func
Version: 3.2.0
Version: 3.2.1
Section: base
Priority: optional
Architecture: amd64
Expand Down
2 changes: 1 addition & 1 deletion deb/arm64/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: func
Version: 3.2.0
Version: 3.2.1
Section: base
Priority: optional
Architecture: arm64
Expand Down
2 changes: 1 addition & 1 deletion webui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "func-webui",
"version": "3.2.0",
"version": "3.2.1",
"scripts": {
"dev": "vite",
"build": "vite build",
Expand Down
4 changes: 1 addition & 3 deletions webui/src/components/Node.vue
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,7 @@ const algodClient = computed(() => {
watch(
() => algodStatus.value,
(val) => {
if (!val?.["last-version"].includes("/925a464")) {
store.isIncentiveReady = true;
}
if (val?.["last-round"] >= 46512890) store.isIncentiveReady = true;
}
);
Expand Down
2 changes: 0 additions & 2 deletions webui/src/components/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ async function getVersion() {
if (!init) {
init = true;
updateNodeLatest(true);
} else {
throw Error("Download Failed");
}
}
Expand Down

0 comments on commit 1558341

Please sign in to comment.