Add: README.md en_ru

This commit is contained in:
Stepan Zhukovsky 2023-07-22 21:29:41 +09:00
parent 87f7a712e0
commit 92ccfaf440
3 changed files with 229 additions and 4 deletions

114
README-ru.md Normal file
View File

@ -0,0 +1,114 @@
# wg-bootstrap
```sh
█░█░█ █▀▀ ▄▄ █▀ ▀█▀ ▄▀█ █▀█ ▀█▀
▀▄▀▄▀ █▄█ ░░ ▄█ ░█░ █▀█ █▀▄ ░█░
```
# Утилита обертка для wg-quick
Предоставляет удобный интерфейс командной строки для быстрого создания
конфигурационного файла интерфейса WireGuard без необходимости вручную
редактировать его текстовым редактором. А так же можно использовать для
создания интерфейса и его удаления
## Возможности
- Автоматическая проверка прав пользователя на запуск команд
- Создание конфигурационного файла интерфейса в интерактивном режиме
- Изменение AllowedIPs на лету
- Добавление AllowedIPs к уже созданным
- Автоматическое размещение конфигурационного файла в /etc/wireguard
- Чтение информации в конфигурационном файле
- Инициализация разных конфигурационных файлов и их запуск по имени
- Удаление конфигурационного файла
- Включение и отключение интерфейса с теми же ключами что и wg-quick
## Установка и обновление
### Зависимости
- GNU/Linux
- python3, желательно ^3.8.1
- wireguard или wireguard-tools
- wget для загрузки исполняемого файла
### Установка
- Загрузите последнюю версию из ветки main в локальную директорию на пути $PATH
```sh
sudo wget https://git.isptech.ru/ISPsystem/QuickAccess/raw/branch/main/wg_bootstrap/wg_start.py -O /usr/local/bin/wg-start && sudo chmod 775 /usr/local/bin/wg-start
```
> Не используйте sudo если пользователь является владельцем локальной директории например ~/.local/bin
>
> При необходимости измените стандартный путь /usr/local/bin/wg-start в двух местах команды выше на тот который нужен именно вам.
>
> Команда выше добавит флаг исполнения к команде wg-start автоматически
### Обновление
- Выполните загрузку повторно
> Ссылка всегда ведет на последнюю стабильную версию.
>
> После тега 0.1.0 ветка main содержит только стабильный релиз
## Использование
### Справка
```sh
usage: wg-start [-h] [-v] {init,cat,rm,add,replace,up,down} interface [allowedIPs]
CRUD WireGuard config file or UP/DOWN wg-interface
positional arguments:
{init,cat,rm,add,replace,up,down}
Action with interface
interface WG interface name (wg0, wg1, wgName etc...)
allowedIPs Set AllowedIPs must be a string
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
```
### Примеры
- Инициализация конфигурационного файла нового интерфейса wg0:
```sh
wg-start init wg0
```
- Инициализация (включение) интерфейса wg0
```sh
wg-start up wg0
```
- Удаление (отключение) интерфейса wg0
```sh
wg-start up wg0
```
- Прочитать конфигурационный файл интерфейса wg0
```sh
wg-start cat wg0
```
- Удалить конфигурационный файл интерфейса wg0
```sh
wg-start rm wg0
```
- Заменить AllowedIPS на 0.0.0.0/24 в конфигурационном файле интерфейса wg0
```sh
wg-start replace wg0 0.0.0.0/24
```
- Добавить к AllowedIPS 172.10.10.0/24 в конфигурационном файле интерфейса wg0
```sh
wg-start add wg0 172.10.10.0/24
```
- Добавить к AllowedIPS несколько IP в конфигурационном файле интерфейса wg0
```sh
wg-start add wg0 "172.10.11.0/24, 10.10.10.1/24, 192.168.1.1"
```
> Имя интерфейса может быть любым wg0 это просто пример, можно дать интерфейсу осмысленное название
>
> Можно добавлять любое количество интерфейсов, если такой интерфейс уже присутствовал он будет перезаписан!
### Приятного использования, друг и спасибо что дочитал до конца
## License
GNU GPL 3.0

115
README.md
View File

@ -1,3 +1,114 @@
# wg-bootstrap
# wg bootstrap
Quick setup and connection to the client using WireGuard VPN
```sh
█░█░█ █▀▀ ▄▄ █▀ ▀█▀ ▄▀█ █▀█ ▀█▀
▀▄▀▄▀ █▄█ ░░ ▄█ ░█░ █▀█ █▀▄ ░█░
```
# Utility wrapper for wg-quick
Provides a convenient command line interface for quick creation
configuration file of the WireGuard interface without having to manually
edit it with a text editor. Also can be used for
interface creation and removal
## Features
- Automatic check of user permissions to run commands
- Create interface configuration file interactively
- Change AllowedIPs on the fly
- Adding AllowedIPs to already created ones
- Automatic placement of the configuration file in /etc/wireguard
- Reading information in the configuration file
- Initializing various configuration files and running them by name
- Delete configuration file
- Enable and disable the interface with the same keys as wg-quick
## Install and update
### Dependencies
- GNU/Linux
- python3, preferably ^3.8.1
- wireguard or wireguard-tools
- wget to download the executable
### Installation
- Download the latest version from the main branch to a local directory in $PATH
```sh
sudo wget https://git.isptech.ru/ISPsystem/QuickAccess/raw/branch/main/wg_bootstrap/wg_start.py -O /usr/local/bin/wg-start && sudo chmod 775 /usr/local/bin/wg-start
```
> Don't use sudo if the user owns a local directory like ~/.local/bin
>
> If necessary, change the standard path /usr/local/bin/wg-start in the two places in the command above to the one you need.
>
> The command above will add the execution flag to the wg-start command automatically
### Update
- Download again
> The link always leads to the latest stable version.
>
> After the 0.1.0 tag, the main branch only contains the stable release
## Usage
### Reference
```sh
usage: wg-start [-h] [-v] {init,cat,rm,add,replace,up,down} interface [allowedIPs]
CRUD WireGuard config file or UP/DOWN wg-interface
positional arguments:
{init,cat,rm,add,replace,up,down}
Action with interface
interface WG interface name (wg0, wg1, wgName etc...)
allowedIPs Set AllowedIPs must be a string
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
```
### Examples
- Initialization of the configuration file of the new wg0 interface:
```sh
wg-start init wg0
```
- Initialization (enabling) of wg0 interface
```sh
wg-start up wg0
```
- Removing (disabling) the wg0 interface
```sh
wg-start up wg0
```
- Read wg0 interface configuration file
```sh
wg-start cat wg0
```
- Delete wg0 interface configuration file
```sh
wg-start rm wg0
```
- Replace AllowedIPS with 0.0.0.0/24 in wg0 interface config file
```sh
wg-start replace wg0 0.0.0.0/24
```
- Add to AllowedIPS 172.10.10.0/24 in wg0 interface config file
```sh
wg-start add wg0 172.10.10.0/24
```
- Add multiple IPs to AllowedIPS in wg0 interface config file
```sh
wg-start add wg0 "172.10.11.0/24, 10.10.10.1/24, 192.168.1.1"
```
> Interface name can be anything wg0 this is just an example, you can give the interface a meaningful name
>
> You can add any number of interfaces, if such an interface was already present, it will be overwritten!
### Have fun friend and thanks for reading to the end
## License
GNU GPL 3.0

View File

@ -69,7 +69,7 @@ def get_wg_conf() -> dict:
@sudo_required
def gen_wg_conf(config_path, **settings):
"""
generates a config file for the wireguard interface,
generates a config file for the wireguard interface,
receiving a dict (**settings) with the desired values
Args:
@ -106,7 +106,7 @@ def exist_wg_conf(config_path):
@sudo_required
def change_allowed_ips(config_path, allowed_ips, action="replace"):
"""
the function changes the AllowedIPs value in
the function changes the AllowedIPs value in
the passed configuration file.
Args: