Compare commits
No commits in common. "8ca7aad3c3db4ffbb45b9ae3cb10e86d510d98fb" and "b4a4631a1d69bd981fdd1b319120a3f2d7daa728" have entirely different histories.
8ca7aad3c3
...
b4a4631a1d
5 changed files with 19 additions and 80 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -1127,7 +1127,6 @@ dependencies = [
|
|||
"test-log",
|
||||
"thiserror",
|
||||
"time",
|
||||
"tokio",
|
||||
"toml",
|
||||
"tracing",
|
||||
"tracing-error",
|
||||
|
|
|
@ -28,5 +28,4 @@ RUN apt-get update && \
|
|||
USER 1000
|
||||
COPY --from=builder /app/target/release/git-next /usr/local/bin
|
||||
|
||||
ENTRYPOINT [ "/usr/local/bin/git-next" ]
|
||||
CMD [ "server", "start" ]
|
||||
ENTRYPOINT [ "/usr/local/bin/git-next", "server", "start" ]
|
||||
|
|
|
@ -51,7 +51,6 @@ toml = { workspace = true }
|
|||
# Actors
|
||||
actix = { workspace = true }
|
||||
actix-rt = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
|
||||
# boilerplate
|
||||
bon = { workspace = true }
|
||||
|
|
|
@ -576,58 +576,6 @@ world = { repo = "user/world", branch = "master", main = "master", next = "upcom
|
|||
|
||||
The token is created [here](https://github.com/settings/tokens/new) and requires the `repo` and `admin:repo_hook` permissions.
|
||||
|
||||
## Docker
|
||||
|
||||
`git-next` is available as a [Docker image](https://git.kemitix.net/kemitix/-/packages/container/git-next/).
|
||||
|
||||
```shell
|
||||
docker pull docker pull git.kemitix.net/kemitix/git-next:latest
|
||||
```
|
||||
|
||||
### Docker Compose
|
||||
|
||||
Here is an example `docker-compose.yml`:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
server:
|
||||
image: git.kemitix.net/kemitix/git-next:latest
|
||||
container_name: git-next-server
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
RUST_LOG: "hyper=warn,info"
|
||||
ports:
|
||||
- 8080:8092
|
||||
volumes:
|
||||
- ./:/app/
|
||||
```
|
||||
|
||||
Note: this assumes the `git-next-server.toml` has a `listen.http.port` of
|
||||
`8092` and that you are using a reverse proxy to route traffic arriving at
|
||||
`listen.url` to port `8080`.
|
||||
|
||||
### Docker Run
|
||||
|
||||
This will run with the `server start` options:
|
||||
|
||||
```shell
|
||||
docker run -it -v .:/app/ git.kemitix.net/kemitix/git-next:latest
|
||||
```
|
||||
|
||||
To perform `server init`:
|
||||
|
||||
```shell
|
||||
docker run -it -v .:/app/ git.kemitix.net/kemitix/git-next:latest server init
|
||||
```
|
||||
|
||||
To perform repo `init`:
|
||||
|
||||
```shell
|
||||
docker run -it -v .:/app/ git.kemitix.net/kemitix/git-next:latest init
|
||||
```
|
||||
|
||||
TUI support is not available in the docker container. See [kemitix/git-next#154](https://git.kemitix.net/kemitix/git-next/issues/154).
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions to `git-next` are welcome! If you find a bug or have a feature
|
||||
|
|
|
@ -20,7 +20,7 @@ use git_next_core::git::RepositoryFactory;
|
|||
|
||||
use color_eyre::{eyre::Context, Result};
|
||||
use kxio::{fs::FileSystem, network::Network};
|
||||
use tracing::info;
|
||||
use tracing::{error, info};
|
||||
|
||||
use std::{
|
||||
path::PathBuf,
|
||||
|
@ -46,7 +46,6 @@ pub fn init(fs: &FileSystem) -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_lines)]
|
||||
pub fn start(
|
||||
ui: bool,
|
||||
fs: FileSystem,
|
||||
|
@ -98,6 +97,7 @@ pub fn start(
|
|||
use crate::server::actor::messages::SubscribeToUpdates;
|
||||
use crate::tui;
|
||||
|
||||
let (tx_shutdown, rx_shutdown) = channel::<String>();
|
||||
let tui_addr = tui::Tui::new(tx_shutdown.clone()).start();
|
||||
server.do_send(SubscribeToUpdates::new(tui_addr.clone().recipient()));
|
||||
server.do_send(ShutdownTrigger::new(tx_shutdown));
|
||||
|
@ -116,26 +116,18 @@ pub fn start(
|
|||
} else {
|
||||
server.do_send(ShutdownTrigger::new(tx_shutdown.clone()));
|
||||
server.do_send(FileUpdated);
|
||||
|
||||
info!("Server running - Press Ctrl-C to stop...");
|
||||
tokio::select! {
|
||||
_r = signal::ctrl_c() => {
|
||||
info!("Ctrl-C received, shutting down...");
|
||||
}
|
||||
_x = async move {
|
||||
loop{
|
||||
if let Ok(message) = rx_shutdown.try_recv() {
|
||||
let _ = shutdown_message_holder_exec
|
||||
.write()
|
||||
.map(|mut o| o.replace(message));
|
||||
break;
|
||||
}
|
||||
actix_rt::task::yield_now().await;
|
||||
}
|
||||
} => {
|
||||
info!("signaled shutdown");
|
||||
}
|
||||
};
|
||||
|
||||
actix_rt::spawn(async move {
|
||||
let _ = signal::ctrl_c().await;
|
||||
info!("Ctrl-C received, shutting down...");
|
||||
let _ = tx_shutdown.send(String::new());
|
||||
});
|
||||
if let Ok(message) = rx_shutdown.try_recv() {
|
||||
let _ = shutdown_message_holder_exec
|
||||
.write()
|
||||
.map(|mut o| o.replace(message));
|
||||
}
|
||||
}
|
||||
|
||||
// shutdown
|
||||
|
@ -155,10 +147,10 @@ pub fn start(
|
|||
#[cfg(feature = "tui")]
|
||||
if ui {
|
||||
ratatui::restore();
|
||||
eprintln!("Server: {err:?}");
|
||||
}
|
||||
if !err.is_empty() {
|
||||
return Err(color_eyre::eyre::eyre!(format!("{err}")));
|
||||
}
|
||||
error!(?err, "server");
|
||||
return Err(color_eyre::eyre::eyre!(format!("{err}")));
|
||||
}
|
||||
|
||||
// check for error from file watcher thread
|
||||
|
@ -167,7 +159,9 @@ pub fn start(
|
|||
#[cfg(feature = "tui")]
|
||||
if ui {
|
||||
ratatui::restore();
|
||||
eprintln!("File Watcher: {err:?}");
|
||||
}
|
||||
error!(?err, "file watcher");
|
||||
return Err(color_eyre::eyre::eyre!(format!("{err}")));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue