1
0
mirror of https://git.cloudron.io/cloudron/syncthing-app synced 2026-06-17 11:35:49 +00:00

Compare commits

...

15 Commits

Author SHA1 Message Date
Package Updates 7403b5ab73 Update package version to 1.34.1 2026-06-02 17:21:56 +00:00
Renovate Bot 1e3e2bbe53 chore(deps): update dependency syncthing/syncthing to v2.1.1
| datasource      | package             | from  | to    |
| --------------- | ------------------- | ----- | ----- |
| github-releases | syncthing/syncthing | 2.1.0 | 2.1.1 |
2026-06-02 16:40:37 +00:00
Girish Ramakrishnan 6bfb76fbf9 test: make test/test.js non-executable and remove shebang 2026-05-19 16:11:20 +02:00
Package Updates 32094b5108 Update package version to 1.34.0 2026-05-12 10:26:08 +00:00
Girish Ramakrishnan 8cf30550e3 fix tests 2026-05-12 12:14:49 +02:00
Renovate Bot a6a2bf218a chore(deps): update dependency syncthing/syncthing to v2.1.0
| datasource      | package             | from   | to    |
| --------------- | ------------------- | ------ | ----- |
| github-releases | syncthing/syncthing | 2.0.16 | 2.1.0 |
2026-05-12 08:46:59 +00:00
Girish Ramakrishnan ebc099e986 test: simplify clearCache, drop logout helpers, simplify button selectors
- Drop `await clearCache()` from login/auth helpers; clearing cache before
  every login is no longer necessary now that charlie isolates sessions.
- Replace `logout` helpers with `clearCache` directly in `it()` calls; the
  helpers were either thin wrappers around `clearCache()` or did real
  navigation that is no longer worth the maintenance.
- Simplify `xpath=//button[text()=...]` / `[contains(., ...)]` button text
  selectors to charlie's bare-string (or RegExp for OR-clauses) form.
2026-05-01 10:42:22 +02:00
Girish Ramakrishnan 3695f39ab6 test file cleanups 2026-04-30 10:25:54 +02:00
Girish Ramakrishnan ad17c38599 test: pass full Mocha test to takeScreenshot for unique screenshot names 2026-04-29 17:12:03 +02:00
Girish Ramakrishnan f861f076e4 test: drop 'text=' prefix from charlie locators
charlie now treats bare strings as exact-match (was substring) and
RegExp as the explicit fuzzy escape hatch. The 'text=' prefix has
been removed and now throws a migration error from charlie.

Made-with: Cursor
2026-04-27 17:03:24 +02:00
Girish Ramakrishnan b3297ccc87 test: port to charlie
Made-with: Cursor
2026-04-24 20:04:51 +02:00
Girish Ramakrishnan efe0db3947 test: remove package.json and package-lock.json, charlie provides all deps
Made-with: Cursor
2026-04-16 10:44:36 +02:00
Girish Ramakrishnan b8c7faa37a test: remove chromedriver dependency
Selenium Manager auto-detects the system ChromeDriver, making the
chromedriver npm package unnecessary.

Made-with: Cursor
2026-04-15 17:19:43 +02:00
Girish Ramakrishnan 7c3f77d272 test: convert test to ESM
Replace CommonJS require() with ESM imports, add "type": "module"
to test/package.json, remove 'use strict' and jshint directives,
replace __dirname with import.meta.dirname.

Made-with: Cursor
2026-04-15 16:17:02 +02:00
Girish Ramakrishnan 653e6a11bb Replace expect.js with node:assert/strict
expect.js is unmaintained and unnecessary — Node's built-in assert
module covers all our assertion patterns. This also removes expect.js
from package.json dependencies.

Made-with: Cursor
2026-04-15 15:38:49 +02:00
6 changed files with 62 additions and 3229 deletions
+23
View File
@@ -826,3 +826,26 @@
* The handling of conflict resolution involving deleted files has changed. A delete can now be the winning outcome of conflict resolution, resulting in the deleted file being moved to a conflict copy. * The handling of conflict resolution involving deleted files has changed. A delete can now be the winning outcome of conflict resolution, resulting in the deleted file being moved to a conflict copy.
* fix(protocol): verify compressed message length before decompression by [@​calmh](https://github.com/calmh) in [#​10595](https://github.com/syncthing/syncthing/pull/10595) * fix(protocol): verify compressed message length before decompression by [@​calmh](https://github.com/calmh) in [#​10595](https://github.com/syncthing/syncthing/pull/10595)
[1.34.0]
* Update syncthing to 2.1.0
* [Full Changelog](https://github.com/syncthing/syncthing/releases/tag/v2.1.0)
* fix(stdiscosrv): close file descriptor on flush error in write by [@cuiweixie](https://github.com/cuiweixie) in [#10615](https://github.com/syncthing/syncthing/pull/10615)
* fix(gui): disable autocomplete for folder password by [@bt90](https://github.com/bt90) in [#10342](https://github.com/syncthing/syncthing/pull/10342)
* fix(protocol): limit size of incoming request messages by [@calmh](https://github.com/calmh) in [#10629](https://github.com/syncthing/syncthing/pull/10629)
* fix(gui): don't show local device under remote devices (ref [#10563](https://github.com/syncthing/syncthing/issues/10563)) by [@maen-bn](https://github.com/maen-bn) in [#10631](https://github.com/syncthing/syncthing/pull/10631)
* fix(gui): order folders alphabetically and ensure local device stays hidden (ref [#10563](https://github.com/syncthing/syncthing/issues/10563), ref [#10631](https://github.com/syncthing/syncthing/issues/10631)) by [@maen-bn](https://github.com/maen-bn) in [#10637](https://github.com/syncthing/syncthing/pull/10637)
* fix(gui): fallback to folder ID when label is empty in remove dialog by [@RealCharlesChia](https://github.com/RealCharlesChia) in [#10657](https://github.com/syncthing/syncthing/pull/10657)
* fix(gui): fix tabs visually disabled but still clickable during ignore patterns setup (fixes [#10634](https://github.com/syncthing/syncthing/issues/10634)) by [@JRNitre](https://github.com/JRNitre) in [#10651](https://github.com/syncthing/syncthing/pull/10651)
* fix(strelaysrv): properly use bind address for outgoing requests (fixes [#10658](https://github.com/syncthing/syncthing/issues/10658)) by [@calmh](https://github.com/calmh) in [#10659](https://github.com/syncthing/syncthing/pull/10659)
* feat(gui, config): support simple folder grouping (fixes [#2070](https://github.com/syncthing/syncthing/issues/2070)) by [@maen-bn](https://github.com/maen-bn) in [#10563](https://github.com/syncthing/syncthing/pull/10563)
* feat(dialer): add HTTP/HTTPS proxy support via CONNECT by [@luizluca](https://github.com/luizluca) in [#10572](https://github.com/syncthing/syncthing/pull/10572)
[1.34.1]
* Update syncthing to 2.1.1
* [Full Changelog](https://github.com/syncthing/syncthing/releases/tag/v2.1.1)
* fix(syncthing): properly upgrade via REST when Syncthing is running (fixes [#10697](https://github.com/syncthing/syncthing/issues/10697)) by [@calmh](https://github.com/calmh) in [#10699](https://github.com/syncthing/syncthing/pull/10699)
* fix(versioner): ensure user read/write/execute on archived dirs (fixes [#10532](https://github.com/syncthing/syncthing/issues/10532)) by [@calmh](https://github.com/calmh) in [#10696](https://github.com/syncthing/syncthing/pull/10696)
* fix(discover): only announce wildcard for TCP punching when listening on wildcard address (fixes [#10503](https://github.com/syncthing/syncthing/issues/10503)) by [@calmh](https://github.com/calmh) in [#10691](https://github.com/syncthing/syncthing/pull/10691)
* fix(stcrashreceiver): close source loader responses on errors by [@mattn](https://github.com/mattn) in [#10704](https://github.com/syncthing/syncthing/pull/10704)
* fix(protocol): handle zero-size requests (fixes [#10709](https://github.com/syncthing/syncthing/issues/10709)) by [@calmh](https://github.com/calmh) in [#10710](https://github.com/syncthing/syncthing/pull/10710)
+2 -2
View File
@@ -5,8 +5,8 @@
"description": "file://DESCRIPTION.md", "description": "file://DESCRIPTION.md",
"changelog": "file://CHANGELOG", "changelog": "file://CHANGELOG",
"tagline": "Decentralized file synchronization", "tagline": "Decentralized file synchronization",
"version": "1.33.17", "version": "1.34.1",
"upstreamVersion": "2.0.16", "upstreamVersion": "2.1.1",
"healthCheckPath": "/healthcheck", "healthCheckPath": "/healthcheck",
"httpPort": 8000, "httpPort": 8000,
"addons": { "addons": {
+1 -1
View File
@@ -4,7 +4,7 @@ RUN mkdir -p /app/code
WORKDIR /app/code WORKDIR /app/code
# renovate: datasource=github-releases depName=syncthing/syncthing versioning=semver extractVersion=^v(?<version>.+)$ # renovate: datasource=github-releases depName=syncthing/syncthing versioning=semver extractVersion=^v(?<version>.+)$
ARG SYNCTHING_VERSION=2.0.16 ARG SYNCTHING_VERSION=2.1.1
RUN wget https://github.com/syncthing/syncthing/releases/download/v${SYNCTHING_VERSION}/syncthing-linux-amd64-v${SYNCTHING_VERSION}.tar.gz -O - | tar -xz -C /app/code --strip-components=1 RUN wget https://github.com/syncthing/syncthing/releases/download/v${SYNCTHING_VERSION}/syncthing-linux-amd64-v${SYNCTHING_VERSION}.tar.gz -O - | tar -xz -C /app/code --strip-components=1
-3069
View File
File diff suppressed because it is too large Load Diff
-17
View File
@@ -1,17 +0,0 @@
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"chromedriver": "^147.0.1",
"expect.js": "^0.3.1",
"mocha": "^11.7.5",
"selenium-webdriver": "^4.41.0"
}
}
+36 -140
View File
@@ -1,195 +1,91 @@
#!/usr/bin/env node
/* jshint esversion: 8 */ import { app, clearCache, click, cloudronCli, goto, password, sendKeys, setupBrowser, takeScreenshot, teardownBrowser, username, waitFor } from '@cloudron/charlie';
/* global it, xit, describe, before, after, afterEach */
'use strict'; /* global it, describe, before, after, afterEach */
require('chromedriver');
const execSync = require('child_process').execSync,
expect = require('expect.js'),
fs = require('fs'),
path = require('path'),
timers = require('timers/promises'),
{ Builder, By, until } = require('selenium-webdriver'),
{ Options } = require('selenium-webdriver/chrome');
if (!process.env.USERNAME || !process.env.PASSWORD) {
console.log('USERNAME and PASSWORD env vars need to be set');
process.exit(1);
}
describe('Application life cycle test', function () { describe('Application life cycle test', function () {
this.timeout(0); const FOLDER = 'xmf'; // keep small; long folder names fail in automation
const LOCATION = process.env.LOCATION || 'test';
const TEST_TIMEOUT = 30000;
const FOLDER = 'xmf'; // keep this small. long folder names fail in automation, not sure why
const SYNC_PORT = 22001; const SYNC_PORT = 22001;
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }; const adminUsername = 'admin';
const adminPassword = 'changeme';
let browser, app; before(setupBrowser);
const adminUsername = 'admin', adminPassword = 'changeme'; after(teardownBrowser);
const username = process.env.USERNAME;
const password = process.env.PASSWORD;
before(function () {
const chromeOptions = new Options().windowSize({ width: 1280, height: 1024 });
if (process.env.CI) chromeOptions.addArguments('no-sandbox', 'disable-dev-shm-usage', 'headless');
browser = new Builder().forBrowser('chrome').setChromeOptions(chromeOptions).build();
if (!fs.existsSync('./screenshots')) fs.mkdirSync('./screenshots');
});
after(function () {
browser.quit();
});
afterEach(async function () { afterEach(async function () {
if (!process.env.CI || !app) return; await takeScreenshot(this.currentTest);
const currentUrl = await browser.getCurrentUrl();
if (!currentUrl.includes(app.domain)) return;
expect(this.currentTest.title).to.be.a('string');
const screenshotData = await browser.takeScreenshot();
fs.writeFileSync(`./screenshots/${new Date().getTime()}-${this.currentTest.title.replaceAll(' ', '_')}.png`, screenshotData, 'base64');
}); });
function getAppInfo() { async function login(uname, pass) {
const inspect = JSON.parse(execSync('cloudron inspect')); await goto(`https://${app.fqdn}`, 'label=User');
app = inspect.apps.filter(function (a) { return a.location.indexOf(LOCATION) === 0; })[0]; await sendKeys('label=User', uname);
expect(app).to.be.an('object'); await sendKeys('label=Password', pass);
} await click('Log In');
await waitFor('Actions');
async function waitForElement(elem) {
await browser.wait(until.elementLocated(elem), TEST_TIMEOUT);
await browser.wait(until.elementIsVisible(browser.findElement(elem)), TEST_TIMEOUT);
}
async function login(username, password) {
await browser.manage().deleteAllCookies();
await browser.get('https://' + app.fqdn);
await waitForElement(By.id('user'));
await browser.findElement(By.id('user')).sendKeys(username);
await browser.findElement(By.id('password')).sendKeys(password);
await browser.findElement(By.xpath('//button[@type="submit"]')).click();
await waitForElement(By.xpath('//span[text()="Actions"]'));
}
async function logout() {
await browser.get('https://' + app.fqdn);
await waitForElement(By.xpath('//span[text()="Actions"]'));
await browser.findElement(By.xpath('//span[text()="Actions"]')).click();
await browser.sleep(4000);
await waitForElement(By.xpath('//span[text()="Log Out"]'));
await browser.findElement(By.xpath('//span[text()="Log Out"]')).click();
await browser.sleep(4000);
await waitForElement(By.id('user'));
} }
async function loadPage() { async function loadPage() {
await browser.get('https://' + app.fqdn); await goto(`https://${app.fqdn}`, 'Actions');
await waitForElement(By.xpath('//span[text()="Actions"]'));
} }
async function addFolder() { async function addFolder() {
await browser.get('https://' + app.fqdn); await goto(`https://${app.fqdn}`, /Add Folder/);
await browser.findElement(By.css('[ng-click*=addFolder]')).click(); await click(/Add Folder/);
await browser.sleep(8000); await sendKeys('label=Folder Label', FOLDER);
await waitForElement(By.id('folderPath')); await sendKeys('label=Folder Path', `/app/data/${FOLDER}`);
await browser.sleep(8000); // wait more, not sure why this is needed await click(/Save/);
await browser.findElement(By.id('folderLabel')).sendKeys(FOLDER); await waitFor(FOLDER);
await browser.findElement(By.id('folderPath')).sendKeys(`/app/data/${FOLDER}`);
await browser.sleep(8000); // without this sometimes only part of the folder name gets through
await browser.findElement(By.css('[ng-click*=saveFolder]')).click();
await browser.sleep(8000); // without this "stale element"
await waitForElement(By.xpath(`//span[contains(text(), '${FOLDER}')]`));
await browser.sleep(8000);
} }
async function checkFolder() { async function checkFolder() {
await browser.get('https://' + app.fqdn); await goto(`https://${app.fqdn}`, FOLDER);
await browser.sleep(5000);
await browser.get('https://' + app.fqdn);
await browser.wait(until.elementLocated(By.xpath(`//span[text()="${FOLDER}"]`)), TEST_TIMEOUT);
} }
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
// NO SSO // NO SSO
it('install app (NO SSO)', function () { execSync('cloudron install --no-sso --port-bindings SYNC_PORT=' + SYNC_PORT + ' --location ' + LOCATION, EXEC_ARGS); }); it('install app (NO SSO)', () => cloudronCli.install({ noSso: true, tcpPortFlags: { SYNC_PORT } }));
it('can get app information', getAppInfo);
it('can admin login', login.bind(null, adminUsername, adminPassword)); it('can admin login', login.bind(null, adminUsername, adminPassword));
it('can load page', loadPage); it('can load page', loadPage);
it('can add folder', addFolder); it('can add folder', addFolder);
it('can check folder', checkFolder); it('can check folder', checkFolder);
it('uninstall app', async function () { it('uninstall app', cloudronCli.uninstall);
await browser.get('about:blank');
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
});
// SSO // SSO
it('install app (SSO)', function () { execSync('cloudron install --port-bindings SYNC_PORT=' + SYNC_PORT + ' --location ' + LOCATION, EXEC_ARGS); }); it('install app (SSO)', () => cloudronCli.install({ noSso: false, tcpPortFlags: { SYNC_PORT } }));
it('can get app information', getAppInfo);
it('can login', login.bind(null, username, password)); it('can login', login.bind(null, username, password));
it('can load page', loadPage); it('can load page', loadPage);
it('can add folder', addFolder); it('can add folder', addFolder);
it('can logout', logout); it('can logout', clearCache);
it('backup app', async function () { execSync('cloudron backup create --app ' + app.id, EXEC_ARGS); }); it('backup app', cloudronCli.createBackup);
it('restore app', async function () { it('restore app', cloudronCli.restoreFromLatestBackup);
await browser.get('about:blank');
execSync('cloudron restore --app ' + app.id, EXEC_ARGS);
await timers.setTimeout(5000);
});
it('can login', login.bind(null, username, password)); it('can login', login.bind(null, username, password));
it('can load page', loadPage); it('can load page', loadPage);
it('can check folder', checkFolder); it('can check folder', checkFolder);
it('can logout', logout); it('can logout', clearCache);
it('move to different location', async function () { it('move to different location', cloudronCli.changeLocation);
await browser.get('about:blank');
execSync(`cloudron configure --location ${LOCATION}2 --app ${app.id}`, EXEC_ARGS);
await timers.setTimeout(5000);
});
it('can get app information', getAppInfo);
it('can login', login.bind(null, username, password)); it('can login', login.bind(null, username, password));
it('can load page', loadPage); it('can load page', loadPage);
it('can check folder', checkFolder); it('can check folder', checkFolder);
it('can logout', logout); it('can logout', clearCache);
it('uninstall app', async function () { it('uninstall app', cloudronCli.uninstall);
await browser.get('about:blank');
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
});
// test update // test update
it('can install app', async function () { it('can install app for update', () => cloudronCli.appstoreInstall({ tcpPortFlags: { SYNC_PORT } }));
execSync('cloudron install --port-bindings SYNC_PORT=' + SYNC_PORT + ' --appstore-id net.syncthing.cloudronapp2 --location ' + LOCATION, EXEC_ARGS);
await timers.setTimeout(30000);
});
it('can get app information', getAppInfo);
it('can login', login.bind(null, username, password)); it('can login', login.bind(null, username, password));
it('can load page', loadPage); it('can load page', loadPage);
it('can add folder', addFolder); it('can add folder', addFolder);
it('can logout', logout); it('can logout', clearCache);
it('can update', async function () { it('can update', cloudronCli.update);
await browser.get('about:blank');
execSync('cloudron update --app ' + LOCATION, EXEC_ARGS);
await timers.setTimeout(30000);
});
it('can login', login.bind(null, username, password)); it('can login', login.bind(null, username, password));
it('can check folder', checkFolder); it('can check folder', checkFolder);
it('uninstall app', async function () { it('uninstall app', cloudronCli.uninstall);
await browser.get('about:blank');
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
});
}); });