Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ping/HealthCheck endpoint needed. #113

Closed
yakuter opened this issue May 31, 2020 · 5 comments · Fixed by #115
Closed

Ping/HealthCheck endpoint needed. #113

yakuter opened this issue May 31, 2020 · 5 comments · Fixed by #115
Labels
Priority: Low This issue can probably be picked up by anyone looking to contribute to the project, as an entry fix Status: Available No one has claimed responsibility for this issue. Type: Enhancement Most issues will probably ask for additions or changes. It's expected that this type of issue will r

Comments

@yakuter
Copy link
Collaborator

yakuter commented May 31, 2020

Is your feature request related to a problem? Please describe.
We don't know if the server is running. We need a public (excluded from auth) endpoint to check server status. Then we can use uptimerobot and check the server status regularly.

Describe the solution you'd like

We need an endpoint which only returns 200 with a GET method. It should be /ping, /health or /health-check. We can search for best practice about it.

For a better health check, this endpoint can check if postgres or mysql is running and db connection is fine.

Additional context
Does anyone want to work on this?

@yakuter yakuter added Priority: Medium This issue may be useful, and needs some attention. Status: Available No one has claimed responsibility for this issue. Type: Enhancement Most issues will probably ask for additions or changes. It's expected that this type of issue will r labels May 31, 2020
@yakuter yakuter added this to Accepted, Let's Develop! in PassWall Roadmap May 31, 2020
@mrtrkmn
Copy link
Contributor

mrtrkmn commented May 31, 2020

I can take it 👋🏻
Would it be sufficient to return something like this ; (assumes that mysql service is used, postgres not used )

{
	"service": {
		"status": "OK",
		"statusCode": "200",
		"error": "N/A"
	},
	"postgres": {
		"status": "N/A",
		"statusCode": "N/A",
		"error": "N/A"
	},
	"mysql": {
		"status": "OK",
		"statusCode": "200",
		"error": "N/A"
	}
}

@mrtrkmn
Copy link
Contributor

mrtrkmn commented May 31, 2020

This (https://github.com/AppsFlyer/go-sundheit) can be used or can be implemented natively it depends how many services will be included in the future. Of course, there might be a drawback of using external library every time (-it may blow up the binary which is generated at the end.-).

@yakuter
Copy link
Collaborator Author

yakuter commented May 31, 2020

I can take it 👋🏻
Would it be sufficient to return something like this ; (assumes that mysql service is used, postgres not used )

{
	"service": {
		"status": "OK",
		"statusCode": "200",
		"error": "N/A"
	},
	"postgres": {
		"status": "N/A",
		"statusCode": "N/A",
		"error": "N/A"
	},
	"mysql": {
		"status": "OK",
		"statusCode": "200",
		"error": "N/A"
	}
}

We can remove "status" lines. Just status_code and error is fine. Also I think we don't need external lib for this job. Can I assign you with this?

@mrtrkmn
Copy link
Contributor

mrtrkmn commented May 31, 2020

Yeah, I think so as well. As I mentioned importing libraries can blow up binary, no need to import it.
is this urgent ? btw

@yakuter
Copy link
Collaborator Author

yakuter commented May 31, 2020

No not urgent. Anytime is fine.

@yakuter yakuter added Priority: Low This issue can probably be picked up by anyone looking to contribute to the project, as an entry fix and removed Priority: Medium This issue may be useful, and needs some attention. labels May 31, 2020
yakuter pushed a commit that referenced this issue Jun 3, 2020
* check token earlier

Signed-off-by: Ahmet Turkmen <f.ahmet.turkmen@icloud.com>

* add /health endpoint

Signed-off-by: Ahmet Turkmen <f.ahmet.turkmen@icloud.com>

* add workflow to run tests

Signed-off-by: Ahmet Turkmen <f.ahmet.turkmen@icloud.com>

* return NoToken Err

Signed-off-by: Ahmet Turkmen <f.ahmet.turkmen@icloud.com>

* remove suffix

Signed-off-by: Ahmet Turkmen <f.ahmet.turkmen@icloud.com>
yakuter added a commit that referenced this issue Jun 3, 2020
* Create CONTRIBUTING.md

* Translation (#103)

* used const and var for strings

* update

* update

* CONTRIBUTING.md file translated into Turkish.

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* Update CONTRIBUTING-TR.md

* pre-generated issue template added (#106)

Signed-off-by: Ahmet Turkmen <f.ahmet.turkmen@icloud.com>

* Removed unnecessary alpine image (#109)

* Remove unnecessary alpine image

* Fix mkdir command for docker
Signed-off-by: Kaan Karakaya <yusufkaan142@gmail.com>

* Fix libc for docker

Signed-off-by: Kaan Karakaya <yusufkaan142@gmail.com>

* password package implemented (#112)

* password package implemented

Signed-off-by: Ahmet Turkmen <f.ahmet.turkmen@icloud.com>

* app/enc/password func updated

Signed-off-by: Ahmet Turkmen <f.ahmet.turkmen@icloud.com>

* rename and delete deprecated todo

Signed-off-by: Ahmet Turkmen <f.ahmet.turkmen@icloud.com>

* Feature/add health check #113 (#115)

* check token earlier

Signed-off-by: Ahmet Turkmen <f.ahmet.turkmen@icloud.com>

* add /health endpoint

Signed-off-by: Ahmet Turkmen <f.ahmet.turkmen@icloud.com>

* add workflow to run tests

Signed-off-by: Ahmet Turkmen <f.ahmet.turkmen@icloud.com>

* return NoToken Err

Signed-off-by: Ahmet Turkmen <f.ahmet.turkmen@icloud.com>

* remove suffix

Signed-off-by: Ahmet Turkmen <f.ahmet.turkmen@icloud.com>

* Closes #118

* update health test

* workflow db user info

Co-authored-by: Recep Alaca <recep@users.noreply.github.com>
Co-authored-by: Ahmet Türkmen <f.ahmet.turkmen@icloud.com>
Co-authored-by: Kaan Karakaya <yusufkaan142@gmail.com>
@yakuter yakuter moved this from Accepted, Let's Develop! to Developer Preview/Edge in PassWall Roadmap Jun 4, 2020
@yakuter yakuter moved this from Developer Preview/Edge to Let's Get This Party Started! in PassWall Roadmap Jun 4, 2020
@yakuter yakuter moved this from Let's Get This Party Started! to Developer Preview/Edge in PassWall Roadmap Jun 4, 2020
@yakuter yakuter moved this from Developer Preview/Edge to Let's Get This Party Started! in PassWall Roadmap Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low This issue can probably be picked up by anyone looking to contribute to the project, as an entry fix Status: Available No one has claimed responsibility for this issue. Type: Enhancement Most issues will probably ask for additions or changes. It's expected that this type of issue will r
Projects
PassWall Roadmap
Let's Get This Party Started!
Development

Successfully merging a pull request may close this issue.

2 participants