forked from ideal-world/spacegate
-
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.
Merge remote-tracking branch 'upstream/dev' into update/k8s
- Loading branch information
Showing
14 changed files
with
99 additions
and
56 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
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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
#![warn(clippy::indexing_slicing, clippy::unwrap_used, clippy::dbg_macro, clippy::undocumented_unsafe_blocks)] | ||
//! This crate is aim to manage the configuration of spacegate application with various backends. | ||
/// re-export spacegate_model | ||
pub mod model; | ||
/// Configuration backends and services traits | ||
pub mod service; | ||
|
||
pub use model::*; |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
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,34 @@ | ||
CONFIG_PATH=/etc/spacegate/config.json | ||
PLUGIN_PATH=/lib/spacegate/plugins | ||
BIN_PATH=/usr/local/bin | ||
cargo build --release --features dylib | ||
sudo cp target/release/spacegate $BIN_PATH | ||
|
||
# Create config file | ||
sudo mkdir /etc/spacegate | ||
|
||
if [ -f $CONFIG_PATH ]; then | ||
echo "Config file already exists" | ||
else | ||
sudo echo "{}" > /etc/spacegate/config.json | ||
sudo chmod 666 /etc/spacegate/config.json | ||
fi | ||
|
||
if [ -f $PLUGIN_PATH ]; then | ||
echo "Plugin dir already exists" | ||
else | ||
# Create plugin directory | ||
sudo mkdir $PLUGIN_PATH | ||
fi | ||
|
||
|
||
if [ -f /etc/systemd/system/spacegate.service ]; then | ||
echo "Systemd unit file already exists" | ||
else | ||
# Create systemd service | ||
sudo cp resource/install/spacegate.service /etc/systemd/system/spacegate.service | ||
fi | ||
|
||
# Enable and start service | ||
sudo systemctl enable spacegate | ||
sudo systemctl start spacegate |
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,13 @@ | ||
[Unit] | ||
Description=Spacegate | ||
|
||
[Service] | ||
PIDFile=/run/spacegate.pid | ||
ExecStart=spacegate | ||
Restart=always | ||
ExecStop=/bin/kill -INT $MAINPID | ||
KillSignal=SIGINT | ||
TimeoutStopSec=5 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |