mirror of
https://git.cloudron.io/cloudron/minio-app
synced 2025-09-13 00:15:40 +00:00
Compare commits
59 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
1ef2baf396 | ||
|
20706ccaf4 | ||
|
4100d16964 | ||
|
a85c1935bc | ||
|
f4996c9fc9 | ||
|
5e1f06e1e9 | ||
|
a89ff592f0 | ||
|
9471c04cb9 | ||
|
20dbe5de5a | ||
|
c0a34431df | ||
|
ce95621eb4 | ||
|
cd4fec9029 | ||
|
d1677d9ef9 | ||
|
131038a255 | ||
|
0b59adbb35 | ||
|
76ba09cd4b | ||
|
9820e5bf90 | ||
|
7d38995613 | ||
|
6162ff540b | ||
|
c0b9c4167f | ||
|
fa8f08f760 | ||
|
84072d9227 | ||
|
0f877a2d95 | ||
|
44ed6f8aee | ||
|
10c6c019fd | ||
|
93853449f9 | ||
|
16de972113 | ||
|
f9ca8a265e | ||
|
e82c8db22d | ||
|
e38d1020ac | ||
|
f814368e12 | ||
|
8713b30b79 | ||
|
9683b980b0 | ||
|
9272b4fa7b | ||
|
b6f66e8e25 | ||
|
612d47f4ac | ||
|
c65ab2057f | ||
|
03d7a890c3 | ||
|
1f9617699a | ||
|
17265598fd | ||
|
ab3caee22d | ||
|
e9c6aad49f | ||
|
5e92ec256f | ||
|
b1732c5fe7 | ||
|
cce40f5225 | ||
|
07c38643cc | ||
|
ca9c3a6034 | ||
|
2c7ca16313 | ||
|
8135c8bab4 | ||
|
c89a1e1d62 | ||
|
ba9f0e152f | ||
|
c106b7f078 | ||
|
25ff011c14 | ||
|
98b2ecc550 | ||
|
7042b7a23c | ||
|
acda6fc0d6 | ||
|
f7096a7f9d | ||
|
70ca0ce938 | ||
|
b969cab785 |
83
CHANGELOG
83
CHANGELOG
@@ -954,3 +954,86 @@ Improve replication performance. See (#12080, #12054, #12009) for more details.
|
|||||||
* fix: calculate correct content range with partNumber query. See (#11992) for more details.
|
* fix: calculate correct content range with partNumber query. See (#11992) for more details.
|
||||||
* scanner: Shuffle disks to scan. See (#12036) for more details.
|
* scanner: Shuffle disks to scan. See (#12036) for more details.
|
||||||
* Add runtime mem stats to server info. See (#11995) for more details.
|
* Add runtime mem stats to server info. See (#11995) for more details.
|
||||||
|
|
||||||
|
[1.162.0]
|
||||||
|
* Update minio to 2021-04-22T15-44-28Z
|
||||||
|
* [Full changelog](https://github.com/minio/minio/releases/tag/RELEASE.2021-04-22T15-44-28Z)
|
||||||
|
* fix: pick valid FileInfo additionally based on dataDir. See (#12116) for more details.
|
||||||
|
* Service account related improvements. See (#12117) for more details.
|
||||||
|
* fix: newMultipartUpload should go to same pool as existing object. See (#12106) for more details.
|
||||||
|
* ignore more tokens in some mountinfo entries. See (#12104) for more details.
|
||||||
|
* Grab read lock while reading usage cache. See (#12111) for more details.
|
||||||
|
|
||||||
|
[1.163.0]
|
||||||
|
* Update minio to 2021-05-11T23-27-41Z
|
||||||
|
* [Full changelog](https://github.com/minio/minio/releases/tag/RELEASE.2021-05-11T23-27-41Z)
|
||||||
|
|
||||||
|
[1.164.0]
|
||||||
|
* Update minio to 2021-05-18T00-53-28Z
|
||||||
|
* [Full changelog](https://github.com/minio/minio/releases/tag/RELEASE.2021-05-18T00-53-28Z)
|
||||||
|
|
||||||
|
[1.164.1]
|
||||||
|
* Update minio to 2021-05-20T22-31-44Z
|
||||||
|
* [Full changelog](https://github.com/minio/minio/releases/tag/RELEASE.2021-05-20T22-31-44Z)
|
||||||
|
|
||||||
|
[1.164.2]
|
||||||
|
* Update minio to 2021-05-22T02-34-39Z
|
||||||
|
* [Full changelog](https://github.com/minio/minio/releases/tag/RELEASE.2021-05-22T02-34-39Z)
|
||||||
|
|
||||||
|
[1.164.3]
|
||||||
|
* Update minio to 2021-05-27T22-06-31Z
|
||||||
|
* [Full changelog](https://github.com/minio/minio/releases/tag/RELEASE.2021-05-27T22-06-31Z)
|
||||||
|
|
||||||
|
[1.164.4]
|
||||||
|
* Update minio to 2021-06-07T21-40-51Z
|
||||||
|
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2021-06-07T21-40-51Z)
|
||||||
|
|
||||||
|
[1.164.5]
|
||||||
|
* Update minio to 2021-06-14T01-29-23Z
|
||||||
|
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2021-06-14T01-29-23Z)
|
||||||
|
|
||||||
|
[1.165.0]
|
||||||
|
* Update minio to 2021-06-17T00-10-46Z
|
||||||
|
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2021-06-17T00-10-46Z)
|
||||||
|
|
||||||
|
[1.165.1]
|
||||||
|
* Update minio to 2021-07-08T01-15-01Z
|
||||||
|
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2021-07-08T01-15-01Z)
|
||||||
|
|
||||||
|
[1.166.0]
|
||||||
|
* Update minio to 2021-07-22T05-23-32Z
|
||||||
|
* Use new minio dashboard 2021-06-13T17-48-22Z
|
||||||
|
|
||||||
|
[1.167.0]
|
||||||
|
* Update minio to 2021-09-15T04-54-25Z
|
||||||
|
* Update minio dashboard to 2021-09-02T09-21-27Z
|
||||||
|
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2021-09-15T04-54-25Z)
|
||||||
|
* SSE-KMS support was not working with copyObject() refer #13206
|
||||||
|
* Support UserInfo claims refer #12469
|
||||||
|
|
||||||
|
[2.0.0]
|
||||||
|
* **This is a major update. The changes below are required for the app to work. The newer version of the app has 2 domain names - one for the console (browser UI) and one of the API domain (API/S3 requests). **
|
||||||
|
* Be sure to take a backup before updating the app.
|
||||||
|
* Once updated, go to the `Location` view and set the API Domain.
|
||||||
|
* Update the various apps/servers/code to use the API domain as the backup destination.
|
||||||
|
|
||||||
|
[2.1.0]
|
||||||
|
* Update minio to 2022-01-28T02-28-16Z
|
||||||
|
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2022-01-28T02-28-16Z)
|
||||||
|
* make sure to pass groups for all credentials while verifying policies by @harshavardhana in #14193
|
||||||
|
* do not expect 'speedtest' to be a bucket by @harshavardhana in #14199
|
||||||
|
* Optimize read locker cleanup by @klauspost in #14200
|
||||||
|
* Ensure that AssumeRole calls are sent to Audit log by @donatello in #14202
|
||||||
|
|
||||||
|
[2.2.0]
|
||||||
|
* Update minio to 2022-02-05T04-40-59Z
|
||||||
|
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2022-02-05T04-40-59Z)
|
||||||
|
|
||||||
|
[2.2.1]
|
||||||
|
* Update minio to 2022-02-07T08-17-33Z
|
||||||
|
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2022-02-07T08-17-33Z)
|
||||||
|
|
||||||
|
[2.3.0]
|
||||||
|
* Update minio to 2022-02-18T01-50-10Z
|
||||||
|
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2022-02-18T01-50-10Z)
|
||||||
|
|
||||||
|
@@ -5,23 +5,31 @@
|
|||||||
"description": "file://DESCRIPTION.md",
|
"description": "file://DESCRIPTION.md",
|
||||||
"changelog": "file://CHANGELOG",
|
"changelog": "file://CHANGELOG",
|
||||||
"tagline": "Distributed object storage",
|
"tagline": "Distributed object storage",
|
||||||
"version": "1.161.0",
|
"version": "2.3.0",
|
||||||
"healthCheckPath": "/minio/login",
|
"healthCheckPath": "/minio/login",
|
||||||
"httpPort": 8000,
|
"httpPort": 8000,
|
||||||
|
"httpPorts": {
|
||||||
|
"API_SERVER_DOMAIN": {
|
||||||
|
"title": "API Server Domain",
|
||||||
|
"description": "The domain name for MinIO (S3) API requests",
|
||||||
|
"containerPort": 9000,
|
||||||
|
"defaultValue": "minio-api"
|
||||||
|
}
|
||||||
|
},
|
||||||
"addons": {
|
"addons": {
|
||||||
"localstorage": {}
|
"localstorage": {}
|
||||||
},
|
},
|
||||||
"manifestVersion": 2,
|
"manifestVersion": 2,
|
||||||
"website": "http://www.minio.io",
|
"website": "http://www.minio.io",
|
||||||
"minBoxVersion": "5.3.0",
|
"minBoxVersion": "7.1.0",
|
||||||
"forumUrl": "https://forum.cloudron.io/category/69/minio",
|
"forumUrl": "https://forum.cloudron.io/category/69/minio",
|
||||||
"documentationUrl": "https://docs.cloudron.io/apps/minio/",
|
"documentationUrl": "https://docs.cloudron.io/apps/minio/",
|
||||||
"contactEmail": "support@cloudron.io",
|
"contactEmail": "support@cloudron.io",
|
||||||
"icon": "logo.png",
|
"icon": "logo.png",
|
||||||
"tags": [ "storage", "hosting", "s3", "objectstore" ],
|
"tags": [ "storage", "hosting", "s3", "objectstore" ],
|
||||||
"mediaLinks": [
|
"mediaLinks": [
|
||||||
"https://screenshots.cloudron.io/io.minio.cloudronapp/minio-browser-gateway.png",
|
"https://screenshots.cloudron.io/io.minio.cloudronapp/pic1.png",
|
||||||
"https://screenshots.cloudron.io/io.minio.cloudronapp/minio-browser.png"
|
"https://screenshots.cloudron.io/io.minio.cloudronapp/pic2.png"
|
||||||
],
|
],
|
||||||
"postInstallMessage": "file://POSTINSTALL.md"
|
"postInstallMessage": "file://POSTINSTALL.md"
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
This app packages Minio <upstream>2021-04-18T19-26-29Z</upstream>.
|
This app packages Minio <upstream>2022-02-18T01-50-10Z</upstream>.
|
||||||
|
|
||||||
Minio is a distributed object storage server built for cloud applications and devops.
|
Minio is a distributed object storage server built for cloud applications and devops.
|
||||||
|
|
||||||
|
20
Dockerfile
20
Dockerfile
@@ -1,14 +1,16 @@
|
|||||||
FROM cloudron/base:3.0.0@sha256:455c70428723e3a823198c57472785437eb6eab082e79b3ff04ea584faf46e92
|
FROM cloudron/base:3.2.0@sha256:ba1d566164a67c266782545ea9809dc611c4152e27686fd14060332dd88263ea
|
||||||
|
|
||||||
ARG VERSION=RELEASE.2021-04-18T19-26-29Z
|
|
||||||
|
|
||||||
RUN mkdir -p /app/code \
|
|
||||||
&& wget https://dl.min.io/server/minio/release/linux-amd64/minio.${VERSION} -O /app/code/minio \
|
|
||||||
&& chmod +x /app/code/minio
|
|
||||||
|
|
||||||
|
RUN mkdir -p /app/code
|
||||||
WORKDIR /app/code
|
WORKDIR /app/code
|
||||||
|
|
||||||
ADD start.sh /app/code/start.sh
|
ARG VERSION=RELEASE.2022-02-18T01-50-10Z
|
||||||
ADD minio-credentials /app/code/minio-credentials
|
ARG MC_VERSION=RELEASE.2022-02-16T05-54-01Z
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# https://dl.min.io/client/mc/release/linux-amd64/
|
||||||
|
RUN wget https://dl.min.io/client/mc/release/linux-amd64/mc.${MC_VERSION} -O /app/code/mc && chmod +x /app/code/mc
|
||||||
|
|
||||||
|
COPY env.sh minio-credentials start.sh /app/code/
|
||||||
|
|
||||||
CMD [ "/app/code/start.sh" ]
|
CMD [ "/app/code/start.sh" ]
|
||||||
|
@@ -34,3 +34,6 @@ npm install
|
|||||||
PATH=$PATH:node_modules/.bin mocha --bail test.js
|
PATH=$PATH:node_modules/.bin mocha --bail test.js
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
MinIO Console is an embedded web-based object browser built into MinIO Server
|
||||||
|
9
env.sh
Normal file
9
env.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# 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
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 111 KiB |
Binary file not shown.
Before Width: | Height: | Size: 106 KiB |
BIN
screenshots/pic1.png
Normal file
BIN
screenshots/pic1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 MiB |
BIN
screenshots/pic2.png
Normal file
BIN
screenshots/pic2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 MiB |
21
start.sh
21
start.sh
@@ -4,16 +4,23 @@ set -eu
|
|||||||
|
|
||||||
mkdir -p /app/data/data /run/minio/config /run/minio/certs
|
mkdir -p /app/data/data /run/minio/config /run/minio/certs
|
||||||
|
|
||||||
# minio is used for backups at times and has a large number of files. optimize by checking if files
|
[[ ! -f /app/data/env.sh ]] && cp /app/code/env.sh /app/data/env.sh
|
||||||
# are actually in correct chown state
|
source /app/data/env.sh
|
||||||
|
|
||||||
|
# https://docs.min.io/minio/baremetal/reference/minio-server/minio-server.html#envvar.MINIO_SERVER_URL
|
||||||
|
[[ -n "${API_SERVER_DOMAIN:-}" ]] && export MINIO_SERVER_URL="https://${API_SERVER_DOMAIN}"
|
||||||
|
export MINIO_BROWSER_REDIRECT_URL="https://${CLOUDRON_APP_DOMAIN}"
|
||||||
|
|
||||||
|
if [[ ! -d /app/data/mc_config ]]; then
|
||||||
|
mkdir -p /app/data/mc_config
|
||||||
|
/app/code/mc --config-dir /app/data/mc_config &> /dev/null || true
|
||||||
|
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
|
||||||
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
|
||||||
|
|
||||||
[[ ! -f /app/data/env.sh ]] && echo -e "# Add custom minio configuration to this file. Restart the app for changes to take effect.\n\nexport CLOUDRON_MINIO_STARTUP_ARGS='server /app/data/data'" > /app/data/env.sh
|
|
||||||
|
|
||||||
source /app/data/env.sh
|
|
||||||
|
|
||||||
# the --config-dir is deprecated and not used. but without it, minio will try to create $HOME/.minio :/ same for --certs-dir
|
# the --config-dir is deprecated and not used. but without it, minio will try to create $HOME/.minio :/ same for --certs-dir
|
||||||
echo "==> Starting minio"
|
echo "==> Starting minio"
|
||||||
exec /usr/local/bin/gosu cloudron:cloudron /app/code/minio --certs-dir /run/minio/certs --config-dir /run/minio/config --quiet ${CLOUDRON_MINIO_STARTUP_ARGS} --address :8000
|
exec /usr/local/bin/gosu cloudron:cloudron /app/code/minio --certs-dir /run/minio/certs --config-dir /run/minio/config --quiet ${CLOUDRON_MINIO_STARTUP_ARGS} --address :9000 --console-address :8000
|
||||||
|
|
||||||
|
2461
test/package-lock.json
generated
2461
test/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -9,9 +9,10 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chromedriver": "^89.0.0",
|
"chromedriver": "^97.0.2",
|
||||||
"expect.js": "^0.3.1",
|
"expect.js": "^0.3.1",
|
||||||
"mocha": "^8.3.2",
|
"mocha": "^9.2.0",
|
||||||
"selenium-webdriver": "^3.6.0"
|
"selenium-webdriver": "^4.1.1",
|
||||||
|
"superagent": "^7.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
171
test/test.js
171
test/test.js
@@ -1,31 +1,33 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/* jshint esversion: 8 */
|
||||||
/* global describe */
|
/* global describe */
|
||||||
/* global before */
|
/* global before */
|
||||||
/* global after */
|
/* global after */
|
||||||
/* global it */
|
/* global it */
|
||||||
|
/* global xit */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
require('chromedriver');
|
require('chromedriver');
|
||||||
|
|
||||||
var execSync = require('child_process').execSync,
|
const execSync = require('child_process').execSync,
|
||||||
expect = require('expect.js'),
|
expect = require('expect.js'),
|
||||||
|
fs = require('fs'),
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
{ Builder, By, Key, until } = require('selenium-webdriver'),
|
superagent = require('superagent'),
|
||||||
|
{ Builder, By, until } = require('selenium-webdriver'),
|
||||||
{ Options } = require('selenium-webdriver/chrome');
|
{ Options } = require('selenium-webdriver/chrome');
|
||||||
|
|
||||||
|
|
||||||
describe('Application life cycle test', function () {
|
describe('Application life cycle test', function () {
|
||||||
this.timeout(0);
|
this.timeout(0);
|
||||||
|
|
||||||
const LOCATION = 'test';
|
const LOCATION = 'test';
|
||||||
const TEST_TIMEOUT = 10000;
|
const TEST_TIMEOUT = 10000;
|
||||||
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' };
|
|
||||||
const BUCKET = 'cloudrontestbucket';
|
const BUCKET = 'cloudrontestbucket';
|
||||||
|
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' };
|
||||||
|
|
||||||
var app;
|
let browser, app;
|
||||||
var browser;
|
|
||||||
|
|
||||||
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();
|
||||||
@@ -35,132 +37,79 @@ describe('Application life cycle test', function () {
|
|||||||
browser.quit();
|
browser.quit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
async function waitForElement(elem) {
|
||||||
|
await browser.wait(until.elementLocated(elem), TEST_TIMEOUT);
|
||||||
|
await browser.wait(until.elementIsVisible(browser.findElement(elem)), TEST_TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
function getAppInfo() {
|
function getAppInfo() {
|
||||||
var inspect = JSON.parse(execSync('cloudron inspect'));
|
var inspect = JSON.parse(execSync('cloudron inspect'));
|
||||||
app = inspect.apps.filter(function (a) { return a.location.indexOf(LOCATION) === 0; })[0];
|
app = inspect.apps.filter(function (a) { return a.location.indexOf(LOCATION) === 0; })[0];
|
||||||
expect(app).to.be.an('object');
|
expect(app).to.be.an('object');
|
||||||
}
|
}
|
||||||
|
|
||||||
function pageLoaded() {
|
async function login(accessKey='minioadmin', secretKey='minioadmin') {
|
||||||
return browser.wait(until.elementLocated(By.className('page-load pl-0 pl-1')), TEST_TIMEOUT);
|
await browser.get(`https://${app.fqdn}/login`);
|
||||||
|
await waitForElement(By.id('accessKey'));
|
||||||
|
await browser.findElement(By.id('accessKey')).sendKeys(accessKey);
|
||||||
|
await browser.findElement(By.id('secretKey')).sendKeys(secretKey);
|
||||||
|
await browser.findElement(By.xpath('//button[contains(text(), "Login")]')).click();
|
||||||
|
await waitForElement(By.xpath('//h4[contains(text(), "Buckets")]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function visible(selector) {
|
async function logout() {
|
||||||
return browser.wait(until.elementLocated(selector), TEST_TIMEOUT).then(function () {
|
await browser.get(`https://${app.fqdn}/`);
|
||||||
return browser.wait(until.elementIsVisible(browser.findElement(selector)), TEST_TIMEOUT);
|
await waitForElement(By.xpath('//h4[contains(text(), "Buckets")]'));
|
||||||
});
|
await browser.findElement(By.xpath('//div/span[contains(text(), "Logout")]')).click();
|
||||||
|
await waitForElement(By.id('accessKey'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function login(accessKey, secretKey, callback) {
|
async function addBucket() {
|
||||||
browser.manage().deleteAllCookies();
|
await browser.get(`https://${app.fqdn}/buckets`);
|
||||||
browser.get('https://' + app.fqdn).then(function () {
|
await waitForElement(By.xpath('//button/span[text()="Create Bucket"]'));
|
||||||
return visible(By.id('accessKey'));
|
await browser.findElement(By.xpath('//button/span[text()="Create Bucket"]')).click();
|
||||||
}).then(function () {
|
await browser.sleep(2000);
|
||||||
return browser.findElement(By.id('accessKey')).sendKeys(accessKey);
|
await browser.findElement(By.xpath('//input[@id="bucket-name"]')).sendKeys(BUCKET);
|
||||||
}).then(function () {
|
await browser.findElement(By.xpath('//button[text()="Create Bucket"]')).click();
|
||||||
return browser.findElement(By.id('secretKey')).sendKeys(secretKey);
|
await waitForElement(By.xpath(`//a[contains(text(), "${BUCKET}")]`));
|
||||||
}).then(function () {
|
|
||||||
// return browser.findElement(By.className('lw-btn')).click();
|
|
||||||
return browser.findElement(By.tagName('form')).submit();
|
|
||||||
}).then(function () {
|
|
||||||
return browser.wait(until.elementLocated(By.id('top-right-menu')), TEST_TIMEOUT);
|
|
||||||
}).then(function () {
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function logout(callback) {
|
async function checkBucket() {
|
||||||
browser.get('https://' + app.fqdn);
|
await browser.get(`https://${app.fqdn}/buckets`);
|
||||||
|
await waitForElement(By.xpath(`//h1[contains(text(), "${BUCKET}")]`));
|
||||||
pageLoaded().then(function () {
|
|
||||||
return visible(By.id('top-right-menu'));
|
|
||||||
}).then(function () {
|
|
||||||
return browser.findElement(By.id('top-right-menu')).click();
|
|
||||||
}).then(function () {
|
|
||||||
if (app.manifest.version === '1.137.0') {
|
|
||||||
return visible(By.xpath('//*[text()="Sign Out "]'));
|
|
||||||
} else {
|
|
||||||
return visible(By.xpath('//*[contains(text(), "Logout")]'));
|
|
||||||
}
|
|
||||||
}).then(function () {
|
|
||||||
if (app.manifest.version === '1.137.0') {
|
|
||||||
return browser.findElement(By.xpath('//*[text()="Sign Out "]')).click();
|
|
||||||
} else {
|
|
||||||
return browser.findElement(By.xpath('//*[contains(text(),"Logout")]')).click();
|
|
||||||
}
|
|
||||||
}).then(function () {
|
|
||||||
return browser.wait(until.elementLocated(By.id('accessKey')), TEST_TIMEOUT);
|
|
||||||
}).then(function () {
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addBucket(callback) {
|
async function checkRedirect() {
|
||||||
browser.get('https://' + app.fqdn);
|
const response = await superagent.get(`https://${app.secondaryDomains[0].fqdn}`).set('User-Agent', 'Mozilla/5.0').redirects(0).ok(() => true);
|
||||||
|
expect(response.status).to.be(307);
|
||||||
pageLoaded().then(function () {
|
expect(response.headers.location).to.be(`https://${app.fqdn}`);
|
||||||
return visible(By.className('fa-plus'));
|
|
||||||
}).then(function () {
|
|
||||||
return browser.findElement(By.className('fa-plus')).click();
|
|
||||||
}).then(function () {
|
|
||||||
const c = 'fa-hdd';
|
|
||||||
return visible(By.className(c));
|
|
||||||
}).then(function () {
|
|
||||||
const c = 'fa-hdd';
|
|
||||||
return browser.findElement(By.className(c)).click();
|
|
||||||
}).then(function () {
|
|
||||||
return visible(By.xpath('//*[@class="modal-body"]/form/div/input'));
|
|
||||||
}).then(function () {
|
|
||||||
return browser.findElement(By.xpath('//*[@class="modal-body"]/form/div/input')).sendKeys(BUCKET);
|
|
||||||
}).then(function () {
|
|
||||||
return browser.findElement(By.xpath('//*[@class="modal-body"]/form')).submit();
|
|
||||||
}).then(function () {
|
|
||||||
return visible(By.xpath('//*[@class="main"]/a[text()="' + BUCKET + '"]'));
|
|
||||||
}).then(function () {
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkBucket(callback) {
|
async function checkApi() {
|
||||||
browser.get('https://' + app.fqdn);
|
const response = await superagent.get(`https://${app.secondaryDomains[0].fqdn}`).ok(() => true);
|
||||||
|
expect(response.status).to.be(403);
|
||||||
pageLoaded().then(function () {
|
expect(response.body.toString('utf8')).to.contain('<Code>AccessDenied</Code>');
|
||||||
return browser.findElement(By.xpath(`//a[contains(text(), ${BUCKET})]`));
|
|
||||||
}).then(function () {
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function openSettings(callback) {
|
|
||||||
browser.get('https://' + app.fqdn);
|
|
||||||
|
|
||||||
pageLoaded().then(function () {
|
|
||||||
return visible(By.id('top-right-menu'));
|
|
||||||
}).then(function () {
|
|
||||||
return browser.findElement(By.id('top-right-menu')).click();
|
|
||||||
}).then(function () {
|
|
||||||
return visible(By.xpath('//*[contains(text(), "Change Password")]'));
|
|
||||||
}).then(function () {
|
|
||||||
return browser.findElement(By.xpath('//*[contains(text(),"Change Password")]')).click();
|
|
||||||
}).then(function () {
|
|
||||||
return browser.wait(until.elementLocated(By.xpath('//*[contains(text(), "Change Password")]')), TEST_TIMEOUT);
|
|
||||||
}).then(function () {
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
|
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
|
||||||
it('install app', function () { execSync('cloudron install --location ' + LOCATION, EXEC_ARGS); });
|
it('install app', function () { execSync(`cloudron install --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 login', login.bind(null, 'minioadmin', 'minioadmin'));
|
||||||
it('can add bucket', addBucket);
|
it('can add bucket', addBucket);
|
||||||
it('can open settings', openSettings);
|
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
|
it('does redirect', checkRedirect);
|
||||||
|
it('check api', checkApi);
|
||||||
|
|
||||||
it('can change credentials', function () {
|
it('can change credentials', function () {
|
||||||
execSync(`cloudron exec --app ${app.id} -- /app/code/minio-credentials set minioakey minioskey`, EXEC_ARGS);
|
let data = fs.readFileSync(path.join(__dirname, '../env.sh'), 'utf8');
|
||||||
|
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);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can restart app', function () { execSync(`cloudron restart --app ${app.id}`, EXEC_ARGS); });
|
it('can restart app', function () { execSync(`cloudron restart --app ${app.id}`, EXEC_ARGS); });
|
||||||
@@ -168,6 +117,8 @@ describe('Application life cycle test', function () {
|
|||||||
it('can 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('check api', checkApi);
|
||||||
|
|
||||||
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', function () {
|
it('restore app', function () {
|
||||||
@@ -180,8 +131,9 @@ describe('Application life cycle test', function () {
|
|||||||
|
|
||||||
it('can login', login.bind(null, 'minioakey', 'minioskey'));
|
it('can login', login.bind(null, 'minioakey', 'minioskey'));
|
||||||
it('has bucket', checkBucket);
|
it('has bucket', checkBucket);
|
||||||
it('can open settings', openSettings);
|
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
|
it('does redirect', checkRedirect);
|
||||||
|
it('check api', checkApi);
|
||||||
|
|
||||||
it('move to different location', function () {
|
it('move to different location', function () {
|
||||||
browser.manage().deleteAllCookies();
|
browser.manage().deleteAllCookies();
|
||||||
@@ -192,6 +144,8 @@ describe('Application life cycle test', function () {
|
|||||||
it('can 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('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); });
|
||||||
|
|
||||||
@@ -202,12 +156,15 @@ describe('Application life cycle test', function () {
|
|||||||
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);
|
||||||
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 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('has bucket', checkBucket);
|
it('has bucket', checkBucket);
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
|
it('does redirect', checkRedirect);
|
||||||
|
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); });
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user