Skip to content

Commit 0891231

Browse files
authored
Merge pull request #64 from GalaxyPay/dev
chore: release v3.3.2
2 parents 5ffca5b + 7548435 commit 0891231

21 files changed

+177
-92
lines changed

Diff for: .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.3.1
269+
tag: v3.3.2
270270
artifacts: "Output/*"

Diff for: 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.3.1"
5+
#define MyAppVersion "3.3.2"
66
#define MyAppPublisher "Galaxy Pay, LLC"
77
#define MyAppPublisherURL "https://galaxy-pay.com"
88
#define MyPublishPath "publish"

Diff for: FUNC/FUNC.csproj

+4-8
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,11 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<Content Remove="appsettings.Development.json" />
14-
<Content Remove="appsettings.json" />
15-
</ItemGroup>
16-
17-
<ItemGroup>
18-
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="9.0.0" />
19-
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.0" />
13+
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="9.0.1" />
14+
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.1" />
2015
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
21-
<PackageReference Include="Octokit" Version="13.0.1" />
16+
<PackageReference Include="Octokit" Version="14.0.0" />
17+
<PackageReference Include="Yarp.ReverseProxy" Version="2.2.0" />
2218
</ItemGroup>
2319

2420
<ItemGroup>

Diff for: FUNC/Node.cs

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ public static async Task<NodeStatus> Get(string name)
2727
var endpointAddressToken = config.GetValue("EndpointAddress");
2828
string endpointAddress = endpointAddressToken?.Value<string>() ?? ":0";
2929
port = int.Parse(endpointAddress[(endpointAddress.IndexOf(":") + 1)..]);
30+
if (name == "algorand")
31+
Shared.AlgoPort = port;
32+
else if (name == "voi")
33+
Shared.VoiPort = port;
3034
}
3135

3236
string sc = string.Empty;

Diff for: FUNC/Program.cs

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using FUNC;
22
using Microsoft.Net.Http.Headers;
3+
using Yarp.ReverseProxy.Transforms;
34

45
var builder = WebApplication.CreateBuilder(args);
56

@@ -11,11 +12,29 @@
1112
builder.WebHost.ConfigureKestrel(options =>
1213
{
1314
options.ListenAnyIP(3536);
15+
var cert = X509.Generate(subject: "FUNC");
1416
options.ListenAnyIP(3537, listenOptions =>
1517
{
16-
listenOptions.UseHttps(X509.Generate(subject: "FUNC"));
18+
listenOptions.UseHttps(cert);
19+
});
20+
options.ListenAnyIP(3538, listenOptions =>
21+
{
22+
listenOptions.UseHttps(cert);
1723
});
1824
});
25+
builder.Services.AddReverseProxy()
26+
.LoadFromConfig(builder.Configuration.GetSection("ReverseProxy"))
27+
.AddTransforms(transformBuilderContext =>
28+
{
29+
transformBuilderContext.AddRequestTransform(transformContext =>
30+
{
31+
var ogPort = transformContext.HttpContext.Request.Host.Port;
32+
var destPort = ogPort == 3538 ? Shared.VoiPort : Shared.AlgoPort;
33+
var newUri = new UriBuilder(transformContext.DestinationPrefix) { Port = destPort }.Uri;
34+
transformContext.DestinationPrefix = newUri.ToString();
35+
return ValueTask.CompletedTask;
36+
});
37+
});
1938

2039
var app = builder.Build();
2140

@@ -28,5 +47,6 @@
2847
app.UseCors(options => options.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
2948
app.MapControllers();
3049
app.UseFileServer();
50+
app.MapReverseProxy();
3151

3252
app.Run();

Diff for: FUNC/Shared.cs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace FUNC
2+
{
3+
public static class Shared
4+
{
5+
public static int AlgoPort { get; set; } = 8081;
6+
public static int VoiPort { get; set; } = 8082;
7+
}
8+
}

Diff for: FUNC/appsettings.json

+20-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,24 @@
55
"Microsoft.AspNetCore": "Warning"
66
}
77
},
8-
"AllowedHosts": "*"
8+
"AllowedHosts": "*",
9+
"ReverseProxy": {
10+
"Routes": {
11+
"route1": {
12+
"ClusterId": "cluster1",
13+
"Match": {
14+
"Path": "/v2/{**catch-all}"
15+
}
16+
}
17+
},
18+
"Clusters": {
19+
"cluster1": {
20+
"Destinations": {
21+
"destination1": {
22+
"Address": "http://localhost"
23+
}
24+
}
25+
}
26+
}
27+
}
928
}

Diff for: README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,13 @@ If you want to participate in consensus, you'll need to generate a Participation
152152

153153
- 3536 AND 3537 - FUNC UI and API
154154
- 8081 - Algorand algod
155-
- 8082 - Voi algod
155+
- 8082 AND 3538 - Voi algod
156156

157157
- The `algod` ports are configurable through the UI, and you only need to open the ones for the networks you use
158158

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

161-
- 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.
161+
- 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.
162162

163163
## Build (for Developers)
164164

@@ -168,4 +168,6 @@ You can fork the repo and let Github Actions do the build for you, or you can ru
168168
- [local-publish.sh](local-publish.sh) and [create-package-pkg.sh](create-package-pkg.sh) (Mac)
169169
- [local-publish.sh](local-publish.sh) and [create-package-deb.sh](create-package-deb.sh) (Linux)
170170

171+
Note the `create-package` scripts take an argument of `amd64` or `arm64`.
172+
171173
Dependencies include .NET Core 8, Node.js, pnpm, and Inno Setup.

Diff for: 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.3.1_linux-$1
3+
PKG=Output/func_3.3.2_linux-$1
44

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

Diff for: 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.3.1_darwin-$1.pkg
8+
Output/func_3.3.2_darwin-$1.pkg

Diff for: deb/amd64/control

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

Diff for: deb/arm64/control

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

Diff for: webui/.eslintrc-auto-import.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"Ref": true,
1616
"VNode": true,
1717
"WritableComputedRef": true,
18+
"axios": true,
1819
"computed": true,
1920
"createApp": true,
2021
"customRef": true,
@@ -59,6 +60,7 @@
5960
"toValue": true,
6061
"triggerRef": true,
6162
"unref": true,
63+
"useAppStore": true,
6264
"useAttrs": true,
6365
"useCssModule": true,
6466
"useCssVars": true,
@@ -69,9 +71,6 @@
6971
"watch": true,
7072
"watchEffect": true,
7173
"watchPostEffect": true,
72-
"watchSyncEffect": true,
73-
"axios": true,
74-
"default": true,
75-
"useAppStore": true
74+
"watchSyncEffect": true
7675
}
7776
}

Diff for: 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.3.1",
3+
"version": "3.3.2",
44
"scripts": {
55
"dev": "vite",
66
"build": "vite build",

Diff for: webui/src/components/Config.vue

+63-46
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,64 @@
22
<v-dialog v-model="show" max-width="800" persistent>
33
<v-card :disabled="loading">
44
<v-card-title> Configure Node </v-card-title>
5-
<v-container v-if="config">
6-
<v-text-field label="Port" v-model.number="port" type="number" />
7-
<v-text-field
8-
label="Token (Read-Only)"
9-
readonly
10-
:model-value="token"
11-
:append-inner-icon="mdiContentCopy"
12-
@click:append-inner="copyVal(token)"
13-
/>
14-
<v-select
15-
label="BaseLoggerDebugLevel"
16-
v-model="baseLoggerDebugLevel"
17-
variant="outlined"
18-
density="comfortable"
19-
:items="[...Array(6).keys()]"
20-
hint="Must be 4 or greater for telemetry to work. For best performance, set to 0."
21-
persistent-hint
22-
class="pb-2"
23-
/>
24-
<v-checkbox-btn v-model="showDNSBootstrapID" label="DNS Bootstrap ID" />
25-
<v-textarea
26-
:disabled="!showDNSBootstrapID"
27-
label="DNS Bootstrap ID"
28-
v-model="config.DNSBootstrapID"
29-
rows="2"
30-
/>
31-
<v-checkbox-btn
32-
v-model="enableP2P"
33-
label="Enable P2P"
34-
:disabled="!enableP2P"
35-
/>
36-
<v-checkbox-btn
37-
v-model="enableP2PHybridMode"
38-
label="Enable P2P Hybrid Mode"
39-
:disabled="!enableP2PHybridMode"
40-
/>
41-
</v-container>
42-
<v-card-actions>
43-
<v-btn text="Cancel" variant="tonal" @click="show = false" />
44-
<v-btn
45-
text="Save"
46-
color="primary"
47-
variant="tonal"
48-
@click="saveConfig()"
49-
/>
50-
</v-card-actions>
5+
<v-form ref="form" @submit.prevent="saveConfig()">
6+
<v-container v-if="config">
7+
<v-text-field
8+
label="Port"
9+
v-model.number="port"
10+
type="number"
11+
:rules="[portRule]"
12+
class="pb-2"
13+
/>
14+
<v-text-field
15+
label="Token (Read-Only)"
16+
readonly
17+
:model-value="token"
18+
:append-inner-icon="mdiContentCopy"
19+
@click:append-inner="copyVal(token)"
20+
/>
21+
<v-select
22+
label="BaseLoggerDebugLevel"
23+
v-model="baseLoggerDebugLevel"
24+
variant="outlined"
25+
density="comfortable"
26+
:items="[...Array(6).keys()]"
27+
hint="Must be 4 or greater for telemetry to work. For best performance, set to 0."
28+
persistent-hint
29+
class="pb-2"
30+
/>
31+
<v-checkbox-btn
32+
v-model="showDNSBootstrapID"
33+
label="DNS Bootstrap ID"
34+
/>
35+
<v-textarea
36+
:disabled="!showDNSBootstrapID"
37+
label="DNS Bootstrap ID"
38+
v-model="config.DNSBootstrapID"
39+
rows="2"
40+
/>
41+
<v-checkbox-btn
42+
v-model="enableP2P"
43+
label="Enable P2P"
44+
:disabled="!enableP2P"
45+
/>
46+
<v-checkbox-btn
47+
v-model="enableP2PHybridMode"
48+
label="Enable P2P Hybrid Mode"
49+
:disabled="!enableP2PHybridMode"
50+
/>
51+
</v-container>
52+
<v-card-actions>
53+
<v-btn text="Cancel" variant="tonal" @click="show = false" />
54+
<v-btn text="Save" color="primary" variant="tonal" type="submit" />
55+
</v-card-actions>
56+
</v-form>
5157
</v-card>
5258
</v-dialog>
5359
</template>
5460

5561
<script lang="ts" setup>
62+
import { networks } from "@/data";
5663
import FUNC from "@/services/api";
5764
import { delay } from "@/utils";
5865
import { mdiContentCopy } from "@mdi/js";
@@ -78,6 +85,14 @@ const show = computed({
7885
7986
const store = useAppStore();
8087
const config = ref();
88+
const form = ref();
89+
90+
const invalidPorts = networks
91+
.map((n) => n.yarpAlgodPort.toString())
92+
.concat("3536");
93+
const portRule = (v: string) => {
94+
return !invalidPorts.includes(v) || "Invalid Port";
95+
};
8196
8297
const port = computed({
8398
get() {
@@ -144,6 +159,8 @@ const showDNSBootstrapID = computed({
144159
const loading = ref(false);
145160
146161
async function saveConfig() {
162+
const { valid } = await form.value.validate();
163+
if (!valid) return;
147164
try {
148165
loading.value = true;
149166
await FUNC.api.put(`${props.name}/config`, {

Diff for: webui/src/components/Node.vue

+12-2
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@
205205
</template>
206206

207207
<script setup lang="ts">
208+
import { networks } from "@/data";
208209
import FUNC from "@/services/api";
209210
import { NodeStatus } from "@/types";
210211
import { checkCatchup, delay } from "@/utils";
@@ -327,7 +328,15 @@ async function getNodeStatus() {
327328
if (nodeStatus.value?.serviceStatus !== "Running") {
328329
refreshing = false;
329330
}
330-
if (
331+
if (location.protocol === "https:") {
332+
if (nodeStatus.value && oldStatus?.token !== nodeStatus.value.token) {
333+
algodClient.value = new Algodv2(
334+
nodeStatus.value.token,
335+
`https://${location.hostname}`,
336+
networks.find((n) => n.title === props.name)?.yarpAlgodPort
337+
);
338+
}
339+
} else if (
331340
nodeStatus.value &&
332341
(oldStatus?.port !== nodeStatus.value.port ||
333342
oldStatus?.token !== nodeStatus.value.token)
@@ -377,7 +386,8 @@ async function getAlgodStatus() {
377386
}
378387
} catch (err: any) {
379388
console.error(err);
380-
store.setSnackbar(err?.response?.data || err.message, "error");
389+
if (err.status !== 502)
390+
store.setSnackbar(err?.response?.data || err.message, "error");
381391
}
382392
}
383393

0 commit comments

Comments
 (0)