Skip to content

Commit bb07cb3

Browse files
author
Jaison Titus
committed
Initial Commit
0 parents  commit bb07cb3

File tree

181 files changed

+22560
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+22560
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.hasura
2+
node_modules
3+
npm-debug.log
4+
test

.hasuraignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# gitignore like file
2+
# files and directories mentioned here will be ignored while publishing to hasura
3+
iOS-app
4+
android-app
5+
react-native

README.md

+493
Large diffs are not rendered by default.

clusters.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- alias: hasura
2+
config:
3+
configmap: controller-conf
4+
namespace: babushka20-hasura
5+
data: null
6+
kubeContext: babushka20
7+
name: babushka20

conf/README.md

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# conf
2+
3+
This directory has the configuration to deploy your project on any Hasura cluster. With the secrets (like API keys, client secrets) and this configuration, you can deploy the project on any Hasura cluster.
4+
5+
The configuration is templated so that it can be seamlessly used across multiple clusters. Templating also helps with the management of different kinds of clusters, for example you may have a dev, staging and production clusters where the configuration might differ slightly. The templates are written in [pongo2](https://github.com/flosch/pongo2), a jinja like templating language.
6+
7+
A context variable called `cluster` is available to be used in the templates. This is an extension of the cluster object present in `clusters.yaml` file. Apart from the keys present in `clusters.yaml`, a key called `metadata` with some cluster specific information will be present.
8+
9+
If you need to add your own variables, you can add them under the `data` key in `clusters.yaml` and this will be available as `cluster.data`
10+
11+
The entire context variable `cluster` can be viewed anytime using the command:
12+
13+
```bash
14+
$ hasura cluster template-context
15+
```
16+
17+
A typical context is as follows:
18+
19+
```yaml
20+
name: h34-ambitious93-stg
21+
alias: hasura
22+
kubeContext: ambitious93
23+
config:
24+
configmap: controller-conf
25+
namespace: hasura
26+
metadata:
27+
filestore:
28+
volume:
29+
hostPath:
30+
path: /data/hasura.io/filestore
31+
name: filestore-pv
32+
gateway:
33+
externalIPs:
34+
- 111.222.33.44
35+
ports:
36+
- name: http
37+
port: 80
38+
protocol: TCP
39+
targetPort: 80
40+
- name: https
41+
port: 443
42+
protocol: TCP
43+
targetPort: 443
44+
- name: ssh
45+
port: 22
46+
protocol: TCP
47+
targetPort: 22
48+
namespaces:
49+
hasura: hasura
50+
user: default
51+
postgres:
52+
volume:
53+
hostPath:
54+
path: /data/hasura.io/postgres
55+
name: postgres-pv
56+
registry: null
57+
sessionStore:
58+
volume:
59+
hostPath:
60+
path: /data/hasura.io/redis
61+
name: redis-pv
62+
data: null
63+
```

conf/auth.yaml

+188
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# Configuration for Hasura Auth
2+
3+
# All values in this configuration are strings, including boolean and integer
4+
# values.
5+
6+
# Configuration for default providers
7+
# Each provider has the following fields:
8+
# `enabled` : To mark if the provider is enabled. Valid values are "true" or
9+
# "false".
10+
# `defaultRoles`: Specify the roles that get added when a user signs-up. By
11+
# default the user role is added (even when the list does not contain "user").
12+
# If you do not want any extra roles, leave it as an empty list.
13+
# Example: the below two examples are same
14+
# defaultRoles: ["user", "admin"]
15+
# defaultRoles: ["admin"]
16+
defaultProviders:
17+
username:
18+
enabled: "true"
19+
defaultRoles: []
20+
email:
21+
enabled: "false"
22+
defaultRoles: []
23+
mobile:
24+
enabled: "false"
25+
defaultRoles: []
26+
mobile-password:
27+
enabled: "false"
28+
defaultRoles: []
29+
google:
30+
enabled: "false"
31+
defaultRoles: []
32+
facebook:
33+
enabled: "false"
34+
defaultRoles: []
35+
github:
36+
enabled: "false"
37+
defaultRoles: []
38+
linkedin:
39+
enabled: "false"
40+
defaultRoles: []
41+
42+
# Session related configuration
43+
session:
44+
# Name of the cookie. This is usually set to your cluster's domain. No need
45+
# to edit this in normal circumstances.
46+
cookieName: {{ cluster.name }}
47+
# if the cookie should be sent over https only. Stick to "true".
48+
cookieSecure: "true"
49+
# The default age of a user session in seconds. Default: 181440 (3 weeks)
50+
sessionAge: "1814400"
51+
52+
# Configuration related to the email provider
53+
email:
54+
# email address of the sender for verification emails
55+
verifyEmailFrom: [email protected]
56+
# Name of the sender for verification emails
57+
verifEmailFromName: Admin
58+
# Subject for verification emails
59+
verifyEmailSubject: Verify your account - {{ cluster.name }}
60+
# Template for verification emails. HTML can be used in the template. The
61+
# template is a Jinja template. Leave the "{{token}}" as it is. It will be
62+
# used by the auth service to inject the actual token when sending the email.
63+
verifyTemplate: |
64+
Hi, Please click on <br/>
65+
https://auth.{{ cluster.name }}.hasura-app.io/ui/verify-email?token={{ "{{token}}" }}
66+
to verify your email.
67+
# Email verification token expiry time in days
68+
verifyTokenExpires: "7"
69+
70+
# email address of the sender for forgot password emails
71+
forgotPassEmailFrom: [email protected]
72+
# Name of the sender for forgot password emails
73+
forgotPassEmailFromName: Admin
74+
# Subject for forgot password emails
75+
forgotPassEmailSubject: Reset password request - {{ cluster.name }}
76+
# Template for forgot password emails. HTML can be used in the template. The
77+
# template is a Jinja template. Leave the "{{token}}" as it is. It will be
78+
# used by the auth service to inject the actual token when sending the email.
79+
forgotPassTemplate: |
80+
Hi, <br/> Click on
81+
https://auth.{{ cluster.name }}.hasura-app.io/ui/reset-password?token={{ "{{token}}" }}
82+
to reset your password.
83+
# Forgot password reset token expiry time in days
84+
resetTokenExpires: "7"
85+
86+
# Configuration for the mobile provider
87+
mobile:
88+
# Template for the SMS that is sent. This is a Jinja template. Leave the
89+
# "{{otp}}" as it is. It will be used by the auth service to inject the
90+
# actual token.
91+
smsTemplate: |
92+
Verify your acccount with {{ cluster.name }}! Your OTP is {{ "{{otp}}" }}.
93+
# OTP expiry time in minutes
94+
otpExpiryTime: "15"
95+
96+
# Configuration for the mobile-password provider
97+
mobilePassword:
98+
# Template for the SMS that is sent. This is a Jinja template. Leave the
99+
# "{{otp}}" as it is. It will be used by the auth service to inject the
100+
# actual token.
101+
smsTemplate: |
102+
Verify your acccount with {{ cluster.name }}! Your OTP is {{ "{{otp}}" }}.
103+
# OTP expiry time in minutes
104+
otpExpiryTime: "15"
105+
106+
# Configuration for password
107+
password:
108+
# minimum length of the password allowed.
109+
minLength: "8"
110+
111+
# Below fields are all optional
112+
#
113+
# Configuration for google provider
114+
#google:
115+
# # list of the all the client ids generated for your Google app
116+
# clientIds: ["xxxxxx", "yyyyyy"]
117+
#
118+
# Configuration for facebook provider
119+
#facebook:
120+
# # your facebook app client id
121+
# clientId: xxxxxxxxx
122+
# # your facebook app client secret
123+
# clientSecret:
124+
# secretKeyRef:
125+
# key: auth.facebook.client_secret
126+
# name: hasura-secrets
127+
#
128+
# Configuration for github provider
129+
#github:
130+
# # your github app client id
131+
# clientId: xxxxxxxxx
132+
# # your github app client secret
133+
# clientSecret:
134+
# secretKeyRef:
135+
# key: auth.github.client_secret
136+
# name: hasura-secrets
137+
#
138+
# Configuration for linkedin provider
139+
#linkedin:
140+
# # your linkedin app client id
141+
# clientId: xxxxxxxxx
142+
# # your linkedin app client secret
143+
# clientSecret:
144+
# secretKeyRef:
145+
# key: auth.linkedin.client_secret
146+
# name: hasura-secrets
147+
148+
# Configuration for adding a custom provider
149+
#customProviders:
150+
# myCustomProvider:
151+
# enabled: "true",
152+
# hooks:
153+
# signup: "https://mycustomprovider.test42.hasura-app.io/signup"
154+
# login: "https://mycustomprovider.test42.hasura-app.io/login"
155+
# merge: "https://mycustomprovider.test42.hasura-app.io/merge"
156+
# createUser: "https://mycustomprovider.test42.hasura-app.io/create-user"
157+
# deleteUser: "https://mycustomprovider.test42.hasura-app.io/delete-user"
158+
# defaultRoles: ["admin"]
159+
160+
161+
# The below fields are used by the platform when initializing. Please do not
162+
# edit these configuration
163+
postgres:
164+
database: hasuradb
165+
host: postgres.{{ cluster.metadata.namespaces.hasura }}
166+
password:
167+
secretKeyRef:
168+
key: postgres.password
169+
name: hasura-secrets
170+
port: "5432"
171+
user:
172+
secretKeyRef:
173+
key: postgres.user
174+
name: hasura-secrets
175+
redis:
176+
cred: null
177+
host: session-redis.{{ cluster.metadata.namespaces.hasura }}
178+
port: "6379"
179+
notifyDomain: http://notify.{{ cluster.metadata.namespaces.hasura }}
180+
superUser:
181+
password:
182+
secretKeyRef:
183+
key: auth.admin.password
184+
name: hasura-secrets
185+
username: admin
186+
# optional fields
187+
188+
# mobile: 987654321

conf/authorized-keys.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Defines where SSH keys are stored on the cluster.
2+
#
3+
# In this current configuration, it points to the `authorizedKeys`
4+
# key of configmap `ssh-authorized-keys` which is created
5+
# during project creation.
6+
#
7+
# All SSH keys added to the cluster (using `hasura ssh-key add`)
8+
# are stored in this ConfigMap
9+
10+
configMapKeyRef:
11+
name: ssh-authorized-keys
12+
key: authorizedKeys

conf/ci.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Defines continuous integration for the project
2+
3+
# registry defines a custom docker registry to push images that are built on the cluster
4+
registry: {{ cluster.metadata.registry|json }}
5+
6+
# remotes define which microservices has to be updated when code is pushed to the remote
7+
remotes:
8+
# Default remote to push code and configuration
9+
{{ cluster.name }}:
10+
<<: {}
11+
'{{ cluster.metadata.namespaces.user }}.api':
12+
api:
13+
dockerfile: microservices/api/Dockerfile
14+
path: microservices/api
15+
# Add new remotes here above this line
16+
# Example:
17+
18+
# remote-name:
19+
# namespace.service-name:
20+
# container-name:
21+
# path: services/app
22+
# dockerfile: services/app/Dockerfile
23+

conf/dev-mode.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
gateway: true

conf/domains.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Domain configuration for the gateway
2+
# Hasura allots a cluster-name.hasura-app.io for every cluster
3+
4+
{{ cluster.name }}.hasura-app.io:
5+
ssl:
6+
type: LetsEncrypt
7+
conf:
8+
account: {{ cluster.name }}
9+
10+
# Point your own domain to the IP of the cluster and add the domain here
11+
# Example configuration for domain with free SSL certs from LetsEncypt
12+
#
13+
# example-domain.com:
14+
# ssl:
15+
# type: LetsEncrypt
16+
# conf: {}
17+
18+
# Example configurtaion for a domain without SSL
19+
#
20+
# example-domain.com:
21+
# ssl: null

conf/filestore.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Configuration for Hausra Filestore service
2+
3+
# hookUrl
4+
# -------
5+
# defines the URL to be contacted for enforcing permissions
6+
# The filestore service has the following built in hooks:
7+
#
8+
# Private: Only logged in users can read and upload
9+
# hookUrl: http://localhost:8080/v1/hooks/user-read-write
10+
#
11+
# Public: Anybody can read, but only logged in users can upload
12+
# hookUrl: http://localhost:8080/v1/hooks/public-read-user-write
13+
#
14+
# Read Only: Anybody can read, but no one can upload
15+
# hookUrl: http://localhost:8080/v1/hooks/public-read
16+
#
17+
# Custom Permission URL: For any other custom permissions, you need to define your own service
18+
#
19+
# Default permissions are admin-only
20+
21+
hookUrl: http://localhost:8080/v1/hooks/public-read-user-write
22+
23+
# volume
24+
# -------
25+
# Volume defines the Kubernetes volume to be mounted for storing the files, this is usually filled in from the metadata.
26+
27+
volume: {{ cluster.metadata.filestore.volume|json }}

conf/gateway.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Configuration for opening the the Gateway to the external world
2+
# Filled in from cluster metadata, contains Kubernete spec for the service object
3+
{{ cluster.metadata.gateway|json }}

conf/http-directives.conf

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# You can add nginx directives that can go into the 'http' section of the gateway here
2+
gzip on;
3+
gzip_http_version 1.1;
4+
gzip_min_length 1024;
5+
gzip_types text/plain text/css text/javascript application/json application/x-javascript application/javascript text/xml application/xml application/xml+rss;
6+
gzip_proxied any;
7+
gzip_disable msie6;
8+
gzip_comp_level 1;

0 commit comments

Comments
 (0)