mirror of
https://git.cloudron.io/cloudron/minio-app
synced 2025-09-13 16:29:13 +00:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
74bc0cbbd2 | ||
|
316047b1d3 | ||
|
569e830514 | ||
|
7417ce44e5 | ||
|
88918c602a | ||
|
7b26be880d | ||
|
e966943be5 |
@@ -2339,3 +2339,10 @@ Improve replication performance. See (#12080, #12054, #12009) for more details.
|
|||||||
* Update minio to 2024-02-14T21-36-02Z
|
* Update minio to 2024-02-14T21-36-02Z
|
||||||
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-02-14T21-36-02Z)
|
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-02-14T21-36-02Z)
|
||||||
|
|
||||||
|
[3.12.14]
|
||||||
|
* Update minio to 2024-02-17T01-15-57Z
|
||||||
|
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-02-17T01-15-57Z)
|
||||||
|
|
||||||
|
[3.13.0]
|
||||||
|
* Implement OIDC authentication
|
||||||
|
|
||||||
|
@@ -5,8 +5,8 @@
|
|||||||
"description": "file://DESCRIPTION.md",
|
"description": "file://DESCRIPTION.md",
|
||||||
"changelog": "file://CHANGELOG",
|
"changelog": "file://CHANGELOG",
|
||||||
"tagline": "Distributed object storage",
|
"tagline": "Distributed object storage",
|
||||||
"version": "3.12.13",
|
"version": "3.13.0",
|
||||||
"upstreamVersion": "2024-02-14T21-36-02Z",
|
"upstreamVersion": "2024-02-17T01-15-57Z",
|
||||||
"healthCheckPath": "/minio/login",
|
"healthCheckPath": "/minio/login",
|
||||||
"memoryLimit": 2147483648,
|
"memoryLimit": 2147483648,
|
||||||
"httpPort": 8000,
|
"httpPort": 8000,
|
||||||
@@ -19,8 +19,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"addons": {
|
"addons": {
|
||||||
"localstorage": {}
|
"localstorage": {},
|
||||||
|
"oidc": { "loginRedirectUri": "/oauth_callback" }
|
||||||
},
|
},
|
||||||
|
"optionalSso": true,
|
||||||
"manifestVersion": 2,
|
"manifestVersion": 2,
|
||||||
"website": "http://www.minio.io",
|
"website": "http://www.minio.io",
|
||||||
"minBoxVersion": "7.1.2",
|
"minBoxVersion": "7.1.2",
|
||||||
|
@@ -3,7 +3,7 @@ FROM cloudron/base:4.2.0@sha256:46da2fffb36353ef714f97ae8e962bd2c212ca091108d768
|
|||||||
RUN mkdir -p /app/code
|
RUN mkdir -p /app/code
|
||||||
WORKDIR /app/code
|
WORKDIR /app/code
|
||||||
|
|
||||||
ARG VERSION=RELEASE.2024-02-14T21-36-02Z
|
ARG VERSION=RELEASE.2024-02-17T01-15-57Z
|
||||||
|
|
||||||
# sometimes here https://dl.min.io/server/minio/release/linux-amd64/archive/
|
# sometimes here https://dl.min.io/server/minio/release/linux-amd64/archive/
|
||||||
# RUN wget https://dl.min.io/server/minio/release/linux-amd64/minio.${VERSION} -O /app/code/minio && chmod +x /app/code/minio
|
# RUN wget https://dl.min.io/server/minio/release/linux-amd64/minio.${VERSION} -O /app/code/minio && chmod +x /app/code/minio
|
||||||
@@ -11,6 +11,6 @@ RUN wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio.${VERS
|
|||||||
# https://dl.min.io/client/mc/release/linux-amd64/
|
# https://dl.min.io/client/mc/release/linux-amd64/
|
||||||
RUN wget https://dl.min.io/client/mc/release/linux-amd64/mc -O /app/code/mc && chmod +x /app/code/mc
|
RUN wget https://dl.min.io/client/mc/release/linux-amd64/mc -O /app/code/mc && chmod +x /app/code/mc
|
||||||
|
|
||||||
COPY env.sh start.sh /app/code/
|
COPY env.sh.template start.sh /app/code/
|
||||||
|
|
||||||
CMD [ "/app/code/start.sh" ]
|
CMD [ "/app/code/start.sh" ]
|
||||||
|
@@ -1,7 +1,19 @@
|
|||||||
|
<nosso>
|
||||||
Please use the following credentials to login:
|
Please use the following credentials to login:
|
||||||
|
|
||||||
**Username**: minioadmin<br/>
|
**Username**: minioadmin<br/>
|
||||||
**Password**: minioadmin<br/>
|
**Password**: minioadmin<br/>
|
||||||
|
|
||||||
Please change the credentials immediately by following this [guide](https://cloudron.io/documentation/apps/minio/#admin-credentials).
|
Please change the credentials immediately by following this [guide](https://cloudron.io/documentation/apps/minio/#admin-credentials).
|
||||||
|
</nosso>
|
||||||
|
|
||||||
|
<sso>
|
||||||
|
|
||||||
|
Please use the following credentials to login via 'Other Authentication Methods' -> 'Use Credentials':
|
||||||
|
|
||||||
|
**Username**: minioadmin<br/>
|
||||||
|
**Password**: See `MINIO_ROOT_PASSWORD` in `/app/data/env.sh` <a href="/frontend/filemanager.html#/viewer/app/$CLOUDRON-APP-ID/env.sh">Open File Manager</a><br/>
|
||||||
|
|
||||||
|
Cloudron users have `readwrite` access policy. See the [docs](https://cloudron.io/documentation/apps/minio/#admin-credentials) on how to change it.
|
||||||
|
|
||||||
|
</nosso>
|
||||||
|
9
env.sh
9
env.sh
@@ -1,9 +0,0 @@
|
|||||||
# Add custom minio configuration to this file. Restart the app for changes to take effect.
|
|
||||||
|
|
||||||
export CLOUDRON_MINIO_STARTUP_ARGS='server /app/data/data'
|
|
||||||
|
|
||||||
# See https://docs.min.io/minio/baremetal/reference/minio-server/minio-server.html#envvar.MINIO_ROOT_USER
|
|
||||||
# You can use pwgen -1s 64 to generate usernames and passwords
|
|
||||||
export MINIO_ROOT_USER=minioadmin
|
|
||||||
export MINIO_ROOT_PASSWORD=minioadmin
|
|
||||||
|
|
4
env.sh.template
Normal file
4
env.sh.template
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# Add custom minio configuration to this file. Restart the app for changes to take effect.
|
||||||
|
|
||||||
|
export CLOUDRON_MINIO_STARTUP_ARGS='server /app/data/data'
|
||||||
|
|
26
start.sh
26
start.sh
@@ -5,7 +5,18 @@ set -eu
|
|||||||
mkdir -p /app/data/data /run/minio/config /run/minio/certs
|
mkdir -p /app/data/data /run/minio/config /run/minio/certs
|
||||||
|
|
||||||
# env vars take precedence over config.yaml (https://github.com/minio/minio/blob/master/docs/distributed/CONFIG.md#things-to-know)
|
# env vars take precedence over config.yaml (https://github.com/minio/minio/blob/master/docs/distributed/CONFIG.md#things-to-know)
|
||||||
[[ ! -f /app/data/env.sh ]] && cp /app/code/env.sh /app/data/env.sh
|
if [[ ! -f /app/data/env.sh ]]; then
|
||||||
|
echo "=> First run"
|
||||||
|
cp /app/code/env.sh.template /app/data/env.sh
|
||||||
|
# minio does not show the password login by default when OIDC is setup (https://github.com/minio/minio/discussions/16928)
|
||||||
|
# we generate a dynamic password because users might forget to change the admin password (with the oidc login being so click friendly)
|
||||||
|
if [[ -n "${CLOUDRON_OIDC_ISSUER:-}" ]]; then
|
||||||
|
echo -e "export MINIO_ROOT_USER=minioadmin\nexport MINIO_ROOT_PASSWORD=$(pwgen -1s 20)\n\n" >> /app/data/env.sh
|
||||||
|
else
|
||||||
|
echo -e "export MINIO_ROOT_USER=minioadmin\nexport MINIO_ROOT_PASSWORD=minioadmin\n\n" >> /app/data/env.sh
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
source /app/data/env.sh
|
source /app/data/env.sh
|
||||||
|
|
||||||
# https://docs.min.io/minio/baremetal/reference/minio-server/minio-server.html#envvar.MINIO_SERVER_URL
|
# https://docs.min.io/minio/baremetal/reference/minio-server/minio-server.html#envvar.MINIO_SERVER_URL
|
||||||
@@ -17,6 +28,19 @@ if [[ ! -d /app/data/mc_config ]]; then
|
|||||||
/app/code/mc --config-dir /app/data/mc_config &> /dev/null || true
|
/app/code/mc --config-dir /app/data/mc_config &> /dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -n "${CLOUDRON_OIDC_ISSUER:-}" ]]; then
|
||||||
|
export MINIO_IDENTITY_OPENID_DISPLAY_NAME="Cloudron"
|
||||||
|
export MINIO_IDENTITY_OPENID_CONFIG_URL="${CLOUDRON_OIDC_DISCOVERY_URL}"
|
||||||
|
export MINIO_IDENTITY_OPENID_CLIENT_ID="${CLOUDRON_OIDC_CLIENT_ID}"
|
||||||
|
export MINIO_IDENTITY_OPENID_CLIENT_SECRET="${CLOUDRON_OIDC_CLIENT_SECRET}"
|
||||||
|
export MINIO_IDENTITY_OPENID_SCOPES="openid profile email"
|
||||||
|
if [[ -z "${MINIO_IDENTITY_OPENID_ROLE_POLICY:-}" ]]; then
|
||||||
|
export MINIO_IDENTITY_OPENID_ROLE_POLICY="readwrite"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export MINIO_IDENTITY_OPENID_COMMENT="Cloudron OIDC"
|
||||||
|
fi
|
||||||
|
|
||||||
# minio is used for backups at times and has a large number of files. optimize by checking if files are actually in correct chown state
|
# minio is used for backups at times and has a large number of files. optimize by checking if files are actually in correct chown state
|
||||||
echo "==> Changing ownership"
|
echo "==> Changing ownership"
|
||||||
[[ $(stat --format '%U' /app/data/data) != "cloudron" ]] && chown -R cloudron:cloudron /app/data
|
[[ $(stat --format '%U' /app/data/data) != "cloudron" ]] && chown -R cloudron:cloudron /app/data
|
||||||
|
28
test/package-lock.json
generated
28
test/package-lock.json
generated
@@ -9,10 +9,10 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chromedriver": "^121.0.0",
|
"chromedriver": "^121.0.2",
|
||||||
"expect.js": "^0.3.1",
|
"expect.js": "^0.3.1",
|
||||||
"mocha": "^10.3.0",
|
"mocha": "^10.3.0",
|
||||||
"selenium-webdriver": "^4.17.0",
|
"selenium-webdriver": "^4.18.1",
|
||||||
"superagent": "^8.1.2"
|
"superagent": "^8.1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -228,9 +228,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/chromedriver": {
|
"node_modules/chromedriver": {
|
||||||
"version": "121.0.0",
|
"version": "121.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-121.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-121.0.2.tgz",
|
||||||
"integrity": "sha512-ZIKEdZrQAfuzT/RRofjl8/EZR99ghbdBXNTOcgJMKGP6N/UL6lHUX4n6ONWBV18pDvDFfQJ0x58h5AdOaXIOMw==",
|
"integrity": "sha512-58MUSCEE3oB3G3Y/Jo3URJ2Oa1VLHcVBufyYt7vNfGrABSJm7ienQLF9IQ8LPDlPVgLUXt2OBfggK3p2/SlEBg==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@testim/chrome-version": "^1.1.4",
|
"@testim/chrome-version": "^1.1.4",
|
||||||
@@ -1192,9 +1192,9 @@
|
|||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||||
},
|
},
|
||||||
"node_modules/selenium-webdriver": {
|
"node_modules/selenium-webdriver": {
|
||||||
"version": "4.17.0",
|
"version": "4.18.1",
|
||||||
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.18.1.tgz",
|
||||||
"integrity": "sha512-e2E+2XBlGepzwgFbyQfSwo9Cbj6G5fFfs9MzAS00nC99EewmcS2rwn2MwtgfP7I5p1e7DYv4HQJXtWedsu6DvA==",
|
"integrity": "sha512-uP4OJ5wR4+VjdTi5oi/k8oieV2fIhVdVuaOPrklKghgS59w7Zz3nGa5gcG73VcU9EBRv5IZEBRhPr7qFJAj5mQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jszip": "^3.10.1",
|
"jszip": "^3.10.1",
|
||||||
"tmp": "^0.2.1",
|
"tmp": "^0.2.1",
|
||||||
@@ -1710,9 +1710,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"chromedriver": {
|
"chromedriver": {
|
||||||
"version": "121.0.0",
|
"version": "121.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-121.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-121.0.2.tgz",
|
||||||
"integrity": "sha512-ZIKEdZrQAfuzT/RRofjl8/EZR99ghbdBXNTOcgJMKGP6N/UL6lHUX4n6ONWBV18pDvDFfQJ0x58h5AdOaXIOMw==",
|
"integrity": "sha512-58MUSCEE3oB3G3Y/Jo3URJ2Oa1VLHcVBufyYt7vNfGrABSJm7ienQLF9IQ8LPDlPVgLUXt2OBfggK3p2/SlEBg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@testim/chrome-version": "^1.1.4",
|
"@testim/chrome-version": "^1.1.4",
|
||||||
"axios": "^1.6.5",
|
"axios": "^1.6.5",
|
||||||
@@ -2408,9 +2408,9 @@
|
|||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||||
},
|
},
|
||||||
"selenium-webdriver": {
|
"selenium-webdriver": {
|
||||||
"version": "4.17.0",
|
"version": "4.18.1",
|
||||||
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.17.0.tgz",
|
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.18.1.tgz",
|
||||||
"integrity": "sha512-e2E+2XBlGepzwgFbyQfSwo9Cbj6G5fFfs9MzAS00nC99EewmcS2rwn2MwtgfP7I5p1e7DYv4HQJXtWedsu6DvA==",
|
"integrity": "sha512-uP4OJ5wR4+VjdTi5oi/k8oieV2fIhVdVuaOPrklKghgS59w7Zz3nGa5gcG73VcU9EBRv5IZEBRhPr7qFJAj5mQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"jszip": "^3.10.1",
|
"jszip": "^3.10.1",
|
||||||
"tmp": "^0.2.1",
|
"tmp": "^0.2.1",
|
||||||
|
@@ -9,10 +9,10 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chromedriver": "^121.0.0",
|
"chromedriver": "^121.0.2",
|
||||||
"expect.js": "^0.3.1",
|
"expect.js": "^0.3.1",
|
||||||
"mocha": "^10.3.0",
|
"mocha": "^10.3.0",
|
||||||
"selenium-webdriver": "^4.17.0",
|
"selenium-webdriver": "^4.18.1",
|
||||||
"superagent": "^8.1.2"
|
"superagent": "^8.1.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
157
test/test.js
157
test/test.js
@@ -20,6 +20,11 @@ const execSync = require('child_process').execSync,
|
|||||||
{ Builder, By, until } = require('selenium-webdriver'),
|
{ Builder, By, until } = require('selenium-webdriver'),
|
||||||
{ Options } = require('selenium-webdriver/chrome');
|
{ 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);
|
this.timeout(0);
|
||||||
|
|
||||||
@@ -29,6 +34,9 @@ describe('Application life cycle test', function () {
|
|||||||
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' };
|
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' };
|
||||||
|
|
||||||
let browser, app;
|
let browser, app;
|
||||||
|
let athenticated_by_oidc = false, rootPassword;
|
||||||
|
let username = process.env.USERNAME;
|
||||||
|
let password = process.env.PASSWORD;
|
||||||
|
|
||||||
before(function () {
|
before(function () {
|
||||||
browser = new Builder().forBrowser('chrome').setChromeOptions(new Options().windowSize({ width: 1280, height: 1024 })).build();
|
browser = new Builder().forBrowser('chrome').setChromeOptions(new Options().windowSize({ width: 1280, height: 1024 })).build();
|
||||||
@@ -49,23 +57,56 @@ describe('Application life cycle test', function () {
|
|||||||
expect(app).to.be.an('object');
|
expect(app).to.be.an('object');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function login(accessKey='minioadmin', secretKey='minioadmin') {
|
async function login(username, password) {
|
||||||
|
await browser.manage().deleteAllCookies();
|
||||||
|
await browser.get('about:blank');
|
||||||
|
await browser.sleep(2000);
|
||||||
await browser.get(`https://${app.fqdn}/login`);
|
await browser.get(`https://${app.fqdn}/login`);
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
if (await browser.findElements(By.id('accessKey')).then(found => !found.length) && await browser.findElements(By.id('alternativeMethods-select')).then(found => !!found.length)) {
|
||||||
|
await browser.findElement(By.xpath('//div[@id="alternativeMethods-select"]/div[contains(., "Other Authentication Methods")]')).click();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
await browser.findElement(By.xpath('//li[contains(., "Use Credentials")] | //div[@label="Use Credentials"]')).click();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
}
|
||||||
await waitForElement(By.id('accessKey'));
|
await waitForElement(By.id('accessKey'));
|
||||||
await browser.findElement(By.id('accessKey')).sendKeys(accessKey);
|
await browser.findElement(By.id('accessKey')).sendKeys(username);
|
||||||
await browser.findElement(By.id('secretKey')).sendKeys(secretKey);
|
await browser.findElement(By.id('secretKey')).sendKeys(password);
|
||||||
await browser.findElement(By.xpath('//button[@id="do-login"]')).click();
|
await browser.findElement(By.xpath('//button[@id="do-login"]')).click();
|
||||||
await waitForElement(By.xpath('//span[contains(text(), "Buckets")]'));
|
await waitForElement(By.xpath('//span[contains(text(), "Buckets")]'));
|
||||||
await timers.setTimeout(5000);
|
await timers.setTimeout(5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function loginOIDC(username, password) {
|
||||||
|
browser.manage().deleteAllCookies();
|
||||||
|
await browser.get(`https://${app.fqdn}/login`);
|
||||||
|
await browser.sleep(4000);
|
||||||
|
|
||||||
|
await browser.findElement(By.xpath('//button[contains(., "Cloudron")]')).click();
|
||||||
|
await browser.sleep(4000);
|
||||||
|
|
||||||
|
if (!athenticated_by_oidc) {
|
||||||
|
await waitForElement(By.xpath('//input[@name="username"]'));
|
||||||
|
await browser.findElement(By.xpath('//input[@name="username"]')).sendKeys(username);
|
||||||
|
await browser.findElement(By.xpath('//input[@name="password"]')).sendKeys(password);
|
||||||
|
await browser.sleep(2000);
|
||||||
|
await browser.findElement(By.id('loginSubmitButton')).click();
|
||||||
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
athenticated_by_oidc = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
await waitForElement(By.xpath('//span[contains(text(), "Buckets")]'));
|
||||||
|
}
|
||||||
|
|
||||||
async function logout() {
|
async function logout() {
|
||||||
await browser.get(`https://${app.fqdn}/`);
|
await browser.get(`https://${app.fqdn}/`);
|
||||||
await waitForElement(By.xpath('//span[contains(text(), "Buckets")]'));
|
await waitForElement(By.xpath('//span[contains(text(), "Buckets")]'));
|
||||||
const button = await browser.findElement(By.xpath('//button[@id="sign-out"]'));
|
const button = await browser.findElement(By.xpath('//button[@id="sign-out"]'));
|
||||||
await browser.executeScript('arguments[0].scrollIntoView(false)', button);
|
await browser.executeScript('arguments[0].scrollIntoView(false)', button);
|
||||||
await button.click();
|
await button.click();
|
||||||
await waitForElement(By.id('accessKey'));
|
await waitForElement(By.xpath('//*[@id="accessKey"] | //button[contains(., "Cloudron")]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addBucket() {
|
async function addBucket() {
|
||||||
@@ -96,38 +137,87 @@ describe('Application life cycle test', function () {
|
|||||||
expect(response.body.toString('utf8')).to.contain('<Code>AccessDenied</Code>');
|
expect(response.body.toString('utf8')).to.contain('<Code>AccessDenied</Code>');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function changeAdminCredentials() {
|
||||||
|
let data = fs.readFileSync(path.join(__dirname, '../env.sh.template'), 'utf8');
|
||||||
|
data += '\nexport MINIO_ROOT_USER=minioakey\nexport MINIO_ROOT_PASSWORD=minioskey\n';
|
||||||
|
fs.writeFileSync('/tmp/env.sh', data);
|
||||||
|
execSync(`cloudron push --app ${app.id} /tmp/env.sh /app/data/env.sh`, EXEC_ARGS);
|
||||||
|
execSync(`cloudron restart --app ${app.id}`, EXEC_ARGS);
|
||||||
|
await timers.setTimeout(10000);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getAdminCredentials() {
|
||||||
|
execSync(`cloudron pull --app ${app.id} /app/data/env.sh /tmp/env.sh`, EXEC_ARGS);
|
||||||
|
const data = fs.readFileSync('/tmp/env.sh', 'utf8');
|
||||||
|
const m = data.match(/MINIO_ROOT_PASSWORD=(.*)/);
|
||||||
|
if (!m) throw new Error('Could not detect root password');
|
||||||
|
rootPassword = m[1].trim();
|
||||||
|
console.log(`root password is [${rootPassword}]`);
|
||||||
|
}
|
||||||
|
|
||||||
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
|
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
|
||||||
it('install app', async function () {
|
|
||||||
execSync(`cloudron install --location ${LOCATION} --secondary-domains API_SERVER_DOMAIN=${LOCATION}-api`, EXEC_ARGS);
|
// // no SSO
|
||||||
|
it('install app (no SSO)', async function () {
|
||||||
|
execSync(`cloudron install --no-sso --location ${LOCATION} --secondary-domains API_SERVER_DOMAIN=${LOCATION}-api`, EXEC_ARGS);
|
||||||
await timers.setTimeout(10000);
|
await timers.setTimeout(10000);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can get app information', getAppInfo);
|
it('can get app information', getAppInfo);
|
||||||
|
|
||||||
it('can login', login.bind(null, 'minioadmin', 'minioadmin'));
|
it('can admin login', login.bind(null, 'minioadmin', 'minioadmin'));
|
||||||
it('can add bucket', addBucket);
|
it('can add bucket', addBucket);
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
it('does redirect', checkRedirect);
|
it('does redirect', checkRedirect);
|
||||||
it('check api', checkApi);
|
it('check api', checkApi);
|
||||||
|
|
||||||
it('can change credentials', async function () {
|
it('can change admin credentials', changeAdminCredentials);
|
||||||
let data = fs.readFileSync(path.join(__dirname, '../env.sh'), 'utf8');
|
it('can restart app', async function () {
|
||||||
data = data
|
|
||||||
.replace(/MINIO_ROOT_USER=.*/, 'MINIO_ROOT_USER=minioakey')
|
|
||||||
.replace(/MINIO_ROOT_PASSWORD=.*/, 'MINIO_ROOT_PASSWORD=minioskey');
|
|
||||||
fs.writeFileSync('/tmp/env.sh', data);
|
|
||||||
execSync(`cloudron push --app ${app.id} /tmp/env.sh /app/data/env.sh`, EXEC_ARGS);
|
|
||||||
execSync(`cloudron restart --app ${app.id}`, EXEC_ARGS);
|
execSync(`cloudron restart --app ${app.id}`, EXEC_ARGS);
|
||||||
await timers.setTimeout(10000);
|
await timers.setTimeout(10000);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can restart app', function () { execSync(`cloudron restart --app ${app.id}`, EXEC_ARGS); });
|
it('can admin login', login.bind(null, 'minioakey', 'minioskey'));
|
||||||
|
|
||||||
it('can login', login.bind(null, 'minioakey', 'minioskey'));
|
|
||||||
it('has bucket', checkBucket);
|
it('has bucket', checkBucket);
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
it('does redirect', checkRedirect);
|
it('does redirect', checkRedirect);
|
||||||
it('check api', checkApi);
|
it('check api', checkApi);
|
||||||
|
it('uninstall app', function () { execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS); });
|
||||||
|
|
||||||
|
// SSO
|
||||||
|
it('install app (SSO)', async function () {
|
||||||
|
execSync(`cloudron install --location ${LOCATION} --secondary-domains API_SERVER_DOMAIN=${LOCATION}-api`, EXEC_ARGS);
|
||||||
|
await timers.setTimeout(10000);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('can get app information', getAppInfo);
|
||||||
|
it('can get admin credentials', getAdminCredentials);
|
||||||
|
it('can admin login', async function () { await login('minioadmin', rootPassword); });
|
||||||
|
it('can add bucket', addBucket);
|
||||||
|
it('can logout', logout);
|
||||||
|
it('does redirect', checkRedirect);
|
||||||
|
it('check api', checkApi);
|
||||||
|
|
||||||
|
it('can OIDC login', loginOIDC.bind(null, username, password));
|
||||||
|
it('has bucket', checkBucket);
|
||||||
|
it('can logout', logout);
|
||||||
|
|
||||||
|
it('can change admin credentials', changeAdminCredentials);
|
||||||
|
|
||||||
|
it('can restart app', async function () {
|
||||||
|
execSync(`cloudron restart --app ${app.id}`, EXEC_ARGS);
|
||||||
|
await timers.setTimeout(10000);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('can admin login', login.bind(null, 'minioakey', 'minioskey'));
|
||||||
|
it('has bucket', checkBucket);
|
||||||
|
it('can logout', logout);
|
||||||
|
it('does redirect', checkRedirect);
|
||||||
|
it('check api', checkApi);
|
||||||
|
|
||||||
|
it('can OIDC login', loginOIDC.bind(null, username, password));
|
||||||
|
it('has bucket', checkBucket);
|
||||||
|
it('can logout', logout);
|
||||||
|
|
||||||
it('backup app', function () { execSync('cloudron backup create --app ' + app.id, EXEC_ARGS); });
|
it('backup app', function () { execSync('cloudron backup create --app ' + app.id, EXEC_ARGS); });
|
||||||
it('restore app', async function () {
|
it('restore app', async function () {
|
||||||
@@ -139,9 +229,15 @@ describe('Application life cycle test', function () {
|
|||||||
await timers.setTimeout(10000);
|
await timers.setTimeout(10000);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can login', login.bind(null, 'minioakey', 'minioskey'));
|
it('can get app information', getAppInfo);
|
||||||
|
it('can admin login', login.bind(null, 'minioakey', 'minioskey'));
|
||||||
it('has bucket', checkBucket);
|
it('has bucket', checkBucket);
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
|
|
||||||
|
it('can OIDC login', loginOIDC.bind(null, username, password));
|
||||||
|
it('has bucket', checkBucket);
|
||||||
|
it('can logout', logout);
|
||||||
|
|
||||||
it('does redirect', checkRedirect);
|
it('does redirect', checkRedirect);
|
||||||
it('check api', checkApi);
|
it('check api', checkApi);
|
||||||
|
|
||||||
@@ -152,28 +248,47 @@ describe('Application life cycle test', function () {
|
|||||||
});
|
});
|
||||||
it('can get app information', getAppInfo);
|
it('can get app information', getAppInfo);
|
||||||
|
|
||||||
it('can login', login.bind(null, 'minioakey', 'minioskey'));
|
it('can admin login', login.bind(null, 'minioakey', 'minioskey'));
|
||||||
it('has bucket', checkBucket);
|
it('has bucket', checkBucket);
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
|
|
||||||
|
it('can OIDC login', loginOIDC.bind(null, username, password));
|
||||||
|
it('has bucket', checkBucket);
|
||||||
|
it('can logout', logout);
|
||||||
|
|
||||||
it('does redirect', checkRedirect);
|
it('does redirect', checkRedirect);
|
||||||
it('check api', checkApi);
|
it('check api', checkApi);
|
||||||
|
|
||||||
it('uninstall app', function () { execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS); });
|
it('uninstall app', function () { execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS); });
|
||||||
|
|
||||||
// test update
|
// test update
|
||||||
it('can install app', function () { execSync('cloudron install --appstore-id io.minio.cloudronapp --location ' + LOCATION, EXEC_ARGS); });
|
it('can install app for update', function () { execSync('cloudron install --appstore-id io.minio.cloudronapp --location ' + LOCATION, EXEC_ARGS); });
|
||||||
it('can get app information', getAppInfo);
|
it('can get app information', getAppInfo);
|
||||||
|
|
||||||
it('can login', login.bind(null, 'minioadmin', 'minioadmin'));
|
it('can login', login.bind(null, 'minioadmin', 'minioadmin'));
|
||||||
it('can add buckets', addBucket);
|
it('can add buckets', addBucket);
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
|
|
||||||
|
/* should be added on the next release
|
||||||
|
it('can OIDC login', loginOIDC.bind(null, username, password));
|
||||||
|
it('has bucket', checkBucket);
|
||||||
|
it('can logout', logout);
|
||||||
|
*/
|
||||||
|
|
||||||
it('can update', function () { execSync(`cloudron update --app ${LOCATION}`, EXEC_ARGS); });
|
it('can update', function () { execSync(`cloudron update --app ${LOCATION}`, EXEC_ARGS); });
|
||||||
it('can configure', function () { execSync(`cloudron configure --app ${LOCATION} --location ${LOCATION} --secondary-domains API_SERVER_DOMAIN=${LOCATION}-api`, EXEC_ARGS); });
|
it('can configure', function () { execSync(`cloudron configure --app ${LOCATION} --location ${LOCATION} --secondary-domains API_SERVER_DOMAIN=${LOCATION}-api`, EXEC_ARGS); });
|
||||||
it('can get app information', getAppInfo);
|
it('can get app information', getAppInfo);
|
||||||
|
|
||||||
it('can login', login.bind(null, 'minioadmin', 'minioadmin'));
|
it('can admin login', login.bind(null, 'minioadmin', 'minioadmin'));
|
||||||
it('has bucket', checkBucket);
|
it('has bucket', checkBucket);
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
|
|
||||||
|
/* should be added on the next release
|
||||||
|
it('can OIDC login', loginOIDC.bind(null, username, password));
|
||||||
|
it('has bucket', checkBucket);
|
||||||
|
it('can logout', logout);
|
||||||
|
*/
|
||||||
|
|
||||||
it('does redirect', checkRedirect);
|
it('does redirect', checkRedirect);
|
||||||
it('check api', checkApi);
|
it('check api', checkApi);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user