Add tests for proxy app upstreamUri

This commit is contained in:
Johannes Zellner
2022-11-23 14:36:57 +01:00
parent 817e950d47
commit a5d244b593
4 changed files with 138 additions and 0 deletions

View File

@@ -43,6 +43,34 @@ const manifest = {
}
};
// copied from the proxy app CloudronManifest.json
const proxyAppManifest = {
"id": "io.cloudron.builtin.appproxy",
"title": "App Proxy",
"author": "Cloudron Team",
"version": "1.0.0",
"upstreamVersion": "1.0.0",
"description": "file://DESCRIPTION.md",
"tagline": "Proxy an app through Cloudron",
"tags": [ "proxy", "external" ],
"healthCheckPath": "/",
"httpPort": 3000,
"minBoxVersion": "7.3.0",
"dockerImage": "istobeignored",
"manifestVersion": 2,
"multiDomain": true,
"website": "https://cloudron.io",
"documentationUrl": "https://docs.cloudron.io/dashboard/#app-proxy",
"forumUrl": "https://forum.cloudron.io",
"contactEmail": "support@cloudron.io",
"icon": "file://logo.png",
"addons": {},
"mediaLinks": [
"https://screenshots.cloudron.io/io.cloudron.builtin.appproxy/diagram.png"
],
"changelog": "file://CHANGELOG.md"
};
const domain = {
domain: 'example.com',
zoneName: 'example.com',
@@ -110,6 +138,27 @@ const app = {
};
Object.freeze(app);
const proxyApp = {
id: 'proxyapptestid',
appStoreId: proxyAppManifest.id,
installationState: apps.ISTATE_PENDING_INSTALL,
runState: 'running',
subdomain: 'proxylocation',
upstreamUri: 'http://1.2.3.4:80',
domain: domain.domain,
fqdn: domain.domain + '.' + 'proxylocation',
manifest,
containerId: '',
portBindings: null,
accessRestriction: null,
memoryLimit: 0,
mailboxDomain: domain.domain,
secondaryDomains: [],
redirectDomains: [],
aliasDomains: []
};
Object.freeze(proxyApp);
exports = module.exports = {
createTree,
domainSetup,
@@ -124,6 +173,7 @@ exports = module.exports = {
dashboardFqdn: `my.${domain.domain}`,
app,
proxyApp,
admin,
auditSource,
domain, // the domain object