1
0
mirror of https://git.cloudron.io/cloudron/gitea-app synced 2025-09-24 14:07:45 +00:00

Compare commits

...

37 Commits

Author SHA1 Message Date
Johannes Zellner
b86f9c7a20 Ensure the tests work with other instances installed 2018-03-26 12:36:09 +02:00
Johannes Zellner
7fd766b348 Bump version 2018-03-26 12:16:04 +02:00
Girish Ramakrishnan
525327c150 Version 1.4.1 2018-02-19 17:03:24 -08:00
Girish Ramakrishnan
bc658da61e Update Gitea to 1.3.3 2018-02-19 16:56:06 -08:00
Girish Ramakrishnan
25f206ccdb Version 1.4.0 2018-01-18 11:28:31 -08:00
Girish Ramakrishnan
d3553de1a6 Use SMTPS port to send email for Go programs 2018-01-18 11:21:31 -08:00
Girish Ramakrishnan
99379fdbb3 Version 1.3.1 2017-12-14 21:04:37 +05:30
Girish Ramakrishnan
21a9fccd60 Update gitea to 1.3.2 2017-12-14 20:48:44 +05:30
Girish Ramakrishnan
8837d2fd60 Version 1.3.0 2017-12-11 09:07:54 +05:30
Girish Ramakrishnan
a66843c3e3 Version 1.3.0 2017-12-11 08:58:10 +05:30
Girish Ramakrishnan
67403a6d2a Gitea 1.3.1 2017-12-11 08:46:00 +05:30
Dennis Schwerdel
c137f79e9b Version 1.2.0 2017-11-29 21:21:37 +01:00
Girish Ramakrishnan
0249f20656 Version 1.1.3 2017-11-03 15:06:22 -07:00
Girish Ramakrishnan
5d00e930ff Use gitea 1.2.3 2017-11-03 14:58:42 -07:00
Girish Ramakrishnan
619bd735a6 Version 1.1.2 2017-10-27 12:07:29 -07:00
Girish Ramakrishnan
a59430be60 Use gitea 1.2.2 2017-10-27 12:06:39 -07:00
Girish Ramakrishnan
3e04f6b996 Version 1.1.1 2017-10-17 10:46:38 -07:00
Girish Ramakrishnan
7481ed9f60 Update to Gitea 1.2.1 2017-10-17 10:30:05 -07:00
Girish Ramakrishnan
93e8df020f Version 1.1.0 2017-10-14 11:45:30 -07:00
Girish Ramakrishnan
2329c01ba5 Fix tests 2017-10-14 11:45:26 -07:00
Girish Ramakrishnan
bf67824fa6 Gitea got a new logo
https://github.com/go-gitea/gitea/pull/2194
2017-10-14 11:18:05 -07:00
Girish Ramakrishnan
795e6efb0a Use Gitea 1.2.0 2017-10-14 11:00:49 -07:00
Dennis Schwerdel
d984b4fe6c Update to 1.1.4 2017-09-04 23:30:42 +02:00
Dennis Schwerdel
6a90609565 Release 1.0.2 2017-09-02 19:35:33 +02:00
dswd
c67b13585f Merge branch 'totp_fix' into 'master'
Preserve SECRET_KEY across restarts

Closes #2

See merge request !5
2017-09-02 17:20:21 +00:00
Girish Ramakrishnan
24d40b7912 Preserve SECRET_KEY across restarts
fixes #2
2017-09-01 15:17:41 -07:00
Girish Ramakrishnan
83ca72d103 Merge branch 'CVE-2017-1000117' into 'master'
Cve 2017 1000117

See merge request !4
2017-08-11 19:31:37 +00:00
Girish Ramakrishnan
8b65c0a5db Version 1.0.1 2017-08-11 11:58:28 -07:00
Girish Ramakrishnan
8685d0606a Update git
https://people.canonical.com/~ubuntu-security/cve/2017/CVE-2017-1000117.html
2017-08-11 11:29:00 -07:00
Dennis Schwerdel
355ee698dc Using crudini for configuration merging 2017-08-09 07:06:23 +02:00
dswd
b8b3abfbfc Merge branch 'update_to_1.1.3' into 'master'
Update to 1.1.3

See merge request !3
2017-08-09 04:57:48 +00:00
Girish Ramakrishnan
3970139ea7 Add --wait for configure 2017-08-08 14:53:40 -07:00
Girish Ramakrishnan
9b4fb46cf3 Version 1.0.0 2017-08-08 14:53:22 -07:00
Girish Ramakrishnan
4357f4b3b9 Update to version 1.1.3 2017-08-07 11:22:40 -07:00
Girish Ramakrishnan
821c13e7eb restart requires --wait now 2017-08-07 11:22:40 -07:00
Girish Ramakrishnan
a03fb92253 Add update test 2017-08-07 11:22:40 -07:00
Dennis Schwerdel
c636d1dd87 Updated to 1.1.2 2017-06-12 13:13:49 +02:00
9 changed files with 279 additions and 61 deletions

View File

@@ -6,3 +6,89 @@
[0.1.2]
* Updated description
[0.1.3]
* Updated to version 1.1.2
[1.0.0]
* Update to version 1.1.3
[1.0.1]
* Update Git to v2.7.4-0ubuntu1.2
* Fixes critical security issue that allows remote command execution in git
* https://people.canonical.com/~ubuntu-security/cve/2017/CVE-2017-1000117.html
[1.0.2]
* Preserve SECRET_KEY across updates and restarts
[1.0.3]
* Update to version 1.1.4
[1.1.0]
* Update to version 1.2.0
* New logo!
* SECURITY: Sanitation fix from Gogs (#1461)
* Status-API
* Implement GPG api
* https://github.com/go-gitea/gitea/releases/tag/v1.2.0
[1.1.1]
* Update to version 1.2.1
* Fix PR, milestone and label functionality if issue unit is disabled (#2710) (#2714)
* Fix plain readme didn't render correctly on repo home page (#2705) (#2712)
* Fix so that user can still fork his own repository to his organizations (#2699) (#2707)
* Fix .netrc authentication (#2700) (#2708)
* Fix slice out of bounds error in mailer (#2479) (#2696)
[1.1.2]
* Update to version 1.2.2
* Add checks for commits with missing author and time (#2771) (#2785)
* Fix sending mail with a non-latin display name (#2559) (#2783)
* Sync MaxGitDiffLineCharacters with conf/app.ini (#2779) (#2780)
* Update vendor git (#2765) (#2772)
* Fix emojify image URL (#2769) (#2773)
[1.1.3]
* Update to version 1.2.3
* Only require one email when validating GPG key (#2266, #2467, #2663) (#2788)
* Fix order of comments (#2835) (#2839)
[1.2.0]
* Update to version 1.3.0
[1.3.0]
* Update to version 1.3.1
* Add documentationUrl
* Sanitize logs for mirror sync (#3057, #3082) (#3078)
* Fix missing branch in release bug (#3108) (#3117)
* Fix repo indexer and submodule bug (#3107) (#3110)
* Fix legacy URL redirects (#3100) (#3106)
* Fix redis session failed (#3086) (#3089)
* Fix issue list branch link broken (#3061) (#3070)
* Fix missing password length check when change password (#3039) (#3071)
[1.3.1]
* Update Gitea to 1.3.2
* Fix run web with -p push failed (#3154) (#3179)
* Fix source download link when no code unit allowed (#3166) (#3169)
* Allow adding collaborators with (fullname) (#3103) (#3168)
* Fix repo links (#3093) (#3163)
* Fix Uninitialized variable in ParsePatch (#3156) (#3162)
* Fix migration order v1.3 (#3157)
* Fix avatar URLs (#3069) (#3143)
[1.4.0]
* Fix email sending (use SMTPS)
[1.4.1]
* Update Gitea to 1.3.3
* Security fixes
* Fix escaping changed title in comments (#3530) (#3535)
* Escape search query display (#3486) (#3489)
* Bug fixes
* Fix repo-transfer-and-team-repo-count bug (#3241) (#3244)
* Open external tracker in blank window, consistently with wiki (#3227) (#3228)
* Change SSL Mode from checkbox to string in admin page (#3208) (#3211)
[1.5.0]
* Update Gitea to 1.4.0

View File

@@ -4,7 +4,7 @@
"author": "Gitea developers",
"description": "file://DESCRIPTION.md",
"tagline": "A painless self-hosted Git Service",
"version": "0.1.2",
"version": "1.5.0",
"healthCheckPath": "/healthcheck",
"httpPort": 3000,
"addons": {
@@ -33,5 +33,7 @@
],
"tags": [ "version control", "git", "code hosting", "development" ],
"changelog": "file://CHANGELOG",
"postInstallMessage": "file://POSTINSTALL.md"
"postInstallMessage": "file://POSTINSTALL.md",
"minBoxVersion": "1.10.0",
"documentationUrl": "https://cloudron.io/documentation/apps/gitea/"
}

View File

@@ -1,6 +1,6 @@
Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket or Gitlab. The initial development have been done on Gogs but we have forked it and named it Gitea. If you want to read more about the reasons why we have done that please read [this](https://blog.gitea.io/2016/12/welcome-to-gitea/) blog post.
This app packages Gitea <upstream>1.4.0</upstream>
This app packages Gitea <upstream>1.1.1</upstream>
Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket or Gitlab.
### Purpose

View File

@@ -1,9 +1,9 @@
FROM cloudron/base:0.10.0
ENV VERSION 1.1.1
ENV VERSION 1.4.0
RUN apt-get update && \
apt-get install -y openssh-server && \
apt-get install -y openssh-server git && \
rm -rf /etc/ssh_host_* && \
rm -r /var/cache/apt /var/lib/apt/lists

View File

@@ -6,7 +6,7 @@ If you want to disable Cloudron SSO, do the following:
* Admin Panel -> Authentication -> 'cloudron' -> Uncheck 'This authentication is activated'
* Admin Panel -> Users -> Change Authentication Source to 'Local' and also give a password
You can create a `/app/data/app.ini` with any custom configuration. See the
You can edit `/app/data/app.ini` and add any custom configuration. See the
[configuration cheat sheet](https://docs.gitea.io/en-us/config-cheat-sheet)
for more information.

View File

@@ -2,7 +2,9 @@ APP_NAME = Gitea
RUN_USER = git
RUN_MODE = prod
[database]
; those settings are protected and can't be modified
DB_TYPE = mysql
HOST = ##MYSQL_HOST:##MYSQL_PORT
NAME = ##MYSQL_DATABASE
@@ -11,7 +13,9 @@ PASSWD = ##MYSQL_PASSWORD
SSL_MODE = disable
PATH =
[server]
; those settings are protected and can't be modified
PROTOCOL = http
DOMAIN = ##DOMAIN
ROOT_URL = https://%(DOMAIN)s/
@@ -20,55 +24,74 @@ HTTP_PORT = 3000
DISABLE_SSH = ##DISABLE_SSH
SSH_PORT = ##SSH_PORT
APP_DATA_PATH = /app/data/appdata
; Landing page for non-logged users, can be "home" or "explore"
LANDING_PAGE = explore
[repository]
; this setting is protected and can't be modified
ROOT = /app/data/repository
SCRIPT_TYPE = bash
[repository.upload]
ENABLED = true
; this setting is protected and can't be modified
TEMP_PATH = /run/gitea/tmp/uploads
[release.attachment]
ENABLED = true
; APP_DATA_PATH/attachments
PATH =
[mailer]
ENABLED = true
; those settings are protected and can't be modified
HOST = ##MAIL_SERVER:##MAIL_PORT
USER = ##MAIL_SMTP_USERNAME
PASSWD = ##MAIL_SMTP_PASSWORD
FROM = ##MAIL_FROM
SKIP_VERIFY = true
[security]
; those settings are protected and can't be modified
INSTALL_LOCK = true
SECRET_KEY = ##SECRET_KEY
[service]
DISABLE_REGISTRATION = false
SHOW_REGISTRATION_BUTTON = false
ENABLE_NOTIFY_MAIL = true
[log]
; Either "console", "file", "conn", "smtp" or "database", default is "console"
; those settings are protected and can't be modified
MODE = console
; used for xorm.log
ROOT_PATH = /run/gitea
[picture]
; APP_DATA_PATH/avatars
AVATAR_UPLOAD_PATH =
GRAVATAR_SOURCE = gravatar
DISABLE_GRAVATAR = false
[attachment]
ENABLE = true
; APP_DATA_PATH/attachments
PATH =
[indexer]
; this setting is protected and can't be modified
ISSUE_INDEXER_PATH = /app/data/appdata/indexers/issues.bleve

BIN
logo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@@ -55,24 +55,48 @@ sed -e "s/^Port .*/Port ${SSH_PORT}/" \
-e "s,^HostKey /etc/ssh/,HostKey /app/data/sshd/," \
/etc/ssh/sshd_config > /run/gitea/sshd_config
sed -e "s/##DOMAIN/${APP_DOMAIN}/g" \
-e "s/##SSH_PORT/${SSH_PORT}/g" \
-e "s/##DISABLE_SSH/${disable_ssh}/g" \
-e "s/##MYSQL_HOST/${MYSQL_HOST}/g" \
-e "s/##MYSQL_PORT/${MYSQL_PORT}/g" \
-e "s/##MYSQL_USERNAME/${MYSQL_USERNAME}/g" \
-e "s/##MYSQL_PASSWORD/${MYSQL_PASSWORD}/g" \
-e "s/##MYSQL_DATABASE/${MYSQL_DATABASE}/g" \
-e "s/##MAIL_SERVER/${MAIL_SMTP_SERVER}/g" \
-e "s/##MAIL_PORT/${MAIL_SMTP_PORT}/g" \
-e "s/##MAIL_FROM/${MAIL_FROM}/g" \
-e "s/##MAIL_SMTP_USERNAME/${MAIL_SMTP_USERNAME}/g" \
-e "s/##MAIL_SMTP_PASSWORD/${MAIL_SMTP_PASSWORD}/g" \
-e "s/##SECRET_KEY/$(pwgen -1 -s)/g" \
/home/git/app.ini.template > "/run/gitea/app.ini"
cp /home/git/app.ini.template "/run/gitea/app.ini"
# create default user config file
if ! [ -f /app/data/app.ini ]; then
cp /home/git/app.ini.template /app/data/app.ini
fi
if [ "$(crudini --get /app/data/app.ini security SECRET_KEY)" == "##SECRET_KEY" ]; then
echo "Generating new SECRET_KEY"
crudini --set "/app/data/app.ini" security SECRET_KEY $(pwgen -1 -s)
fi
# merge user config file
crudini --merge "/run/gitea/app.ini" < "/app/data/app.ini"
# override important values
crudini --set "/run/gitea/app.ini" database DB_TYPE mysql
crudini --set "/run/gitea/app.ini" database HOST "${MYSQL_HOST}:${MYSQL_PORT}"
crudini --set "/run/gitea/app.ini" database NAME "${MYSQL_DATABASE}"
crudini --set "/run/gitea/app.ini" database USER "${MYSQL_USERNAME}"
crudini --set "/run/gitea/app.ini" database PASSWD "${MYSQL_PASSWORD}"
crudini --set "/run/gitea/app.ini" database SSL_MODE "disable"
crudini --set "/run/gitea/app.ini" server PROTOCOL "http"
crudini --set "/run/gitea/app.ini" server DOMAIN "${APP_DOMAIN}"
crudini --set "/run/gitea/app.ini" server ROOT_URL "https://%(DOMAIN)s/"
crudini --set "/run/gitea/app.ini" server HTTP_ADDR ""
crudini --set "/run/gitea/app.ini" server HTTP_PORT "3000"
crudini --set "/run/gitea/app.ini" server DISABLE_SSH "${disable_ssh}"
crudini --set "/run/gitea/app.ini" server SSH_PORT "${SSH_PORT}"
crudini --set "/run/gitea/app.ini" server APP_DATA_PATH "/app/data/appdata"
crudini --set "/run/gitea/app.ini" repository ROOT "/app/data/repository"
crudini --set "/run/gitea/app.ini" repository.upload TEMP_PATH "/run/gitea/tmp/uploads"
crudini --set "/run/gitea/app.ini" mailer HOST "${MAIL_SMTP_SERVER}:${MAIL_SMTPS_PORT}"
crudini --set "/run/gitea/app.ini" mailer USER "${MAIL_SMTP_USERNAME}"
crudini --set "/run/gitea/app.ini" mailer PASSWD "${MAIL_SMTP_PASSWORD}"
crudini --set "/run/gitea/app.ini" mailer FROM "${MAIL_FROM}"
crudini --set "/run/gitea/app.ini" mailer SKIP_VERIFY "true"
crudini --set "/run/gitea/app.ini" security INSTALL_LOCK "true"
crudini --set "/run/gitea/app.ini" log MODE "console"
crudini --set "/run/gitea/app.ini" log ROOT_PATH "/run/gitea"
crudini --set "/run/gitea/app.ini" indexer ISSUE_INDEXER_PATH "/app/data/appdata/indexers/issues.bleve"
# merge any user config file
[[ -f /app/data/app.ini ]] && cat "/app/data/app.ini" >> "/run/gitea/app.ini"
mkdir -p /app/data/repository /app/data/ssh

View File

@@ -63,17 +63,32 @@ describe('Application life cycle test', function () {
}, TIMEOUT).then(function () { done(); });
}
function getAppInfo() {
var inspect = JSON.parse(execSync('cloudron inspect'));
app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0];
expect(app).to.be.an('object');
}
function setAvatar(done) {
browser.get('https://' + app.fqdn + '/user/settings/avatar').then(function () {
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 () {
browser.wait(until.elementLocated(by.xpath('//p[contains(text(),"updated successfully")]')), TIMEOUT).then(function () { done(); });
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 checkAvatar(done) {
return done();
superagent.get('https://' + app.fqdn + '/avatars/a3e6f3316fc1738e29d621e6a26e93d3').end(function (error, result) {
expect(error).to.be(null);
expect(result.statusCode).to.be(200);
@@ -91,7 +106,7 @@ describe('Application life cycle test', function () {
}).then(function () {
return browser.findElement(by.xpath('//button[contains(text(), "Commit Changes")]')).click();
}).then(function () {
waitForUrl('https://' + app.fqdn + '/' + username + '/' + reponame + '/src/master/newfile', done);
waitForUrl('https://' + app.fqdn + '/' + username + '/' + reponame + '/src/branch/master/newfile', done);
});
}
@@ -112,28 +127,52 @@ describe('Application life cycle test', function () {
function addPublicKey(done) {
var publicKey = fs.readFileSync(__dirname + '/id_rsa.pub', 'utf8');
browser.get('https://' + app.fqdn + '/user/settings/ssh').then(function () {
var sshPage;
if (app.manifest.version === '1.0.3') {
sshPage = 'https://' + app.fqdn + '/user/settings/ssh';
} else {
sshPage = 'https://' + app.fqdn + '/user/settings/keys';
}
browser.get(sshPage).then(function () {
return browser.findElement(by.xpath('//div[text()="Add Key"]')).click();
}).then(function () {
return browser.findElement(by.id('ssh-key-title')).sendKeys('testkey');
}).then(function () {
return browser.findElement(by.id('ssh-key-content')).sendKeys(publicKey.trim()); // #3480
}).then(function () {
var button = browser.findElement(by.xpath('//button[contains(text(), "Add Key")]'));
return browser.executeScript('arguments[0].scrollIntoView(false)', button);
}).then(function () {
return browser.findElement(by.xpath('//button[contains(text(), "Add Key")]')).click();
}).then(function () {
return browser.wait(until.elementLocated(by.xpath('//p[contains(text(), "added successfully!")]')), TIMEOUT);
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) {
browser.get('https://' + app.fqdn).then(function () {
return browser.findElement(by.linkText('New Repository')).click();
}).then(function () {
return browser.wait(until.elementLocated(by.xpath('//*[contains(text(), "New Repository")]')), TIMEOUT);
}).then(function () {
var getRepoPage;
if (app.manifest.version === '1.0.3') {
getRepoPage = browser.get('https://' + app.fqdn).then(function () {
return browser.findElement(by.linkText('New Repository')).click();
}).then(function () {
return browser.wait(until.elementLocated(by.xpath('//*[contains(text(), "New Repository")]')), TIMEOUT);
});
} else {
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 () {
@@ -160,7 +199,7 @@ describe('Application life cycle test', function () {
});
}
function checkGitClone(done) {
function cloneRepo(done) {
rimraf.sync(repodir);
var env = Object.create(process.env);
env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh';
@@ -168,6 +207,34 @@ describe('Application life cycle test', function () {
done();
}
function pushFile(done) {
var env = Object.create(process.env);
env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh';
execSync('touch newfile && git add newfile && git commit -a -mx && git push ssh://git@' + app.fqdn + ':29418/' + username + '/' + reponame + ' master',
{ env: env, cwd: repodir });
rimraf.sync('/tmp/testrepo');
done();
}
function fileExists() {
expect(fs.existsSync(repodir + '/newfile')).to.be(true);
}
function sendMail(done) {
browser.get('https://' + app.fqdn + '/admin/config').then(function () {
var button = browser.findElement(by.xpath('//button[@id="test-mail-btn"]'));
return browser.executeScript('arguments[0].scrollIntoView(true)', button);
}).then(function () {
return browser.findElement(by.xpath('//input[@name="email"]')).sendKeys('test@cloudron.io');
}).then(function () {
return browser.findElement(by.xpath('//button[@id="test-mail-btn"]')).click();
}).then(function () {
return browser.wait(until.elementLocated(by.xpath('//p[contains(text(),"Test email has been sent to \'test@cloudron.io\'")]')), TIMEOUT);
}).then(function () {
done();
});
}
xit('build app', function () {
execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
});
@@ -199,14 +266,7 @@ describe('Application life cycle test', function () {
execSync('cloudron install --new --wait --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
});
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 get the main page', function (done) {
superagent.get('https://' + app.fqdn).end(function (error, result) {
expect(error).to.be(null);
@@ -217,6 +277,7 @@ describe('Application life cycle test', function () {
});
it('can login', login);
it('can send mail', sendMail);
it('can set avatar', setAvatar);
it('can get avatar', checkAvatar);
@@ -226,27 +287,20 @@ describe('Application life cycle test', function () {
it('displays correct clone url', checkCloneUrl);
it('can clone the url', checkGitClone);
it('can add and push a file', function (done) {
var env = Object.create(process.env);
env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh';
execSync('touch newfile && git add newfile && git commit -a -mx && git push ssh://git@' + app.fqdn + ':29418/' + username + '/' + reponame + ' master',
{ env: env, cwd: repodir });
rimraf.sync('/tmp/testrepo');
done();
});
it('can clone the url', cloneRepo);
it('can add and push a file', pushFile);
it('can edit file', editFile);
it('can restart app', function (done) {
execSync('cloudron restart --wait');
execSync('cloudron restart --wait --app ' + app.id);
done();
});
it('can clone the url', checkCloneUrl);
it('can clone the url', checkGitClone);
it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
it('can login', login);
it('displays correct clone url', checkCloneUrl);
it('can clone the url', cloneRepo);
it('file exists in repo', fileExists);
it('backup app', function () {
execSync('cloudron backup create --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
@@ -256,13 +310,14 @@ describe('Application life cycle test', function () {
execSync('cloudron restore --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
});
it('can login', login);
it('can get avatar', checkAvatar);
it('can clone the url', checkGitClone);
it('can clone the url', cloneRepo);
it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
it('move to different location', function () {
browser.manage().deleteAllCookies();
execSync('cloudron configure --location ' + LOCATION + '2', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
//browser.manage().deleteAllCookies(); // commented because of error "'Network.deleteCookie' wasn't found"
execSync('cloudron configure --wait --location ' + LOCATION + '2 --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
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');
@@ -271,7 +326,7 @@ describe('Application life cycle test', function () {
it('can login', login);
it('can get avatar', checkAvatar);
it('displays correct clone url', checkCloneUrl);
it('can clone the url', checkGitClone);
it('can clone the url', cloneRepo);
it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
it('uninstall app', function () {
@@ -292,4 +347,32 @@ describe('Application life cycle test', function () {
done();
});
});
// test update
it('can install app', function () {
execSync('cloudron install --new --wait --appstore-id ' + app.manifest.id + ' --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
});
it('can get app information', getAppInfo);
it('can login', login);
it('can set avatar', setAvatar);
it('can get avatar', checkAvatar);
it('can add public key', addPublicKey);
it('can create repo', createRepo);
it('can clone the url', cloneRepo);
it('can add and push a file', pushFile);
it('can update', function () {
execSync('cloudron install --wait --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
});
it('can login', login);
it('can send mail', sendMail);
it('can get avatar', checkAvatar);
it('can clone the url', cloneRepo);
it('file exists in cloned repo', fileExists);
it('uninstall app', function () {
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
});
});