mirror of
https://git.cloudron.io/cloudron/gitea-app
synced 2025-09-24 14:07:45 +00:00
Compare commits
36 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c231b12f2d | ||
|
1265366151 | ||
|
278116abdb | ||
|
8a942dc8f7 | ||
|
1b15db85e3 | ||
|
d37044f8e0 | ||
|
e7671bd3f2 | ||
|
32cc8175e5 | ||
|
534e4884b4 | ||
|
6e1f363b88 | ||
|
3eb57f2c07 | ||
|
b16095eef5 | ||
|
18b3ae6bc2 | ||
|
fbf8e5f953 | ||
|
106e65df9e | ||
|
1b629265fa | ||
|
f9949c11a3 | ||
|
a7e693c4ed | ||
|
b00d2aced2 | ||
|
c2419ba46c | ||
|
b39e1850d7 | ||
|
4d37e33eee | ||
|
b86f9c7a20 | ||
|
7fd766b348 | ||
|
525327c150 | ||
|
bc658da61e | ||
|
25f206ccdb | ||
|
d3553de1a6 | ||
|
99379fdbb3 | ||
|
21a9fccd60 | ||
|
8837d2fd60 | ||
|
a66843c3e3 | ||
|
67403a6d2a | ||
|
c137f79e9b | ||
|
0249f20656 | ||
|
5d00e930ff |
145
CHANGELOG
145
CHANGELOG
@@ -48,3 +48,148 @@
|
||||
* 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
|
||||
|
||||
[1.5.1]
|
||||
* Update Gitea to 1.4.1
|
||||
* Add “error” as reserved username (#3882) (#3886)
|
||||
* Do not allow inactive users to access repositories using private key (#3887) (#3889)
|
||||
* Fix path cleanup in file editor, when initilizing new repository and LFS oids (#3871) (#3873)
|
||||
* Remove unnecessary allowed safe HTML (#3778) (#3779)
|
||||
* Correctly check http git access rights for reverse proxy authorized users (#3721) (#3743)
|
||||
* Fix to use only needed columns from tables to get repository git paths (#3870) (#3883)
|
||||
* Fix GPG expire time display when time is zero (#3584) (#3884)
|
||||
* Fix to update only issue last update time when adding a comment (#3855) (#3860)
|
||||
* Fix repository star count after deleting user (#3781) (#3783)
|
||||
* Use the active branch for the code tab (#3720) (#3776)
|
||||
* Set default branch name on first push (#3715) (#3723)
|
||||
* Show clipboard button if disable HTTP of git protocol (#3773) (#3774)
|
||||
|
||||
[1.5.2]
|
||||
* Update Gitea to 1.4.2
|
||||
* Adjust z-index for floating labels (#3939) (#3950)
|
||||
* Add missing token validation on application settings page (#3976) #3978
|
||||
* Webhook and hook_task clean up (#4006)
|
||||
* Fix webhook bug of response info is not displayed in UI (#4023)
|
||||
* Fix writer cannot read bare repo guide (#4033) (#4039)
|
||||
* Don't force due date to current time (#3830) (#4057)
|
||||
* Fix wiki redirects (#3919) (#4065)
|
||||
* Fix attachment ENABLED (#4064) (#4066)
|
||||
* Added deletion of an empty line at the end of file (#4054) (#4074)
|
||||
* Use ResolveReference instead of path.Join (#4073)
|
||||
* Fix #4081 Check for leading / in base before removing it (#4083)
|
||||
* Respository's home page not updated after first push (#4075)
|
||||
|
||||
[1.5.2-1]
|
||||
* Rebuild Gitea package because of https://github.com/go-gitea/gitea/issues/4167
|
||||
* Adjust z-index for floating labels (#3939) (#3950)
|
||||
* Add missing token validation on application settings page (#3976) #3978
|
||||
* Webhook and hook_task clean up (#4006)
|
||||
* Fix webhook bug of response info is not displayed in UI (#4023)
|
||||
* Fix writer cannot read bare repo guide (#4033) (#4039)
|
||||
* Don't force due date to current time (#3830) (#4057)
|
||||
* Fix wiki redirects (#3919) (#4065)
|
||||
* Fix attachment ENABLED (#4064) (#4066)
|
||||
* Added deletion of an empty line at the end of file (#4054) (#4074)
|
||||
* Use ResolveReference instead of path.Join (#4073)
|
||||
* Fix #4081 Check for leading / in base before removing it (#4083)
|
||||
* Respository's home page not updated after first push (#4075)
|
||||
|
||||
[1.5.3]
|
||||
* Update Gitea to 1.4.3
|
||||
* SECURITY
|
||||
* HTML-escape plain-text READMEs (#4192) (#4214)
|
||||
* Fix open redirect vulnerability on login screen (#4312) (#4312)
|
||||
* BUGFIXES
|
||||
* Fix broken monitoring page when running processes are shown (#4203) (#4208)
|
||||
* Fix delete comment bug (#4216) (#4228)
|
||||
* Delete reactions added to issues and comments when deleting repository (#4232) (#4237)
|
||||
* Fix wiki URL encoding bug (#4091) (#4254)
|
||||
* Fix code tab link when viewing tags (#3908) (#4263)
|
||||
* Fix webhook type conflation (#4285) (#4285)
|
||||
|
||||
[1.5.4]
|
||||
* Allow customization using gitea's custom data directory
|
||||
|
||||
[1.6.0]
|
||||
* Update Gitea to 1.5.0
|
||||
* Security
|
||||
* Check that repositories can only be migrated to own user or organizations (#4366) (#4370)
|
||||
* Limit uploaded avatar image-size to 4096px x 3072px by default (#4353)
|
||||
* Do not allow to reuse TOTP passcode (#3878)
|
||||
* Features
|
||||
* Add cli commands to regen hooks & keys (#3979)
|
||||
* Add support for FIDO U2F (#3971)
|
||||
* Added user language setting (#3875)
|
||||
* Add topic support (#3711)
|
||||
* Multiple assignees (#3705)
|
||||
* Add protected branch whitelists for merging (#3689)
|
||||
* Global code search support (#3664)
|
||||
* Add label descriptions (#3662)
|
||||
* Add issue search via API (#3612)
|
||||
* Add repository setting to enable/disable health checks (#3607)
|
||||
* Emoji Autocomplete (#3433)
|
||||
* Implements generator cli for secrets (#3531)
|
||||
|
||||
[1.6.1]
|
||||
* Update Gitea to 1.5.1
|
||||
* Security
|
||||
* Don't disclose emails of all users when sending out emails (#4784)
|
||||
* Improve URL validation for external wiki and external issues (#4710) (#4740)
|
||||
* Make cookies HttpOnly and obey COOKIE_SECURE flag (#4706) (#4707)
|
||||
* Bugfixes
|
||||
* Fix missing release title in webhook (#4783) (#4800)
|
||||
* Make sure to reset commit count in the cache on mirror syncing (#4770)
|
||||
* Fixed bug where team with admin privelege type doesn't get any unit (#4759)
|
||||
* Fix failure on creating pull request with assignees (#4583) (#4727)
|
||||
* Hide org/create menu item in Dashboard if user has no rights (#4678) (#4686)
|
||||
|
||||
[1.7.0]
|
||||
* Update base image
|
||||
|
||||
[1.7.1]
|
||||
* Update Gitea to 1.5.2
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"author": "Gitea developers",
|
||||
"description": "file://DESCRIPTION.md",
|
||||
"tagline": "A painless self-hosted Git Service",
|
||||
"version": "1.1.2",
|
||||
"version": "1.7.1",
|
||||
"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/"
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
This app packages Gitea <upstream>1.2.2</upstream>
|
||||
This app packages Gitea <upstream>1.5.2</upstream>
|
||||
|
||||
Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket or Gitlab.
|
||||
|
||||
|
10
Dockerfile
10
Dockerfile
@@ -1,6 +1,4 @@
|
||||
FROM cloudron/base:0.10.0
|
||||
|
||||
ENV VERSION 1.2.2
|
||||
FROM cloudron/base:1.0.0@sha256:147a648a068a2e746644746bbfb42eb7a50d682437cead3c67c933c546357617
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y openssh-server git && \
|
||||
@@ -16,7 +14,7 @@ RUN passwd -d git
|
||||
|
||||
RUN mkdir -p /home/git/gitea
|
||||
## TODO: use redis as well
|
||||
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/1.5.2/gitea-1.5.2-linux-amd64 -o /home/git/gitea/gitea \
|
||||
&& chmod +x /home/git/gitea/gitea
|
||||
|
||||
# setup config paths
|
||||
@@ -31,9 +29,7 @@ RUN ln -s /app/data/gitconfig /home/git/.gitconfig
|
||||
|
||||
ADD start.sh /home/git/start.sh
|
||||
|
||||
# disable pam authentication for sshd
|
||||
RUN sed -e 's/UsePAM yes/UsePAM no/' -e 's/UsePrivilegeSeparation yes/UsePrivilegeSeparation no/' -i /etc/ssh/sshd_config
|
||||
RUN echo "UseDNS no" >> /etc/ssh/sshd_config
|
||||
COPY sshd_config /etc/ssh/sshd_config
|
||||
|
||||
CMD [ "/home/git/start.sh" ]
|
||||
|
||||
|
79
sshd_config
Normal file
79
sshd_config
Normal file
@@ -0,0 +1,79 @@
|
||||
# Package generated configuration file
|
||||
# See the sshd_config(5) manpage for details
|
||||
|
||||
# What ports, IPs and protocols we listen for
|
||||
Port 29418
|
||||
# Use these options to restrict which interfaces/protocols sshd will bind to
|
||||
ListenAddress 0.0.0.0
|
||||
Protocol 2
|
||||
# HostKeys for protocol version 2
|
||||
HostKey /app/data/sshd/ssh_host_rsa_key
|
||||
HostKey /app/data/sshd/ssh_host_dsa_key
|
||||
HostKey /app/data/sshd/ssh_host_ecdsa_key
|
||||
HostKey /app/data/sshd/ssh_host_ed25519_key
|
||||
|
||||
# Logging
|
||||
SyslogFacility AUTH
|
||||
LogLevel INFO
|
||||
|
||||
# Authentication:
|
||||
LoginGraceTime 120
|
||||
PermitRootLogin prohibit-password
|
||||
StrictModes yes
|
||||
|
||||
PubkeyAuthentication yes
|
||||
#AuthorizedKeysFile %h/.ssh/authorized_keys
|
||||
|
||||
# Don't read the user's ~/.rhosts and ~/.shosts files
|
||||
IgnoreRhosts yes
|
||||
# similar for protocol version 2
|
||||
HostbasedAuthentication no
|
||||
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
|
||||
#IgnoreUserKnownHosts yes
|
||||
|
||||
# To enable empty passwords, change to yes (NOT RECOMMENDED)
|
||||
PermitEmptyPasswords no
|
||||
|
||||
# Change to yes to enable challenge-response passwords (beware issues with
|
||||
# some PAM modules and threads)
|
||||
ChallengeResponseAuthentication no
|
||||
|
||||
# Change to no to disable tunnelled clear text passwords
|
||||
#PasswordAuthentication yes
|
||||
|
||||
# Kerberos options
|
||||
#KerberosAuthentication no
|
||||
#KerberosGetAFSToken no
|
||||
#KerberosOrLocalPasswd yes
|
||||
#KerberosTicketCleanup yes
|
||||
|
||||
# GSSAPI options
|
||||
#GSSAPIAuthentication no
|
||||
#GSSAPICleanupCredentials yes
|
||||
|
||||
X11Forwarding yes
|
||||
X11DisplayOffset 10
|
||||
PrintMotd no
|
||||
PrintLastLog yes
|
||||
TCPKeepAlive yes
|
||||
#UseLogin no
|
||||
|
||||
#MaxStartups 10:30:60
|
||||
#Banner /etc/issue.net
|
||||
|
||||
# Allow client to pass locale environment variables
|
||||
AcceptEnv LANG LC_*
|
||||
|
||||
Subsystem sftp /usr/lib/openssh/sftp-server
|
||||
|
||||
# Set this to 'yes' to enable PAM authentication, account processing,
|
||||
# and session processing. If this is enabled, PAM authentication will
|
||||
# be allowed through the ChallengeResponseAuthentication and
|
||||
# PasswordAuthentication. Depending on your PAM configuration,
|
||||
# PAM authentication via ChallengeResponseAuthentication may bypass
|
||||
# the setting of "PermitRootLogin without-password".
|
||||
# If you just want the PAM account and session checks to run without
|
||||
# PAM authentication, then enable this but set PasswordAuthentication
|
||||
# and ChallengeResponseAuthentication to 'no'.
|
||||
UsePAM no
|
||||
UseDNS no
|
12
start.sh
12
start.sh
@@ -2,7 +2,7 @@
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
mkdir -p /run/gitea/tmp/uploads
|
||||
mkdir -p /run/gitea/tmp/uploads /run/sshd
|
||||
|
||||
setup_ldap_source() {
|
||||
set -eu
|
||||
@@ -50,10 +50,7 @@ fi
|
||||
chmod 0600 /app/data/sshd/*_key
|
||||
chmod 0644 /app/data/sshd/*.pub
|
||||
|
||||
sed -e "s/^Port .*/Port ${SSH_PORT}/" \
|
||||
-e "s/^#ListenAddress .*/ListenAddress 0.0.0.0/" \
|
||||
-e "s,^HostKey /etc/ssh/,HostKey /app/data/sshd/," \
|
||||
/etc/ssh/sshd_config > /run/gitea/sshd_config
|
||||
sed -e "s/^Port .*/Port ${SSH_PORT}/" /etc/ssh/sshd_config > /run/gitea/sshd_config
|
||||
|
||||
cp /home/git/app.ini.template "/run/gitea/app.ini"
|
||||
|
||||
@@ -87,7 +84,7 @@ 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_SMTP_PORT}"
|
||||
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}"
|
||||
@@ -97,8 +94,7 @@ 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"
|
||||
|
||||
|
||||
mkdir -p /app/data/repository /app/data/ssh
|
||||
mkdir -p /app/data/repository /app/data/ssh /app/data/custom
|
||||
|
||||
chown -R git:git /app/data /run/gitea
|
||||
|
||||
|
@@ -9,4 +9,4 @@ stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
environment=HOME="/home/git",USER="git"
|
||||
environment=HOME="/home/git",USER="git",GITEA_CUSTOM="/app/data/custom"
|
||||
|
@@ -17,6 +17,7 @@
|
||||
"superagent": "^1.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"chromedriver": "^2.38.2",
|
||||
"selenium-server-standalone-jar": "^3.3.1",
|
||||
"selenium-webdriver": "^3.3.0",
|
||||
"superagent": "^1.8.5"
|
||||
|
115
test/test.js
115
test/test.js
@@ -9,6 +9,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
require('chromedriver');
|
||||
|
||||
var execSync = require('child_process').execSync,
|
||||
ejs = require('ejs'),
|
||||
expect = require('expect.js'),
|
||||
@@ -71,7 +73,7 @@ describe('Application life cycle test', function () {
|
||||
expect(app).to.be.an('object');
|
||||
}
|
||||
|
||||
function setAvatar(done) {
|
||||
function setAvatarOld(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 () {
|
||||
@@ -87,6 +89,25 @@ describe('Application life cycle test', function () {
|
||||
});
|
||||
}
|
||||
|
||||
function setAvatar(done) {
|
||||
if (app.manifest.version === '1.5.4') return setAvatarOld(done);
|
||||
|
||||
browser.get('https://' + app.fqdn + '/user/settings').then(function () {
|
||||
var button = browser.findElement(by.xpath('//label[contains(text(), "Use Custom Avatar")]'));
|
||||
return browser.executeScript('arguments[0].scrollIntoView(false)', button);
|
||||
}).then(function () {
|
||||
return browser.findElement(by.xpath('//label[contains(text(), "Use Custom Avatar")]')).click();
|
||||
}).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")]')).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) {
|
||||
return done();
|
||||
superagent.get('https://' + app.fqdn + '/avatars/a3e6f3316fc1738e29d621e6a26e93d3').end(function (error, result) {
|
||||
@@ -106,7 +127,7 @@ return done();
|
||||
}).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);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -127,12 +148,7 @@ return done();
|
||||
function addPublicKey(done) {
|
||||
var publicKey = fs.readFileSync(__dirname + '/id_rsa.pub', 'utf8');
|
||||
|
||||
var sshPage;
|
||||
if (app.manifest.version === '1.0.3') {
|
||||
sshPage = 'https://' + app.fqdn + '/user/settings/ssh';
|
||||
} else {
|
||||
sshPage = 'https://' + app.fqdn + '/user/settings/keys';
|
||||
}
|
||||
const sshPage = 'https://' + app.fqdn + '/user/settings/keys';
|
||||
|
||||
browser.get(sshPage).then(function () {
|
||||
return browser.findElement(by.xpath('//div[text()="Add Key"]')).click();
|
||||
@@ -216,10 +232,42 @@ return done();
|
||||
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() {
|
||||
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(),"A testing 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' });
|
||||
});
|
||||
@@ -234,7 +282,7 @@ return done();
|
||||
if (error) return done(error);
|
||||
if (result.statusCode !== 200) return done(new Error('Login failed with status ' + result.statusCode));
|
||||
|
||||
token = result.body.token;
|
||||
token = result.body.accessToken;
|
||||
|
||||
superagent.get('https://' + inspect.apiEndpoint + '/api/v1/profile')
|
||||
.query({ access_token: token }).end(function (error, result) {
|
||||
@@ -262,6 +310,7 @@ return done();
|
||||
});
|
||||
|
||||
it('can login', login);
|
||||
it('can send mail', sendMail);
|
||||
it('can set avatar', setAvatar);
|
||||
it('can get avatar', checkAvatar);
|
||||
|
||||
@@ -276,8 +325,11 @@ return done();
|
||||
it('can add and push a file', pushFile);
|
||||
it('can edit file', editFile);
|
||||
|
||||
it('can add custom file', addCustomFile);
|
||||
it('can check custom file', checkCustomFile);
|
||||
|
||||
it('can restart app', function (done) {
|
||||
execSync('cloudron restart --wait');
|
||||
execSync('cloudron restart --wait --app ' + app.id);
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -299,12 +351,17 @@ return done();
|
||||
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 --wait --location ' + LOCATION + '2', { 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');
|
||||
it('move to different location', function (done) {
|
||||
//browser.manage().deleteAllCookies(); // commented because of error "'Network.deleteCookie' wasn't found"
|
||||
// ensure we don't hit NXDOMAIN in the mean time
|
||||
browser.get('about:blank').then(function () {
|
||||
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');
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('can login', login);
|
||||
@@ -313,8 +370,12 @@ return done();
|
||||
it('can clone the url', cloneRepo);
|
||||
it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
|
||||
|
||||
it('uninstall app', function () {
|
||||
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
it('uninstall app', function (done) {
|
||||
// ensure we don't hit NXDOMAIN in the mean time
|
||||
browser.get('about:blank').then(function () {
|
||||
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
// check if the _first_ login via email succeeds
|
||||
@@ -327,8 +388,12 @@ return done();
|
||||
|
||||
login(function (error) {
|
||||
if (error) return done(error);
|
||||
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
done();
|
||||
|
||||
// ensure we don't hit NXDOMAIN in the mean time
|
||||
browser.get('about:blank').then(function () {
|
||||
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -350,11 +415,17 @@ return done();
|
||||
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' });
|
||||
it('uninstall app', function (done) {
|
||||
// ensure we don't hit NXDOMAIN in the mean time
|
||||
browser.get('about:blank').then(function () {
|
||||
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user