Skip to content

Commit

Permalink
chore: add pingap service config
Browse files Browse the repository at this point in the history
  • Loading branch information
vicanso committed Nov 24, 2024
1 parent 5103c26 commit e008557
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: make test
- name: Run cargo msrv
run: |
cargo install cargo-msrv --version 0.16.2
cargo install cargo-msrv --version 0.17.0
cargo msrv list
- name: Run cargo cov
run: |
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ udeps:
cargo +nightly udeps

msrv:
cargo msrv verify
cargo msrv list


bloat:
Expand Down
4 changes: 2 additions & 2 deletions conf/pingap.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ name = "pingap"
# the error response's template (default <html>...</html>)
error_template = ""

# process id file (default /tmp/pingap.pid)
pid_file = "/tmp/pingap.pid"
# process id file (default /run/pingap.pid)
pid_file = "/run/pingap.pid"

# upgrade sock (default /tmp/pingap_upgrade.sock)
upgrade_sock = "/tmp/pingap_upgrade.sock"
Expand Down
17 changes: 17 additions & 0 deletions pingap.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Pingap server

[Unit]
Description=A high performance web server and a reverse proxy server
After=network.target nss-lookup.target

[Service]
Type=forking
PIDFile=/run/pingap.pid
ExecStartPre=/usr/sbin/pingap --conf=/etc/pingap/conf?separation -t'
ExecStart=/usr/sbin/pingap --conf=/etc/pingap/conf?separation -d --log=/var/pingap/logs --autorestart
#ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/pingap.pid
TimeoutStopSec=5
KillMode=mixed
[Install]
WantedBy=multi-user.target
4 changes: 2 additions & 2 deletions src/config/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ impl BasicConf {
if let Some(pid_file) = &self.pid_file {
pid_file.clone()
} else {
format!("/tmp/{}.pid", util::get_pkg_name())
format!("/run/{}.pid", util::get_pkg_name())
}
}
}
Expand Down Expand Up @@ -1454,7 +1454,7 @@ graceful_shutdown_timeout = "10s"
log_format_json = false
log_level = "info"
name = "pingap"
pid_file = "/tmp/pingap.pid"
pid_file = "/run/pingap.pid"
sentry = ""
threads = 1
upgrade_sock = "/tmp/pingap_upgrade.sock"
Expand Down
2 changes: 1 addition & 1 deletion src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ mod tests {
})
.await
.unwrap();
assert_eq!("CAAD3074", conf.hash().unwrap());
assert_eq!("A9384AEB", conf.hash().unwrap());
assert_eq!(false, support_observer());
assert_eq!(true, get_config_storage().is_some());
let dir = TempDir::new().unwrap();
Expand Down
2 changes: 1 addition & 1 deletion web/src/i18n/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export default {
cacheEviction: "支持缓存逐出",
cachePredictor: "支持缓存状态记录",
checkCacheControl: "校验Cache-Control响应头",
cacheHeaders: "响应头",
cacheHeaders: "缓存请求头",
cacheHeadersPlaceholder: "输入要添加至缓存key的请求头",
cachePurgeIpList: "允许缓存清除ip",
cachePurgeIpListPlaceholder: "输入允许执行缓存清除的ip",
Expand Down

0 comments on commit e008557

Please sign in to comment.