Skip to content

Commit 4c3a9eb

Browse files
authored
Merge pull request #618 from mctraffic/fix/gitHub-BaseUrl
modified views and checks for GitHub BaseUrl usage
2 parents c4c01bb + baa7066 commit 4c3a9eb

File tree

6 files changed

+57
-7
lines changed

6 files changed

+57
-7
lines changed

client/src/components/apps/form.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,10 +1802,13 @@ export default defineComponent({
18021802
(v: any) => /^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(v) || 'Allowed characters : [a-zA-Z0-9_-]',
18031803
],
18041804
repositoryRules: [
1805-
//v => !!v || 'Repository is required',
1806-
(v: any) => v.length <= 120 || 'Repository must be less than 120 characters',
1805+
//(v: any) => !!v || 'Repository is required',
1806+
//(v: any) => v.length <= 120 || 'Repository must be less than 120 characters',
18071807
// ((git|ssh|http(s)?)|(git@[\w\.]+))(:(//)?)([\w\.@\:/\-~]+)(\.git)(/)?
1808-
(v: any) => /((git|ssh|http(s)?)|(git@[\w.]+))(:(\/\/)?)([\w.@:/\-~]+)(\.git)(\/)?/.test(v) || 'Format "owner/repository"',
1808+
// ((git|ssh|http(s)?)|(git@[\w.]+))(:(\/\/)?)([\w.@:\/\-~]+)(\.git)
1809+
// (git@[\w.]+:\/\/)([\w.\/\-~]+)(\.git) // not working
1810+
// ((git|ssh|http(s)?)|(git@[\w\.-]+))(:(//)?)([\w\.@\:/\-~]+)(\.git)(/)?
1811+
(v: any) => /^((git|ssh|http(s)?)|(git@[\w\.-]+))(:(\/\/)?)([\w\.@\:\/\-~]+)(\.git)(\/)?/.test(v) || 'Format "[email protected]:organisation/repository.git"',
18091812
],
18101813
domainRules: [
18111814
(v: any) => !!v || 'Domain is required',

client/src/components/settings/form-deployment.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,19 @@
5454

5555
<h4 class="text-uppercase">Github</h4>
5656
<v-row>
57+
<v-col
58+
cols="12"
59+
md="3"
60+
>
61+
<v-text-field
62+
v-model="settings.secrets.GITHUB_BASEURL"
63+
label="github Base Url"
64+
required
65+
></v-text-field>
66+
</v-col>
5767
<v-col
5868
cols="12"
59-
md="6"
69+
md="3"
6070
>
6171
<v-text-field
6272
v-model="settings.secrets.GITHUB_PERSONAL_ACCESS_TOKEN"
@@ -218,4 +228,4 @@ export default defineComponent({
218228
}
219229
})
220230
221-
</script>
231+
</script>

client/src/components/settings/form.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ import FormNotifications from './form-notifications.vue'
6565
6666
// types & interfaces
6767
export interface Secrets {
68+
GITHUB_BASEURL: string;
6869
GITHUB_PERSONAL_ACCESS_TOKEN: string;
6970
GITEA_PERSONAL_ACCESS_TOKEN: string;
7071
GITEA_BASEURL: string;
@@ -389,6 +390,7 @@ export default defineComponent({
389390
show: false,
390391
settings: {
391392
secrets: {
393+
GITHUB_BASEURL: '',
392394
GITHUB_PERSONAL_ACCESS_TOKEN: '',
393395
GITEA_PERSONAL_ACCESS_TOKEN: '',
394396
GITEA_BASEURL: '',
@@ -548,4 +550,4 @@ export default defineComponent({
548550
</script>
549551

550552
<style lang="scss">
551-
</style>
553+
</style>

server/src/git/github.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,4 +404,4 @@ export class GithubApi extends Repo {
404404

405405
return ret;
406406
}
407-
}
407+
}

server/src/modules/settings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export class Settings {
6464
}
6565

6666
config["secrets"] = {
67+
GITHUB_BASEURL: process.env.GITHUB_BASEURL || '',
6768
GITHUB_PERSONAL_ACCESS_TOKEN: process.env.GITHUB_PERSONAL_ACCESS_TOKEN || '',
6869
GITEA_PERSONAL_ACCESS_TOKEN: process.env.GITEA_PERSONAL_ACCESS_TOKEN || '',
6970
GITEA_BASEURL: process.env.GITEA_BASEURL || '',
@@ -143,6 +144,7 @@ export class Settings {
143144
process.env[key] = secrets[key]
144145
}
145146
*/
147+
process.env.GITHUB_BASEURL = secrets.GITHUB_BASEURL
146148
process.env.GITHUB_PERSONAL_ACCESS_TOKEN = secrets.GITHUB_PERSONAL_ACCESS_TOKEN
147149
process.env.GITEA_PERSONAL_ACCESS_TOKEN = secrets.GITEA_PERSONAL_ACCESS_TOKEN
148150
process.env.GITEA_BASEURL = secrets.GITEA_BASEURL

services/trailbase/app.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apiVersion: application.kubero.dev/v1alpha1
2+
kind: KuberoApp
3+
metadata:
4+
name: trailbase
5+
annotations:
6+
kubero.dev/template.architecture: '["linux/amd64"]'
7+
kubero.dev/template.description: "A fast, open-source application server with type-safe APIs, including an admin interface."
8+
kubero.dev/template.icon: "https://avatars.githubusercontent.com/u/176172021"
9+
kubero.dev/template.installation: ""
10+
kubero.dev/template.links: "[]"
11+
kubero.dev/template.screenshots: "[]"
12+
kubero.dev/template.source: "https://github.com/trailbaseio/trailbase"
13+
kubero.dev/template.categories: '["devtool", "utility"]'
14+
kubero.dev/template.title: "Trailbase"
15+
kubero.dev/template.website: "https://www.trailbase.io/"
16+
labels:
17+
manager: kubero
18+
spec:
19+
name: trailbase
20+
deploymentstrategy: docker
21+
envVars: []
22+
extraVolumes: []
23+
cronjobs: []
24+
addons: []
25+
web:
26+
replicaCount: 1
27+
worker:
28+
replicaCount: 0
29+
image:
30+
containerPort: "4000"
31+
pullPolicy: Always
32+
repository: trailbase/trailbase
33+
tag: latest

0 commit comments

Comments
 (0)