Metadata-Version: 2.4
Name: dnss-network-tools
Version: 0.1.0
Summary: Linux Wi-Fi hotspot sharing and network resilience command-line tools
Keywords: linux,network,wifi,hotspot,dns
Classifier: Environment :: Console
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.9
Description-Content-Type: text/markdown

switch to another network, change Wi-Fi/DNS/gateway settings, or launch the Python
or restoration of the router's internet service. On ChromeOS, Wi-Fi recovery and
# DNSS Network Tools

This Python package provides command-line tools for sharing an existing Linux
internet connection over Wi-Fi and checking or changing local network settings.
It does not create an internet connection when no upstream connection exists.

## Install

After the package has been published to PyPI, install it in a virtual
environment:

```sh
python3 -m venv .venv
source .venv/bin/activate
python -m pip install dnss-network-tools
```

## Share Ethernet With a Chromebook

You need a Linux computer with this package installed, Ethernet internet that
works, and a Wi-Fi adapter that supports hotspot mode. Run these steps on the
Linux computer itself, not in a Codespaces terminal.

1. Plug the Ethernet cable into the Linux computer and check that it can open
   a website.
2. Start the Wi-Fi hotspot:

   ```sh
   sudo "$(command -v dnss-hotspot)" start --ssid "Chromebook Internet"
   ```

3. Enter your Linux password if asked. NetworkManager then asks you to choose a
   password for the new Wi-Fi network. Remember it.
4. On the Chromebook, open the network menu, turn on Wi-Fi, and select
   **Chromebook Internet**.
5. Enter the Wi-Fi password and open a website to check the connection.

Stop the hotspot from the Linux computer when finished:

```sh
sudo "$(command -v dnss-hotspot)" stop
```

If the helper cannot find a suitable Wi-Fi adapter, the adapter may not support
hotspot mode. If Ethernet does not provide internet to the Linux computer, the
hotspot cannot provide internet to the Chromebook.

## Other Command

The package also installs `network-resilience` for network status, DNS, and
gateway diagnostics. For example:

```sh
network-resilience status
```

The PWA files in this repository are a separate offline status screen; they are
not part of the PyPI package and cannot create a hotspot.

## Build and Publish

From this project directory, build and check the package:

```sh
python3 -m pip install --upgrade build twine
python3 -m build
python3 -m twine check dist/*
```

Create a PyPI API token in your PyPI account. Then upload without putting the
token in your shell command or saving it in the project:

```sh
export TWINE_USERNAME=__token__
read -rsp "PyPI token: " TWINE_PASSWORD
printf '\n'
python3 -m twine upload dist/*
unset TWINE_USERNAME TWINE_PASSWORD
```

The name `dnss-network-tools` was available when checked, but PyPI names can be
claimed at any time. Uploading requires your own token; do not share it here or
commit it to the repository.

- A Linux computer with this project available on it
- An Ethernet cable and an internet connection that works on the Linux computer
- A Wi-Fi adapter in the Linux computer that supports hotspot mode

The Linux computer and Chromebook are separate devices. Run the commands below
on the Linux computer itself, not in a Codespaces terminal.

## Start the Hotspot

1. Plug the Ethernet cable into the Linux computer.
2. Check that the Linux computer can open a website over Ethernet.
3. Open a terminal in the project folder and run:

   ```sh
   sudo python3 linux_hotspot.py start --ssid "Chromebook Internet"
   ```

4. Enter your Linux password if asked. NetworkManager will then ask for a
   password for the new Wi-Fi network. Choose one and remember it.
5. On the Chromebook, open the network menu, turn on Wi-Fi, and select
   **Chromebook Internet**.
6. Enter the Wi-Fi password you chose. Open a website to check that the
   Chromebook has internet access.

## Stop the Hotspot

When you are finished, run this on the Linux computer:

```sh
sudo python3 linux_hotspot.py stop
```

## If It Does Not Work

- If the Linux computer cannot browse the internet over Ethernet, the hotspot
  cannot provide internet to the Chromebook.
- If the script reports that it cannot find a suitable Wi-Fi adapter, the
  adapter may not support hotspot mode. You may need another adapter.
- If you are using Codespaces, run the helper from the project on the physical
  Linux computer instead. Codespaces cannot control that computer's network
  hardware.
