Skip to content

Commit

Permalink
Merge pull request #21 from Grizzelbee/development
Browse files Browse the repository at this point in the history
fixed #20 : Add support for WireGuard inside a docker container
  • Loading branch information
Grizzelbee authored Apr 21, 2022
2 parents 27430cf + 37e8ae0 commit fe9af80
Show file tree
Hide file tree
Showing 18 changed files with 15,334 additions and 420 deletions.
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
gulpfile.js
admin/i18n
admin/i18n/*
admin/build
admin/build/*
admin/Sicherungs*
admin/sudoers_config.png
tasks
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,19 @@ Since WireGuard internally only uses the public keys to identify peers, but they
- User: The user which executes the script on the host (will be stored encrypted)
- Password: Password for this user (will be stored encrypted)
- sudo: whether the wg command should be executed using sudo or not (requires valid config of sudoers! -> see [security hints])
- Docker: Executes a `docker exec`command to reach a wireguard server inside a docker container. Please check if it fits your needs or whether you may switch to a supported container.
- poll interval: pause between each poll in seconds (will also delay the first run after adapter start)
* Translation page
- Public Key: The public key of one of your peers
- group name: A symbolic name for this peer

### executed command line depends on checkboxes:
* No checkbox checked: `wg show all dump` will be executed (for root-like users and use of the SetUID-Bit)
* Sudo checkbox is checked: `sudo wg show all dump` will be executed (works with proper sudoers line)
* Docker checkbox is checked: `docker exec -it wireguard /usr/bin/wg show all dump` will be executed
* Sudo and Docker checkboxes are checked: `sudo docker exec -it wireguard /usr/bin/wg show all dump` will be executed

> If you use WireGuard in a docker container, I assume you are familiar enough with both technologies and security concepts to configure your system to execute the shown commands in a way that doesn't ask for any password - since this is not supported.
## How it works
* info.connection of the adapter is used to indicate that at least one WireGuard interface is online and reported by `wg show all`. If no Wireguard interface is online - nothing is reported. In that case an error gets logged and the adapters' traffic light turns yellow.
Expand Down Expand Up @@ -74,6 +82,9 @@ Basically there are three ways to execute the command:
* none

## Changelog
### v1.2.0 (2022-04-21)
* (grizzelbee) New: Added support for WireGuard inside a docker container

### v1.1.3 (2022-03-31)
* (grizzelbee) New: Fixed sentry error [WIREGUARD-1](https://sentry.io/organizations/grizzelbee/issues/3027754005/events/?project=6215712)
* (grizzelbee) New: Fixed sentry error [WIREGUARD-H](https://sentry.io/organizations/grizzelbee/issues/3129951381/events/?project=6215712)
Expand Down
6 changes: 5 additions & 1 deletion admin/i18n/de/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"Installation_hint_2": "Der wg-Befehl muss sich in PATH befinden und der Benutzer benötigt Administratorrechte.",
"Installation_hint_3": "Tipp: Sicherheitshinweise zum ausführenden Benutzer und sudo entnehmen Sie bitte der ReadMe-Datei auf github.",
"Installation_hint_4": "Klicken Sie hier, um Sicherheitshinweise auf github zu lesen.",
"Installation_hint_5": "Aktivieren Sie das Docker-Kontrollkästchen, wenn Sie WireGuard in einem Docker-Container ausführen; ",
"Installation_hint_6": "Aktivieren Sie sudo, wenn Sie sudo benötigen, um den Befehl ohne Passwort auszuführen.",
"Main settings": "Haupteinstellungen",
"Name": "Name",
"Password": "Passwort",
Expand All @@ -17,5 +19,7 @@
"Public-Key translations": "Public-Key-Übersetzungen",
"Use sudo": "Verwenden Sie sudo",
"User": "Benutzer",
"donation": "Wenn Ihnen dieser Adapter gefällt und Sie erwägen, mich zu unterstützen:"
"docker": "Docker",
"donation": "Wenn Ihnen dieser Adapter gefällt und Sie erwägen, mich zu unterstützen:",
"sudo": "sudo"
}
8 changes: 6 additions & 2 deletions admin/i18n/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"Installation_hint_2": "wg command needs to be in PATH and user needs administrator privileges.",
"Installation_hint_3": "Tip: For security hints regarding the executing user and sudo please refer to the ReadMe file on github.",
"Installation_hint_4": "Click here to read the security hints on github.",
"Installation_hint_5": "Check docker checkbox if you are running WireGuard inside a docker container; ",
"Installation_hint_6": "activate sudo if you need sudo to execute the command without password.",
"Main settings": "Main settings",
"Name": "Name",
"Password": "Password",
Expand All @@ -15,7 +17,9 @@
"Poll interval": "Poll interval",
"Public key": "Public key",
"Public-Key translations": "Public-Key translations",
"Use sudo": "Use sudo",
"Use sudo": "sudo",
"User": "User",
"donation": "If you like this adapter and consider supporting me:"
"docker": "docker",
"donation": "If you like this adapter and consider supporting me:",
"sudo": "sudo"
}
6 changes: 5 additions & 1 deletion admin/i18n/es/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"Installation_hint_2": "El comando wg debe estar en PATH y el usuario necesita privilegios de administrador.",
"Installation_hint_3": "Sugerencia: para obtener sugerencias de seguridad sobre el usuario que ejecuta y sudo, consulte el archivo Léame en github.",
"Installation_hint_4": "Haga clic aquí para leer las sugerencias de seguridad en github.",
"Installation_hint_5": "Marque la casilla de verificación de la ventana acoplable si está ejecutando WireGuard dentro de un contenedor de la ventana acoplable; ",
"Installation_hint_6": "marque sudo si necesita sudo para ejecutar el comando sin contraseña.",
"Main settings": "Ajustes principales",
"Name": "Nombre",
"Password": "Clave",
Expand All @@ -17,5 +19,7 @@
"Public-Key translations": "Traducciones de clave pública",
"Use sudo": "Usa sudo",
"User": "Usuario",
"donation": "Si te gusta este adaptador y consideras apoyarme:"
"docker": "estibador",
"donation": "Si te gusta este adaptador y consideras apoyarme:",
"sudo": "sudo"
}
6 changes: 5 additions & 1 deletion admin/i18n/fr/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"Installation_hint_2": "La commande wg doit être dans PATH et l'utilisateur a besoin de privilèges d'administrateur.",
"Installation_hint_3": "Astuce : Pour des conseils de sécurité concernant l'utilisateur exécutant et sudo, veuillez vous référer au fichier Lisez-moi sur github.",
"Installation_hint_4": "Cliquez ici pour lire les conseils de sécurité sur github.",
"Installation_hint_5": "Cochez la case Docker si vous exécutez WireGuard dans un conteneur Docker ; ",
"Installation_hint_6": "vérifiez sudo si vous avez besoin de sudo pour exécuter la commande sans mot de passe.",
"Main settings": "Réglages principaux",
"Name": "Nom",
"Password": "Mot de passe",
Expand All @@ -17,5 +19,7 @@
"Public-Key translations": "Traductions de clé publique",
"Use sudo": "Utiliser sudo",
"User": "Utilisateur",
"donation": "Si vous aimez cet adaptateur et envisagez de me soutenir :"
"docker": "docker",
"donation": "Si vous aimez cet adaptateur et envisagez de me soutenir :",
"sudo": "sudo"
}
6 changes: 5 additions & 1 deletion admin/i18n/it/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"Installation_hint_2": "Il comando wg deve essere in PATH e l'utente necessita dei privilegi di amministratore.",
"Installation_hint_3": "Suggerimento: per suggerimenti sulla sicurezza relativi all'utente in esecuzione e sudo, fare riferimento al file Leggimi su github.",
"Installation_hint_4": "Fai clic qui per leggere i suggerimenti sulla sicurezza su github.",
"Installation_hint_5": "Seleziona la casella di controllo della finestra mobile se stai eseguendo WireGuard all'interno di un contenitore della finestra mobile; ",
"Installation_hint_6": "controlla sudo se hai bisogno di sudo per eseguire il comando senza password.",
"Main settings": "Impostazioni principali",
"Name": "Nome",
"Password": "Parola d'ordine",
Expand All @@ -17,5 +19,7 @@
"Public-Key translations": "Traduzioni a chiave pubblica",
"Use sudo": "Usa sudo",
"User": "Utente",
"donation": "Se ti piace questo adattatore e considera di supportarmi:"
"docker": "portuale",
"donation": "Se ti piace questo adattatore e considera di supportarmi:",
"sudo": "sudo"
}
6 changes: 5 additions & 1 deletion admin/i18n/nl/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"Installation_hint_2": "wg-opdracht moet in PATH staan ​​en de gebruiker heeft beheerdersrechten nodig.",
"Installation_hint_3": "Tip: Raadpleeg voor veiligheidstips met betrekking tot de uitvoerende gebruiker en sudo het ReadMe-bestand op github.",
"Installation_hint_4": "Klik hier om veiligheidstips voor github te lezen.",
"Installation_hint_5": "Schakel het selectievakje Docker in als u WireGuard in een docker-container gebruikt; ",
"Installation_hint_6": "vink sudo aan als je sudo nodig hebt om de opdracht zonder wachtwoord uit te voeren.",
"Main settings": "Belangrijkste instellingen",
"Name": "Naam",
"Password": "Wachtwoord",
Expand All @@ -17,5 +19,7 @@
"Public-Key translations": "Public-Key vertalingen",
"Use sudo": "Gebruik sudo",
"User": "Gebruiker",
"donation": "Als je deze adapter leuk vindt en overweegt mij te steunen:"
"docker": "havenarbeider",
"donation": "Als je deze adapter leuk vindt en overweegt mij te steunen:",
"sudo": "sudo"
}
6 changes: 5 additions & 1 deletion admin/i18n/pl/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"Installation_hint_2": "Komenda wg musi znajdować się w PATH, a użytkownik potrzebuje uprawnień administratora.",
"Installation_hint_3": "Wskazówka: Aby uzyskać wskazówki dotyczące bezpieczeństwa dotyczące wykonującego użytkownika i sudo, zapoznaj się z plikiem ReadMe na github.",
"Installation_hint_4": "Kliknij tutaj, aby przeczytać wskazówki dotyczące bezpieczeństwa na github.",
"Installation_hint_5": "Zaznacz pole wyboru docker, jeśli używasz WireGuard wewnątrz kontenera docker; ",
"Installation_hint_6": "sprawdź sudo, jeśli potrzebujesz sudo, aby wykonać polecenie bez hasła.",
"Main settings": "Ustawienia główne",
"Name": "Imię",
"Password": "Hasło",
Expand All @@ -17,5 +19,7 @@
"Public-Key translations": "Tłumaczenia klucza publicznego",
"Use sudo": "Użyj sudo",
"User": "Użytkownik",
"donation": "Jeśli podoba Ci się ten adapter i rozważ wsparcie mnie:"
"docker": "doker",
"donation": "Jeśli podoba Ci się ten adapter i rozważ wsparcie mnie:",
"sudo": "sudo"
}
6 changes: 5 additions & 1 deletion admin/i18n/pt/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"Installation_hint_2": "O comando wg precisa estar no PATH e o usuário precisa de privilégios de administrador.",
"Installation_hint_3": "Dica: Para dicas de segurança sobre o usuário em execução e o sudo, consulte o arquivo ReadMe no github.",
"Installation_hint_4": "Clique aqui para ler dicas de segurança no github.",
"Installation_hint_5": "Marque a caixa de seleção do docker se estiver executando o WireGuard dentro de um contêiner do docker; ",
"Installation_hint_6": "verifique sudo se precisar de sudo para executar o comando sem senha.",
"Main settings": "Configurações principais",
"Name": "Nome",
"Password": "Senha",
Expand All @@ -17,5 +19,7 @@
"Public-Key translations": "Traduções de chave pública",
"Use sudo": "Usar sudo",
"User": "Do utilizador",
"donation": "Se você gosta deste adaptador e considera me apoiar:"
"docker": "estivador",
"donation": "Se você gosta deste adaptador e considera me apoiar:",
"sudo": "sudo"
}
6 changes: 5 additions & 1 deletion admin/i18n/ru/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"Installation_hint_2": "Команда wg должна быть в PATH, а пользователю нужны права администратора.",
"Installation_hint_3": "Совет. Советы по безопасности относительно исполняющего пользователя и sudo см. в файле ReadMe на github.",
"Installation_hint_4": "Нажмите здесь, чтобы прочитать советы по безопасности на github.",
"Installation_hint_5": "Установите флажок Docker, если вы используете WireGuard внутри контейнера Docker; ",
"Installation_hint_6": "проверьте sudo, если вам нужно sudo для выполнения команды без пароля.",
"Main settings": "Основные настройки",
"Name": "Имя",
"Password": "Пароль",
Expand All @@ -17,5 +19,7 @@
"Public-Key translations": "Переводы с открытым ключом",
"Use sudo": "Используйте судо",
"User": "Пользователь",
"donation": "Если вам нравится этот адаптер и вы можете поддержать меня:"
"docker": "докер",
"donation": "Если вам нравится этот адаптер и вы можете поддержать меня:",
"sudo": "судо"
}
6 changes: 5 additions & 1 deletion admin/i18n/zh-cn/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"Installation_hint_2": "wg 命令需要在 PATH 中,并且用户需要管理员权限。",
"Installation_hint_3": "提示:有关执行用户和 sudo 的安全提示,请参阅 github 上的自述文件。",
"Installation_hint_4": "单击此处阅读 github 上的安全提示。",
"Installation_hint_5": "如果您在 docker 容器中运行 WireGuard,请选中 docker 复选框;",
"Installation_hint_6": "如果您需要 sudo 来执行没有密码的命令,请检查 sudo。",
"Main settings": "主要设置",
"Name": "姓名",
"Password": "密码",
Expand All @@ -17,5 +19,7 @@
"Public-Key translations": "公钥翻译",
"Use sudo": "使用须藤",
"User": "用户",
"donation": "如果你喜欢这个适配器并考虑支持我:"
"docker": "码头工人",
"donation": "如果你喜欢这个适配器并考虑支持我:",
"sudo": "须藤"
}
9 changes: 6 additions & 3 deletions admin/index_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@
<span class="translate">Installation_hint_2</span>
<span class="translate">Installation_hint_3</span>
<span><a href="https://github.com/Grizzelbee/ioBroker.wireguard#security-hints" class="translate">Installation_hint_4</a></span>
<span class="translate">Installation_hint_5</span>
<span class="translate">Installation_hint_6</span>
</div>
</div>
<div class="row">
Expand All @@ -156,11 +158,12 @@
<tr>
<th data-name="_index" style="width: 5%" class="translate"></th>
<th data-name="name" style="width: 15%" class="translate" for="name">Name</th>
<th data-name="hostaddress" style="width: 20%" class="translate" for="hostaddress">Host address</th>
<th data-name="hostaddress" style="width: 15%" class="translate" for="hostaddress">Host address</th>
<th data-name="user" style="width: 20%" class="translate encrypt" for="user">User</th>
<th data-name="password" style="width: 20%" class="translate encrypt" for="password" data-type="password">Password</th>
<th data-name="sudo" style="width: 5%" class="translate" for="sudo" data-type="checkbox">Use sudo</th>
<th data-name="pollInterval" style="width: 20%" class="translate" for="pollInterval">Poll interval</th>
<th data-name="sudo" style="width: 5%" class="translate" for="sudo" data-type="checkbox">sudo</th>
<th data-name="docker" style="width: 5%" class="translate" for="docker" data-type="checkbox">Docker</th>
<th data-name="pollInterval" style="width: 5%" class="translate" for="pollInterval">Poll interval</th>
<th data-buttons="delete up down" style="width: 5%"></th>
</tr>
</thead>
Expand Down
Loading

0 comments on commit fe9af80

Please sign in to comment.