Skip to content

Commit

Permalink
Merge pull request #910 from RunOnFlux/development
Browse files Browse the repository at this point in the history
v3.32.1
  • Loading branch information
TheTrunk authored Jan 21, 2023
2 parents 7186e50 + 3554562 commit 832902e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
16 changes: 8 additions & 8 deletions ZelBack/src/services/upnpService.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async function verifyUPNPsupport(apiport = config.apiport) {
await client.createMapping({
public: +apiport + 1,
private: +apiport + 1,
ttl: 2 * 60 * 60, // 2 hours
ttl: 0, // 1 hour
description: 'Flux_OS_reserved_port',
});
} catch (error) {
Expand Down Expand Up @@ -87,19 +87,19 @@ async function setupUPNP(apiport = config.apiport) {
await client.createMapping({
public: +apiport,
private: +apiport,
ttl: 2 * 60 * 60, // 2 hours. Some routers force low ttl if 0, indefinite is used. Flux refreshes this every 6 blocks ~ 12 minutes
ttl: 0, // 1 hour. Some routers force low ttl if 0, indefinite is used. Flux refreshes this every 6 blocks ~ 12 minutes
description: 'Flux_Backend_API',
});
await client.createMapping({
public: +apiport - 1,
private: +apiport - 1,
ttl: 2 * 60 * 60, // 2 hours
ttl: 0, // 1 hour
description: 'Flux_Home_UI',
});
await client.createMapping({
public: +apiport + 2,
private: +apiport + 2,
ttl: 2 * 60 * 60, // 2 hours
ttl: 0, // 1 hour
description: 'Flux_Syncthing',
});
return true;
Expand All @@ -120,14 +120,14 @@ async function mapUpnpPort(port, description) {
await client.createMapping({
public: port,
private: port,
ttl: 2 * 60 * 60, // 2 hours
ttl: 0, // 1 hour
protocol: 'TCP',
description,
});
await client.createMapping({
public: port,
private: port,
ttl: 2 * 60 * 60, // 2 hours
ttl: 0, // 1 hour
protocol: 'UDP',
description,
});
Expand Down Expand Up @@ -178,14 +178,14 @@ async function mapPortApi(req, res) {
await client.createMapping({
public: port,
private: port,
ttl: 2 * 60 * 60, // 2 hours
ttl: 0, // 1 hour
protocol: 'TCP',
description: 'Flux_manual_entry',
});
await client.createMapping({
public: port,
private: port,
ttl: 2 * 60 * 60, // 2 hours
ttl: 0, // 1 hour
protocol: 'UDP',
description: 'Flux_manual_entry',
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flux",
"version": "3.32.0",
"version": "3.32.1",
"description": "Flux, Your Gateway to a Decentralized World",
"repository": {
"type": "git",
Expand Down
24 changes: 12 additions & 12 deletions tests/unit/upnpService.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ describe('upnpService tests', () => {
sinon.assert.notCalled(logSpy);
sinon.assert.calledThrice(createMappingSpy);
sinon.assert.calledWithExactly(createMappingSpy, {
public: 123, private: 123, ttl: 7200, description: 'Flux_Backend_API',
public: 123, private: 123, ttl: 3600, description: 'Flux_Backend_API',
});
sinon.assert.calledWithExactly(createMappingSpy, {
public: 122, private: 122, ttl: 7200, description: 'Flux_Home_UI',
public: 122, private: 122, ttl: 3600, description: 'Flux_Home_UI',
});
sinon.assert.calledWithExactly(createMappingSpy, {
public: 125, private: 125, ttl: 7200, description: 'Flux_Syncthing',
public: 125, private: 125, ttl: 3600, description: 'Flux_Syncthing',
});
});

Expand All @@ -164,13 +164,13 @@ describe('upnpService tests', () => {
sinon.assert.notCalled(logSpy);
sinon.assert.calledThrice(createMappingSpy);
sinon.assert.calledWithExactly(createMappingSpy, {
public: 5550, private: 5550, ttl: 7200, description: 'Flux_Backend_API',
public: 5550, private: 5550, ttl: 3600, description: 'Flux_Backend_API',
});
sinon.assert.calledWithExactly(createMappingSpy, {
public: 5549, private: 5549, ttl: 7200, description: 'Flux_Home_UI',
public: 5549, private: 5549, ttl: 3600, description: 'Flux_Home_UI',
});
sinon.assert.calledWithExactly(createMappingSpy, {
public: 5552, private: 5552, ttl: 7200, description: 'Flux_Syncthing',
public: 5552, private: 5552, ttl: 3600, description: 'Flux_Syncthing',
});
});

Expand Down Expand Up @@ -208,14 +208,14 @@ describe('upnpService tests', () => {
sinon.assert.calledWithExactly(createMappingSpy, {
public: 123,
private: 123,
ttl: 2 * 60 * 60,
ttl: 1 * 60 * 60,
protocol: 'TCP',
description: 'some description',
});
sinon.assert.calledWithExactly(createMappingSpy, {
public: 123,
private: 123,
ttl: 2 * 60 * 60,
ttl: 1 * 60 * 60,
protocol: 'UDP',
description: 'some description',
});
Expand Down Expand Up @@ -360,14 +360,14 @@ describe('upnpService tests', () => {
sinon.assert.calledWithExactly(createMappingSpy, {
public: 1234,
private: 1234,
ttl: 2 * 60 * 60,
ttl: 1 * 60 * 60,
protocol: 'TCP',
description: 'Flux_manual_entry',
});
sinon.assert.calledWithExactly(createMappingSpy, {
public: 1234,
private: 1234,
ttl: 2 * 60 * 60,
ttl: 1 * 60 * 60,
protocol: 'UDP',
description: 'Flux_manual_entry',
});
Expand All @@ -393,14 +393,14 @@ describe('upnpService tests', () => {
sinon.assert.calledWithExactly(createMappingSpy, {
public: 1234,
private: 1234,
ttl: 2 * 60 * 60,
ttl: 1 * 60 * 60,
protocol: 'TCP',
description: 'Flux_manual_entry',
});
sinon.assert.calledWithExactly(createMappingSpy, {
public: 1234,
private: 1234,
ttl: 2 * 60 * 60,
ttl: 1 * 60 * 60,
protocol: 'UDP',
description: 'Flux_manual_entry',
});
Expand Down

0 comments on commit 832902e

Please sign in to comment.