mirror of
https://git.cloudron.io/cloudron/gitea-app.git
synced 2025-10-01 16:39:40 +00:00
Merge branch 'checklist-oidc-provider-name' into 'master'
checklist added to CloudronManifest, CLOUDRON_OIDC_PROVIDER_NAME implemented See merge request apps/gitea-app!10
This commit is contained in:
commit
4f611ecb5a
4 changed files with 11 additions and 12 deletions
|
@ -49,7 +49,12 @@
|
||||||
],
|
],
|
||||||
"changelog": "file://CHANGELOG.md",
|
"changelog": "file://CHANGELOG.md",
|
||||||
"postInstallMessage": "file://POSTINSTALL.md",
|
"postInstallMessage": "file://POSTINSTALL.md",
|
||||||
"minBoxVersion": "7.5.1",
|
"checklist": {
|
||||||
|
"change-default-password": {
|
||||||
|
"message": "Change the default admin password"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"minBoxVersion": "8.1.0",
|
||||||
"forumUrl": "https://forum.cloudron.io/category/19/gitea",
|
"forumUrl": "https://forum.cloudron.io/category/19/gitea",
|
||||||
"documentationUrl": "https://docs.cloudron.io/apps/gitea/"
|
"documentationUrl": "https://docs.cloudron.io/apps/gitea/"
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,6 @@ This app is pre-setup with an admin account. The initial credentials are:
|
||||||
**Username**: root<br/>
|
**Username**: root<br/>
|
||||||
**Password**: changeme<br/>
|
**Password**: changeme<br/>
|
||||||
|
|
||||||
Please change the admin password immediately.
|
|
||||||
|
|
||||||
<sso>
|
<sso>
|
||||||
Use the `Local` authentication source for logging in as admin.
|
Use the `Local` authentication source for logging in as admin.
|
||||||
</sso>
|
</sso>
|
||||||
|
|
2
start.sh
2
start.sh
|
@ -11,7 +11,7 @@ setup_oidc_source() {
|
||||||
|
|
||||||
now=$(date +%s)
|
now=$(date +%s)
|
||||||
mysql -u"${CLOUDRON_MYSQL_USERNAME}" -p"${CLOUDRON_MYSQL_PASSWORD}" -h mysql --database="${CLOUDRON_MYSQL_DATABASE}" -e \
|
mysql -u"${CLOUDRON_MYSQL_USERNAME}" -p"${CLOUDRON_MYSQL_PASSWORD}" -h mysql --database="${CLOUDRON_MYSQL_DATABASE}" -e \
|
||||||
"REPLACE INTO login_source (id, type, name, is_active, cfg, created_unix, updated_unix) VALUES (1,6,'cloudron', 1,'{\"Provider\":\"openidConnect\",\"ClientID\":\"${CLOUDRON_OIDC_CLIENT_ID}\",\"ClientSecret\":\"${CLOUDRON_OIDC_CLIENT_SECRET}\",\"OpenIDConnectAutoDiscoveryURL\":\"${CLOUDRON_OIDC_ISSUER}/.well-known/openid-configuration\",\"CustomURLMapping\":null,\"IconURL\":\"\",\"Scopes\":[\"openid email profile\"],\"RequiredClaimName\":\"\",\"RequiredClaimValue\":\"\",\"GroupClaimName\":\"\",\"AdminGroup\":\"\",\"GroupTeamMap\":\"\",\"GroupTeamMapRemoval\":false,\"RestrictedGroup\":\"\"}','${now}','${now}')"
|
"REPLACE INTO login_source (id, type, name, is_active, cfg, created_unix, updated_unix) VALUES (1,6,'${CLOUDRON_OIDC_PROVIDER_NAME:-Cloudron}', 1,'{\"Provider\":\"openidConnect\",\"ClientID\":\"${CLOUDRON_OIDC_CLIENT_ID}\",\"ClientSecret\":\"${CLOUDRON_OIDC_CLIENT_SECRET}\",\"OpenIDConnectAutoDiscoveryURL\":\"${CLOUDRON_OIDC_ISSUER}/.well-known/openid-configuration\",\"CustomURLMapping\":null,\"IconURL\":\"\",\"Scopes\":[\"openid email profile\"],\"RequiredClaimName\":\"\",\"RequiredClaimValue\":\"\",\"GroupClaimName\":\"\",\"AdminGroup\":\"\",\"GroupTeamMap\":\"\",\"GroupTeamMapRemoval\":false,\"RestrictedGroup\":\"\"}','${now}','${now}')"
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_root_user() {
|
setup_root_user() {
|
||||||
|
|
12
test/test.js
12
test/test.js
|
@ -29,7 +29,6 @@ describe('Application life cycle test', function () {
|
||||||
const SSH_PORT = 29420;
|
const SSH_PORT = 29420;
|
||||||
|
|
||||||
let app, browser;
|
let app, browser;
|
||||||
let athenticated_by_oidc = false;
|
|
||||||
|
|
||||||
const repodir = '/tmp/testrepo';
|
const repodir = '/tmp/testrepo';
|
||||||
const reponame = 'testrepo';
|
const reponame = 'testrepo';
|
||||||
|
@ -108,24 +107,21 @@ describe('Application life cycle test', function () {
|
||||||
await login('root', 'changeme');
|
await login('root', 'changeme');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loginOIDC(username, password) {
|
async function loginOIDC(username, password, alreadyAuthenticated = true) {
|
||||||
browser.manage().deleteAllCookies();
|
browser.manage().deleteAllCookies();
|
||||||
await browser.get(`https://${app.fqdn}/user/login`);
|
await browser.get(`https://${app.fqdn}/user/login`);
|
||||||
await browser.sleep(2000);
|
await browser.sleep(2000);
|
||||||
|
|
||||||
|
await browser.findElement(By.xpath('//a[contains(@href, "/user/oauth2/Cloudron")]')).click();
|
||||||
await browser.findElement(By.xpath('//a[contains(@class, "openidConnect") and contains(., "Sign in with cloudron")]')).click();
|
|
||||||
await browser.sleep(2000);
|
await browser.sleep(2000);
|
||||||
|
|
||||||
if (!athenticated_by_oidc) {
|
if (!alreadyAuthenticated) {
|
||||||
await waitForElement(By.xpath('//input[@name="username"]'));
|
await waitForElement(By.xpath('//input[@name="username"]'));
|
||||||
await browser.findElement(By.xpath('//input[@name="username"]')).sendKeys(username);
|
await browser.findElement(By.xpath('//input[@name="username"]')).sendKeys(username);
|
||||||
await browser.findElement(By.xpath('//input[@name="password"]')).sendKeys(password);
|
await browser.findElement(By.xpath('//input[@name="password"]')).sendKeys(password);
|
||||||
await browser.sleep(2000);
|
await browser.sleep(2000);
|
||||||
await browser.findElement(By.id('loginSubmitButton')).click();
|
await browser.findElement(By.id('loginSubmitButton')).click();
|
||||||
await browser.sleep(2000);
|
await browser.sleep(2000);
|
||||||
|
|
||||||
athenticated_by_oidc = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await waitForElement(By.xpath('//img[contains(@class, "avatar")]'));
|
await waitForElement(By.xpath('//img[contains(@class, "avatar")]'));
|
||||||
|
@ -219,7 +215,7 @@ describe('Application life cycle test', function () {
|
||||||
it('can send mail', sendMail);
|
it('can send mail', sendMail);
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
|
|
||||||
it('can login', loginOIDC.bind(null, username, password));
|
it('can login', loginOIDC.bind(null, username, password, false));
|
||||||
it('can set avatar', setAvatar);
|
it('can set avatar', setAvatar);
|
||||||
it('can get avatar', checkAvatar);
|
it('can get avatar', checkAvatar);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue