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

Compare commits

...

48 Commits

Author SHA1 Message Date
Johannes Zellner
46982e68f7 Fixup tests 2022-08-19 16:31:54 +02:00
Johannes Zellner
a2d2edabaf Fixup test 2022-08-19 16:18:45 +02:00
Johannes Zellner
7261adc546 Update test deps 2022-08-19 10:48:02 +02:00
Johannes Zellner
a338dc215a Bump version 2022-08-19 10:47:45 +02:00
Girish Ramakrishnan
a12cf5f70b not sure why commented out 2022-07-31 08:21:18 +02:00
Girish Ramakrishnan
730611229e Version 1.24.0 2022-07-31 08:13:30 +02:00
Girish Ramakrishnan
fcb4caff89 Fixup tests 2022-07-31 08:12:39 +02:00
Girish Ramakrishnan
200dc7676f Update test packages 2022-07-31 07:55:51 +02:00
Girish Ramakrishnan
320fbf86d9 Update gitea to 1.17.0 2022-07-31 07:49:17 +02:00
Girish Ramakrishnan
04d857e88b Version 1.23.12 2022-05-16 13:44:40 -07:00
Girish Ramakrishnan
e2f6fb52b3 Update gitea to 1.16.8 2022-05-16 12:25:14 -07:00
Johannes Zellner
4224cc9692 Add missing versions 2022-05-02 11:28:50 +02:00
Johannes Zellner
d416ec0dc7 Update test deps 2022-05-02 11:08:36 +02:00
Johannes Zellner
ea5ff4e574 Bump version for 1.16.7 2022-05-02 11:08:20 +02:00
Girish Ramakrishnan
27720786bf Update test packages 2022-04-20 17:32:30 -07:00
Girish Ramakrishnan
f48a4c4d72 Update gitea to 1.16.6 2022-04-20 17:27:52 -07:00
Johannes Zellner
65fbb9cb7d Bump version for 1.16.5 2022-03-24 10:38:58 +01:00
Johannes Zellner
63bfe621d1 Update test deps 2022-03-15 10:47:12 +01:00
Johannes Zellner
a6688ede57 Bump version for 1.16.4 2022-03-15 10:47:00 +01:00
Johannes Zellner
7f2646bfb3 Update test deps 2022-03-04 12:36:27 +01:00
Johannes Zellner
aafc1968ec Bump version for 1.16.3 2022-03-04 12:35:54 +01:00
Girish Ramakrishnan
2f85d288e0 Version 1.23.6 2022-02-24 19:46:34 -08:00
Girish Ramakrishnan
e5296ab5ee Fixup tests 2022-02-24 19:42:35 -08:00
Girish Ramakrishnan
77e05f56bf Update Gitea 1.16.2 2022-02-24 19:17:02 -08:00
Girish Ramakrishnan
4eab21379e Listen on IPv6 as well
luckily, sshd does not error if the interface has no IPv6 address
2022-02-09 20:15:27 -08:00
Girish Ramakrishnan
1da61b548f Version 1.23.5 2022-02-06 11:41:39 -08:00
Girish Ramakrishnan
76df0b0113 Update test packages 2022-02-06 11:22:22 -08:00
Girish Ramakrishnan
d9fa8399fe Update Gitea to 1.16.1 2022-02-06 10:24:28 -08:00
Johannes Zellner
aa0b00cd1e Fixup tests 2022-01-31 14:08:14 +01:00
Johannes Zellner
8999bc9112 --name is deprecated in favor of --username 2022-01-31 13:45:10 +01:00
Johannes Zellner
a7734d29fb login source table schema has changed 2022-01-31 13:43:01 +01:00
Johannes Zellner
b667082cec Bump version for 1.16.0 2022-01-31 12:26:31 +01:00
Johannes Zellner
9abcb0c5ec Update test deps 2022-01-30 17:56:40 +01:00
Johannes Zellner
3f6593c676 Bump version for 1.15.11 2022-01-30 17:56:26 +01:00
Johannes Zellner
5f7b0457db Update test deps 2022-01-17 10:43:26 +01:00
Johannes Zellner
7adfed915b Bump version for 1.15.10 2022-01-17 10:43:10 +01:00
Johannes Zellner
2af74e6817 Update to lockfile v2 2022-01-02 10:16:08 +01:00
Johannes Zellner
57ad6d200a Bump version for 1.15.9 2022-01-02 10:15:55 +01:00
Girish Ramakrishnan
4df53960f5 Version 1.23.1 2021-12-20 21:37:17 -08:00
Girish Ramakrishnan
2fb28433fb Update Gitea to 1.15.8 2021-12-20 21:25:21 -08:00
Girish Ramakrishnan
6874ea9d46 Version 1.23.0 2021-12-03 10:36:21 -08:00
Girish Ramakrishnan
2c284d36fa Update test packages 2021-12-03 10:36:16 -08:00
Girish Ramakrishnan
83da665570 add asciidoctor and pandoc 2021-12-03 10:05:28 -08:00
Girish Ramakrishnan
a427a098fe Update gitea to 1.15.7 2021-12-03 09:44:35 -08:00
Girish Ramakrishnan
eb4f29375b Merge branch 'master' into 'master'
markup: add jupyter notebook markup language

See merge request cloudron/gitea-app!6
2021-12-03 17:43:23 +00:00
Mark Stenglein
05dcb14e8d markup: add jupyter notebook markup language
Follows documentation here:
  - https://docs.gitea.io/en-us/external-renderers/#installing-external-binaries

This adds jupyter and configures gitea to use jupyter to render notebook files.
2021-12-03 03:06:00 +00:00
Johannes Zellner
5a03ee8f27 Update test deps 2021-10-28 13:05:31 +02:00
Johannes Zellner
e62f99643d Bump version for 1.15.6 2021-10-28 13:04:04 +02:00
10 changed files with 2261 additions and 199 deletions

171
CHANGELOG
View File

@@ -834,3 +834,174 @@
* AutoRegistration is supposed to be working with disabled registration (backport) (#17292) * AutoRegistration is supposed to be working with disabled registration (backport) (#17292)
* Handle duplicate keys on GPG key ring (#17242) (#17284) * Handle duplicate keys on GPG key ring (#17242) (#17284)
* Fix SVG side by side comparison link (#17375) (#17391) * Fix SVG side by side comparison link (#17375) (#17391)
[1.22.6]
* Update Gitea to 1.15.6
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.15.6)
* Prevent panic in serv.go with Deploy Keys (#17434) (#17435)
* Fix CSV render error (#17406) (#17431)
* Read expected buffer size (#17409) (#17430)
* Ensure that restricted users can access repos for which they are members (#17460) (#17464)
* Make commit-statuses popup show correctly (#17447) (#17466)
[1.23.0]
* Update Gitea to 1.15.7
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.15.7)
* Enable rendering of jupyter notebooks, rst, asciidoc by default
* Only allow webhook to send requests to allowed hosts (#17482) (#17510)
* Fix login redirection links (#17451) (#17473)
[1.23.1]
* Update Gitea to 1.15.8
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.15.8)
* Move POST /{username}/action/{action} to simply POST /{username} (#18045) (#18046)
* Fix delete u2f keys bug (#18040) (#18042)
* Reset Session ID on login (#18018) (#18041)
* Prevent off-by-one error on comments on newly appended lines (#18029) (#18035)
* Stop printing 03d after escaped characters in logs (#18030) (#18034)
[1.23.2]
* Update Gitea to 1.15.9
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.15.9)
* Fix wrong redirect on org labels (#18128) (#18134)
* Fix: unstable sort skips/duplicates issues across pages (#18094) (#18095)
* Revert "Fix delete u2f keys bug (#18042)" (#18107)
* Migrating wiki don't require token, so we should move it out of the require form (#17645) (#18104)
* Prevent NPE if gitea uploader fails to open url (#18080) (#18101)
* Reset locale on login (#17734) (#18100)
* Correctly handle failed migrations (#17575) (#18099)
* Instead of using routerCtx just escape the url before routing (#18086) (#18098)
* Quote references to the user table in consistency checks (#18072) (#18073)
* Add NotFound handler (#18062) (#18067)
* Ensure that git repository is closed before transfer (#18049) (#18057)
* Use common sessioner for API and web routes (#18114)
[1.23.3]
* Update Gitea to 1.15.10
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.15.10)
* Fix inconsistent PR comment counts (#18260) (#18261)
* Fix release link broken (#18252) (#18253)
* Fix update user from site administration page bug (#18250) (#18251)
* Set HeadCommit when creating tags (#18116) (#18173)
* Use correct translation key for error messages due to max repo limits (#18135 & #18153) (#18152)
* Fix purple color in suggested label colors (#18241) (#18242)
* Bump mermaid from 8.10.1 to 8.13.8 (#18198) (#18206)
[1.23.4]
* Update Gitea to 1.16.0
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.16.0)
[1.23.5]
* Update Gitea to 1.16.1
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.16.1)
* Update JS dependencies, fix lint (#18389) (#18540)
* Add dropdown icon to label set template dropdown (#18564) (#18571)
* Comments on migrated issues/prs must link to the comment ID (#18630) (#18637)
* Stop logging an error when notes are not found (#18626) (#18635)
* Ensure that blob-excerpt links work for wiki (#18587) (#18624)
* Only attempt to flush queue if the underlying worker pool is not finished (#18593) (#18620)
[1.23.6]
* Update Gitea to 1.16.2
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.16.2)
* Show fullname on issue edits and gpg/ssh signing info (#18828)
* Immediately Hammer if second kill is sent (#18823) (#18826)
* Allow mermaid render error to wrap (#18791)
[1.23.7]
* Update Gitea to 1.16.3
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.16.3)
[1.23.8]
* Update Gitea to 1.16.4
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.16.4)
* Restrict email address validation (#17688) (#19085)
* Fix lfs bug (#19072) (#19080)
[1.23.9]
* Update Gitea to 1.16.5
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.16.5)
* Prevent redirect to Host (2) (#19175) (#19186)
* Try to prevent autolinking of displaynames by email readers (#19169) (#19183)
* Clean paths when looking in Storage (#19124) (#19179)
* Do not send notification emails to inactive users (#19131) (#19139)
* Do not send activation email if manual confirm is set (#19119) (#19122)
[1.23.10]
* Update Gitea to 1.16.6
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.16.6)
[1.23.11]
* Update Gitea to 1.16.7
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.16.7)
* Escape git fetch remote (#19487) (#19490)
* On Migrations, only write commit-graph if wiki clone was successful (#19563) (#19568)
* Respect DefaultUserIsRestricted system default when creating new user (#19310) (#19560)
* Don't error when branch's commit doesn't exist (#19547) (#19548)
* Support hostname:port to pass host matcher's check (#19543) (#19544)
* Prevent dangling archiver goroutine (#19516) (#19526)
* Fix migrate release from github (#19510) (#19523)
* When view _Siderbar or _Footer, just display once (#19501) (#19522)
* Fix blame page select range error and some typos (#19503)
* Fix name of doctor fix "authorized-keys" in hints (#19464) (#19484)
* User specific repoID or xorm builder conditions for issue search (#19475) (#19476)
* Prevent dangling cat-file calls (goroutine alternative) (#19454) (#19466)
* RepoAssignment ensure to close before overwrite (#19449) (#19460)
* Set correct PR status on 3way on conflict checking (#19457) (#19458)
* Mark TemplateLoading error as "UnprocessableEntity" (#19445) (#19446)
[1.23.12]
* Update Gitea to 1.16.8
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.16.8)
* Add doctor check/fix for bogus action rows (#19656) (#19669)
* Make .cs highlighting legible on dark themes (#19604) (#19605)
* Delete user related oauth stuff on user deletion too (#19677) (#19680)
* Fix new release from tags list UI (#19670) (#19673)
* Prevent NPE when checking repo units if the user is nil (#19625) (#19630)
[1.24.0]
* Update Gitea to 1.17.0
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.17.0)
* Automatically render wiki TOC (#19873)
* Adding button to link accounts from user settings (#19792)
* Allow set default merge style while creating repo (#19751)
* Auto merge pull requests when all checks succeeded (#9307 & #19648)
* Improve reviewing PR UX (#19612)
* Add support for rendering console output with colors (#19497)
[1.24.1]
* Update Gitea to 1.17.1
* [Full changelog](https://github.com/go-gitea/gitea/releases/tag/v1.17.1)
* Correctly escape within tribute.js (#20831) (#20832)
* Add support for NuGet API keys (#20721) (#20734)
* Display project in issue list (#20583)
* Add disable download source configuration (#20548) (#20579)
* Add username check to doctor (#20140) (#20671)
* Enable Wire 2 for Internal SSH Server (#20616) (#20617)
* Use the total issue count for UI (#20785) (#20827)
* Add proxy host into allow list (#20798) (#20819)
* Add missing translation for queue flush workers (#20791) (#20792)
* Improve comment header for mobile (#20781) (#20789)
* Fix git.Init for doctor sub-command (#20782) (#20783)
* Check webhooks slice length before calling xorm (#20642) (#20768)
* Remove manual rollback for failed generated repositories (#20639) (#20762)
* Use correct field name in npm template (#20675) (#20760)
* Keep download count on Container tag overwrite (#20728) (#20735)
* Fix v220 migration to be compatible for MSSQL 2008 r2 (#20702) (#20707)
* Use request timeout for git service rpc (#20689) (#20693)
* Send correct NuGet status codes (#20647) (#20677)
* Use correct context to get package content (#20673) (#20676)
* Fix the JS error "EventSource is not defined" caused by some non-standard browsers (#20584) (#20663)
* Add default commit messages to PR for squash merge (#20618) (#20645)
* Fix package upload for files >32mb (#20622) (#20635)
* Fix the new-line copy-paste for rendered code (#20612)
* Clean up and fix clone button script (#20415 & #20600) (#20599)
* Fix default merge style (#20564) (#20565)
* Add repository condition for issue count (#20454) (#20496)
* Make branch icon stand out more (#20726) (#20774)
* Fix loading button with invalid form (#20754) (#20759)
* Fix SecToTime edge-cases (#20610) (#20611)
* Executable check always returns true for windows (#20637) (#20835)
* Check issue labels slice length before calling xorm Insert (#20655) (#20836)
* Fix owners cannot create organization repos bug (#20841) (#20854)
* Prevent 500 is head repo does not have PullRequest unit in IsUserAllowedToUpdate (#20839) (#20848)

View File

@@ -4,7 +4,8 @@
"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.22.5", "version": "1.24.1",
"upstreamVersion": "1.17.1",
"healthCheckPath": "/explore", "healthCheckPath": "/explore",
"httpPort": 3000, "httpPort": 3000,
"memoryLimit": 536870912, "memoryLimit": 536870912,
@@ -36,7 +37,7 @@
"tags": [ "version control", "git", "code hosting", "development", "github", "bitbucket", "gitlab" ], "tags": [ "version control", "git", "code hosting", "development", "github", "bitbucket", "gitlab" ],
"changelog": "file://CHANGELOG", "changelog": "file://CHANGELOG",
"postInstallMessage": "file://POSTINSTALL.md", "postInstallMessage": "file://POSTINSTALL.md",
"minBoxVersion": "5.3.0", "minBoxVersion": "7.1.2",
"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/"
} }

View File

@@ -1,5 +1,3 @@
This app packages Gitea <upstream>1.15.5</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.
### Purpose ### Purpose

View File

@@ -1,9 +1,10 @@
FROM cloudron/base:3.0.0@sha256:455c70428723e3a823198c57472785437eb6eab082e79b3ff04ea584faf46e92 FROM cloudron/base:3.2.0@sha256:ba1d566164a67c266782545ea9809dc611c4152e27686fd14060332dd88263ea
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y openssh-server git && \ apt-get install -y openssh-server git asciidoctor pandoc && \
rm -rf /etc/ssh_host_* && \ rm -rf /etc/ssh_host_* && \
rm -r /var/cache/apt /var/lib/apt/lists rm -r /var/cache/apt /var/lib/apt/lists
RUN pip3 install jupyter
ADD supervisor/ /etc/supervisor/conf.d/ ADD supervisor/ /etc/supervisor/conf.d/
@@ -15,7 +16,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.15.5 ARG VERSION=1.17.1
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

View File

@@ -103,3 +103,24 @@ COOKIE_SECURE = true
COOKIE_NAME = cloudron_gitea COOKIE_NAME = cloudron_gitea
GC_INTERVAL_TIME = 2592000 GC_INTERVAL_TIME = 2592000
[markup.asciidoc]
ENABLED = true
FILE_EXTENSIONS = .adoc,.asciidoc
RENDER_COMMAND = "asciidoctor -s -a showtitle --out-file=- -"
; Input is not a standard input but a file
IS_INPUT_FILE = false
[markup.restructuredtext]
ENABLED = true
FILE_EXTENSIONS = .rst
RENDER_COMMAND = "timeout 30s pandoc +RTS -M512M -RTS -f rst"
IS_INPUT_FILE = false
[markup.jupyter]
ENABLED = true
FILE_EXTENSIONS = .ipynb
RENDER_COMMAND = "jupyter nbconvert --stdin --stdout --to html --template basic"
IS_INPUT_FILE = false
[markup.sanitizer.jupyter.img]
ALLOW_DATA_URI_IMAGES = true

View File

@@ -5,6 +5,7 @@
Port 29418 Port 29418
# Use these options to restrict which interfaces/protocols sshd will bind to # Use these options to restrict which interfaces/protocols sshd will bind to
ListenAddress 0.0.0.0 ListenAddress 0.0.0.0
ListenAddress ::
Protocol 2 Protocol 2
# HostKeys for protocol version 2 # HostKeys for protocol version 2
HostKey /app/data/sshd/ssh_host_rsa_key HostKey /app/data/sshd/ssh_host_rsa_key

View File

@@ -7,15 +7,17 @@ mkdir -p /run/gitea/tmp/uploads /run/sshd /run/gitea/sessions
setup_ldap_source() { setup_ldap_source() {
set -eu set -eu
echo "==> Setup LDAP source"
# Get the existing LDAP source status. This allows the user to disable LDAP # Get the existing LDAP source status. This allows the user to disable LDAP
# Note that this method is deprecated since this app now supports optionalSso # Note that this method is deprecated since this app now supports optionalSso
ldap_status=$(mysql -u"${CLOUDRON_MYSQL_USERNAME}" -p"${CLOUDRON_MYSQL_PASSWORD}" -h mysql --database="${CLOUDRON_MYSQL_DATABASE}" -N -B -e "select is_actived from login_source WHERE name='cloudron';") ldap_status=$(mysql -u"${CLOUDRON_MYSQL_USERNAME}" -p"${CLOUDRON_MYSQL_PASSWORD}" -h mysql --database="${CLOUDRON_MYSQL_DATABASE}" -N -B -e "select is_active from login_source WHERE name='cloudron';")
[[ -z "${ldap_status}" ]] && ldap_status="1" [[ -z "${ldap_status}" ]] && ldap_status="1"
now=$(date +%s) now=$(date +%s)
if mysql -u"${CLOUDRON_MYSQL_USERNAME}" -p"${CLOUDRON_MYSQL_PASSWORD}" -h mysql --database="${CLOUDRON_MYSQL_DATABASE}" \ if mysql -u"${CLOUDRON_MYSQL_USERNAME}" -p"${CLOUDRON_MYSQL_PASSWORD}" -h mysql --database="${CLOUDRON_MYSQL_DATABASE}" \
-e "REPLACE INTO login_source (id, type, name, is_actived, cfg, created_unix, updated_unix) VALUES (1,2,'cloudron',${ldap_status},'{\"Name\":\"cloudron\",\"Host\":\"${CLOUDRON_LDAP_SERVER}\",\"Port\":${CLOUDRON_LDAP_PORT},\"UseSSL\":false,\"SkipVerify\":true,\"BindDN\":\"${CLOUDRON_LDAP_BIND_DN}\",\"BindPassword\":\"${CLOUDRON_LDAP_BIND_PASSWORD}\",\"UserBase\":\"${CLOUDRON_LDAP_USERS_BASE_DN}\",\"AttributeUsername\":\"username\",\"AttributeName\":\"displayname\",\"AttributeSurname\":\"\",\"AttributeMail\":\"mail\",\"Filter\":\"(\\\\u007C(mail=%[1]s)(username=%[1]s))\"}','${now}','${now}');"; then -e "REPLACE INTO login_source (id, type, name, is_active, cfg, created_unix, updated_unix) VALUES (1,2,'cloudron',${ldap_status},'{\"Name\":\"cloudron\",\"Host\":\"${CLOUDRON_LDAP_SERVER}\",\"Port\":${CLOUDRON_LDAP_PORT},\"UseSSL\":false,\"SkipVerify\":true,\"BindDN\":\"${CLOUDRON_LDAP_BIND_DN}\",\"BindPassword\":\"${CLOUDRON_LDAP_BIND_PASSWORD}\",\"UserBase\":\"${CLOUDRON_LDAP_USERS_BASE_DN}\",\"AttributeUsername\":\"username\",\"AttributeName\":\"displayname\",\"AttributeSurname\":\"\",\"AttributeMail\":\"mail\",\"Filter\":\"(\\\\u007C(mail=%[1]s)(username=%[1]s))\"}','${now}','${now}');"; then
echo "==> LDAP Authentication was setup with activation status ${ldap_status}" echo "==> LDAP Authentication was setup with activation status ${ldap_status}"
else else
echo "==> Failed to setup LDAP authentication" echo "==> Failed to setup LDAP authentication"
@@ -26,7 +28,7 @@ setup_ldap_source() {
setup_root_user() { setup_root_user() {
set -eu set -eu
if sudo -H -u git /home/git/gitea/gitea admin user create --name root --password changeme --email test@cloudron.io --admin -c /run/gitea/app.ini; then if sudo -H -u git /home/git/gitea/gitea admin user create --username root --password changeme --email test@cloudron.io --admin -c /run/gitea/app.ini; then
echo "==> root user added" echo "==> root user added"
else else
echo "==> Failed to add root user" echo "==> Failed to add root user"

2194
test/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -9,11 +9,11 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"chromedriver": "^94.0.0", "chromedriver": "^104.0.0",
"expect.js": "^0.3.1", "expect.js": "^0.3.1",
"mocha": "^9.1.3", "mocha": "^10.0.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"selenium-webdriver": "^4.0.0", "selenium-webdriver": "^4.4.0",
"superagent": "^6.1.0" "superagent": "^8.0.0"
} }
} }

View File

@@ -11,11 +11,10 @@
require('chromedriver'); require('chromedriver');
var execSync = require('child_process').execSync, const execSync = require('child_process').execSync,
expect = require('expect.js'), expect = require('expect.js'),
fs = require('fs'), fs = require('fs'),
path = require('path'), path = require('path'),
rimraf = require('rimraf'),
superagent = require('superagent'), superagent = require('superagent'),
{ Builder, By, until } = require('selenium-webdriver'), { Builder, By, until } = require('selenium-webdriver'),
{ Options } = require('selenium-webdriver/chrome'); { Options } = require('selenium-webdriver/chrome');
@@ -49,7 +48,7 @@ describe('Application life cycle test', function () {
after(function () { after(function () {
browser.quit(); browser.quit();
rimraf.sync(repodir); fs.rmSync(repodir, { recursive: true, force: true });
}); });
function getAppInfo() { function getAppInfo() {
@@ -76,10 +75,10 @@ describe('Application life cycle test', function () {
async function checkAvatar() { async function checkAvatar() {
await browser.get(`https://${app.fqdn}/${username}`); await browser.get(`https://${app.fqdn}/${username}`);
var avatarSrc = await browser.findElement(By.xpath('//a[@id="profile-avatar"]/img')).getAttribute('src'); const avatarSrc = await browser.findElement(By.xpath('//div[@id="profile-avatar"]/a/img')).getAttribute('src');
var avatar = await superagent.get(avatarSrc); const response = await superagent.get(avatarSrc);
expect(avatar.statusCode).to.equal(200); expect(response.statusCode).to.equal(200);
} }
async function login(username, password) { async function login(username, password) {
@@ -88,7 +87,7 @@ describe('Application life cycle test', function () {
await browser.findElement(By.id('user_name')).sendKeys(username); await browser.findElement(By.id('user_name')).sendKeys(username);
await browser.findElement(By.id('password')).sendKeys(password); await browser.findElement(By.id('password')).sendKeys(password);
await browser.findElement(By.xpath('//form[@action="/user/login"]//button')).click(); await browser.findElement(By.xpath('//form[@action="/user/login"]//button')).click();
await browser.wait(until.elementLocated(By.linkText('Dashboard')), TIMEOUT); await browser.wait(until.elementLocated(By.xpath('//img[contains(@class, "avatar")]')), TIMEOUT);
} }
async function adminLogin() { async function adminLogin() {
@@ -111,7 +110,8 @@ describe('Application life cycle test', function () {
await browser.get(sshPage); await browser.get(sshPage);
await browser.findElement(By.xpath('//div[text()="Add Key"]')).click(); await browser.wait(until.elementLocated(By.id('add-ssh-button')), TIMEOUT);
await browser.findElement(By.id('add-ssh-button')).click();
await browser.findElement(By.id('ssh-key-title')).sendKeys('testkey'); await browser.findElement(By.id('ssh-key-title')).sendKeys('testkey');
await browser.findElement(By.id('ssh-key-content')).sendKeys(publicKey.trim()); // #3480 await browser.findElement(By.id('ssh-key-content')).sendKeys(publicKey.trim()); // #3480
var button = browser.findElement(By.xpath('//button[contains(text(), "Add Key")]')); var button = browser.findElement(By.xpath('//button[contains(text(), "Add Key")]'));
@@ -146,18 +146,18 @@ describe('Application life cycle test', function () {
} }
function cloneRepo() { function cloneRepo() {
rimraf.sync(repodir); fs.rmSync(repodir, { recursive: true, force: true });
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 });
} }
function pushFile() { function pushFile() {
var env = Object.create(process.env); const 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} main`,
{ env: env, cwd: repodir }); { env: env, cwd: repodir });
rimraf.sync('/tmp/testrepo'); fs.rmSync(repodir, { recursive: true, force: true });
} }
function fileExists() { function fileExists() {
@@ -233,18 +233,6 @@ describe('Application life cycle test', function () {
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS); execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
}); });
// check if the _first_ login via email succeeds
it('can login via email', async function () { execSync(`cloudron install --location ${LOCATION} -p SSH_PORT=${SSH_PORT}`, EXEC_ARGS); });
it('can get app information', getAppInfo);
it('can login', login.bind(null, email, password));
it('uninstall app', async function () {
// ensure we don't hit NXDOMAIN in the mean time
await browser.get('about:blank');
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
});
// No SSO // No SSO
it('install app (no sso)', function () { execSync(`cloudron install --no-sso --location ${LOCATION} -p SSH_PORT=${SSH_PORT}`, EXEC_ARGS); }); it('install app (no sso)', function () { execSync(`cloudron install --no-sso --location ${LOCATION} -p SSH_PORT=${SSH_PORT}`, EXEC_ARGS); });
@@ -270,10 +258,11 @@ describe('Application life cycle test', function () {
it('can add and push a file', pushFile); it('can add and push a file', pushFile);
it('can update', function () { execSync('cloudron update --app ' + app.id, EXEC_ARGS); }); it('can update', function () { execSync('cloudron update --app ' + app.id, EXEC_ARGS); });
it('can get app information', getAppInfo);
xit('can admin login', adminLogin); it('can admin login', adminLogin);
xit('can send mail', sendMail); it('can send mail', sendMail);
xit('can logout', logout); it('can logout', logout);
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);