optionalSso flag added, tests updated

This commit is contained in:
Vladimir D 2024-02-19 18:31:04 +04:00
parent 7417ce44e5
commit 569e830514
3 changed files with 42 additions and 2 deletions

View File

@ -22,6 +22,7 @@
"localstorage": {},
"oidc": { "loginRedirectUri": "/oauth_callback" }
},
"optionalSso": true,
"manifestVersion": 2,
"website": "http://www.minio.io",
"minBoxVersion": "7.1.2",

View File

@ -5,10 +5,11 @@ Please use the following credentials to login:
Please change the credentials immediately by following this [guide](https://cloudron.io/documentation/apps/minio/#admin-credentials).
<sso>
By default, Cloudron users have `readwrite` access policy.
If you'd like to change it, you should create a respective policy by following [Minio documentation](https://min.io/docs/minio/linux/administration/identity-access-management/policy-based-access-control.html)
After that you should add the variable MINIO_IDENTITY_OPENID_ROLE_POLICY in /app/data/env.sh, e.g.
After that you should add the variable `MINIO_IDENTITY_OPENID_ROLE_POLICY` in /app/data/env.sh, e.g.
```
export MINIO_IDENTITY_OPENID_ROLE_POLICY="new-policy-name"
@ -17,3 +18,4 @@ export MINIO_IDENTITY_OPENID_ROLE_POLICY="new-policy-name"
Where `new-policy-name` is the policy you have created.
Be sure to restart the app after making changes.
</sso>

View File

@ -135,7 +135,44 @@ describe('Application life cycle test', function () {
}
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
it('install app', async function () {
// 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 Admin login', login.bind(null, 'minioadmin', 'minioadmin'));
it('can add bucket', addBucket);
it('can logout', logout);
it('does redirect', checkRedirect);
it('check api', checkApi);
it('can change Admin 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);
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 Admin login', login.bind(null, 'minioakey', 'minioskey'));
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);
});