You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+31-25Lines changed: 31 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,27 +7,27 @@ Please note we have a code of conduct, please follow it in all your interactions
7
7
8
8
## IMPORTANT: CapRover Goals & Scope
9
9
10
-
Since the birth of CapRover, there has been many contributions and suggestions that shaped CapRover as we know it today. One of the very important factor in the contribution you make is to stick with CapRover design philosophy.- CapRover is not an enterprise grade application like Kubernetes. *Do not* patch it with half-done features that make it look like one - it will eventually fail as we don't have resources to support such features.- CapRover scope is a helper around Docker, nginx and Let's Encrypt.
10
+
Since the birth of CapRover, there has been many contributions and suggestions that shaped CapRover as we know it today. One of the very important factor in the contribution you make is to stick with CapRover design philosophy.- CapRover is not an enterprise grade application like Kubernetes. _Do not_ patch it with half-done features that make it look like one - it will eventually fail as we don't have resources to support such features.- CapRover scope is a helper around Docker, nginx and Let's Encrypt.
11
11
12
12
The goal is to make the common use-cases exposed via simple controls on UI while allowing further customizations to be done through hooks and scripts. If a new feature is doable via the existing features, or a basic tool, do not add it to CapRover. We do not want to bloat this application. One example is: "Add a flag to customize the placement constraints of containers". This is definitely doable in Docker, but we don't want to mirror every single functionality of Docker to CapRover. If we do that, CapRover becomes a very hard to maintain project. Instead we should add customization hooks for these advanced and rare use cases. For example, instead of mirroring every single nginx config, we added the ability of customizing the nginx config for advanced users.- Last but not least AVOID LARGE PULL REQUESTS at all cost as they won't get reviewed unless they are discussed in the Slack channel beforehand.
13
13
14
14
## Pull Request Process
15
15
16
-
1. IF APPLICABLE: Update the docs (https://github.com/caprover/caprover-website) with details of changes to the interface, this includes new environment
16
+
1. IF APPLICABLE: Update the docs (https://github.com/caprover/caprover-website) with details of changes to the interface, this includes new environment
17
17
variables, exposed ports, useful file locations and container parameters.
18
18
2. Make sure your commit comments are self explanatory.
19
19
3. Discuss the changes you want to make beforehand.
20
20
4. Please avoid making opinion-based changes if it's just a code-style change - this includes, but not limited to, changes to how we work with promises, class inheritence and etc.
21
21
5. To keep the process simple with just a few contributors, development happens directly on the master branch
22
22
and releases will be deployed on the same branch.
23
23
6. By creating a Pull Request, you agree to all terms in https://github.com/caprover/caprover/blob/master/contrib.md
24
-
25
-
## Running dev environment
24
+
25
+
###Running backend dev environment
26
26
27
27
First, you need a Captain instance running in debug mode, this can be a remote server, a VM on your local machine,
28
28
or your local machine itself. Needless to say, Docker is required (same minimum version as mentioned in README). Ubuntu is the best dev environment for CapRover.
29
29
30
-
> Docker for Mac users: You need to add `/captain` to shared paths.
30
+
> Docker for Mac users: You need to add `/captain` to shared paths.
31
31
> To do so, click on the Docker icon -> Preferences -> File Sharing and add `/captain`
32
32
> This is not possible in Catalina or above versions. You can try your luck by changing `CAPTAIN_BASE_DIRECTORY` in `src/utils/CaptainConstants.ts` and in `dev-scripts/dev-clean-run-as-dev.sh` but it might be best to develop in a linux VM for best results.
33
33
@@ -38,18 +38,21 @@ $ npm install
38
38
$ npm run build
39
39
$ ./dev-scripts/dev-clean-run-as-dev.sh
40
40
```
41
+
41
42
You are good to go! You can run the following line to see the logs for the back-end service.
42
43
43
44
```bash
44
45
npm run dev
45
46
```
47
+
46
48
The main differences between the release and debug mode are:
47
-
- docker image is created from the local source file, instead of getting pulled from Docker hub
48
-
- security is much weaker is debug due to a static salt
49
-
- self health monitoring is disabled in debug so that we can see possible crashes
50
-
- same origin policy is disabled in debug mode to make front end development easier
51
-
- an additional endpoint is available at `/force-exit` which force restarts the backend service
52
-
- static resources (including front end app) are not being served in debug build.
49
+
50
+
- docker image is created from the local source file, instead of getting pulled from Docker hub
51
+
- security is much weaker is debug due to a static salt
52
+
- self health monitoring is disabled in debug so that we can see possible crashes
53
+
- same origin policy is disabled in debug mode to make front end development easier
54
+
- an additional endpoint is available at `/force-exit` which force restarts the backend service
55
+
- static resources (including front end app) are not being served in debug build.
53
56
54
57
Captain by default uses `captain.localhost` as its root domain. It's not always needed, but if you need a root
55
58
domain for your development, you can simply run a local DNS server on your local machine and point
@@ -61,22 +64,25 @@ And add this line to it: `address=/captain.localhost/192.168.1.2` where `192.168
61
64
To make sure you have dnsmasq, you can run `which dnsmasq` on your terminal, if it's available,
62
65
path of it will be printed on the terminal, otherwise, there won't be anything printed on your terminal.
63
66
67
+
To test the API, you can import the Postman collection JSON in `./dev-scripts` directory.
64
68
65
69
### front end development:
70
+
66
71
See https://github.com/caprover/caprover-frontend
67
72
68
73
### CLI development:
69
74
70
75
See https://github.com/caprover/caprover-cli
71
76
72
77
### Backend development:
78
+
73
79
Start the debug build for the backend service as explained above. To see any changes you make,
74
80
first save the changes, then you need to restart the service either by sending a request to `/force-exit` endpoint,
75
81
or by running `npm run dev`.
76
82
77
83
### Security Issues
78
-
Security issues are high priority and they will be addressed immediately. If you find a security issue, please do not post as a public issue, instead, please email it to us: security at caprover dot com.
79
84
85
+
Security issues are high priority and they will be addressed immediately. If you find a security issue, please do not post as a public issue, instead, please email it to us: security at caprover dot com.
80
86
81
87
## Code of Conduct
82
88
@@ -94,22 +100,22 @@ orientation.
94
100
Examples of behavior that contributes to creating a positive environment
95
101
include:
96
102
97
-
* Using welcoming and inclusive language
98
-
* Being respectful of differing viewpoints and experiences
99
-
* Gracefully accepting constructive criticism
100
-
* Focusing on what is best for the community
101
-
* Showing empathy towards other community members
103
+
- Using welcoming and inclusive language
104
+
- Being respectful of differing viewpoints and experiences
105
+
- Gracefully accepting constructive criticism
106
+
- Focusing on what is best for the community
107
+
- Showing empathy towards other community members
102
108
103
109
Examples of unacceptable behavior by participants include:
104
110
105
-
* The use of sexualized language or imagery and unwelcome sexual attention or
106
-
advances
107
-
* Trolling, insulting/derogatory comments, and personal or political attacks
108
-
* Public or private harassment
109
-
* Publishing others' private information, such as a physical or electronic
110
-
address, without explicit permission
111
-
* Other conduct which could reasonably be considered inappropriate in a
112
-
professional setting
111
+
- The use of sexualized language or imagery and unwelcome sexual attention or
112
+
advances
113
+
- Trolling, insulting/derogatory comments, and personal or political attacks
114
+
- Public or private harassment
115
+
- Publishing others' private information, such as a physical or electronic
116
+
address, without explicit permission
117
+
- Other conduct which could reasonably be considered inappropriate in a
0 commit comments