-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initiate tests with coverage; proper readme & contribution docu…
…mentations
- Loading branch information
Showing
13 changed files
with
309 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = false | ||
max_line_length = 120 | ||
tab_width = 4 | ||
|
||
[*.rs] | ||
max_line_length = 100 | ||
|
||
[{*.har,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.prettierrc,.stylelintrc,bowerrc,composer.lock,jest.config}] | ||
indent_size = 2 | ||
|
||
[{*.yaml,*.yml}] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
github: teknologi-umum | ||
custom: ["https://saweria.co/teknologiumum"] | ||
custom: [ "https://saweria.co/teknologiumum" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Contributing Guide | ||
|
||
Hello! We'd love to see your contribution on this repository soon, even if it's just a typo fix! | ||
|
||
Contributing means anything from reporting bugs, ideas, suggestion, code fix, even new feature. | ||
|
||
Bear in mind to keep your contributions under the [Code of Conduct](./.github/CODE_OF_CONDUCT.md) for the community. | ||
|
||
## Bug report, ideas, and suggestion | ||
|
||
The [issues](https://github.com/teknologi-umum/polarite/issues) page is a great way to communicate to us. | ||
Other than that, we have a [Telegram group](https://t.me/teknologi_umum_v2) that you can discuss your ideas into. | ||
If you're not an Indonesian speaker, it's 100% fine to talk in English there. | ||
|
||
Please make sure that the issue you're creating is in as much detail as possible. Poor communication might lead to a big mistake, we're trying to avoid that. | ||
|
||
## Pull request | ||
|
||
**A big heads up before you're writing a breaking change code or a new feature: Please open up an | ||
[issue](https://github.com/teknologi-umum/polarite/issues) regarding what you're working on, or just talk in the | ||
[Telegram group](https://t.me/teknologi_umum_v2).** | ||
|
||
### Prerequisites | ||
|
||
You will need a few things to get things working: | ||
|
||
1. Latest stable version of [Rust](https://www.rust-lang.org/tools/install). | ||
2. An IDE or text editor with Rust plugin installed. | ||
|
||
### Getting Started | ||
|
||
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own Github account and [clone](https://help.github.com/articles/cloning-a-repository/) it to your local machine. | ||
2. Run `cargo update` to install the dependencies needed. | ||
3. Run `cargo run` to start the development application. | ||
4. Have fun! | ||
|
||
You are encouraged to use [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0-beta.2/) | ||
for your commit message. But it's not really compulsory. | ||
|
||
### Testing your change | ||
|
||
Creating tests are not necessary, but it's always great if you can provide tests! | ||
|
||
```sh | ||
$ cargo test | ||
``` | ||
|
||
### Before creating a PR | ||
|
||
Please test (command above) and format your code accordingly to pass the CI. | ||
|
||
```sh | ||
$ cargo fmt | ||
``` | ||
|
||
And you're set! |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[package] | ||
name = "kuma-relay" | ||
name = "roselite" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM rust:1.69.0-bullseye AS builder | ||
WORKDIR /app | ||
COPY . . | ||
RUN cargo build --release | ||
|
||
FROM debian:bullseye-slim AS runtime | ||
WORKDIR /app | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/* | ||
COPY --from=builder /app/target/release/roselite roselite | ||
CMD ["/app/roselite"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,67 @@ | ||
# Kuma Relay | ||
# Roselite | ||
|
||
Nothing to see here yet | ||
Roselite is a simple application to relay your [Uptime Kuma](https://github.com/louislam/uptime-kuma) push monitor type | ||
(falls within the passive monitor category) for multiple applications. | ||
|
||
## Usage | ||
|
||
Create a file using TOML, YAML, or JSON (or JSON5) containing the configuration for Roselite. The configuration in JSON | ||
should looks like: | ||
|
||
```json5 | ||
{ | ||
"monitors": [ | ||
{ | ||
// This is the endpoint that you can acquire from your Uptime Kuma instance | ||
"push_url": "https://your-uptime-kuma.com/api/push/Eq15E23yc3", | ||
// This is the endpoint to your private/secluded server within an internal network | ||
"monitor_url": "https://your-internal-endpoint.com" | ||
}, | ||
// ... | ||
] | ||
} | ||
``` | ||
|
||
Put the path to the configuration file on `CONFIGURATION_FILE_PATH` environment variable. It will be read by Roselite | ||
and be processed. It only accepts file with extensions of `toml`, `yml`, `yaml`, `json`, and `json5`. | ||
|
||
That's it. Now you can run your own Roselite and looks at moving heartbeats on your Uptime Kuma instance. | ||
|
||
## Contributing | ||
|
||
See [contributing guide](./CONTRIBUTING.md) | ||
|
||
## Where do "Roselite" comes from? | ||
|
||
We have a convention of having project names being taken from | ||
the [list of minerals on Wikipedia](https://en.wikipedia.org/wiki/List_of_minerals). | ||
As this one happens to be some project that's probably a bit niche, I'd like to think of having it named after | ||
our convention. You can read more about Roselite [on Wikipedia](https://en.wikipedia.org/wiki/Roselite). | ||
|
||
## License | ||
|
||
``` | ||
MIT License | ||
Copyright (c) 2023 Teknologi Umum <opensource@teknologiumum.com> | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
``` | ||
|
||
See [LICENSE](./LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.