Skip to content

Commit 2ac3ada

Browse files
authored
Merge pull request #32 from eeditiones/fix/14
major refactoring
2 parents 3667d68 + d023408 commit 2ac3ada

20 files changed

+1444
-1135
lines changed

.existdb.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"servers": {
33
"localhost": {
4-
"server": "http://localhost:8080/exist",
4+
"server": "https://127.0.0.1:8443/exist",
55
"user": "admin",
66
"password": "",
77
"root": "/db/apps/tuttle"

.github/workflows/node.js.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ jobs:
2727
services:
2828
# Label used to access the service container
2929
exist:
30-
env:
31-
tuttle_token_tuttle_sample_data: ${{ secrets.TUTTLE_TEST_TOKEN }}
30+
env:
31+
tuttle_token_tuttle_sample_data: ${{ secrets.TUTTLE_TEST_TOKEN }}
32+
tuttle_token_tuttle_sample_gitlab: ${{ secrets.GITLAB_READ_TOKEN }}
3233
image: existdb/existdb:${{ matrix.exist-version }}
3334
ports:
3435
- 8443:8443

gulpfile.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ const packageUri = existJSON.package.namespace
1919
const serverInfo = existJSON.servers.localhost
2020
const target = serverInfo.root
2121

22+
const url = new URL(serverInfo.server)
23+
// console.log(url)
24+
25+
// FIXME read from .existdb.json
2226
const connectionOptions = {
27+
host: url.hostname,
28+
port: url.port,
29+
secure: url.protocol === 'https:',
2330
basic_auth: {
2431
user: serverInfo.user,
2532
pass: serverInfo.password

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.2.0",
44
"description": "tuttle - a Git-integration for eXist-db",
55
"scripts": {
6+
"start": "gulp",
67
"test": "gulp install && mocha --exit",
78
"test:watch": "mocha --watch",
89
"test:build": "gulp test:install",
@@ -17,8 +18,8 @@
1718
},
1819
"license": "GPL-3.0",
1920
"devDependencies": {
20-
"@existdb/gulp-exist": "^4.0.0",
21-
"@existdb/gulp-replace-tmpl": "^1.0.0",
21+
"@existdb/gulp-exist": "^4.4.0",
22+
"@existdb/gulp-replace-tmpl": "^1.0.4",
2223
"@semantic-release/exec": "^5.0.0",
2324
"@semantic-release/git": "^9.0.0",
2425
"@semantic-release/github": "^7.2.0",

src/api.json

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"servers": [
99
{
1010
"description": "Endpoint for testing on localhost",
11-
"url": "http://localhost:8080/exist/apps/tuttle"
11+
"url": "/exist/apps/tuttle"
1212
}
1313
],
1414
"components": {
@@ -19,7 +19,7 @@
1919
},
2020
"cookieAuth": {
2121
"type": "apiKey",
22-
"name": "teipublisher.com.login",
22+
"name": "eeditiones.org.login",
2323
"in": "cookie"
2424
}
2525
}
@@ -109,7 +109,7 @@
109109
"x-constraints": {
110110
"user": "admin"
111111
},
112-
"operationId": "api:git-pull",
112+
"operationId": "api:git-pull-default",
113113
"parameters": [
114114
{
115115
"name": "hash",
@@ -143,7 +143,7 @@
143143
"x-constraints": {
144144
"user": "admin"
145145
},
146-
"operationId": "api:git-deploy",
146+
"operationId": "api:git-deploy",
147147
"responses": {
148148
"200":{
149149
"description": "JSON dump of request",
@@ -184,7 +184,8 @@
184184
"in": "query",
185185
"required": false,
186186
"schema":{
187-
"type": "boolean"
187+
"type": "boolean",
188+
"default": false
188189
}
189190
}
190191
],
@@ -223,13 +224,14 @@
223224
"in": "query",
224225
"required": false,
225226
"schema":{
226-
"type": "boolean"
227+
"type": "boolean",
228+
"default": false
227229
}
228230
}
229231
],
230232
"responses": {
231233
"200":{
232-
"description": "JSON dump of request",
234+
"description": "result of the update",
233235
"content": {
234236
"application/json": {
235237
"schema": {
@@ -268,7 +270,7 @@
268270
],
269271
"responses": {
270272
"200": {
271-
"description": "GIT Hash",
273+
"description": "git hashes",
272274
"content": {
273275
"application/json": {
274276
"schema": {
@@ -333,14 +335,15 @@
333335
"x-constraints": {
334336
"user": "admin"
335337
},
336-
"operationId": "api:get-commit",
338+
"operationId": "api:get-commits",
337339
"parameters": [
338340
{
339341
"name": "count",
340342
"in": "query",
341343
"required": false,
342344
"schema":{
343-
"type": "integer"
345+
"type": "integer",
346+
"default": 20
344347
}
345348
},
346349
{
@@ -372,14 +375,15 @@
372375
"x-constraints": {
373376
"user": "admin"
374377
},
375-
"operationId": "api:get-commit",
378+
"operationId": "api:get-commits-default",
376379
"parameters": [
377380
{
378381
"name": "count",
379382
"in": "query",
380383
"required": false,
381384
"schema":{
382-
"type": "integer"
385+
"type": "integer",
386+
"default": 20
383387
}
384388
}
385389
],

src/data/tuttle.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@
44
<default>true</default>
55
<type>github</type>
66
<baseurl>https://api.github.com/</baseurl>
7-
<repo>tuttle-sample-data</repo>
87
<owner>eeditiones</owner>
8+
<repo>tuttle-sample-data</repo>
99
<token>XXX</token>
10-
<ref>main</ref>
10+
<ref>next</ref>
1111
<hookuser>admin</hookuser>
1212
<hookpasswd></hookpasswd>
1313
</collection>
1414

1515
<collection name="tuttle-sample-gitlab">
1616
<type>gitlab</type>
1717
<baseurl>https://gitlab.com/api/v4/</baseurl>
18-
<project-id>tuttle-sample-data</project-id>
18+
<owner>line-o</owner>
19+
<repo>tuttle-sample-data</repo>
20+
<project-id>50872175</project-id>
1921
<token>XXX</token>
20-
<ref>master</ref>
22+
<ref>main</ref>
2123
<hookuser>admin</hookuser>
2224
<hookpasswd></hookpasswd>
2325
</collection>
@@ -34,9 +36,7 @@
3436
</blacklist>
3537

3638

37-
<config prefix="/db/apps" suffix="-stage" lock="git-lock.xml" apikeys="/db/system/auth/tuttle-token.xml">
39+
<config prefix="/db/apps/" suffix="-stage" lock="git-lock.xml" apikeys="/db/system/auth/tuttle-token.xml">
3840
<sm user="nobody" group="nogroup" mode="rw-r--r--"/>
3941
</config>
40-
41-
4242
</tuttle>

src/index.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
<!DOCTYPE html>
12
<html lang="en">
23
<head>
34
<meta charset="UTF-8"/>
45

56
<title>Tuttle Dashboard</title>
6-
<link rel="stylesheet" href="resources/css/fore.css">
7-
<link rel="stylesheet" href="resources/css/vars.css">
8-
<link rel="stylesheet" href="resources/css/styles.css">
7+
<link rel="stylesheet" href="resources/css/fore.css" />
8+
<link rel="stylesheet" href="resources/css/vars.css" />
9+
<link rel="stylesheet" href="resources/css/styles.css" />
910

1011
</head>
1112
<body>
@@ -158,11 +159,11 @@ <h1><img class="tuttle" src="resources/images/HPTuttle-1866.png"></img>
158159
<section class="login">
159160
<fx-control ref="instance('auth')/user" update-event="enter">
160161
<label>User</label>
161-
<input type="text" autofocus autocomplete="false">
162+
<input type="text" autofocus="autofocus" autocomplete="false" />
162163
</fx-control>
163164
<fx-control ref="instance('auth')/password" update-event="enter">
164165
<label>Password</label>
165-
<input type="password">
166+
<input type="password" />
166167
</fx-control>
167168

168169
<fx-trigger>
@@ -205,8 +206,6 @@ <h3>Git Repositories</h3>
205206
</fx-switch>
206207
</fx-fore>
207208
<script type="module" src="./js/fore-all.js"></script>
208-
209-
210209
</div>
211210
</body>
212211
</html>

0 commit comments

Comments
 (0)