Skip to content

Commit 0604a54

Browse files
committed
fix: update hardcoded port 8080 to 38123 in tests, CI, and docs
1 parent 4007a66 commit 0604a54

File tree

11 files changed

+30
-30
lines changed

11 files changed

+30
-30
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130
shell: bash
131131
run: |
132132
for i in {1..30}; do
133-
curl -s http://localhost:8080 > /dev/null && break
133+
curl -s http://localhost:38123 > /dev/null && break
134134
sleep 1
135135
done
136136

__tests__/desktop-stub-utils.test.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -260,18 +260,18 @@ describe('extractMediaFilename', () => {
260260

261261
describe('buildMediaUrl', () => {
262262
test('constructs correct URL', () => {
263-
const result = buildMediaUrl('http://localhost:8080', 'abc123', 'image.png');
264-
expect(result).toBe('http://localhost:8080/api/media/abc123/image.png');
263+
const result = buildMediaUrl('http://localhost:38123', 'abc123', 'image.png');
264+
expect(result).toBe('http://localhost:38123/api/media/abc123/image.png');
265265
});
266266

267267
test('encodes filename', () => {
268-
const result = buildMediaUrl('http://localhost:8080', 'abc123', 'my image.png');
269-
expect(result).toBe('http://localhost:8080/api/media/abc123/my%20image.png');
268+
const result = buildMediaUrl('http://localhost:38123', 'abc123', 'my image.png');
269+
expect(result).toBe('http://localhost:38123/api/media/abc123/my%20image.png');
270270
});
271271

272272
test('handles special characters', () => {
273-
const result = buildMediaUrl('http://localhost:8080', 'abc123', 'image (1).png');
274-
expect(result).toBe('http://localhost:8080/api/media/abc123/image%20(1).png');
273+
const result = buildMediaUrl('http://localhost:38123', 'abc123', 'image (1).png');
274+
expect(result).toBe('http://localhost:38123/api/media/abc123/image%20(1).png');
275275
});
276276
});
277277

@@ -283,17 +283,17 @@ describe('extractBlobUrl', () => {
283283
});
284284

285285
test('extracts blob URL from string', () => {
286-
const blobUrl = 'blob:http://localhost:8080/550e8400-e29b-41d4-a716-446655440000';
286+
const blobUrl = 'blob:http://localhost:38123/550e8400-e29b-41d4-a716-446655440000';
287287
expect(extractBlobUrl(blobUrl)).toBe(blobUrl);
288288
});
289289

290290
test('extracts blob URL from wrapped path', () => {
291-
const wrapped = 'file:///path/to/blob:http://localhost:8080/550e8400-e29b-41d4-a716-446655440000/media/image.png';
292-
expect(extractBlobUrl(wrapped)).toBe('blob:http://localhost:8080/550e8400-e29b-41d4-a716-446655440000');
291+
const wrapped = 'file:///path/to/blob:http://localhost:38123/550e8400-e29b-41d4-a716-446655440000/media/image.png';
292+
expect(extractBlobUrl(wrapped)).toBe('blob:http://localhost:38123/550e8400-e29b-41d4-a716-446655440000');
293293
});
294294

295295
test('returns null for non-blob paths', () => {
296-
expect(extractBlobUrl('http://localhost:8080/image.png')).toBe(null);
296+
expect(extractBlobUrl('http://localhost:38123/image.png')).toBe(null);
297297
expect(extractBlobUrl('file:///path/to/image.png')).toBe(null);
298298
expect(extractBlobUrl('/media/image.png')).toBe(null);
299299
});

__tests__/logo-header.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import fs from 'fs';
33
import path from 'path';
44
import os from 'os';
55

6-
const SERVER_PORT = Number.parseInt(process.env.SERVER_PORT || '8080', 10);
6+
const SERVER_PORT = Number.parseInt(process.env.SERVER_PORT || '38123', 10);
77
const SERVER_URL = process.env.SERVER_URL || `http://localhost:${SERVER_PORT}`;
88
const LOAD_TIMEOUT = Number.parseInt(process.env.LOAD_TIMEOUT || '30000', 10);
99
const LOGO_TIMEOUT = Number.parseInt(process.env.LOGO_TIMEOUT || '30000', 10);

__tests__/save.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import fs from 'fs';
44
import os from 'os';
55
import crypto from 'crypto';
66

7-
const SERVER_URL = process.env.SERVER_URL || 'http://localhost:8080';
7+
const SERVER_URL = process.env.SERVER_URL || 'http://localhost:38123';
88
const FIXTURES_DIR = path.resolve(import.meta.dir, '..', '.github/assets');
99
const tempFiles = [];
1010

__tests__/server-utils.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,12 @@ describe('generateX2TConfig', () => {
245245

246246
describe('extractFilePathFromUrl', () => {
247247
test('extracts path from OnlyOffice URL format', () => {
248-
const url = 'http://localhost:8080/api/onlyoffice/files/Users/test/file.xlsx';
248+
const url = 'http://localhost:38123/api/onlyoffice/files/Users/test/file.xlsx';
249249
expect(extractFilePathFromUrl(url)).toBe('/Users/test/file.xlsx');
250250
});
251251

252252
test('handles URL-encoded paths', () => {
253-
const url = 'http://localhost:8080/api/onlyoffice/files/Users/test/my%20file.xlsx';
253+
const url = 'http://localhost:38123/api/onlyoffice/files/Users/test/my%20file.xlsx';
254254
expect(extractFilePathFromUrl(url)).toBe('/Users/test/my file.xlsx');
255255
});
256256

@@ -260,8 +260,8 @@ describe('extractFilePathFromUrl', () => {
260260
});
261261

262262
test('returns null for non-matching URLs', () => {
263-
expect(extractFilePathFromUrl('http://localhost:8080/other/path')).toBe(null);
264-
expect(extractFilePathFromUrl('http://localhost:8080/api/convert')).toBe(null);
263+
expect(extractFilePathFromUrl('http://localhost:38123/other/path')).toBe(null);
264+
expect(extractFilePathFromUrl('http://localhost:38123/api/convert')).toBe(null);
265265
});
266266

267267
test('returns null for non-URL input', () => {

build-min.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ EDIT-BUILD-TEST WORKFLOW
131131
4. Start server and test:
132132
bun run server
133133

134-
5. Open browser to http://localhost:8080/open?filepath=/path/to/file.xlsx
134+
5. Open browser to http://localhost:38123/open?filepath=/path/to/file.xlsx
135135

136136

137137
RUNTIME LOADING

download-converter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const os = require('os');
2828
// Project files modified from upstream (excluding test/CI/docs):
2929
//
3030
// Server / Core:
31-
// server.js - Express server (port 8080)
31+
// server.js - Express server (dynamic port, default 38123)
3232
// server-utils.js - Server utility functions (added)
3333
// download-converter.js - Downloads ONLYOFFICE Desktop, extracts x2t (added)
3434
// package.json - Dependencies and scripts

test-console-batch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const path = require('path');
44
const os = require('os');
55
const http = require('http');
66

7-
const SERVER_PORT = Number.parseInt(process.env.SERVER_PORT || '8080', 10);
7+
const SERVER_PORT = Number.parseInt(process.env.SERVER_PORT || '38123', 10);
88
const SERVER_URL = process.env.SERVER_URL || `http://localhost:${SERVER_PORT}`;
99
const BATCH_SIZE = Number.parseInt(process.env.BATCH_SIZE || '5', 10);
1010
const LOAD_TIMEOUT = Number.parseInt(process.env.LOAD_TIMEOUT || '5000', 10);

test-desktop-stub-utils.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@ console.log('\n=== buildMediaUrl Tests ===\n');
2222

2323
console.log('Valid inputs:');
2424
test('builds URL with all params',
25-
utils.buildMediaUrl('http://localhost:8080', 'abc123', 'image.png') ===
26-
'http://localhost:8080/api/media/abc123/image.png');
25+
utils.buildMediaUrl('http://localhost:38123', 'abc123', 'image.png') ===
26+
'http://localhost:38123/api/media/abc123/image.png');
2727

2828
test('encodes filename with spaces',
29-
utils.buildMediaUrl('http://localhost:8080', 'abc', 'my image.png').includes('my%20image.png'));
29+
utils.buildMediaUrl('http://localhost:38123', 'abc', 'my image.png').includes('my%20image.png'));
3030

3131
test('encodes unicode filename',
32-
utils.buildMediaUrl('http://localhost:8080', 'abc', '画像.png').includes('%E7%94%BB%E5%83%8F.png'));
32+
utils.buildMediaUrl('http://localhost:38123', 'abc', '画像.png').includes('%E7%94%BB%E5%83%8F.png'));
3333

3434
console.log('\nMissing fileHash (BUG FIX - should return null):');
3535
test('returns null when fileHash is undefined',
36-
utils.buildMediaUrl('http://localhost:8080', undefined, 'image.png') === null);
36+
utils.buildMediaUrl('http://localhost:38123', undefined, 'image.png') === null);
3737

3838
test('returns null when fileHash is null',
39-
utils.buildMediaUrl('http://localhost:8080', null, 'image.png') === null);
39+
utils.buildMediaUrl('http://localhost:38123', null, 'image.png') === null);
4040

4141
test('returns null when fileHash is empty string',
42-
utils.buildMediaUrl('http://localhost:8080', '', 'image.png') === null);
42+
utils.buildMediaUrl('http://localhost:38123', '', 'image.png') === null);
4343

4444
console.log('\n=== Results ===');
4545
console.log(`Passed: ${passed}`);

test-image.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<head>
44
<title>Image Load Test</title>
55
<script>
6-
const SERVER_PORT = 8080;
6+
const SERVER_PORT = 38123;
77
const SERVER_BASE_URL = 'http://localhost:' + SERVER_PORT;
88
</script>
99
</head>
1010
<body>
1111
<h1>Testing Image Load</h1>
12-
<img id="test" src="http://localhost:8080/api/media/ba3e5be21444fe8a9558f25ed5ee35f4/image1.jpg"
12+
<img id="test" src="http://localhost:38123/api/media/ba3e5be21444fe8a9558f25ed5ee35f4/image1.jpg"
1313
onload="console.log('Image loaded successfully!', this.naturalWidth, 'x', this.naturalHeight)"
1414
onerror="console.error('Image failed to load!')"
1515
style="border: 2px solid blue;">

0 commit comments

Comments
 (0)