Compare commits
11 Commits
07ea207721
...
72582f1b71
Author | SHA1 | Date | |
---|---|---|---|
72582f1b71 | |||
55befef95b | |||
53cc689dc4 | |||
1c20383de6 | |||
53c15a653f | |||
9c5cb6667e | |||
b0c40196b6 | |||
a28a5ca6ee | |||
ea6bfc9c04 | |||
844f8519d5 | |||
1508fbb2bf |
165
CHANGELOG.md
Normal file
165
CHANGELOG.md
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
# Changelog
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.1.0] - 2025-01-11
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- add cuddle please
|
||||||
|
- enable churn update service
|
||||||
|
- add updater to install script
|
||||||
|
- add updater to install script
|
||||||
|
- add http client
|
||||||
|
- run more often
|
||||||
|
- enable checking if it should actually run
|
||||||
|
- enable having get variable from local setup
|
||||||
|
- inherit output as well
|
||||||
|
- allow process from external code
|
||||||
|
- add inherit
|
||||||
|
- add default no labels
|
||||||
|
- warn all targets
|
||||||
|
- update with web assembly components
|
||||||
|
- add labels to config
|
||||||
|
- add abstraction around task
|
||||||
|
- enable webpki roots
|
||||||
|
- add short connect timeout
|
||||||
|
- more error logging
|
||||||
|
- stop the service if running
|
||||||
|
- setup stream logging
|
||||||
|
- update script with warn
|
||||||
|
- disable force again
|
||||||
|
- make curl silent"
|
||||||
|
- force update
|
||||||
|
- use public prod
|
||||||
|
- run as root
|
||||||
|
- agent is already setup
|
||||||
|
- allow errors
|
||||||
|
- some more debugging
|
||||||
|
- some more debugging
|
||||||
|
- stderr to stdout as well
|
||||||
|
- this should work
|
||||||
|
- when config has already been setup
|
||||||
|
- add agent start as well
|
||||||
|
- update with agent setup
|
||||||
|
- add install script
|
||||||
|
- add comments
|
||||||
|
- use actual internal
|
||||||
|
- reqwest as native build
|
||||||
|
- use internal
|
||||||
|
- add external service host
|
||||||
|
- add grpc host
|
||||||
|
- add external vars
|
||||||
|
- add grpc and env
|
||||||
|
- add queue
|
||||||
|
- add common queue
|
||||||
|
- add discovery
|
||||||
|
- add tonic
|
||||||
|
- added tonic
|
||||||
|
- added longer timer
|
||||||
|
- fix error message
|
||||||
|
- add agent
|
||||||
|
- add churn v2
|
||||||
|
- initial v2 commit
|
||||||
|
- reset
|
||||||
|
- update
|
||||||
|
- update
|
||||||
|
- update stuff
|
||||||
|
- update
|
||||||
|
- with drone
|
||||||
|
- with agent db
|
||||||
|
- with sled db and capnp
|
||||||
|
- with sled db
|
||||||
|
- with basic changelog
|
||||||
|
- with basic package
|
||||||
|
- with publish
|
||||||
|
- with monitoring
|
||||||
|
- with monitor
|
||||||
|
- with extra churning repl thingy
|
||||||
|
- with enroll
|
||||||
|
- add initial churn
|
||||||
|
- add simple health check
|
||||||
|
|
||||||
|
### Docs
|
||||||
|
- update readme
|
||||||
|
next up is differentiating the different agents, such that we can execute commands from the cli to for example update dependencies on all machines, restart machines etc.
|
||||||
|
- add installation docs
|
||||||
|
- add notes
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- use actual names for files
|
||||||
|
- *(deps)* update rust crate serde to v1.0.217
|
||||||
|
- *(deps)* update rust crate serde_json to v1.0.134
|
||||||
|
- *(deps)* update all dependencies to v28
|
||||||
|
- *(deps)* update rust crate nodrift to 0.3.0
|
||||||
|
- *(deps)* update rust crate serde to v1.0.216
|
||||||
|
- *(deps)* update tokio-prost monorepo to v0.13.4
|
||||||
|
- *(deps)* update rust crate tokio-util to v0.7.13
|
||||||
|
- *(deps)* update rust crate bytes to v1.9.0
|
||||||
|
- *(deps)* update rust crate tower-http to 0.6.0
|
||||||
|
- *(deps)* update all dependencies
|
||||||
|
- *(deps)* update rust crate capnp to 0.19.5
|
||||||
|
- *(deps)* update rust crate capnp to 0.19.4
|
||||||
|
|
||||||
|
### Other
|
||||||
|
- update final repo
|
||||||
|
- update lock"
|
||||||
|
- update default schedule
|
||||||
|
- *(deps)* update rust crate anyhow to v1.0.95
|
||||||
|
- *(deps)* update rust crate clap to v4.5.23
|
||||||
|
- *(deps)* update all dependencies
|
||||||
|
- *(deps)* update rust crate tracing-subscriber to v0.3.19
|
||||||
|
- *(deps)* update rust crate tracing to v0.1.41
|
||||||
|
- *(deps)* update rust crate serde to v1.0.215
|
||||||
|
- *(deps)* update rust crate serde to v1.0.214
|
||||||
|
- *(deps)* update rust crate serde to v1.0.213
|
||||||
|
- *(deps)* update rust crate serde to v1.0.210
|
||||||
|
- *(deps)* update rust crate serde to v1.0.209
|
||||||
|
- *(deps)* update rust crate serde_json to v1.0.126
|
||||||
|
- *(deps)* update all dependencies
|
||||||
|
- *(deps)* update rust crate serde to v1.0.208
|
||||||
|
- *(deps)* update all dependencies
|
||||||
|
- *(deps)* update rust crate serde to v1.0.203
|
||||||
|
- *(deps)* update rust crate anyhow to 1.0.86
|
||||||
|
- *(deps)* update rust crate anyhow to 1.0.85
|
||||||
|
- *(deps)* update rust crate anyhow to 1.0.84
|
||||||
|
- *(deps)* update rust crate itertools to 0.13.0
|
||||||
|
- *(deps)* update rust crate anyhow to 1.0.83
|
||||||
|
- *(deps)* update rust crate reqwest to 0.12.4
|
||||||
|
- *(deps)* update rust crate chrono to 0.4.38
|
||||||
|
- *(deps)* update rust crate anyhow to 1.0.82
|
||||||
|
- Merge pull request 'chore(release): v0.1.0' (#4) from cuddle-please/release into main
|
||||||
|
|
||||||
|
Reviewed-on: https://git.front.kjuulh.io/kjuulh/churn/pulls/4
|
||||||
|
|
||||||
|
- *(release)* 0.1.0
|
||||||
|
- *(test)* test commit
|
||||||
|
- *(test)* test commit
|
||||||
|
- *(test)* test commit
|
||||||
|
- *(test)* test commit
|
||||||
|
- Merge pull request 'chore(deps): update all dependencies' (#2) from renovate/all into main
|
||||||
|
|
||||||
|
Reviewed-on: https://git.front.kjuulh.io/kjuulh/churn/pulls/2
|
||||||
|
|
||||||
|
- *(deps)* update all dependencies
|
||||||
|
- change to byte slice
|
||||||
|
- fmt
|
||||||
|
- fmt
|
||||||
|
- Add renovate.json
|
||||||
|
|
||||||
|
- Release churn-server v0.1.0
|
||||||
|
|
||||||
|
- Release churn-agent v0.1.0
|
||||||
|
|
||||||
|
- Release churn v0.1.0
|
||||||
|
|
||||||
|
- Release churn v0.1.0
|
||||||
|
|
||||||
|
- Release churn-domain v0.1.0, churn v0.1.0
|
||||||
|
|
||||||
|
- with changelog
|
||||||
|
- Release churn-domain v0.1.0, churn v0.1.0
|
||||||
|
|
158
Cargo.lock
generated
158
Cargo.lock
generated
@ -353,9 +353,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.2.7"
|
version = "1.2.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7"
|
checksum = "ad0cf6e91fde44c773c6ee7ec6bba798504641a8bc2eb7e37a04ffbf4dfaa55a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"jobserver",
|
"jobserver",
|
||||||
"libc",
|
"libc",
|
||||||
@ -779,6 +779,16 @@ version = "1.0.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
|
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "erased-serde"
|
||||||
|
version = "0.4.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
"typeid",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "errno"
|
name = "errno"
|
||||||
version = "0.3.10"
|
version = "0.3.10"
|
||||||
@ -1557,9 +1567,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.22"
|
version = "0.4.24"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
|
checksum = "3d6ea2a48c204030ee31a7d7fc72c93294c92fe87ecb1789881c9543516e1a0d"
|
||||||
|
dependencies = [
|
||||||
|
"value-bag",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mach2"
|
name = "mach2"
|
||||||
@ -1875,9 +1888,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.92"
|
version = "1.0.93"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0"
|
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
@ -2273,6 +2286,15 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde_fmt"
|
||||||
|
version = "1.0.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e1d4ddca14104cd60529e8c7f7ba71a2c8acd8f7f5cfcdc2faf97eeb7c3010a4"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.135"
|
version = "1.0.135"
|
||||||
@ -2418,6 +2440,84 @@ version = "2.6.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sval"
|
||||||
|
version = "2.13.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f6dc0f9830c49db20e73273ffae9b5240f63c42e515af1da1fceefb69fceafd8"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sval_buffer"
|
||||||
|
version = "2.13.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "429922f7ad43c0ef8fd7309e14d750e38899e32eb7e8da656ea169dd28ee212f"
|
||||||
|
dependencies = [
|
||||||
|
"sval",
|
||||||
|
"sval_ref",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sval_dynamic"
|
||||||
|
version = "2.13.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "68f16ff5d839396c11a30019b659b0976348f3803db0626f736764c473b50ff4"
|
||||||
|
dependencies = [
|
||||||
|
"sval",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sval_fmt"
|
||||||
|
version = "2.13.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c01c27a80b6151b0557f9ccbe89c11db571dc5f68113690c1e028d7e974bae94"
|
||||||
|
dependencies = [
|
||||||
|
"itoa",
|
||||||
|
"ryu",
|
||||||
|
"sval",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sval_json"
|
||||||
|
version = "2.13.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0deef63c70da622b2a8069d8600cf4b05396459e665862e7bdb290fd6cf3f155"
|
||||||
|
dependencies = [
|
||||||
|
"itoa",
|
||||||
|
"ryu",
|
||||||
|
"sval",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sval_nested"
|
||||||
|
version = "2.13.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a39ce5976ae1feb814c35d290cf7cf8cd4f045782fe1548d6bc32e21f6156e9f"
|
||||||
|
dependencies = [
|
||||||
|
"sval",
|
||||||
|
"sval_buffer",
|
||||||
|
"sval_ref",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sval_ref"
|
||||||
|
version = "2.13.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bb7c6ee3751795a728bc9316a092023529ffea1783499afbc5c66f5fabebb1fa"
|
||||||
|
dependencies = [
|
||||||
|
"sval",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sval_serde"
|
||||||
|
version = "2.13.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2a5572d0321b68109a343634e3a5d576bf131b82180c6c442dee06349dfc652a"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
"sval",
|
||||||
|
"sval_nested",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.96"
|
version = "2.0.96"
|
||||||
@ -2822,6 +2922,12 @@ version = "0.2.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "typeid"
|
||||||
|
version = "1.0.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typenum"
|
name = "typenum"
|
||||||
version = "1.17.0"
|
version = "1.17.0"
|
||||||
@ -2896,6 +3002,42 @@ version = "0.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
|
checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "value-bag"
|
||||||
|
version = "1.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2"
|
||||||
|
dependencies = [
|
||||||
|
"value-bag-serde1",
|
||||||
|
"value-bag-sval2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "value-bag-serde1"
|
||||||
|
version = "1.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4bb773bd36fd59c7ca6e336c94454d9c66386416734817927ac93d81cb3c5b0b"
|
||||||
|
dependencies = [
|
||||||
|
"erased-serde",
|
||||||
|
"serde",
|
||||||
|
"serde_fmt",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "value-bag-sval2"
|
||||||
|
version = "1.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "53a916a702cac43a88694c97657d449775667bcd14b70419441d05b7fea4a83a"
|
||||||
|
dependencies = [
|
||||||
|
"sval",
|
||||||
|
"sval_buffer",
|
||||||
|
"sval_dynamic",
|
||||||
|
"sval_fmt",
|
||||||
|
"sval_json",
|
||||||
|
"sval_ref",
|
||||||
|
"sval_serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vcpkg"
|
name = "vcpkg"
|
||||||
version = "0.2.15"
|
version = "0.2.15"
|
||||||
@ -3651,9 +3793,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winnow"
|
name = "winnow"
|
||||||
version = "0.6.22"
|
version = "0.6.24"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980"
|
checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
@ -10,4 +10,7 @@ tracing = { version = "0.1", features = ["log"] }
|
|||||||
tracing-subscriber = { version = "0.3.18" }
|
tracing-subscriber = { version = "0.3.18" }
|
||||||
clap = { version = "4", features = ["derive", "env"] }
|
clap = { version = "4", features = ["derive", "env"] }
|
||||||
dotenv = { version = "0.15" }
|
dotenv = { version = "0.15" }
|
||||||
axum = { version = "0.7" }
|
axum = { version = "0.8" }
|
||||||
|
|
||||||
|
[workspace.package]
|
||||||
|
version = "0.1.0"
|
||||||
|
26
README.md
26
README.md
@ -1 +1,27 @@
|
|||||||
# churn
|
# churn
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
To install churn, you need first of all a server and agents.
|
||||||
|
|
||||||
|
Servers can be run via. docker.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker run docker.io/kjuulh/churn-v2:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
To install an agent run the following script
|
||||||
|
|
||||||
|
```shell
|
||||||
|
curl https://git.front.kjuulh.io/kjuulh/churn-v2/raw/branch/main/install.sh | bash
|
||||||
|
```
|
||||||
|
|
||||||
|
configure `~/.local/share/io.kjuulh.churn-agent/churn-agent.toml` use an editor of choice. Churn agent will generate a randomish name for the specific agent, consider giving it something more semantically meaningful to you
|
||||||
|
|
||||||
|
## CLI (TBD)
|
||||||
|
|
||||||
|
Using the churn cli allows sending specific commands to a set of agents
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
10
cuddle.yaml
10
cuddle.yaml
@ -14,6 +14,16 @@ vars:
|
|||||||
- internal: "true"
|
- internal: "true"
|
||||||
- internal_grpc: "true"
|
- internal_grpc: "true"
|
||||||
|
|
||||||
|
please:
|
||||||
|
project:
|
||||||
|
owner: kjuulh
|
||||||
|
repository: churn-v2
|
||||||
|
branch: main
|
||||||
|
settings:
|
||||||
|
api_url: https://git.front.kjuulh.io
|
||||||
|
actions:
|
||||||
|
rust:
|
||||||
|
|
||||||
cuddle/clusters:
|
cuddle/clusters:
|
||||||
dev:
|
dev:
|
||||||
env:
|
env:
|
||||||
|
42
install.sh
42
install.sh
@ -8,15 +8,23 @@ APP_VERSION="latest" # or specify a version
|
|||||||
S3_BUCKET="rust-artifacts"
|
S3_BUCKET="rust-artifacts"
|
||||||
BINARY_NAME="churn"
|
BINARY_NAME="churn"
|
||||||
SERVICE_NAME="${APP_NAME}.service"
|
SERVICE_NAME="${APP_NAME}.service"
|
||||||
|
SERVICE_UPDATE_NAME="${APP_NAME}-update.service"
|
||||||
|
TIMER_UPDATE_NAME="${APP_NAME}-update.timer"
|
||||||
INSTALL_DIR="/usr/local/bin"
|
INSTALL_DIR="/usr/local/bin"
|
||||||
CONFIG_DIR="/etc/${APP_NAME}"
|
CONFIG_DIR="/etc/${APP_NAME}"
|
||||||
CHURN_DISCOVERY="https://churn.prod.kjuulh.app"
|
CHURN_DISCOVERY="https://churn.prod.kjuulh.app"
|
||||||
|
LOG="/var/log/churn-install.log"
|
||||||
|
|
||||||
# Colors for output
|
# Colors for output
|
||||||
RED='\033[0;31m'
|
RED='\033[0;31m'
|
||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
NC='\033[0m' # No Color
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
|
||||||
|
exec > >(tee -i ${LOG})
|
||||||
|
exec 2>&1
|
||||||
|
echo "Starting churn install $(date)"
|
||||||
|
|
||||||
# Check if running as root
|
# Check if running as root
|
||||||
if [ "$EUID" -ne 0 ]; then
|
if [ "$EUID" -ne 0 ]; then
|
||||||
echo -e "${RED}Please run as root${NC}"
|
echo -e "${RED}Please run as root${NC}"
|
||||||
@ -75,12 +83,46 @@ Environment=RUST_LOG=h2=warn,hyper=warn,churn=debug,warn
|
|||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
echo "Creating churn update service..."
|
||||||
|
cat > "/etc/systemd/system/${SERVICE_UPDATE_NAME}" <<EOF
|
||||||
|
[Unit]
|
||||||
|
Description=Daily Churn Update Service
|
||||||
|
After=network-online.target
|
||||||
|
Wants=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/bin/bash -c 'curl -s https://git.front.kjuulh.io/kjuulh/churn-v2/raw/branch/main/install.sh | bash'
|
||||||
|
User=root
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat > "/etc/systemd/system/${TIMER_UPDATE_NAME}" <<EOF
|
||||||
|
[Unit]
|
||||||
|
Description=Run Churn Update Daily
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=daily
|
||||||
|
Persistent=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
|
EOF
|
||||||
|
|
||||||
# Reload systemd and enable service
|
# Reload systemd and enable service
|
||||||
echo "Configuring systemd service..."
|
echo "Configuring systemd service..."
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
systemctl enable "${SERVICE_NAME}"
|
systemctl enable "${SERVICE_NAME}"
|
||||||
systemctl start "${SERVICE_NAME}"
|
systemctl start "${SERVICE_NAME}"
|
||||||
|
|
||||||
|
systemctl enable "${SERVICE_UPDATE_NAME}"
|
||||||
|
|
||||||
|
systemctl enable "${TIMER_UPDATE_NAME}"
|
||||||
|
systemctl start "${TIMER_UPDATE_NAME}"
|
||||||
|
|
||||||
# Check service status
|
# Check service status
|
||||||
if systemctl is-active --quiet "${SERVICE_NAME}"; then
|
if systemctl is-active --quiet "${SERVICE_NAME}"; then
|
||||||
echo -e "${GREEN}Installation successful! ${APP_NAME} is running.${NC}"
|
echo -e "${GREEN}Installation successful! ${APP_NAME} is running.${NC}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user