Fixed reported version
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 6m6s
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 6m6s
This commit is contained in:
parent
61d57d6de1
commit
1a1fcf31fb
|
@ -17,6 +17,12 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set env
|
||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||
- name: Test
|
||||
run: |
|
||||
echo $RELEASE_VERSION
|
||||
echo ${{ env.RELEASE_VERSION }}
|
||||
|
||||
- name: Get Git commit timestamps
|
||||
run: echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
|
||||
|
|
|
@ -6,3 +6,7 @@ pub mod ldap;
|
|||
pub mod ssh;
|
||||
pub mod tunnel;
|
||||
pub mod web;
|
||||
|
||||
pub fn get_version() -> &'static str {
|
||||
std::option_env!("RELEASE_VERSION").unwrap_or(git_version::git_version!())
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ use tracing::{error, info, warn};
|
|||
use tracing_subscriber::EnvFilter;
|
||||
use tracing_subscriber::layer::SubscriberExt;
|
||||
use tracing_subscriber::util::SubscriberInitExt;
|
||||
use tunnel_rs::get_version;
|
||||
use tunnel_rs::ldap::Ldap;
|
||||
use tunnel_rs::ssh::Server;
|
||||
use tunnel_rs::tunnel::Registry;
|
||||
|
@ -29,6 +30,12 @@ async fn main() -> color_eyre::Result<()> {
|
|||
.with(env_filter)
|
||||
.init();
|
||||
|
||||
info!(
|
||||
"Starting {} ({})",
|
||||
std::env!("CARGO_PKG_NAME"),
|
||||
get_version()
|
||||
);
|
||||
|
||||
let key = if let Ok(path) = std::env::var("PRIVATE_KEY_FILE") {
|
||||
russh::keys::PrivateKey::read_openssh_file(Path::new(&path))
|
||||
.wrap_err_with(|| format!("failed to read ssh key: {path}"))?
|
||||
|
|
|
@ -2,7 +2,6 @@ use std::cmp::min;
|
|||
use std::iter::once;
|
||||
|
||||
use clap::Parser;
|
||||
use git_version::git_version;
|
||||
use ratatui::layout::Rect;
|
||||
use ratatui::prelude::CrosstermBackend;
|
||||
use ratatui::{Terminal, TerminalOptions, Viewport};
|
||||
|
@ -11,13 +10,14 @@ use russh::keys::ssh_key::PublicKey;
|
|||
use russh::server::{Auth, Msg, Session};
|
||||
use tracing::{debug, trace, warn};
|
||||
|
||||
use crate::get_version;
|
||||
use crate::io::{Input, TerminalHandle};
|
||||
use crate::ldap::{Ldap, LdapError};
|
||||
use crate::tunnel::{Registry, Tunnel, TunnelAccess};
|
||||
|
||||
/// Quickly create http tunnels for development
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(version = git_version!(), about, long_about = None)]
|
||||
#[command(version = get_version(), about, long_about = None)]
|
||||
pub struct Args {
|
||||
/// Make all tunnels public by default instead of private
|
||||
#[arg(long, group = "access")]
|
||||
|
|
|
@ -4,7 +4,6 @@ use std::iter::once;
|
|||
use std::time::Duration;
|
||||
|
||||
use futures::StreamExt;
|
||||
use git_version::git_version;
|
||||
use ratatui::layout::{Constraint, Flex, Layout, Position, Rect};
|
||||
use ratatui::prelude::CrosstermBackend;
|
||||
use ratatui::style::{Style, Stylize as _};
|
||||
|
@ -18,6 +17,7 @@ use tokio::sync::mpsc::{UnboundedReceiver, UnboundedSender, unbounded_channel};
|
|||
use tracing::error;
|
||||
use unicode_width::UnicodeWidthStr;
|
||||
|
||||
use crate::get_version;
|
||||
use crate::io::TerminalHandle;
|
||||
use crate::tunnel::{Tunnel, TunnelRow};
|
||||
|
||||
|
@ -165,7 +165,7 @@ impl RendererInner {
|
|||
}
|
||||
|
||||
fn render_title(&self, frame: &mut Frame, rect: Rect) {
|
||||
let title = format!("{} ({})", std::env!("CARGO_PKG_NAME"), git_version!()).bold();
|
||||
let title = format!("{} ({})", std::env!("CARGO_PKG_NAME"), get_version()).bold();
|
||||
let title = Line::from(title).centered();
|
||||
frame.render_widget(title, rect);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user