HostControl is a terminal-based desktop application developed with Python and the Textual library. This tool is specifically designed to manage the /etc/hosts
file, providing an intuitive interface that allows users to add, edit, and remove groups of hosts easily and efficiently.
- Manage groups of hosts (add, edit, remove)
- View the synchronization status of each group
- User-friendly terminal-based interface
- Keyboard shortcuts for quick actions
The /etc/hosts
file can usually only be modified by the superuser (root), so it is necessary to grant access to the app to manage this file.
- Run as root: This allows the app to have the necessary permissions to modify the file.
- Change file permissions: Modify the permissions of
/etc/hosts
so your user account can read and write to the file. - Other alternatives: You can also use user groups, configure the
sudoers
file, or use Polkit to manage permissions more securely.
sudo chown {YOUR_USER}:{YOUR_USER} /etc/hosts
These are simple suggestions that may resolve the issue. However, you can apply a more secure and customized solution that better fits your environment, ensuring the integrity and security of the system.
To install and run the application using Docker, you can use the following command:
docker run --rm --name hostcontrol -it -v /etc/hosts:/opt/hosts -v /home/{your_user}/.host_control:/opt/host_control_db nunesfd/hostcontrol
Replace your_user with name of your user. For more details about the parameters used in this command, visit: https://hub.docker.com/r/nunesfd/hostcontrol
Before installing HostControl, ensure you have the following installed on your system:
- Python 3.8 or later
- Pip (Python package manager)
To install HostControl, first clone the GitHub repository:
git clone https://github.com/nunesfd/hostcontrol.git
cd hostcontrol
Creating a virtual environment will isolate the project's dependencies:
python3 -m venv .venv
source .venv/bin/activate
Install the required Python packages:
pip install -r requirements.txt
After installing the dependencies, you can run the app using:
python main.py
pip install textual-dev
make start-dev
make start-console
If you want to contribute to the project, feel free to fork the repository and create a pull request. All contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for more details.