Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨🚀 feat(docker): update Gramps, Owncloud, Nextcloud, Lidarr, Notemark, and Zipline #112

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
121 changes: 70 additions & 51 deletions apps/__tests__/apps.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import fs from "fs";
import jsyaml from "js-yaml";
import fs from 'fs';
import jsyaml from 'js-yaml';

type FormField = {
type: "random";
type: 'random';
required: boolean;
};

Expand All @@ -24,25 +24,28 @@ interface AppConfig {
form_fields?: FormField[];
supported_architectures: string[];
dynamic_config: boolean;
created_at: number;
updated_at: number;
}

const networkExceptions = [
"matter-server",
"mdns-repeater",
"pihole",
"tailscale",
"homeassistant",
"plex",
"zerotier",
"gladys",
"scrypted",
"homebridge",
"cloudflared",
'matter-server',
'mdns-repeater',
'pihole',
'tailscale',
'homeassistant',
'plex',
'zerotier',
'gladys',
'scrypted',
'homebridge',
'cloudflared',
'beszel-agent',
];
const getAppConfigs = (): AppConfig[] => {
const apps: AppConfig[] = [];

const appsDir = fs.readdirSync("./apps");
const appsDir = fs.readdirSync('./apps');

appsDir.forEach((app: string) => {
const path = `./apps/${app}/config.json`;
Expand All @@ -56,22 +59,22 @@ const getAppConfigs = (): AppConfig[] => {
apps.push(config);
}
} catch (e) {
console.error("Error parsing config file", app);
console.error('Error parsing config file', app);
}
}
});

return apps;
};

describe("App configs", () => {
it("Get app config should return at least one app", () => {
describe('App configs', () => {
it('Get app config should return at least one app', () => {
const apps = getAppConfigs();

expect(apps.length).toBeGreaterThan(0);
});

describe("Each app should have an id", () => {
describe('Each app should have an id', () => {
const apps = getAppConfigs();

apps.forEach((app) => {
Expand All @@ -81,7 +84,7 @@ describe("App configs", () => {
});
});

describe("Each app should have a md description", () => {
describe('Each app should have a md description', () => {
const apps = getAppConfigs();

apps.forEach((app) => {
Expand All @@ -98,7 +101,7 @@ describe("App configs", () => {
});
});

describe("Each app should have categories defined as an array", () => {
describe('Each app should have categories defined as an array', () => {
const apps = getAppConfigs();

apps.forEach((app) => {
Expand All @@ -109,7 +112,7 @@ describe("App configs", () => {
});
});

describe("Each app should have a name", () => {
describe('Each app should have a name', () => {
const apps = getAppConfigs();

apps.forEach((app) => {
Expand All @@ -119,7 +122,7 @@ describe("App configs", () => {
});
});

describe("Each app should have a description", () => {
describe('Each app should have a description', () => {
const apps = getAppConfigs();

apps.forEach((app) => {
Expand All @@ -129,7 +132,7 @@ describe("App configs", () => {
});
});

describe("Each app should have a port", () => {
describe('Each app should have a port', () => {
const apps = getAppConfigs();

apps.forEach((app) => {
Expand All @@ -141,7 +144,7 @@ describe("App configs", () => {
});
});

describe("Each app should have a supported architecture", () => {
describe('Each app should have a supported architecture', () => {
const apps = getAppConfigs();

apps.forEach((app) => {
Expand All @@ -152,19 +155,19 @@ describe("App configs", () => {
});
});

test("Each app should have a different port", () => {
test('Each app should have a different port', () => {
const appConfigs = getAppConfigs();
const ports = appConfigs.map((app) => app.port);
expect(new Set(ports).size).toBe(appConfigs.length);
});

test("Each app should have a unique id", () => {
test('Each app should have a unique id', () => {
const appConfigs = getAppConfigs();
const ids = appConfigs.map((app) => app.id);
expect(new Set(ids).size).toBe(appConfigs.length);
});

describe("Each app should have a version", () => {
describe('Each app should have a version', () => {
const apps = getAppConfigs();

apps.forEach((app) => {
Expand All @@ -176,7 +179,7 @@ describe("App configs", () => {
});
});

describe("Each app should have a docker-compose file beside it", () => {
describe('Each app should have a docker-compose file beside it', () => {
const apps = getAppConfigs();

apps.forEach((app) => {
Expand All @@ -186,7 +189,7 @@ describe("App configs", () => {
});
});

describe("Each app should have a metadata folder beside it", () => {
describe('Each app should have a metadata folder beside it', () => {
const apps = getAppConfigs();

apps.forEach((app) => {
Expand All @@ -196,7 +199,7 @@ describe("App configs", () => {
});
});

describe("Each app should have a file named logo.jpg in the metadata folder", () => {
describe('Each app should have a file named logo.jpg in the metadata folder', () => {
const apps = getAppConfigs();

apps.forEach((app) => {
Expand All @@ -206,14 +209,12 @@ describe("App configs", () => {
});
});

describe("Each app should have a container name equals to its id", () => {
describe('Each app should have a container name equals to its id', () => {
const apps = getAppConfigs();

apps.forEach((app) => {
test(app.id, () => {
const dockerComposeFile = fs
.readFileSync(`./apps/${app.id}/docker-compose.yml`)
.toString();
const dockerComposeFile = fs.readFileSync(`./apps/${app.id}/docker-compose.yml`).toString();

const dockerCompose: any = jsyaml.load(dockerComposeFile);

Expand All @@ -223,15 +224,13 @@ describe("App configs", () => {
});
});

describe("Each app should have the same version in config.json and docker-compose.yml", () => {
const exceptions = ["revolt"];
describe('Each app should have the same version in config.json and docker-compose.yml', () => {
const exceptions = ['revolt'];
const apps = getAppConfigs().filter((app) => !exceptions.includes(app.id));

apps.forEach((app) => {
test(app.id, () => {
const dockerComposeFile = fs
.readFileSync(`./apps/${app.id}/docker-compose.yml`)
.toString();
const dockerComposeFile = fs.readFileSync(`./apps/${app.id}/docker-compose.yml`).toString();

const dockerCompose: any = jsyaml.load(dockerComposeFile);

Expand All @@ -240,31 +239,27 @@ describe("App configs", () => {

const dockerImage = dockerCompose.services[app.id].image;

const version = dockerImage.split(":")[1];
const version = dockerImage.split(':')[1];

expect(version).toContain(app.version);
});
});
});

describe("Each app should have network tipi_main_network", () => {
describe('Each app should have network tipi_main_network', () => {
const apps = getAppConfigs();

apps.forEach((app) => {
test(app.id, () => {
if (!networkExceptions.includes(app.id)) {
const dockerComposeFile = fs
.readFileSync(`./apps/${app.id}/docker-compose.yml`)
.toString();
const dockerComposeFile = fs.readFileSync(`./apps/${app.id}/docker-compose.yml`).toString();

const dockerCompose: any = jsyaml.load(dockerComposeFile);

expect(dockerCompose.services[app.id]).toBeDefined();

expect(dockerCompose.services[app.id].networks).toBeDefined();
expect(dockerCompose.services[app.id].networks).toContain(
"tipi_main_network",
);
expect(dockerCompose.services[app.id].networks).toContain('tipi_main_network');
}
});
});
Expand All @@ -282,7 +277,7 @@ describe("App configs", () => {
const labelDoesNotExist = Object.keys(services).some((service) => {
const labels = services[service].labels || {};
if (labels) {
return !labels["runtipi.managed"];
return !labels['runtipi.managed'];
}
return true;
});
Expand All @@ -292,13 +287,13 @@ describe("App configs", () => {
});
});

describe("All form fields with type random should not be marked as required", () => {
describe('All form fields with type random should not be marked as required', () => {
const configs = getAppConfigs();
configs.forEach((config) => {
const formFields = config.form_fields;
if (formFields) {
formFields.forEach((field) => {
if (field.type === "random") {
if (field.type === 'random') {
test(config.id, () => {
expect(Boolean(field.required)).toBe(false);
});
Expand All @@ -307,4 +302,28 @@ describe("App configs", () => {
}
});
});

describe('All apps should have a createdAt field', () => {
const apps = getAppConfigs();
apps.forEach((app) => {
test(app.id, () => {
expect(app.created_at).toBeDefined();
expect(app.created_at).toBeGreaterThan(0);
expect(app.created_at).toBeLessThan(Date.now());
expect(new Date(app.created_at).getFullYear()).toBeGreaterThanOrEqual(2023);
});
});
});

describe('All apps should have an updatedAt field', () => {
const apps = getAppConfigs();
apps.forEach((app) => {
test(app.id, () => {
expect(app.updated_at).toBeDefined();
expect(app.updated_at).toBeGreaterThan(0);
expect(app.updated_at).toBeLessThan(Date.now());
expect(new Date(app.updated_at).getFullYear()).toBeGreaterThanOrEqual(2023);
});
});
});
});
9 changes: 6 additions & 3 deletions apps/activepieces/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"available": true,
"port": 8605,
"exposable": true,
"dynamic_config": true,
"id": "activepieces",
"description": "Your friendliest open source all-in-one automation tool.",
"tipi_version": 28,
"version": "0.29.1",
"tipi_version": 32,
"version": "0.32.0",
"categories": ["automation"],
"short_desc": "True zapier alternative.",
"author": "Activepieces",
Expand Down Expand Up @@ -38,5 +39,7 @@
"env_variable": "AP_JWT_SECRET"
}
],
"supported_architectures": ["arm64", "amd64"]
"supported_architectures": ["arm64", "amd64"],
"created_at": 1691943801422,
"updated_at": 1726366297000
}
Loading
Loading