Compare commits
No commits in common. "5cb2649eff61805439017e2d02dfe274259403e4" and "95149ffd9f2219bab24f7aa2bfd62ed6d173eea2" have entirely different histories.
5cb2649eff
...
95149ffd9f
42
CHANGELOG.md
42
CHANGELOG.md
@ -1,42 +0,0 @@
|
||||
# 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.1.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.1.9] - 2024-06-22
|
||||
|
||||
### Deprecated
|
||||
|
||||
The ability to run `l4p` without arguments is now deprecated. Please use
|
||||
`l4p serve` going forward.
|
||||
|
||||
### Added
|
||||
|
||||
* Added self update functionality. Just run `l4p update` to use it.
|
||||
* Now keeping a change log in the `CHANGELOG.md` file.
|
||||
|
||||
### Changed
|
||||
|
||||
* Updated build pipeline to generate much smaller binaries
|
||||
|
||||
-------
|
||||
|
||||
## Previous versions
|
||||
|
||||
[unreleased]: https://code.kiers.eu/jjkiers/layer4-proxy/compare/v0.1.9...HEAD
|
||||
[0.1.9]: https://code.kiers.eu/jjkiers/layer4-proxy/compare/v0.1.8...v0.1.9
|
||||
|
||||
|
||||
|
||||
Types of changes:
|
||||
|
||||
* `Added` for new features.
|
||||
* `Changed` for changes in existing functionality.
|
||||
* `Deprecated` for soon-to-be removed features.
|
||||
* `Removed` for now removed features.
|
||||
* `Fixed` for any bug fixes.
|
||||
* `Security` in case of vulnerabilities.
|
923
Cargo.lock
generated
923
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "l4p"
|
||||
version = "0.1.9"
|
||||
version = "0.1.8"
|
||||
edition = "2021"
|
||||
authors = ["Jacob Kiers <code@kiers.eu>"]
|
||||
license = "Apache-2.0"
|
||||
@ -25,9 +25,7 @@ byte_string = "1"
|
||||
bytes = "1.1"
|
||||
futures = "0.3"
|
||||
log = "0.4"
|
||||
pico-args = "0.5.0"
|
||||
pretty_env_logger = "0.5"
|
||||
self_update = { version = "0.40.0", features = ["rustls"] }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_yaml = "0.9.21"
|
||||
time = { version = "0.3.1", features = ["local-offset", "formatting"] }
|
||||
|
19
src/main.rs
19
src/main.rs
@ -1,33 +1,14 @@
|
||||
mod config;
|
||||
mod servers;
|
||||
mod update;
|
||||
mod upstreams;
|
||||
|
||||
use crate::config::ConfigV1;
|
||||
use crate::servers::Server;
|
||||
|
||||
use log::{debug, error, info};
|
||||
use pico_args::Arguments;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
let mut args = Arguments::from_env();
|
||||
|
||||
match args.subcommand().expect("Unexpected error").as_deref() {
|
||||
Some("serve") => serve(),
|
||||
Some("update") => update::update(),
|
||||
Some(cmd) => {
|
||||
eprintln!("Invalid command: {cmd}");
|
||||
std::process::exit(1);
|
||||
}
|
||||
None => {
|
||||
eprintln!("Calling l4p without argument is deprecated now. Please use: l4p serve");
|
||||
serve();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn serve() {
|
||||
let config_path = match find_config() {
|
||||
Ok(p) => p,
|
||||
Err(paths) => {
|
||||
|
@ -1,22 +0,0 @@
|
||||
use self_update::{cargo_crate_version, version};
|
||||
|
||||
pub(crate) fn update() {
|
||||
println!("Updating to the latest version...");
|
||||
|
||||
let backend = self_update::backends::gitea::Update::configure()
|
||||
.with_host("https://code.kiers.eu")
|
||||
.repo_owner("jjkiers")
|
||||
.repo_name("layer4-proxy")
|
||||
.bin_name("l4p")
|
||||
.show_download_progress(true)
|
||||
.current_version(cargo_crate_version!())
|
||||
.build()
|
||||
.expect("Should initialize correctly.");
|
||||
|
||||
let status = backend.update_extended();
|
||||
|
||||
match status {
|
||||
Err(e) => eprintln!("Error updating: {e}"),
|
||||
Ok(_) => (),
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user