1
0
mirror of https://git.cloudron.io/cloudron/minio-app synced 2025-09-04 00:05:18 +00:00

Compare commits

...

41 Commits

Author SHA1 Message Date
Girish Ramakrishnan
abef481b63 Version 3.13.3 2024-03-05 10:42:40 +01:00
Girish Ramakrishnan
2b0dcc7d38 Update minio to 2024-03-05T04-48-44Z 2024-03-05 10:41:47 +01:00
Girish Ramakrishnan
0c32be8139 Update tests 2024-03-04 11:33:45 +01:00
Girish Ramakrishnan
fd04e1b784 Version 3.13.2 2024-03-04 10:22:55 +01:00
Girish Ramakrishnan
bd883b747c Update minio to 2024-03-03T17-50-39Z 2024-03-04 10:08:19 +01:00
Johannes Zellner
618c3c6736 Bump version 2024-02-26 15:28:12 +01:00
Johannes Zellner
fba9a4ff32 Update test deps 2024-02-26 14:42:49 +01:00
Johannes Zellner
7878d690b9 Update to 2024-02-26T09-33-48Z 2024-02-26 14:42:36 +01:00
Girish Ramakrishnan
623b291e62 Fixup tests 2024-02-20 13:26:29 +01:00
Girish Ramakrishnan
74bc0cbbd2 Version 3.13.0 2024-02-20 12:25:21 +01:00
Girish Ramakrishnan
316047b1d3 minio does not show the password login by default when OIDC is setup
we generate a dynamic password because users might forget to change the admin password (with the oidc login being so click friendly)
2024-02-20 12:19:30 +01:00
Vladimir D
569e830514 optionalSso flag added, tests updated 2024-02-19 18:31:04 +04:00
Vladimir D
7417ce44e5 OIDC auth implemented, tests updated 2024-02-19 17:13:57 +04:00
Johannes Zellner
88918c602a Bump version 2024-02-17 16:21:16 +01:00
Johannes Zellner
7b26be880d Update test deps 2024-02-17 15:53:05 +01:00
Johannes Zellner
e966943be5 Update to 2024-02-17T01-15-57Z 2024-02-17 15:52:35 +01:00
Johannes Zellner
dd46a7f8e9 Bump version 2024-02-15 10:33:59 +01:00
Johannes Zellner
5295380629 Update to 2024-02-14T21-36-02Z 2024-02-15 10:10:09 +01:00
Johannes Zellner
22f00b1803 Bump version 2024-02-13 18:04:59 +01:00
Johannes Zellner
8315f77f5c Update to 2024-02-13T15-35-11Z 2024-02-13 17:51:59 +01:00
Johannes Zellner
e1a29850c8 Bump version 2024-02-13 11:09:56 +01:00
Johannes Zellner
c94a90e4ab Update to 2024-02-12T21-02-27Z 2024-02-13 10:44:20 +01:00
Girish Ramakrishnan
d4ec80fab3 2GB min (RAM)
https://github.com/minio/minio/issues/18906
https://github.com/minio/docs/issues/1116
https://github.com/minio/minio/pull/18846
2024-02-12 06:44:34 +01:00
Johannes Zellner
682dd521a1 Bump version 2024-02-10 13:04:32 +01:00
Johannes Zellner
cd7055c916 Update test deps 2024-02-10 12:45:25 +01:00
Johannes Zellner
6d385533b3 Update to 2024-02-09T21-25-16Z 2024-02-10 12:45:08 +01:00
Girish Ramakrishnan
36d669ad59 Version 3.12.9 2024-02-07 15:06:45 +01:00
Girish Ramakrishnan
cc5e013c1f Update minio to 2024-02-06T21-36-22Z 2024-02-07 14:47:38 +01:00
Johannes Zellner
20bbaff551 Bump version 2024-02-05 10:57:39 +01:00
Johannes Zellner
d39b1cb50f Update to RELEASE.2024-02-04T22-36-13Z 2024-02-05 10:41:27 +01:00
Johannes Zellner
0dec46fdc0 Bump version 2024-02-01 14:11:01 +01:00
Johannes Zellner
9d8938b7bf Update to 2024-01-31T20-20-33Z 2024-02-01 13:55:19 +01:00
Girish Ramakrishnan
4f43bc611e Version 3.12.6 2024-01-29 09:29:09 +01:00
Johannes Zellner
db768973d6 Update test deps 2024-01-29 09:20:07 +01:00
Johannes Zellner
db0d84862d Update to 2024-01-29T03-56-32Z 2024-01-29 09:19:56 +01:00
Girish Ramakrishnan
0e70c439cf Version 3.12.5 2024-01-19 15:40:44 +01:00
Girish Ramakrishnan
59ed1a0fc1 Update minio to 2024-01-18T22-51-28Z 2024-01-19 15:33:41 +01:00
Johannes Zellner
6542475614 Bump version 2024-01-16 18:54:02 +01:00
Johannes Zellner
9cffe692df Update to 2024-01-16T16-07-38Z 2024-01-16 18:37:28 +01:00
Johannes Zellner
eeac9f0af4 Bump version 2024-01-16 18:37:17 +01:00
Johannes Zellner
b1fe43b656 Update to 2024-01-13T07-53-03Z 2024-01-15 11:40:46 +01:00
10 changed files with 937 additions and 121 deletions

157
CHANGELOG
View File

@@ -2214,3 +2214,160 @@ Improve replication performance. See (#12080, #12054, #12009) for more details.
* Update minio to 2024-01-11T07-46-16Z
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-01-11T07-46-16Z)
[3.12.3]
* Update minio to 2024-01-13T07-53-03Z
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-01-13T07-53-03Z)
* Verify that remote target bucket is on MinIO server for bucket replication by @taran-p in https://github.com/minio/minio/pull/18656
* avoid disk monitoring leaks under various conditions by @harshavardhana in https://github.com/minio/minio/pull/18777
* xl: Remove wrong wording for errCorruptedFormat by @vadmeste in https://github.com/minio/minio/pull/18775
* Add more size intervals to obj size histogram by @krisis in https://github.com/minio/minio/pull/18772
* support proxying of tagging requests in replication by @poornas in https://github.com/minio/minio/pull/18649
* treat all localhost endpoints as local setup with same port by @harshavardhana in https://github.com/minio/minio/pull/18784
[3.12.4]
* Update minio to 2024-01-16T16-07-38Z
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-01-16T16-07-38Z)
* fix: listing SSE encrypted multipart objects by @harshavardhana in https://github.com/minio/minio/pull/18786
* adding a missing return case to fix GetObjectTagging by @zveinn in https://github.com/minio/minio/pull/18793
* xl-meta: Clean output by @klauspost in https://github.com/minio/minio/pull/18794
[3.12.5]
* Update minio to 2024-01-18T22-51-28Z
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-01-18T22-51-28Z)
* reject reference format from a different deployment by @harshavardhana in #18800
* fix: a typo in storeDataUsageInBackend() comment by @chienguo in #18778
* Deallocate huge read buffers by @klauspost in #18813
* fix: HealBucket regression for empty buckets, simplify it by @harshavardhana in #18815
* Fix mini typo by @fwessels in #18816
[3.12.6]
* Update minio to 2024-01-29T03-56-32Z
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-01-29T03-56-32Z)
* Fixes an ugly issue with runtime debug stack excessive logging regression
* avoid calling close for nil inbound/outblock channels (3 hours ago)
* remove getReplicationNodeMetrics() from peer metrics groups (4 hours ago)
[3.12.7]
* Update minio to 2024-01-31T20-20-33Z
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-01-31T20-20-33Z)
* This release fixes a security issue related to service accounts and their permissions for more details
* Performance improvement for large clusters with high IOPs requirements.
* fix: bucket metric of data usage for replication info will be ignore by @jiuker in https://github.com/minio/minio/pull/18895
* fix metrics panic in node metrics endpoint by @poornas in https://github.com/minio/minio/pull/18894
* Update list.md by @dvaldivia in https://github.com/minio/minio/pull/18907
* allow configuring maximum idle connections per host by @harshavardhana in https://github.com/minio/minio/pull/18908
* enable xattr capture by default by @harshavardhana in https://github.com/minio/minio/pull/18911
* reuse transports for callhome and remote tgt validation by @poornas in https://github.com/minio/minio/pull/18912
* exclude veeam virtual objects from replication by @poornas in https://github.com/minio/minio/pull/18918
* Add cgroup v2 support for memory limit by @vadmeste in https://github.com/minio/minio/pull/18905
* remove checkBucketExist check entirely to avoid fan-out calls by @harshavardhana in https://github.com/minio/minio/pull/18917
* Improve tracing & notification scalability by @klauspost in https://github.com/minio/minio/pull/18903
* use all the available nr_requests for NVMe by @harshavardhana in https://github.com/minio/minio/pull/18920
* add total usable capacity, free and used to DataUsageInfo() by @harshavardhana in https://github.com/minio/minio/pull/18921
* remove all the frivolous logs, that may or may not be actionable by @harshavardhana in https://github.com/minio/minio/pull/18922
* Update service file version in makefile by @donatello in https://github.com/minio/minio/pull/18925
* Correct small typo by @fwessels in https://github.com/minio/minio/pull/18923
* fix: permission checks for editing access keys by @donatello in https://github.com/minio/minio/pull/18928
* Keep ServiceV1 admin stop/restart API and mark as deprecated by @vadmeste in https://github.com/minio/minio/pull/18932
[3.12.8]
* Update minio to 2024-02-04T22-36-13Z
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-02-04T22-36-13Z)
* move a collection of peer APIs to websockets by @harshavardhana in https://github.com/minio/minio/pull/18936
* Improve object reuse for grid messages by @klauspost in https://github.com/minio/minio/pull/18940
* batch: Fix a typo while validating smallerThan field by @vadmeste in https://github.com/minio/minio/pull/18942
* fix: null inline policy handling for access keys by @donatello in https://github.com/minio/minio/pull/18945
* log: Use error log type instead of Application/MinIO type by @vadmeste in https://github.com/minio/minio/pull/18930
* Fix some leftover issues from PR 18936 by @fwessels in https://github.com/minio/minio/pull/18946
* simplify deadlineWriter, re-use WithDeadline by @harshavardhana in https://github.com/minio/minio/pull/18948
* Fix ineffective recycling by @klauspost in https://github.com/minio/minio/pull/18952
* deprecate disk tokens, instead rely on deadlines and active monitoring by @harshavardhana in https://github.com/minio/minio/pull/18947
* move Make,Delete,Head,Heal bucket calls to websockets by @harshavardhana in https://github.com/minio/minio/pull/18951
* Fix mux client memory leak by @klauspost in https://github.com/minio/minio/pull/18956
* disconnected returns, an unexpected error to List() returning 500s by @harshavardhana in https://github.com/minio/minio/pull/18959
* xl: Disable rename2 in decommissioning/rebalance by @vadmeste in https://github.com/minio/minio/pull/18964
* Fix typo in api-router.go by @fwessels in https://github.com/minio/minio/pull/18955
* Add more advanced cases for dangling by @harshavardhana in https://github.com/minio/minio/pull/18968
[3.12.9]
* Update minio to 2024-02-06T21-36-22Z
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-02-06T21-36-22Z)
* Fixes a second memory leak observed in ReadVersion without data that uses websockets layer.
* Fixes a crash while running mc admin trace on a distributed setup.
* Fixes TCP socket hangs by adding short deadlines.
[3.12.10]
* Update minio to 2024-02-09T21-25-16Z
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-02-09T21-25-16Z)
* do not block iam.store registration by @harshavardhana in https://github.com/minio/minio/pull/18999
* listing must return WalkDir() errors first by @harshavardhana in https://github.com/minio/minio/pull/19006
* Add GetBucketInfo toStorageErr conversion by @klauspost in https://github.com/minio/minio/pull/19005
* fix: skip policy usage validation for cache update by @donatello in https://github.com/minio/minio/pull/19008
* Update IAM access manager plugin demo by @donatello in https://github.com/minio/minio/pull/19007
* Fix blocked streams blocking reconnects by @klauspost in https://github.com/minio/minio/pull/19017
* optimize startup sequence performance by @harshavardhana in https://github.com/minio/minio/pull/19009
* Fix shared top locks client by @klauspost in https://github.com/minio/minio/pull/19018
* fix: dangling objects honor parityBlocks instead of dataBlocks by @harshavardhana in https://github.com/minio/minio/pull/19019
* remove unnecessary metrics in 'mc admin info' output by @harshavardhana in https://github.com/minio/minio/pull/19020
* Add extra disconnect safety by @klauspost in https://github.com/minio/minio/pull/19022
* introduce reader deadlines for net.Conn by @harshavardhana in https://github.com/minio/minio/pull/19023
[3.12.11]
* Update minio to 2024-02-12T21-02-27Z
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-02-12T21-02-27Z)
* avoid excessive logging for objects that do not exist by @harshavardhana in https://github.com/minio/minio/pull/19030
* Fix panic in tagging request proxying by @poornas in https://github.com/minio/minio/pull/19032
* do not have to use the same distributionAlgo as first pool by @harshavardhana in https://github.com/minio/minio/pull/19031
* fix: allow configuring excess versions alerting by @harshavardhana in https://github.com/minio/minio/pull/19028
* preserve conflicting objects when parent object is being deleted by @harshavardhana in https://github.com/minio/minio/pull/19034
* Convert service account add/update expiration to cond values by @vadmeste in https://github.com/minio/minio/pull/19024
* relax pre-emptive GetBucketInfo() for multi-object delete by @harshavardhana in https://github.com/minio/minio/pull/19035
* honor replaced disk properly by updating globalLocalDrives by @harshavardhana in https://github.com/minio/minio/pull/19038
* metrics: fix typo in namespace for proxy tagging metric by @poornas in https://github.com/minio/minio/pull/19039
[3.12.12]
* Update minio to 2024-02-13T15-35-11Z
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-02-13T15-35-11Z)
* FIx unexpected behavior when creating service account by @taran-p in https://github.com/minio/minio/pull/19036
* sts: Add test for DurationSeconds condition by @vadmeste in https://github.com/minio/minio/pull/19044
* add missing handler for reloading site replication config on peers by @harshavardhana in https://github.com/minio/minio/pull/19042
* fix: update batch replication stats for snowball uploads by @Praveenrajmani in https://github.com/minio/minio/pull/19045
* Send a bucket notification event on DeleteObject() for non-existing object by @Praveenrajmani in https://github.com/minio/minio/pull/19037
* fix incorrect disk io stats in k8s environment by @anjalshireesh in https://github.com/minio/minio/pull/19016
[3.12.13]
* Update minio to 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
[3.13.1]
* Update minio to 2024-02-26T09-33-48Z
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-02-26T09-33-48Z)
* fix: crash in ResourceMetrics RPC handling concurrent writers by @harshavardhana in https://github.com/minio/minio/pull/19123
* fix: re-arrange console-sys to log properly in k8s/docker by @harshavardhana in https://github.com/minio/minio/pull/19129
[3.13.2]
* Update minio to 2024-03-03T17-50-39Z
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-03-03T17-50-39Z)
* Major performance improvement on total connection usage and de-duplicate ILM entries refer #18926
* Major performance improvement for Listing() to avoid readdir() under situations for directory lookups refer #19100
* Read drive IO stats from sysfs instead of procfs by @Praveenrajmani in #19131
* ilm: Select an object when all AND tags are satisfied by @vadmeste in #19134
* remove unnecessary 'recreate' code by @harshavardhana in #19136
* feat: add userCredentials for nats by @jiuker in #19139
[3.13.3]
* Update minio to 2024-03-05T04-48-44Z
* [Changelog](https://github.com/minio/minio/releases/tag/RELEASE.2024-03-05T04-48-44Z)
* fix: healthcheck to fail even if one erasure set doesn't have quorum by @Praveenrajmani in #19180
* Add common middleware to S3 API handlers by @donatello in #19171
* fix: nLink is unreliable on all filesystems by @harshavardhana in #19187
* Fix ilm config at startup by @krisis in #19189
* fix: skip local disks properly in cluster health maintenance check by @harshavardhana in #19184

View File

@@ -5,10 +5,10 @@
"description": "file://DESCRIPTION.md",
"changelog": "file://CHANGELOG",
"tagline": "Distributed object storage",
"version": "3.12.2",
"upstreamVersion": "2024-01-11T07-46-16Z",
"version": "3.13.3",
"upstreamVersion": "2024-03-05T04-48-44Z",
"healthCheckPath": "/minio/login",
"memoryLimit": 805306368,
"memoryLimit": 2147483648,
"httpPort": 8000,
"httpPorts": {
"API_SERVER_DOMAIN": {
@@ -19,8 +19,10 @@
}
},
"addons": {
"localstorage": {}
"localstorage": {},
"oidc": { "loginRedirectUri": "/oauth_callback" }
},
"optionalSso": true,
"manifestVersion": 2,
"website": "http://www.minio.io",
"minBoxVersion": "7.1.2",

View File

@@ -3,7 +3,7 @@ FROM cloudron/base:4.2.0@sha256:46da2fffb36353ef714f97ae8e962bd2c212ca091108d768
RUN mkdir -p /app/code
WORKDIR /app/code
ARG VERSION=RELEASE.2024-01-11T07-46-16Z
ARG VERSION=RELEASE.2024-03-05T04-48-44Z
# 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
@@ -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/
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" ]

View File

@@ -1,7 +1,19 @@
<nosso>
Please use the following credentials to login:
**Username**: minioadmin<br/>
**Password**: minioadmin<br/>
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
View File

@@ -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
View 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'

View File

@@ -5,7 +5,18 @@ set -eu
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)
[[ ! -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
# 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
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
echo "==> Changing ownership"
[[ $(stat --format '%U' /app/data/data) != "cloudron" ]] && chown -R cloudron:cloudron /app/data

670
test/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -9,10 +9,10 @@
"author": "",
"license": "ISC",
"dependencies": {
"chromedriver": "^120.0.1",
"chromedriver": "^122.0.4",
"expect.js": "^0.3.1",
"mocha": "^10.2.0",
"selenium-webdriver": "^4.16.0",
"mocha": "^10.3.0",
"selenium-webdriver": "^4.18.1",
"superagent": "^8.1.2"
}
}

View File

@@ -20,15 +20,23 @@ const execSync = require('child_process').execSync,
{ 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 () {
this.timeout(0);
const LOCATION = 'test';
const TEST_TIMEOUT = 30000;
const TEST_TIMEOUT = parseInt(process.env.TIMEOUT, 10) || 30000;
const BUCKET = 'cloudrontestbucket';
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' };
let browser, app;
let athenticated_by_oidc = false, rootPassword;
let username = process.env.USERNAME;
let password = process.env.PASSWORD;
before(function () {
browser = new Builder().forBrowser('chrome').setChromeOptions(new Options().windowSize({ width: 1280, height: 1024 })).build();
@@ -49,23 +57,58 @@ describe('Application life cycle test', function () {
expect(app).to.be.an('object');
}
async function login(accessKey='minioadmin', secretKey='minioadmin') {
async function login(username, password, expandLoginForm=true) {
await browser.manage().deleteAllCookies();
await browser.get('about:blank');
await browser.sleep(2000);
await browser.get(`https://${app.fqdn}/login`);
await browser.sleep(2000);
if (expandLoginForm) {
await waitForElement(By.xpath('//div[@id="alternativeMethods-select"]/div[contains(., "Other Authentication Methods")]'));
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 browser.findElement(By.id('accessKey')).sendKeys(accessKey);
await browser.findElement(By.id('secretKey')).sendKeys(secretKey);
await browser.findElement(By.id('accessKey')).sendKeys(username);
await browser.findElement(By.id('secretKey')).sendKeys(password);
await browser.findElement(By.xpath('//button[@id="do-login"]')).click();
await waitForElement(By.xpath('//span[contains(text(), "Buckets")]'));
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() {
await browser.get(`https://${app.fqdn}/`);
await waitForElement(By.xpath('//span[contains(text(), "Buckets")]'));
const button = await browser.findElement(By.xpath('//button[@id="sign-out"]'));
await browser.executeScript('arguments[0].scrollIntoView(false)', button);
await button.click();
await waitForElement(By.id('accessKey'));
await browser.sleep(10000); // needed!
await waitForElement(By.xpath('//*[@id="accessKey"] | //button[contains(., "Cloudron")]'));
}
async function addBucket() {
@@ -96,38 +139,87 @@ describe('Application life cycle test', function () {
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); });
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);
});
it('can get app information', getAppInfo);
it('can login', login.bind(null, 'minioadmin', 'minioadmin'));
it('can admin login', login.bind(null, 'minioadmin', 'minioadmin', false));
it('can add bucket', addBucket);
it('can logout', logout);
it('does redirect', checkRedirect);
it('check api', checkApi);
it('can change credentials', async function () {
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);
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 restart app', function () { execSync(`cloudron restart --app ${app.id}`, EXEC_ARGS); });
it('can login', login.bind(null, 'minioakey', 'minioskey'));
it('can admin login', login.bind(null, 'minioakey', 'minioskey', false));
it('has bucket', checkBucket);
it('can logout', logout);
it('does redirect', checkRedirect);
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('restore app', async function () {
@@ -139,9 +231,15 @@ describe('Application life cycle test', function () {
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('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('check api', checkApi);
@@ -152,28 +250,44 @@ describe('Application life cycle test', function () {
});
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('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('check api', checkApi);
it('uninstall app', function () { execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS); });
// 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 login', login.bind(null, 'minioadmin', 'minioadmin'));
it('can get admin credentials', getAdminCredentials);
it('can admin login', async function () { await login('minioadmin', rootPassword); });
it('can add buckets', addBucket);
it('can logout', logout);
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 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 login', login.bind(null, 'minioadmin', 'minioadmin'));
it('can admin login', async function () { await login('minioadmin', rootPassword); });
it('has bucket', checkBucket);
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('check api', checkApi);