refactor(headless-client): remove "linux-client" alias (#4933)

Is this worth it?

```[tasklist]
### Before merging
- [x] Double-check docs and ask Jamil to review
- [x] Would need Brian to review the terraform thing
- [x] Make sure Docker compat isn't broken for existing users (shouldn't be, the image is still just `client`)
- [x] Decide whether compatibility tests need to pass (if something breaks after merge we can revert this)
```
This commit is contained in:
Reactor Scram
2024-05-10 10:43:02 -05:00
committed by GitHub
parent 390f9de811
commit 0ad72f00d1
12 changed files with 21 additions and 41 deletions

View File

@@ -158,7 +158,7 @@ jobs:
platform: linux/arm/v7
shortname: armv7
name:
- package: firezone-linux-client
- package: firezone-headless-client
artifact: firezone-client-headless-linux
image_name: client
- package: firezone-relay

8
rust/Cargo.lock generated
View File

@@ -1967,14 +1967,6 @@ dependencies = [
"url",
]
[[package]]
name = "firezone-linux-client"
version = "1.0.4"
dependencies = [
"anyhow",
"firezone-headless-client",
]
[[package]]
name = "firezone-relay"
version = "1.0.4"

View File

@@ -9,7 +9,6 @@ members = [
"gateway",
"firezone-cli-utils",
"headless-client",
"linux-client",
"snownet-tests",
"phoenix-channel",
"relay",

View File

@@ -3,7 +3,7 @@
This crate acts as the CLI / headless Client, and the privileged tunnel service for the GUI Client, for both Linux and Windows.
It is built as:
- `linux-client` to act as the Linux headless Client
- `headless-client` to act as the Linux / Windows headless Client
- `firezone-headless-client` to act as the Linux tunnel service, Windows headless Client, or Windows tunnel service
In general, the brand name should be part of the file name, but the OS name should not be.

View File

@@ -1,15 +0,0 @@
[package]
name = "firezone-linux-client"
# mark:automatic-version
version = "1.0.4"
edition = "2021"
authors = ["Firezone, Inc."]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = { version = "1.0" }
firezone-headless-client = { path = "../headless-client" }
[lints]
workspace = true

View File

@@ -1 +0,0 @@
This is a stub to fix a build issue in CI. Remove it once PR #4516 is merged into main.

View File

@@ -1,3 +0,0 @@
fn main() -> anyhow::Result<()> {
firezone_headless_client::run()
}

View File

@@ -17,7 +17,12 @@ docker network disconnect firezone_app firezone-client-1 # Disconnect the client
sleep 1
docker network connect firezone_app firezone-client-1 --ip 172.28.0.200 # Reconnect client with a different IP
sudo kill -s HUP "$(ps -C firezone-linux-client -o pid=)" # Send SIGHUP, triggering `reconnect` internally
# Send SIGHUP, triggering `reconnect` internally
# The second command is needed for backwards compatibility with older Docker images
sudo kill -s HUP "$(ps -C firezone-headless-client -o pid=)" ||
sudo kill -s HUP "$(ps -C firezone-linux-client -o pid=)" ||
exit 1
wait $DOWNLOAD_PID || {
echo "Download process failed"

View File

@@ -1,9 +1,10 @@
#!/usr/bin/env bash
# Test Linux DNS control using `systemd-resolved` directly inside the CI runner
# This needs Docker Compose so we can run httpbin.
source "./scripts/tests/lib.sh"
BINARY_NAME=firezone-linux-client
BINARY_NAME=firezone-headless-client
SERVICE_NAME=firezone-client-headless
debug_exit() {
@@ -15,7 +16,9 @@ debug_exit() {
}
# Copy the Linux Client out of its container
docker compose exec client cat firezone-linux-client > "$BINARY_NAME"
docker compose exec client cat "$BINARY_NAME" > "$BINARY_NAME" ||
docker compose exec client cat "firezone-linux-client" > "$BINARY_NAME" ||
exit 1
chmod u+x "$BINARY_NAME"
sudo chown root:root "$BINARY_NAME"
sudo mv "$BINARY_NAME" "/usr/bin/$BINARY_NAME"
@@ -40,7 +43,7 @@ curl --interface "$FZ_IFACE" $HTTPBIN/get && exit 1
echo "# Start Firezone"
resolvectl dns tun-firezone && exit 1
stat /usr/bin/firezone-linux-client
stat "/usr/bin/$BINARY_NAME"
sudo systemctl start "$SERVICE_NAME" || debug_exit
resolvectl dns tun-firezone
resolvectl query "$HTTPBIN" || debug_exit

View File

@@ -38,7 +38,7 @@ Environment="FIREZONE_API_URL=ws://localhost:8081"
Environment="FIREZONE_DNS_CONTROL=systemd-resolved"
Environment="RUST_LOG=info"
ExecStart=firezone-linux-client standalone
ExecStart=firezone-headless-client standalone
Type=notify
# Unfortunately we may need root to control DNS
User=root

View File

@@ -47,7 +47,7 @@ write_files:
Environment="RUST_LOG=${firezone_client_log_level}"
Environment="LOG_DIR=/var/log/firezone"
ExecStart=/usr/local/bin/firezone-linux-client standalone
ExecStart=/usr/local/bin/firezone-headless-client standalone
Type=notify
User=root
@@ -236,6 +236,6 @@ runcmd:
- 'sudo apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install google-cloud-ops-agent'
- sudo docker pull ${client_container_image}
- sudo docker create --name fz-client ${client_container_image}
- 'sudo docker cp fz-client:/bin/firezone-linux-client /usr/local/bin/firezone-linux-client'
- 'sudo docker cp fz-client:/bin/firezone-headless-client /usr/local/bin/firezone-headless-client'
- sudo docker rm -v fz-client
- sudo systemctl enable --now firezone.service

View File

@@ -35,7 +35,7 @@ Once you have a token, you can start the Linux Client using the following
command:
```
sudo FIREZONE_TOKEN=<TOKEN> ./linux-client-x64
sudo FIREZONE_TOKEN=<TOKEN> ./headless-client-x64
```
Set some environment variables to configure it:
@@ -46,7 +46,7 @@ export FIREZONE_ID="some unique identifier"
export FIREZONE_TOKEN=<TOKEN>
export DNS_CONTROL="systemd-resolved" # or "etc-resolv-conf"
export LOG_DIR="./"
sudo -E ./linux-client-x64
sudo -E ./headless-client-x64
```
See [below](#environment-variable-reference) for a full list of environment
@@ -55,9 +55,9 @@ variables.
A sample output of the help command is shown below:
```
> sudo ./linux-client-x64 -h
> sudo ./headless-client-x64 -h
Usage: linux-client-x64 [OPTIONS] [COMMAND]
Usage: headless-client [OPTIONS] [COMMAND]
Commands:
standalone Act as a CLI-only Client