mirror of
https://git.cloudron.io/cloudron/gitea-app
synced 2025-09-26 06:57:26 +00:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8b16de1dcd | ||
|
1074999c40 | ||
|
0cfe7fea88 | ||
|
a3bb9db92e | ||
|
8c84f905e7 | ||
|
0008351e7c | ||
|
0aab01b926 | ||
|
2877b4e599 |
20
CHANGELOG
20
CHANGELOG
@@ -779,3 +779,23 @@
|
|||||||
* Switch to maintained JWT lib (#16532) (#16535)
|
* Switch to maintained JWT lib (#16532) (#16535)
|
||||||
* Upgrade to latest version of golang-jwt (as forked for 1.14) (#16590) (#16607)
|
* Upgrade to latest version of golang-jwt (as forked for 1.14) (#16590) (#16607)
|
||||||
|
|
||||||
|
[1.22.0]
|
||||||
|
* Update Gitea to 1.15.0
|
||||||
|
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.15.0)
|
||||||
|
|
||||||
|
[1.22.1]
|
||||||
|
* Update Gitea to 1.15.1
|
||||||
|
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.15.1)
|
||||||
|
|
||||||
|
[1.22.2]
|
||||||
|
* Update Gitea to 1.15.2
|
||||||
|
* Add unique constraint back into issue_index (#16938)
|
||||||
|
* Close storage objects before cleaning (#16934) (#16942)
|
||||||
|
|
||||||
|
[1.22.3]
|
||||||
|
* Update Gitea to 1.15.3
|
||||||
|
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.15.3)
|
||||||
|
* Add fluid to ui container class to remove margin (#16396) (#16976)
|
||||||
|
* Add caller to cat-file batch calls (#17082) (#17089)
|
||||||
|
* Many bug fixes
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
"author": "Gitea developers",
|
"author": "Gitea developers",
|
||||||
"description": "file://DESCRIPTION.md",
|
"description": "file://DESCRIPTION.md",
|
||||||
"tagline": "A painless self-hosted Git Service",
|
"tagline": "A painless self-hosted Git Service",
|
||||||
"version": "1.21.6",
|
"version": "1.22.3",
|
||||||
"healthCheckPath": "/explore",
|
"healthCheckPath": "/explore",
|
||||||
"httpPort": 3000,
|
"httpPort": 3000,
|
||||||
"memoryLimit": 536870912,
|
"memoryLimit": 536870912,
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
This app packages Gitea <upstream>1.14.6</upstream>
|
This app packages Gitea <upstream>1.15.3</upstream>
|
||||||
|
|
||||||
Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket or Gitlab.
|
Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket or Gitlab.
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@ RUN passwd -d git
|
|||||||
RUN mkdir -p /home/git/gitea
|
RUN mkdir -p /home/git/gitea
|
||||||
WORKDIR /home/git
|
WORKDIR /home/git
|
||||||
|
|
||||||
ARG VERSION=1.14.6
|
ARG VERSION=1.15.3
|
||||||
|
|
||||||
RUN curl -L https://dl.gitea.io/gitea/${VERSION}/gitea-${VERSION}-linux-amd64 -o /home/git/gitea/gitea \
|
RUN curl -L https://dl.gitea.io/gitea/${VERSION}/gitea-${VERSION}-linux-amd64 -o /home/git/gitea/gitea \
|
||||||
&& chmod +x /home/git/gitea/gitea
|
&& chmod +x /home/git/gitea/gitea
|
||||||
|
46
test/package-lock.json
generated
46
test/package-lock.json
generated
@@ -33,9 +33,9 @@
|
|||||||
"integrity": "sha512-8UT/J+xqCYfn3fKtOznAibsHpiuDshCb0fwgWxRazTT19Igp9ovoXMPhXyLD6m3CKQGTMHgqoxaFfMWaL40Rnw=="
|
"integrity": "sha512-8UT/J+xqCYfn3fKtOznAibsHpiuDshCb0fwgWxRazTT19Igp9ovoXMPhXyLD6m3CKQGTMHgqoxaFfMWaL40Rnw=="
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "16.4.13",
|
"version": "16.9.6",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.4.13.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.6.tgz",
|
||||||
"integrity": "sha512-bLL69sKtd25w7p1nvg9pigE4gtKVpGTPojBFLMkGHXuUgap2sLqQt2qUnqmVCDfzGUL0DRNZP+1prIZJbMeAXg==",
|
"integrity": "sha512-YHUZhBOMTM3mjFkXVcK+WwAcYmyhe1wL4lfqNtzI0b3qAy7yuSetnM7QJazgE5PFmgVTNGiLOgRFfJMqW7XpSQ==",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"@types/yauzl": {
|
"@types/yauzl": {
|
||||||
@@ -112,11 +112,11 @@
|
|||||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||||
},
|
},
|
||||||
"axios": {
|
"axios": {
|
||||||
"version": "0.21.1",
|
"version": "0.21.4",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
|
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
|
||||||
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
|
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"follow-redirects": "^1.10.0"
|
"follow-redirects": "^1.14.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
@@ -196,12 +196,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"chromedriver": {
|
"chromedriver": {
|
||||||
"version": "92.0.1",
|
"version": "93.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-92.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-93.0.1.tgz",
|
||||||
"integrity": "sha512-LptlDVCs1GgyFNVbRoHzzy948JDVzTgGiVPXjNj385qXKQP3hjAVBIgyvb/Hco0xSEW8fjwJfsm1eQRmu6t4pQ==",
|
"integrity": "sha512-KDzbW34CvQLF5aTkm3b5VdlTrvdIt4wEpCzT2p4XJIQWQZEPco5pNce7Lu9UqZQGkhQ4mpZt4Ky6NKVyIS2N8A==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@testim/chrome-version": "^1.0.7",
|
"@testim/chrome-version": "^1.0.7",
|
||||||
"axios": "^0.21.1",
|
"axios": "^0.21.2",
|
||||||
"del": "^6.0.0",
|
"del": "^6.0.0",
|
||||||
"extract-zip": "^2.0.1",
|
"extract-zip": "^2.0.1",
|
||||||
"https-proxy-agent": "^5.0.0",
|
"https-proxy-agent": "^5.0.0",
|
||||||
@@ -309,9 +309,9 @@
|
|||||||
"integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ=="
|
"integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ=="
|
||||||
},
|
},
|
||||||
"deep-is": {
|
"deep-is": {
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
|
||||||
"integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ="
|
"integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="
|
||||||
},
|
},
|
||||||
"define-properties": {
|
"define-properties": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
@@ -438,9 +438,9 @@
|
|||||||
"integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA=="
|
"integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA=="
|
||||||
},
|
},
|
||||||
"fastq": {
|
"fastq": {
|
||||||
"version": "1.11.1",
|
"version": "1.13.0",
|
||||||
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.1.tgz",
|
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz",
|
||||||
"integrity": "sha512-HOnr8Mc60eNYl1gzwp6r5RoUyAn5/glBolUzP/Ez6IFVPMPirxn/9phgL6zhOtaTy7ISwPvQ+wT+hfcRZh/bzw==",
|
"integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"reusify": "^1.0.4"
|
"reusify": "^1.0.4"
|
||||||
}
|
}
|
||||||
@@ -476,9 +476,9 @@
|
|||||||
"integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ=="
|
"integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ=="
|
||||||
},
|
},
|
||||||
"follow-redirects": {
|
"follow-redirects": {
|
||||||
"version": "1.14.1",
|
"version": "1.14.4",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz",
|
||||||
"integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg=="
|
"integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g=="
|
||||||
},
|
},
|
||||||
"form-data": {
|
"form-data": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
@@ -850,9 +850,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mocha": {
|
"mocha": {
|
||||||
"version": "9.0.3",
|
"version": "9.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-9.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.1.tgz",
|
||||||
"integrity": "sha512-hnYFrSefHxYS2XFGtN01x8un0EwNu2bzKvhpRFhgoybIvMaOkkL60IVPmkb5h6XDmUl4IMSB+rT5cIO4/4bJgg==",
|
"integrity": "sha512-0wE74YMgOkCgBUj8VyIDwmLUjTsS13WV1Pg7l0SHea2qzZzlq7MDnfbPsHKcELBRk3+izEVkRofjmClpycudCA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@ungap/promise-all-settled": "1.1.2",
|
"@ungap/promise-all-settled": "1.1.2",
|
||||||
"ansi-colors": "4.1.1",
|
"ansi-colors": "4.1.1",
|
||||||
|
@@ -9,9 +9,9 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chromedriver": "^92.0.1",
|
"chromedriver": "^93.0.1",
|
||||||
"expect.js": "^0.3.1",
|
"expect.js": "^0.3.1",
|
||||||
"mocha": "^9.0.3",
|
"mocha": "^9.1.1",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"selenium-webdriver": "^3.6.0",
|
"selenium-webdriver": "^3.6.0",
|
||||||
"superagent": "^6.1.0"
|
"superagent": "^6.1.0"
|
||||||
|
343
test/test.js
343
test/test.js
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
/* jslint node:true */
|
/* jshint esversion: 8 */
|
||||||
/* global it:false */
|
/* global it:false */
|
||||||
/* global xit:false */
|
/* global xit:false */
|
||||||
/* global describe:false */
|
/* global describe:false */
|
||||||
@@ -54,247 +54,130 @@ describe('Application life cycle test', function () {
|
|||||||
|
|
||||||
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 === LOCATION; })[0];
|
|
||||||
|
|
||||||
expect(app).to.be.an('object');
|
expect(app).to.be.an('object');
|
||||||
}
|
}
|
||||||
|
|
||||||
function setAvatarOld(done) {
|
function sleep(millis) {
|
||||||
browser.get('https://' + app.fqdn + '/user/settings/avatar').then(function () {
|
return new Promise(resolve => setTimeout(resolve, millis));
|
||||||
return browser.findElement(By.xpath('//input[@type="file" and @name="avatar"]')).sendKeys(path.resolve(__dirname, '../logo.png'));
|
|
||||||
}).then(function () {
|
|
||||||
return browser.findElement(By.xpath('//button[contains(text(), "Update Avatar Setting")]')).click();
|
|
||||||
}).then(function () {
|
|
||||||
if (app.manifest.version === '1.0.3') {
|
|
||||||
return browser.wait(until.elementLocated(By.xpath('//p[contains(text(),"updated successfully")]')), TIMEOUT);
|
|
||||||
} else {
|
|
||||||
return browser.wait(until.elementLocated(By.xpath('//p[contains(text(),"Your avatar setting has been updated.")]')), TIMEOUT);
|
|
||||||
}
|
|
||||||
}).then(function () {
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setAvatar(done) {
|
async function setAvatar() {
|
||||||
if (app.manifest.version === '1.5.4') return setAvatarOld(done);
|
await browser.get('https://' + app.fqdn + '/user/settings');
|
||||||
|
|
||||||
browser.get('https://' + app.fqdn + '/user/settings').then(function () {
|
var button = await browser.findElement(By.xpath('//label[contains(text(), "Use Custom Avatar")]'));
|
||||||
var button = browser.findElement(By.xpath('//label[contains(text(), "Use Custom Avatar")]'));
|
await browser.executeScript('arguments[0].scrollIntoView(false)', button);
|
||||||
return browser.executeScript('arguments[0].scrollIntoView(false)', button);
|
await browser.findElement(By.xpath('//label[contains(text(), "Use Custom Avatar")]')).click();
|
||||||
}).then(function () {
|
await browser.findElement(By.xpath('//input[@type="file" and @name="avatar"]')).sendKeys(path.resolve(__dirname, '../logo.png'));
|
||||||
return browser.findElement(By.xpath('//label[contains(text(), "Use Custom Avatar")]')).click();
|
await browser.findElement(By.xpath('//button[contains(text(), "Update Avatar")]')).click();
|
||||||
}).then(function () {
|
await browser.wait(until.elementLocated(By.xpath('//p[contains(text(),"Your avatar has been updated.")]')), TIMEOUT);
|
||||||
return browser.findElement(By.xpath('//input[@type="file" and @name="avatar"]')).sendKeys(path.resolve(__dirname, '../logo.png'));
|
|
||||||
}).then(function () {
|
|
||||||
return browser.findElement(By.xpath('//button[contains(text(), "Update Avatar")]')).click();
|
|
||||||
}).then(function () {
|
|
||||||
return browser.wait(until.elementLocated(By.xpath('//p[contains(text(),"Your avatar has been updated.")]')), TIMEOUT);
|
|
||||||
}).then(function () {
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkAvatar(done) {
|
async function checkAvatar() {
|
||||||
return done();
|
await browser.get(`https://${app.fqdn}/${username}`);
|
||||||
superagent.get('https://' + app.fqdn + '/avatars/a3e6f3316fc1738e29d621e6a26e93d3').end(function (error, result) {
|
|
||||||
expect(error).to.be(null);
|
var avatarSrc = await browser.findElement(By.xpath('//a[@id="profile-avatar"]/img')).getAttribute('src');
|
||||||
expect(result.statusCode).to.be(200);
|
|
||||||
done();
|
var avatar = await superagent.get(avatarSrc);
|
||||||
});
|
expect(avatar.statusCode).to.equal(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
function login(username, password, done) {
|
async function login(username, password) {
|
||||||
browser.get('https://' + app.fqdn + '/user/login').then(function () {
|
await browser.get('https://' + app.fqdn + '/user/login');
|
||||||
return browser.findElement(By.id('user_name')).sendKeys(username);
|
|
||||||
}).then(function () {
|
await browser.findElement(By.id('user_name')).sendKeys(username);
|
||||||
return browser.findElement(By.id('password')).sendKeys(password);
|
await browser.findElement(By.id('password')).sendKeys(password);
|
||||||
}).then(function () {
|
await browser.findElement(By.tagName('form')).submit();
|
||||||
return browser.findElement(By.tagName('form')).submit();
|
await browser.wait(until.elementLocated(By.linkText('Dashboard')), TIMEOUT);
|
||||||
}).then(function () {
|
|
||||||
return browser.wait(until.elementLocated(By.linkText('Dashboard')), TIMEOUT);
|
|
||||||
}).then(function () {
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function adminLogin(done) {
|
async function adminLogin() {
|
||||||
login('root', 'changeme', done);
|
await login('root', 'changeme');
|
||||||
}
|
}
|
||||||
|
|
||||||
function logout(done) {
|
async function logout() {
|
||||||
browser.get('https://' + app.fqdn).then(function () {
|
await browser.get('https://' + app.fqdn);
|
||||||
return browser.findElement(By.xpath('//img[contains(@class, "avatar")]')).click();
|
|
||||||
}).then(function () {
|
await browser.findElement(By.xpath('//img[contains(@class, "avatar")]')).click();
|
||||||
browser.sleep(2000);
|
await sleep(2000);
|
||||||
}).then(function () {
|
await browser.findElement(By.xpath('//a[@data-url="/user/logout"]')).click();
|
||||||
return browser.findElement(By.xpath('//a[@data-url="/user/logout"]')).click();
|
await sleep(2000);
|
||||||
}).then(function () {
|
|
||||||
browser.sleep(2000);
|
|
||||||
}).then(function () {
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addPublicKey(done) {
|
async function addPublicKey() {
|
||||||
var publicKey = fs.readFileSync(__dirname + '/id_rsa.pub', 'utf8');
|
var publicKey = fs.readFileSync(__dirname + '/id_rsa.pub', 'utf8');
|
||||||
|
|
||||||
const sshPage = 'https://' + app.fqdn + '/user/settings/keys';
|
const sshPage = 'https://' + app.fqdn + '/user/settings/keys';
|
||||||
|
|
||||||
browser.get(sshPage).then(function () {
|
await browser.get(sshPage);
|
||||||
return browser.findElement(By.xpath('//div[text()="Add Key"]')).click();
|
|
||||||
}).then(function () {
|
await browser.findElement(By.xpath('//div[text()="Add Key"]')).click();
|
||||||
return browser.findElement(By.id('ssh-key-title')).sendKeys('testkey');
|
await browser.findElement(By.id('ssh-key-title')).sendKeys('testkey');
|
||||||
}).then(function () {
|
await browser.findElement(By.id('ssh-key-content')).sendKeys(publicKey.trim()); // #3480
|
||||||
return browser.findElement(By.id('ssh-key-content')).sendKeys(publicKey.trim()); // #3480
|
var button = browser.findElement(By.xpath('//button[contains(text(), "Add Key")]'));
|
||||||
}).then(function () {
|
await browser.executeScript('arguments[0].scrollIntoView(false)', button);
|
||||||
var button = browser.findElement(By.xpath('//button[contains(text(), "Add Key")]'));
|
await browser.findElement(By.xpath('//button[contains(text(), "Add Key")]')).click();
|
||||||
return browser.executeScript('arguments[0].scrollIntoView(false)', button);
|
|
||||||
}).then(function () {
|
await browser.wait(until.elementLocated(By.xpath('//p[contains(text(), "has been added.")]')), TIMEOUT);
|
||||||
return browser.findElement(By.xpath('//button[contains(text(), "Add Key")]')).click();
|
|
||||||
}).then(function () {
|
|
||||||
if (app.manifest.version === '1.0.3') {
|
|
||||||
return browser.wait(until.elementLocated(By.xpath('//p[contains(text(), "added successfully!")]')), TIMEOUT);
|
|
||||||
} else {
|
|
||||||
return browser.wait(until.elementLocated(By.xpath('//p[contains(text(), "has been added.")]')), TIMEOUT);
|
|
||||||
}
|
|
||||||
}).then(function () {
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createRepo(done) {
|
async function createRepo() {
|
||||||
var getRepoPage;
|
var getRepoPage = await browser.get('https://' + app.fqdn + '/repo/create');
|
||||||
if (app.manifest.version === '1.0.3') {
|
|
||||||
getRepoPage = browser.get('https://' + app.fqdn).then(function () {
|
await browser.findElement(By.id('repo_name')).sendKeys(reponame);
|
||||||
return browser.findElement(By.linkText('New Repository')).click();
|
var button = browser.findElement(By.xpath('//button[contains(text(), "Create Repository")]'));
|
||||||
}).then(function () {
|
await browser.executeScript('arguments[0].scrollIntoView(true)', button);
|
||||||
return browser.wait(until.elementLocated(By.xpath('//*[contains(text(), "New Repository")]')), TIMEOUT);
|
await browser.findElement(By.id('auto-init')).click();
|
||||||
|
await browser.findElement(By.xpath('//button[contains(text(), "Create Repository")]')).click();
|
||||||
|
|
||||||
|
await browser.wait(function () {
|
||||||
|
return browser.getCurrentUrl().then(function (url) {
|
||||||
|
return url === 'https://' + app.fqdn + '/' + username + '/' + reponame;
|
||||||
});
|
});
|
||||||
} else {
|
}, TIMEOUT);
|
||||||
getRepoPage = browser.get('https://' + app.fqdn + '/repo/create');
|
|
||||||
}
|
|
||||||
|
|
||||||
getRepoPage.then(function () {
|
|
||||||
return browser.findElement(By.id('repo_name')).sendKeys(reponame);
|
|
||||||
}).then(function () {
|
|
||||||
var button = browser.findElement(By.xpath('//button[contains(text(), "Create Repository")]'));
|
|
||||||
return browser.executeScript('arguments[0].scrollIntoView(true)', button);
|
|
||||||
}).then(function () {
|
|
||||||
return browser.findElement(By.id('auto-init')).click();
|
|
||||||
}).then(function () {
|
|
||||||
return browser.findElement(By.xpath('//button[contains(text(), "Create Repository")]')).click();
|
|
||||||
}).then(function () {
|
|
||||||
browser.wait(function () {
|
|
||||||
return browser.getCurrentUrl().then(function (url) {
|
|
||||||
return url === 'https://' + app.fqdn + '/' + username + '/' + reponame;
|
|
||||||
});
|
|
||||||
}, TIMEOUT);
|
|
||||||
}).then(function () {
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkCloneUrl(done) {
|
async function checkCloneUrl() {
|
||||||
browser.get('https://' + app.fqdn + '/' + username + '/' + reponame).then(function () {
|
await browser.get('https://' + app.fqdn + '/' + username + '/' + reponame);
|
||||||
return browser.findElement(By.id('repo-clone-ssh')).click();
|
await browser.findElement(By.id('repo-clone-ssh')).click();
|
||||||
}).then(function () {
|
|
||||||
return browser.findElement(By.id('repo-clone-url')).getAttribute('value');
|
var cloneUrl = await browser.findElement(By.id('repo-clone-url')).getAttribute('value');
|
||||||
}).then(function (cloneUrl) {
|
expect(cloneUrl).to.be(`ssh://git@${app.fqdn}:${SSH_PORT}/${username}/${reponame}.git`);
|
||||||
expect(cloneUrl).to.be(`ssh://git@${app.fqdn}:${SSH_PORT}/${username}/${reponame}.git`);
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function cloneRepo(done) {
|
function cloneRepo() {
|
||||||
rimraf.sync(repodir);
|
rimraf.sync(repodir);
|
||||||
var env = Object.create(process.env);
|
var env = Object.create(process.env);
|
||||||
env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh';
|
env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh';
|
||||||
execSync(`git clone ssh://git@${app.fqdn}:${SSH_PORT}/${username}/${reponame}.git ${repodir}`, { env: env });
|
execSync(`git clone ssh://git@${app.fqdn}:${SSH_PORT}/${username}/${reponame}.git ${repodir}`, { env: env });
|
||||||
done();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function pushFile(done) {
|
function pushFile() {
|
||||||
var env = Object.create(process.env);
|
var env = Object.create(process.env);
|
||||||
env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh';
|
env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh';
|
||||||
execSync(`touch newfile && git add newfile && git commit -a -mx && git push ssh://git@${app.fqdn}:${SSH_PORT}/${username}/${reponame} master`,
|
execSync(`touch newfile && git add newfile && git commit -a -mx && git push ssh://git@${app.fqdn}:${SSH_PORT}/${username}/${reponame} master`,
|
||||||
{ env: env, cwd: repodir });
|
{ env: env, cwd: repodir });
|
||||||
rimraf.sync('/tmp/testrepo');
|
rimraf.sync('/tmp/testrepo');
|
||||||
done();
|
|
||||||
}
|
|
||||||
|
|
||||||
function addCustomFile(done) {
|
|
||||||
fs.writeFileSync('/tmp/customfile.txt', 'GOGS TEST', 'utf8');
|
|
||||||
execSync(`cloudron exec --app ${app.id} -- mkdir -p /app/data/custom/public`);
|
|
||||||
execSync(`cloudron push --app ${app.id} /tmp/customfile.txt /app/data/custom/public/customfile.txt`);
|
|
||||||
fs.unlinkSync('/tmp/customfile.txt');
|
|
||||||
done();
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkCustomFile(done) {
|
|
||||||
superagent.get('https://' + app.fqdn + '/customfile.txt').end(function (error, result) {
|
|
||||||
if (error) return done(error);
|
|
||||||
|
|
||||||
expect(result.text).to.contain('GOGS TEST');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function fileExists() {
|
function fileExists() {
|
||||||
expect(fs.existsSync(repodir + '/newfile')).to.be(true);
|
expect(fs.existsSync(repodir + '/newfile')).to.be(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendMail(done) {
|
async function sendMail() {
|
||||||
browser.get(`https://${app.fqdn}/admin/config`).then(function () {
|
await browser.get(`https://${app.fqdn}/admin/config`);
|
||||||
var button = browser.findElement(By.xpath('//button[@id="test-mail-btn"]'));
|
|
||||||
return browser.executeScript('arguments[0].scrollIntoView(true)', button);
|
var button = await browser.findElement(By.xpath('//button[@id="test-mail-btn"]'));
|
||||||
}).then(function () {
|
await browser.executeScript('arguments[0].scrollIntoView(true)', button);
|
||||||
return browser.findElement(By.xpath('//input[@name="email"]')).sendKeys('test@cloudron.io');
|
await browser.findElement(By.xpath('//input[@name="email"]')).sendKeys('test@cloudron.io');
|
||||||
}).then(function () {
|
await browser.findElement(By.xpath('//button[@id="test-mail-btn"]')).click();
|
||||||
return browser.findElement(By.xpath('//button[@id="test-mail-btn"]')).click();
|
await browser.wait(until.elementLocated(By.xpath('//p[contains(text(),"A testing email has been sent to \'test@cloudron.io\'")]')), TIMEOUT);
|
||||||
}).then(function () {
|
|
||||||
return browser.wait(until.elementLocated(By.xpath('//p[contains(text(),"A testing email has been sent to \'test@cloudron.io\'")]')), TIMEOUT);
|
|
||||||
}).then(function () {
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
|
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
|
||||||
|
|
||||||
// it('can login', function (done) {
|
|
||||||
// var inspect = JSON.parse(execSync('cloudron inspect'));
|
|
||||||
|
|
||||||
// superagent.post(`https://${inspect.apiEndpoint}/api/v1/developer/login`).send({
|
|
||||||
// username: username,
|
|
||||||
// password: password
|
|
||||||
// }).end(function (error, result) {
|
|
||||||
// if (error) return done(error);
|
|
||||||
// if (result.statusCode !== 200) return done(new Error('Login failed with status ' + result.statusCode));
|
|
||||||
|
|
||||||
// token = result.body.accessToken;
|
|
||||||
|
|
||||||
// superagent.get(`https://${inspect.apiEndpoint}/api/v1/profile`)
|
|
||||||
// .query({ access_token: token }).end(function (error, result) {
|
|
||||||
// if (error) return done(error);
|
|
||||||
// if (result.statusCode !== 200) return done(new Error('Get profile failed with status ' + result.statusCode));
|
|
||||||
|
|
||||||
// email = result.body.email;
|
|
||||||
// done();
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
it('install app', function () { execSync(`cloudron install --location ${LOCATION} -p SSH_PORT=${SSH_PORT}`, EXEC_ARGS); });
|
it('install app', function () { execSync(`cloudron install --location ${LOCATION} -p SSH_PORT=${SSH_PORT}`, EXEC_ARGS); });
|
||||||
|
|
||||||
it('can get app information', getAppInfo);
|
it('can get app information', getAppInfo);
|
||||||
it('can get the main page', function (done) {
|
|
||||||
superagent.get('https://' + app.fqdn).end(function (error, result) {
|
|
||||||
expect(error).to.be(null);
|
|
||||||
expect(result.status).to.eql(200);
|
|
||||||
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('can admin login', adminLogin);
|
it('can admin login', adminLogin);
|
||||||
it('can send mail', sendMail);
|
it('can send mail', sendMail);
|
||||||
@@ -314,9 +197,6 @@ return done();
|
|||||||
|
|
||||||
it('can add and push a file', pushFile);
|
it('can add and push a file', pushFile);
|
||||||
|
|
||||||
it('can add custom file', addCustomFile);
|
|
||||||
it('can check custom file', checkCustomFile);
|
|
||||||
|
|
||||||
it('can restart app', function () { execSync('cloudron restart --app ' + app.id); });
|
it('can restart app', function () { execSync('cloudron restart --app ' + app.id); });
|
||||||
|
|
||||||
xit('can login', login.bind(null, username, password)); // no need to relogin since session persists
|
xit('can login', login.bind(null, username, password)); // no need to relogin since session persists
|
||||||
@@ -332,18 +212,14 @@ return done();
|
|||||||
it('can clone the url', cloneRepo);
|
it('can clone the url', cloneRepo);
|
||||||
it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
|
it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
|
||||||
|
|
||||||
it('move to different location', function (done) {
|
it('move to different location', async function () {
|
||||||
//browser.manage().deleteAllCookies(); // commented because of error "'Network.deleteCookie' wasn't found"
|
//browser.manage().deleteAllCookies(); // commented because of error "'Network.deleteCookie' wasn't found"
|
||||||
// ensure we don't hit NXDOMAIN in the mean time
|
// ensure we don't hit NXDOMAIN in the mean time
|
||||||
browser.get('about:blank').then(function () {
|
await browser.get('about:blank');
|
||||||
execSync('cloudron configure --location ' + LOCATION + '2 --app ' + app.id, EXEC_ARGS);
|
|
||||||
var inspect = JSON.parse(execSync('cloudron inspect'));
|
|
||||||
app = inspect.apps.filter(function (a) { return a.location === LOCATION + '2'; })[0];
|
|
||||||
expect(app).to.be.an('object');
|
|
||||||
|
|
||||||
done();
|
execSync('cloudron configure --location ' + LOCATION + '2 --app ' + app.id, EXEC_ARGS);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
it('can get app information', getAppInfo);
|
||||||
|
|
||||||
it('can login', login.bind(null, username, password));
|
it('can login', login.bind(null, username, password));
|
||||||
it('can get avatar', checkAvatar);
|
it('can get avatar', checkAvatar);
|
||||||
@@ -351,57 +227,38 @@ return done();
|
|||||||
it('can clone the url', cloneRepo);
|
it('can clone the url', cloneRepo);
|
||||||
it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
|
it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
|
||||||
|
|
||||||
it('uninstall app', function (done) {
|
it('uninstall app', async function () {
|
||||||
// ensure we don't hit NXDOMAIN in the mean time
|
// ensure we don't hit NXDOMAIN in the mean time
|
||||||
browser.get('about:blank').then(function () {
|
await browser.get('about:blank');
|
||||||
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// check if the _first_ login via email succeeds
|
// check if the _first_ login via email succeeds
|
||||||
it('can login via email', function (done) {
|
it('can login via email', async function () { execSync(`cloudron install --location ${LOCATION} -p SSH_PORT=${SSH_PORT}`, EXEC_ARGS); });
|
||||||
execSync(`cloudron install --location ${LOCATION} -p SSH_PORT=${SSH_PORT}`, EXEC_ARGS);
|
|
||||||
var inspect = JSON.parse(execSync('cloudron inspect'));
|
|
||||||
|
|
||||||
app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0];
|
it('can get app information', getAppInfo);
|
||||||
expect(app).to.be.an('object');
|
it('can login', login.bind(null, email, password));
|
||||||
|
|
||||||
login(email, password, function (error) {
|
it('uninstall app', async function () {
|
||||||
if (error) return done(error);
|
// ensure we don't hit NXDOMAIN in the mean time
|
||||||
|
await browser.get('about:blank');
|
||||||
// ensure we don't hit NXDOMAIN in the mean time
|
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
||||||
browser.get('about:blank').then(function () {
|
|
||||||
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// No SSO
|
// No SSO
|
||||||
it('install app (no sso)', function () {
|
it('install app (no sso)', function () { execSync(`cloudron install --no-sso --location ${LOCATION} -p SSH_PORT=${SSH_PORT}`, EXEC_ARGS); });
|
||||||
execSync(`cloudron install --no-sso --location ${LOCATION} -p SSH_PORT=${SSH_PORT}`, EXEC_ARGS);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('can get app information', function () {
|
|
||||||
var inspect = JSON.parse(execSync('cloudron inspect'));
|
|
||||||
|
|
||||||
app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0];
|
|
||||||
|
|
||||||
expect(app).to.be.an('object');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
it('can get app information', getAppInfo);
|
||||||
it('can admin login (no sso)', adminLogin);
|
it('can admin login (no sso)', adminLogin);
|
||||||
it('can logout', logout);
|
it('can logout', logout);
|
||||||
|
|
||||||
it('uninstall app (no sso)', function () {
|
it('uninstall app (no sso)', async function () {
|
||||||
|
await browser.get('about:blank');
|
||||||
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
||||||
});
|
});
|
||||||
|
|
||||||
// test update
|
// test update
|
||||||
it('can install app', function () {
|
it('can install app', function () { execSync(`cloudron install --appstore-id ${app.manifest.id} --location ${LOCATION} -p SSH_PORT=${SSH_PORT}`, EXEC_ARGS); });
|
||||||
execSync(`cloudron install --appstore-id ${app.manifest.id} --location ${LOCATION} -p SSH_PORT=${SSH_PORT}`, EXEC_ARGS);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('can get app information', getAppInfo);
|
it('can get app information', getAppInfo);
|
||||||
it('can login', login.bind(null, username, password));
|
it('can login', login.bind(null, username, password));
|
||||||
@@ -412,9 +269,7 @@ return done();
|
|||||||
it('can clone the url', cloneRepo);
|
it('can clone the url', cloneRepo);
|
||||||
it('can add and push a file', pushFile);
|
it('can add and push a file', pushFile);
|
||||||
|
|
||||||
it('can update', function () {
|
it('can update', function () { execSync('cloudron update --app ' + app.id, EXEC_ARGS); });
|
||||||
execSync('cloudron update --app ' + app.id, EXEC_ARGS);
|
|
||||||
});
|
|
||||||
|
|
||||||
xit('can admin login', adminLogin);
|
xit('can admin login', adminLogin);
|
||||||
xit('can send mail', sendMail);
|
xit('can send mail', sendMail);
|
||||||
@@ -425,11 +280,9 @@ return done();
|
|||||||
it('can clone the url', cloneRepo);
|
it('can clone the url', cloneRepo);
|
||||||
it('file exists in cloned repo', fileExists);
|
it('file exists in cloned repo', fileExists);
|
||||||
|
|
||||||
it('uninstall app', function (done) {
|
it('uninstall app', async function () {
|
||||||
// ensure we don't hit NXDOMAIN in the mean time
|
// ensure we don't hit NXDOMAIN in the mean time
|
||||||
browser.get('about:blank').then(function () {
|
await browser.get('about:blank');
|
||||||
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user