mirror of
https://github.com/YunoHost-Apps/pihole_ynh.git
synced 2024-09-03 20:05:58 +02:00
Merge pull request #61 from YunoHost-Apps/fix-linter
Fix linter warnings
This commit is contained in:
commit
3f0b4051d6
17 changed files with 363 additions and 172 deletions
119
README.md
119
README.md
|
@ -1,72 +1,113 @@
|
|||
<!--
|
||||
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
|
||||
It shall NOT be edited by hand.
|
||||
-->
|
||||
|
||||
# Pi-hole for YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/pihole)  
|
||||
[](https://install-app.yunohost.org/?app=pihole)
|
||||
[](https://install-app.yunohost.org/?app=pihole)
|
||||
|
||||
*[Lire ce readme en français.](./README_fr.md)*
|
||||
|
||||
> *This package allow you to install Pi-hole quickly and easily on a YunoHost server.
|
||||
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to learn how to install and enjoy it.*
|
||||
> *This package allows you to install Pi-hole quickly and simply on a YunoHost server.
|
||||
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
|
||||
|
||||
## Overview
|
||||
Network-wide ad blocking via your own Linux hardware
|
||||
|
||||
**Shipped version:** 3.3.1 or 5.3.1
|
||||
Network-wide ad blocking via your own DNS server
|
||||
|
||||
**Shipped version:** 5.3.1~ynh1
|
||||
|
||||
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||

|
||||
|
||||
## Demo
|
||||
|
||||
No demo available.
|
||||
## Disclaimers / important information
|
||||
|
||||
## Configuration
|
||||
|
||||
Use the admin panel of your Pi-hole to configure this app. You may also need to follow the [post-install guide](https://docs.pi-hole.net/main/post-install/) to setup Pi-hole either as a *DNS server* or a *DHCP server*.
|
||||
|
||||
## Documentation
|
||||
|
||||
* Official documentation: https://docs.pi-hole.net/
|
||||
* Pi-hole as a DHCP server: [dhcp.md](./dhcp.md)
|
||||
* YunoHost documentation: There is no other documentation. Feel free to contribute!
|
||||
|
||||
## YunoHost specific features
|
||||
|
||||
* Private access to the admin panel.
|
||||
|
||||
#### Multi-users support
|
||||
|
||||
#### Supported architectures
|
||||
|
||||
* x86-64b - [](https://ci-apps.yunohost.org/ci/apps/pihole/)
|
||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/pihole/)
|
||||
* Buster x86-64b - [](https://ci-buster.nohost.me/ci/apps/pihole/)
|
||||
|
||||
## Limitations
|
||||
|
||||
* Activate DHCP with Pi-hole needs manual configuration of your router.
|
||||
* Pi-Hole can't be updated beyond version 3.3.1, because higher versions use an integrated version of dnsmasq. This would require disabling the version of dnsmasq used by YunoHost.
|
||||
|
||||
## Additionnal informations
|
||||
|
||||
## Links
|
||||
Using Pi-hole as your DHCP server
|
||||
==================
|
||||
|
||||
* Report a bug: https://github.com/YunoHost-Apps/pihole_ynh/issues
|
||||
* Pi-hole website: https://pi-hole.net/
|
||||
* Pi-hole repository: https://github.com/pi-hole/pi-hole/
|
||||
* YunoHost website: https://yunohost.org/
|
||||
> **Be careful, you should considering that playing with your DHCP may break your network.
|
||||
In case your server is down, you will lose your dns resolution and ip address.
|
||||
So, you will lose any internet connection and even the connection to your router.**
|
||||
|
||||
---
|
||||
> **If you encounter this kind of problem, please see "How to restore my network" at the end of this document.**
|
||||
|
||||
Developers infos
|
||||
----------------
|
||||
### How to configure Pi-hole
|
||||
|
||||
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/pihole_ynh/tree/testing).
|
||||
There're two ways to configure Pi-hole to be used as your DHCP server.
|
||||
- Either you can choose to use it when you install the app.
|
||||
- Or you can activate the DHCP server afterwards in the "Settings" tab, "Pi-hole DHCP Server" part.
|
||||
In this second case, it can be better to set the ip of the server to a static address
|
||||
|
||||
To try the testing branch, please do the following:
|
||||
### How to configure my router
|
||||
|
||||
Your personal router or ISP's router has a DHCP server enabled by default.
|
||||
If you keep this DHCP, along with Pi-hole's one, you will have transparent conflicts between them.
|
||||
The first DHCP to respond will distribute its own ip and settings.
|
||||
So you have to turn off the DHCP of your router to let Pi-hole managed your network.
|
||||
|
||||
#### Why should I use only the DHCP of Pi-hole ?
|
||||
|
||||
By using the DHCP of Pi-hole, you allow Pi-hole to give at each of your client its dns configuration. This way every requests will be filtered by Pi-hole.
|
||||
|
||||
Another use case of using Pi-hole's DHCP is if you have hairpinning problems (You can't connect to your server because its IP is your public IP, and your router doesn't allow that).
|
||||
In this case, using Pi-hole's dns will allow you to connect to your server by its local address instead of its public one.
|
||||
|
||||
### How to restore my network
|
||||
|
||||
> Oh crap !
|
||||
Your Pi-hole server is down, and you don't have a DHCP anymore.
|
||||
Don't panic, We'll get through it. \o/
|
||||
|
||||
Use your favorite terminal on your desktop computer.
|
||||
And first, get your main interface (usually `eth0`).
|
||||
``` bash
|
||||
sudo ifconfig
|
||||
```
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --force --debug
|
||||
|
||||
Then, set your ip as a static ip.
|
||||
``` bash
|
||||
sudo ifconfig eth0 192.168.1.100
|
||||
```
|
||||
|
||||
Now, you can connect to your router and turn on its DHCP server to use it again.
|
||||
You can now reset your ip and get a dynamic address.
|
||||
``` bash
|
||||
sudo ifconfig eth0 0.0.0.0 && sudo dhclient eth0
|
||||
```
|
||||
|
||||
> Don't forget to turn off the DHCP of your router if your server is working again.
|
||||
## Documentation and resources
|
||||
|
||||
* Official app website: https://pi-hole.net/
|
||||
* Official admin documentation: https://docs.pi-hole.net
|
||||
* Upstream app code repository: https://github.com/pi-hole/pi-hole/
|
||||
* YunoHost documentation for this app: https://yunohost.org/app_pihole
|
||||
* Report a bug: https://github.com/YunoHost-Apps/pihole_ynh/issues
|
||||
|
||||
## Developer info
|
||||
|
||||
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/pihole_ynh/tree/testing).
|
||||
|
||||
To try the testing branch, please proceed like that.
|
||||
```
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug
|
||||
or
|
||||
sudo yunohost app upgrade pihole -u https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**More info regarding app packaging:** https://yunohost.org/packaging_apps
|
115
README_fr.md
115
README_fr.md
|
@ -1,73 +1,110 @@
|
|||
# Pi-hole pour YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/pihole)  
|
||||
[](https://install-app.yunohost.org/?app=pihole)
|
||||
[](https://install-app.yunohost.org/?app=pihole)
|
||||
|
||||
*[Read this readme in english.](./README.md)*
|
||||
*[Lire ce readme en français.](./README_fr.md)*
|
||||
|
||||
> *Ce package vous permet d'installer Pi-hole rapidement et simplement sur un serveur YunoHost.
|
||||
Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/#/install_fr) pour savoir comment l'installer et en profiter.*
|
||||
> *Ce package vous permet d'installer Pi-hole rapidement et simplement sur un serveur YunoHost.
|
||||
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
|
||||
|
||||
## Résumé
|
||||
Blocage des publicités sur l'ensemble du réseau via votre propre matériel Linux
|
||||
## Vue d'ensemble
|
||||
|
||||
Filtrage publicitaire via votre propre serveur DNS
|
||||
|
||||
**Version incluse :** 5.3.1~ynh1
|
||||
|
||||
**Version embarquée:** 3.3.1 ou 5.3.1
|
||||
|
||||
|
||||
## Captures d'écran
|
||||
|
||||

|
||||

|
||||
|
||||
## Démo
|
||||
|
||||
Aucune démo pour cette application.
|
||||
## Avertissements / informations importantes
|
||||
|
||||
## Configuration
|
||||
|
||||
Utiliser le panneau d'administration de votre Pi-hole pour configurer cette application. Vous devrez peut-être aussi suivre le [guide de post-installation] (https://docs.pi-hole.net/main/post-install/) pour configurer Pi-hole en tant que *serveur DNS* ou *serveur DHCP*.
|
||||
|
||||
## Documentation
|
||||
|
||||
* Documentation officielle: https://docs.pi-hole.net/
|
||||
* Pi-hole en tant que serveur DHCP: [dhcp.md](./dhcp.md)
|
||||
* Documentation YunoHost: Il n'y a pas d'autre documentation, n'hésitez pas à contribuer.
|
||||
|
||||
## Fonctionnalités spécifiques à YunoHost
|
||||
|
||||
* Accès privé au panneau d'administration.
|
||||
|
||||
#### Support multi-utilisateurs
|
||||
|
||||
#### Architectures supportées.
|
||||
|
||||
* x86-64b - [](https://ci-apps.yunohost.org/ci/apps/pihole/)
|
||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/pihole/)
|
||||
* Buster x86-64b - [](https://ci-buster.nohost.me/ci/apps/pihole/)
|
||||
|
||||
## Limitations
|
||||
|
||||
* Activer DHCP avec Pi-hole nécessite une configuration manuelle de votre routeur.
|
||||
* Pi-Hole ne peut pas être mis à jour au-delà de la version 3.3.1, car les versions supérieures utilisent une version intégrée de dnsmasq. Ce qui oblige a désactiver la version de dnsmasq utilisée par YunoHost.
|
||||
|
||||
## Informations additionnelles
|
||||
|
||||
## Liens
|
||||
Faire de Pi-hole votre serveur DHCP
|
||||
==================
|
||||
|
||||
* Reporter un bug: https://github.com/YunoHost-Apps/pihole_ynh/issues
|
||||
* Site de Pi-hole: https://pi-hole.net/
|
||||
* Dépôt de Pi-hole: https://github.com/pi-hole/pi-hole/
|
||||
* Site de YunoHost: https://yunohost.org/
|
||||
> **Attention, vous devez savoir que toucher à votre DHCP pourrait casser votre réseau.
|
||||
Dans le cas où votre serveur serait inaccessible, vous perdriez votre résolution dns et votre adresse IP.
|
||||
Ainsi, vous perdriez toute connexion à internet et même la connexion à votre routeur.**
|
||||
|
||||
---
|
||||
> **Si vous rencontrez ce genre de problèmes, merci de lire la section "Comment restaurer mon réseau" à la fin de ce document.**
|
||||
|
||||
Informations à l'intention des développeurs
|
||||
----------------
|
||||
### Comment configurer Pi-hole
|
||||
|
||||
Il y a 2 manière de configurer Pi-hole pour qu'il soit utilisé comme votre serveur DHCP.
|
||||
- Soit vous pouvez choisir de l'utiliser lorsque vous installez l'application.
|
||||
- Soit vous pouvez activer le serveur DHCP par la suite dans l'onglet "Settings", partie "Pi-hole DHCP Server".
|
||||
Dans ce second cas, il peut être préférable de forcer l'ip du serveur à une adresse statique.
|
||||
|
||||
### Comment configurer mon routeur
|
||||
|
||||
Votre routeur ou celui de votre FAI dispose d'un serveur DHCP activé par défaut.
|
||||
Si vous gardez ce DHCP, en même temps que celui de Pi-hole, vous allez avoir des conflits transparents entre eux.
|
||||
Le premier serveur DHCP à répondre va distribuer ses propres ip et paramètres.
|
||||
Donc vous devez éteindre le serveur DHCP de votre routeur et laisser Pi-hole gérer votre réseau.
|
||||
|
||||
#### Pourquoi je devrais utiliser le DHCP de Pi-hole ?
|
||||
|
||||
En utilisant le DHCP de Pi-hole, vous lui permettez de donner sa configuration dns à chacun de vos clients. De cette manière, chaque requête sera filtrée par Pi-hole.
|
||||
|
||||
Un autre cas d'usage du DHCP de Pi-hole est le cas où vous rencontrez des problèmes de hairpinning (Vous ne pouvez pas vous connecter à votre serveur parce que son ip est votre ip publique, et votre routeur n'autorise pas cela).
|
||||
Dans ce cas, utilisez le dns de Pi-hole va vous permettre de vous connecter à votre serveur par son adresse locale plutôt que son adresse publique.
|
||||
|
||||
### Comment restaurer mon réseau
|
||||
|
||||
> Oups !
|
||||
Votre serveur Pi-hole est tombé, et vous n'avez plus de DHCP.
|
||||
Ne paniquez pas, on va surmonter ça \o/
|
||||
|
||||
Utilisez votre terminal favori sur votre ordinateur de bureau.
|
||||
Et tout d'abord, récupérer votre interface réseau (Le plus souvent `eth0`).
|
||||
``` bash
|
||||
sudo ifconfig
|
||||
```
|
||||
|
||||
Ensuite, changer votre ip pour une ip statique.
|
||||
``` bash
|
||||
sudo ifconfig eth0 192.168.1.100
|
||||
```
|
||||
|
||||
Maintenant, vous pouvez vous connecter à votre routeur et rallumer son serveur DHCP pour l'utiliser à nouveau.
|
||||
Vous pouvez maintenant retirer votre ip statique et réobtenir une ip dynamique.
|
||||
``` bash
|
||||
sudo ifconfig eth0 0.0.0.0 && sudo dhclient eth0
|
||||
```
|
||||
|
||||
> N'oubliez pas d'éteindre le DHCP de votre routeur si votre serveur fonctionne à nouveau.
|
||||
|
||||
## Documentations et ressources
|
||||
|
||||
* Site officiel de l'app : https://pi-hole.net/
|
||||
* Documentation officielle de l'admin : https://docs.pi-hole.net
|
||||
* Dépôt de code officiel de l'app : https://github.com/pi-hole/pi-hole/
|
||||
* Documentation YunoHost pour cette app : https://yunohost.org/app_pihole
|
||||
* Signaler un bug : https://github.com/YunoHost-Apps/pihole_ynh/issues
|
||||
|
||||
## Informations pour les développeurs
|
||||
|
||||
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/pihole_ynh/tree/testing).
|
||||
|
||||
Pour tester la branche testing, merci de procéder ainsi.
|
||||
Pour essayer la branche testing, procédez comme suit.
|
||||
```
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --force --debug
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug
|
||||
ou
|
||||
sudo yunohost app upgrade pihole -u https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
|
|
@ -1,8 +1,8 @@
|
|||
;; Test version last version
|
||||
; Manifest
|
||||
domain="domain.tld" (DOMAIN)
|
||||
path="/path" (PATH)
|
||||
admin="john" (USER)
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
admin="john"
|
||||
query_logging=1
|
||||
enable_dhcp=0
|
||||
pihole_version="Last available"
|
||||
|
@ -26,15 +26,15 @@
|
|||
upgrade=1
|
||||
backup_restore=1
|
||||
multi_instance=0
|
||||
port_already_use=1 (4711)
|
||||
port_already_use=1
|
||||
change_url=1
|
||||
actions=1
|
||||
config_panel=1
|
||||
;; Test version 3
|
||||
; Manifest
|
||||
domain="domain.tld" (DOMAIN)
|
||||
path="/path" (PATH)
|
||||
admin="john" (USER)
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
admin="john"
|
||||
query_logging=1
|
||||
enable_dhcp=0
|
||||
pihole_version="Last 3.X"
|
||||
|
@ -45,8 +45,6 @@
|
|||
upgrade=1 from_commit=d79ec131b3038ff4695c3317b5d3ee4eda9c8932
|
||||
backup_restore=1
|
||||
actions=1
|
||||
;;; Levels
|
||||
Level 5=auto
|
||||
;;; Options
|
||||
Email=
|
||||
Notification=change
|
||||
|
|
|
@ -8,25 +8,25 @@ name = "PiHole configuration"
|
|||
name = "Overwriting config files"
|
||||
|
||||
[main.overwrite_files.overwrite_setupvars]
|
||||
ask = "Overwrite the config file setupVars.conf ?"
|
||||
ask = "Overwrite the config file setupVars.conf?"
|
||||
type = "boolean"
|
||||
default = true
|
||||
help = "If the file is overwritten, a backup will be created."
|
||||
|
||||
[main.overwrite_files.overwrite_ftl]
|
||||
ask = "Overwrite the config file pihole-FTL.conf ?"
|
||||
ask = "Overwrite the config file pihole-FTL.conf?"
|
||||
type = "boolean"
|
||||
default = true
|
||||
help = "If the file is overwritten, a backup will be created."
|
||||
|
||||
[main.overwrite_files.overwrite_nginx]
|
||||
ask = "Overwrite the nginx config file ?"
|
||||
ask = "Overwrite the nginx config file?"
|
||||
type = "boolean"
|
||||
default = true
|
||||
help = "If the file is overwritten, a backup will be created."
|
||||
|
||||
[main.overwrite_files.overwrite_phpfpm]
|
||||
ask = "Overwrite the php-fpm config file ?"
|
||||
ask = "Overwrite the php-fpm config file?"
|
||||
type = "boolean"
|
||||
default = true
|
||||
help = "If the file is overwritten, a backup will be created."
|
||||
|
@ -36,7 +36,7 @@ name = "PiHole configuration"
|
|||
name = "Global configuration"
|
||||
|
||||
[main.global_config.email_type]
|
||||
ask = "Send HTML email to admin ?"
|
||||
ask = "Send HTML email to admin?"
|
||||
type = "boolean"
|
||||
default = true
|
||||
help = "Allow app scripts to send HTML mails instead of plain text."
|
||||
|
@ -46,25 +46,25 @@ name = "PiHole configuration"
|
|||
name = "PHP-FPM configuration"
|
||||
|
||||
[main.php_fpm_config.footprint]
|
||||
ask = "Memory footprint of the service ?"
|
||||
ask = "Memory footprint of the service?"
|
||||
choices = ["low", "medium", "high", "specific"]
|
||||
default = "low"
|
||||
help = "low <= 20Mb per pool. medium between 20Mb and 40Mb per pool. high > 40Mb per pool.<br>Use specific to set a value with the following option."
|
||||
|
||||
[main.php_fpm_config.free_footprint]
|
||||
ask = "Memory footprint of the service ?"
|
||||
ask = "Memory footprint of the service?"
|
||||
type = "number"
|
||||
default = "0"
|
||||
help = "Free field to specify exactly the footprint in Mb if you don't want to use one of the three previous values."
|
||||
|
||||
[main.php_fpm_config.usage]
|
||||
ask = "Expected usage of the service ?"
|
||||
ask = "Expected usage of the service?"
|
||||
choices = ["low", "medium", "high"]
|
||||
default = "low"
|
||||
help = "low: Personal usage, behind the sso. No RAM footprint when not used, but the impact on the processor can be high if many users are using the service.<br>medium: Low usage, few people or/and publicly accessible. Low RAM footprint, medium processor footprint when used.<br>high: High usage, frequently visited website. High RAM footprint, but lower on processor usage and quickly responding."
|
||||
|
||||
[main.php_fpm_config.force_max_children]
|
||||
ask = "Force the value of pm.max_children ?"
|
||||
ask = "Force the value of pm.max_children?"
|
||||
type = "number"
|
||||
default = "0"
|
||||
help = "Do not change this value unless you're sure about what you're doing !<br>pm.max_children is automatically defined by this formula: $max_ram / 2 / $footprint<br>You can force that value, and ignore the formula by changing the value here.<br>To reset to the default value, set to 0."
|
||||
|
|
BIN
doc/.DS_Store
vendored
Normal file
BIN
doc/.DS_Store
vendored
Normal file
Binary file not shown.
64
doc/DISCLAIMER.md
Normal file
64
doc/DISCLAIMER.md
Normal file
|
@ -0,0 +1,64 @@
|
|||
## Configuration
|
||||
|
||||
Use the admin panel of your Pi-hole to configure this app. You may also need to follow the [post-install guide](https://docs.pi-hole.net/main/post-install/) to setup Pi-hole either as a *DNS server* or a *DHCP server*.
|
||||
|
||||
## Limitations
|
||||
|
||||
* Activate DHCP with Pi-hole needs manual configuration of your router.
|
||||
* Pi-Hole can't be updated beyond version 3.3.1, because higher versions use an integrated version of dnsmasq. This would require disabling the version of dnsmasq used by YunoHost.
|
||||
|
||||
|
||||
Using Pi-hole as your DHCP server
|
||||
==================
|
||||
|
||||
> **Be careful, you should considering that playing with your DHCP may break your network.
|
||||
In case your server is down, you will lose your dns resolution and ip address.
|
||||
So, you will lose any internet connection and even the connection to your router.**
|
||||
|
||||
> **If you encounter this kind of problem, please see "How to restore my network" at the end of this document.**
|
||||
|
||||
### How to configure Pi-hole
|
||||
|
||||
There're two ways to configure Pi-hole to be used as your DHCP server.
|
||||
- Either you can choose to use it when you install the app.
|
||||
- Or you can activate the DHCP server afterwards in the "Settings" tab, "Pi-hole DHCP Server" part.
|
||||
In this second case, it can be better to set the ip of the server to a static address
|
||||
|
||||
### How to configure my router
|
||||
|
||||
Your personal router or ISP's router has a DHCP server enabled by default.
|
||||
If you keep this DHCP, along with Pi-hole's one, you will have transparent conflicts between them.
|
||||
The first DHCP to respond will distribute its own ip and settings.
|
||||
So you have to turn off the DHCP of your router to let Pi-hole managed your network.
|
||||
|
||||
#### Why should I use only the DHCP of Pi-hole ?
|
||||
|
||||
By using the DHCP of Pi-hole, you allow Pi-hole to give at each of your client its dns configuration. This way every requests will be filtered by Pi-hole.
|
||||
|
||||
Another use case of using Pi-hole's DHCP is if you have hairpinning problems (You can't connect to your server because its IP is your public IP, and your router doesn't allow that).
|
||||
In this case, using Pi-hole's dns will allow you to connect to your server by its local address instead of its public one.
|
||||
|
||||
### How to restore my network
|
||||
|
||||
> Oh crap !
|
||||
Your Pi-hole server is down, and you don't have a DHCP anymore.
|
||||
Don't panic, We'll get through it. \o/
|
||||
|
||||
Use your favorite terminal on your desktop computer.
|
||||
And first, get your main interface (usually `eth0`).
|
||||
``` bash
|
||||
sudo ifconfig
|
||||
```
|
||||
|
||||
Then, set your ip as a static ip.
|
||||
``` bash
|
||||
sudo ifconfig eth0 192.168.1.100
|
||||
```
|
||||
|
||||
Now, you can connect to your router and turn on its DHCP server to use it again.
|
||||
You can now reset your ip and get a dynamic address.
|
||||
``` bash
|
||||
sudo ifconfig eth0 0.0.0.0 && sudo dhclient eth0
|
||||
```
|
||||
|
||||
> Don't forget to turn off the DHCP of your router if your server is working again.
|
64
doc/DISCLAIMER_fr.md
Normal file
64
doc/DISCLAIMER_fr.md
Normal file
|
@ -0,0 +1,64 @@
|
|||
## Configuration
|
||||
|
||||
Utiliser le panneau d'administration de votre Pi-hole pour configurer cette application. Vous devrez peut-être aussi suivre le [guide de post-installation] (https://docs.pi-hole.net/main/post-install/) pour configurer Pi-hole en tant que *serveur DNS* ou *serveur DHCP*.
|
||||
|
||||
## Limitations
|
||||
|
||||
* Activer DHCP avec Pi-hole nécessite une configuration manuelle de votre routeur.
|
||||
* Pi-Hole ne peut pas être mis à jour au-delà de la version 3.3.1, car les versions supérieures utilisent une version intégrée de dnsmasq. Ce qui oblige a désactiver la version de dnsmasq utilisée par YunoHost.
|
||||
|
||||
|
||||
Faire de Pi-hole votre serveur DHCP
|
||||
==================
|
||||
|
||||
> **Attention, vous devez savoir que toucher à votre DHCP pourrait casser votre réseau.
|
||||
Dans le cas où votre serveur serait inaccessible, vous perdriez votre résolution dns et votre adresse IP.
|
||||
Ainsi, vous perdriez toute connexion à internet et même la connexion à votre routeur.**
|
||||
|
||||
> **Si vous rencontrez ce genre de problèmes, merci de lire la section "Comment restaurer mon réseau" à la fin de ce document.**
|
||||
|
||||
### Comment configurer Pi-hole
|
||||
|
||||
Il y a 2 manière de configurer Pi-hole pour qu'il soit utilisé comme votre serveur DHCP.
|
||||
- Soit vous pouvez choisir de l'utiliser lorsque vous installez l'application.
|
||||
- Soit vous pouvez activer le serveur DHCP par la suite dans l'onglet "Settings", partie "Pi-hole DHCP Server".
|
||||
Dans ce second cas, il peut être préférable de forcer l'ip du serveur à une adresse statique.
|
||||
|
||||
### Comment configurer mon routeur
|
||||
|
||||
Votre routeur ou celui de votre FAI dispose d'un serveur DHCP activé par défaut.
|
||||
Si vous gardez ce DHCP, en même temps que celui de Pi-hole, vous allez avoir des conflits transparents entre eux.
|
||||
Le premier serveur DHCP à répondre va distribuer ses propres ip et paramètres.
|
||||
Donc vous devez éteindre le serveur DHCP de votre routeur et laisser Pi-hole gérer votre réseau.
|
||||
|
||||
#### Pourquoi je devrais utiliser le DHCP de Pi-hole ?
|
||||
|
||||
En utilisant le DHCP de Pi-hole, vous lui permettez de donner sa configuration dns à chacun de vos clients. De cette manière, chaque requête sera filtrée par Pi-hole.
|
||||
|
||||
Un autre cas d'usage du DHCP de Pi-hole est le cas où vous rencontrez des problèmes de hairpinning (Vous ne pouvez pas vous connecter à votre serveur parce que son ip est votre ip publique, et votre routeur n'autorise pas cela).
|
||||
Dans ce cas, utilisez le dns de Pi-hole va vous permettre de vous connecter à votre serveur par son adresse locale plutôt que son adresse publique.
|
||||
|
||||
### Comment restaurer mon réseau
|
||||
|
||||
> Oups !
|
||||
Votre serveur Pi-hole est tombé, et vous n'avez plus de DHCP.
|
||||
Ne paniquez pas, on va surmonter ça \o/
|
||||
|
||||
Utilisez votre terminal favori sur votre ordinateur de bureau.
|
||||
Et tout d'abord, récupérer votre interface réseau (Le plus souvent `eth0`).
|
||||
``` bash
|
||||
sudo ifconfig
|
||||
```
|
||||
|
||||
Ensuite, changer votre ip pour une ip statique.
|
||||
``` bash
|
||||
sudo ifconfig eth0 192.168.1.100
|
||||
```
|
||||
|
||||
Maintenant, vous pouvez vous connecter à votre routeur et rallumer son serveur DHCP pour l'utiliser à nouveau.
|
||||
Vous pouvez maintenant retirer votre ip statique et réobtenir une ip dynamique.
|
||||
``` bash
|
||||
sudo ifconfig eth0 0.0.0.0 && sudo dhclient eth0
|
||||
```
|
||||
|
||||
> N'oubliez pas d'éteindre le DHCP de votre routeur si votre serveur fonctionne à nouveau.
|
BIN
doc/screenshots/dashboard.png
Normal file
BIN
doc/screenshots/dashboard.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 263 KiB |
|
@ -3,11 +3,17 @@
|
|||
"id": "pihole",
|
||||
"packaging_format": 1,
|
||||
"description": {
|
||||
"en": "Network-wide ad blocking via your own DNS server.",
|
||||
"fr": "Filtrage publicitaire sur l'ensemble du réseau via votre propre serveur DNS."
|
||||
"en": "Network-wide ad blocking via your own DNS server",
|
||||
"fr": "Filtrage publicitaire via votre propre serveur DNS"
|
||||
},
|
||||
"version": "5.3.1~ynh1",
|
||||
"url": "https://pi-hole.net/",
|
||||
"upstream": {
|
||||
"license": "EUPL-1.2",
|
||||
"website": "https://pi-hole.net/",
|
||||
"admindoc": "https://docs.pi-hole.net",
|
||||
"code": "https://github.com/pi-hole/pi-hole/"
|
||||
},
|
||||
"license": "EUPL-1.2",
|
||||
"maintainer": {
|
||||
"name": "",
|
||||
|
@ -30,37 +36,25 @@
|
|||
{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"ask": {
|
||||
"en": "Choose a domain for the admin interface of Pi-hole",
|
||||
"fr": "Choisissez un domaine pour l'interface admin de Pi-hole"
|
||||
},
|
||||
"example": "domain.org"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"type": "path",
|
||||
"ask": {
|
||||
"en": "Choose a path for the admin interface of Pi-hole",
|
||||
"fr": "Choisissez un chemin pour l'interface admin de Pi-hole"
|
||||
},
|
||||
"example": "/pihole",
|
||||
"default": "/pihole"
|
||||
},
|
||||
{
|
||||
"name": "admin",
|
||||
"type": "user",
|
||||
"ask": {
|
||||
"en": "Choose the Pi-hole administrator (must be an existing YunoHost user)",
|
||||
"fr": "Administrateur de Pi-hole (doit être un utilisateur YunoHost existant)"
|
||||
},
|
||||
"example": "john"
|
||||
},
|
||||
{
|
||||
"name": "query_logging",
|
||||
"type": "boolean",
|
||||
"ask": {
|
||||
"en": "Do you want to log queries ?",
|
||||
"fr": "Voulez-vous enregistrer les requêtes dns ?"
|
||||
"en": "Do you want to log DNS queries?",
|
||||
"fr": "Voulez-vous enregistrer les requêtes DNS ?"
|
||||
},
|
||||
"help": {
|
||||
"en": "Keeping this option deactivate will render graphs on the admin page useless. But will respect the privacy of the other users.",
|
||||
|
@ -72,11 +66,11 @@
|
|||
"name": "enable_dhcp",
|
||||
"type": "boolean",
|
||||
"ask": {
|
||||
"en": "Do you want to set Pi-hole as your DHCP server ?",
|
||||
"fr": "Voulez-vous utiliser Pi-hole an tant que serveur DHCP ?"
|
||||
"en": "Do you want to set Pi-Hole as your DHCP server?",
|
||||
"fr": "Voulez-vous utiliser Pi-Hole an tant que serveur DHCP ?"
|
||||
},
|
||||
"help": {
|
||||
"en": "If you want to do that, <a href=https://github.com/YunoHost-Apps/pihole_ynh/blob/master/dhcp.md target=_blank>you really have to read this before</a> !",
|
||||
"en": "If you want to do that, <a href=https://github.com/YunoHost-Apps/pihole_ynh/blob/master/dhcp.md target=_blank>you really have to read this before</a>!",
|
||||
"fr": "Si vous voulez faire ça, <a href=https://github.com/YunoHost-Apps/pihole_ynh/blob/master/dhcp.md target=_blank>vous devez vraiment lire cela avant</a> !"
|
||||
},
|
||||
"default": false
|
||||
|
@ -85,12 +79,12 @@
|
|||
"name": "pihole_version",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Which version of Pi-Hole do you want to install ?",
|
||||
"en": "Which version of Pi-Hole do you want to install?",
|
||||
"fr": "Quelle version de Pi-Hole voulez-vous installer ?"
|
||||
},
|
||||
"help": {
|
||||
"en": "The last 3.X version is the last version available with the Debian version of dnsmasq.",
|
||||
"fr": "The last available version will replace the Debian version of dnsmasq by FTLDNS.<br>See the readme for more information."
|
||||
"en": "The last 3.X version is the last version available with the Debian version of dnsmasq. The last available version will replace the Debian version of dnsmasq by FTLDNS.<br>See the readme for more information.",
|
||||
"fr": "La dernière version 3.X est la dernière version disponible avec la version Debian de dnsmasq. La dernière version disponible remplacera la version Debian de dnsmasq par FTLDNS.<br>Voir le readme pour plus d'informations."
|
||||
},
|
||||
"choices": ["Last 3.X","Last available"],
|
||||
"default": "Last 3.X"
|
||||
|
|
|
@ -38,14 +38,14 @@ pihole_version="$(ynh_app_setting_get --app=$app --key=pihole_version)"
|
|||
#=================================================
|
||||
# ACTIVATE MAINTENANCE MODE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Activating maintenance mode..." --time --weight=1
|
||||
ynh_script_progression --message="Activating maintenance mode..." --weight=1
|
||||
|
||||
ynh_maintenance_mode_ON
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1
|
||||
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
|
||||
|
||||
# Create a dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app
|
||||
|
@ -53,7 +53,7 @@ ynh_system_user_create --username=$app
|
|||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Resetting source files..." --time --weight=1
|
||||
ynh_script_progression --message="Resetting source files..." --weight=1
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
pihole_local_repo="/etc/.pihole"
|
||||
|
@ -78,7 +78,7 @@ chown $app:www-data "$final_path"
|
|||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Resetting nginx web server configuration..." --time --weight=1
|
||||
ynh_script_progression --message="Resetting NGINX web server configuration..." --weight=1
|
||||
|
||||
# Create a dedicated nginx config
|
||||
yunohost app action run $app reset_default_nginx
|
||||
|
@ -86,7 +86,7 @@ yunohost app action run $app reset_default_nginx
|
|||
#=================================================
|
||||
# PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Resetting php-fpm configuration..." --time --weight=1
|
||||
ynh_script_progression --message="Resetting PHP-FPM configuration..." --weight=1
|
||||
|
||||
# Create a dedicated php-fpm config
|
||||
yunohost app action run $app reset_default_phpfpm
|
||||
|
@ -94,7 +94,7 @@ yunohost app action run $app reset_default_phpfpm
|
|||
#=================================================
|
||||
# RECREATE DIRECTORIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Recreating and populating directories..." --time --weight=1
|
||||
ynh_script_progression --message="Recreating and populating directories..." --weight=1
|
||||
|
||||
pihole_storage="/etc/pihole"
|
||||
mkdir -p "$pihole_storage"
|
||||
|
@ -241,14 +241,14 @@ ynh_systemd_action --action=restart --service_name=pihole-FTL
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..." --time --weight=1
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
# DEACTIVE MAINTENANCE MODE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Disabling maintenance mode..." --time --weight=1
|
||||
ynh_script_progression --message="Disabling maintenance mode..." --weight=1
|
||||
|
||||
ynh_maintenance_mode_OFF
|
||||
|
||||
|
@ -256,4 +256,4 @@ ynh_maintenance_mode_OFF
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Execution completed" --time --last
|
||||
ynh_script_progression --message="Execution completed" --last
|
||||
|
|
|
@ -72,7 +72,7 @@ then
|
|||
# Get the default file and overwrite the current config
|
||||
cp /etc/yunohost/apps/$app/conf/pihole-FTL.conf "$config_file"
|
||||
|
||||
ynh_script_progression --message="Restarting PiHole..." --weight=2
|
||||
ynh_script_progression --message="Restarting Pi-Hole..." --weight=2
|
||||
|
||||
# Restart pihole-FTL
|
||||
ynh_systemd_action --action=restart --service_name=pihole-FTL
|
||||
|
|
|
@ -19,7 +19,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..." --weight=2
|
||||
ynh_print_info --message="Loading installation settings..."
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -31,11 +31,13 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|||
fpm_config_dir=$(ynh_app_setting_get --app=$app --key=fpm_config_dir)
|
||||
|
||||
#=================================================
|
||||
# STANDARD BACKUP STEPS
|
||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||
#=================================================
|
||||
ynh_print_info --message="Declaring files to be backed up..."
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE MAIN APP DIRECTORIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the main app directory..." --weight=5
|
||||
|
||||
ynh_backup --src_path="$final_path"
|
||||
ynh_backup --src_path="/etc/.pihole"
|
||||
|
@ -45,14 +47,12 @@ ynh_backup --src_path="/opt/pihole"
|
|||
#=================================================
|
||||
# BACKUP NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up nginx web server configuration..."
|
||||
|
||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# BACKUP PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up php-fpm configuration..."
|
||||
|
||||
ynh_backup --src_path="$fpm_config_dir/php-fpm-$app.conf"
|
||||
ynh_backup --src_path="$fpm_config_dir/pool.d/$app.conf"
|
||||
|
@ -62,14 +62,12 @@ ynh_backup --src_path="$fpm_config_dir/pool.d/$app.conf"
|
|||
#=================================================
|
||||
# BACKUP CRON FILE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up cron file..."
|
||||
|
||||
ynh_backup --src_path="/etc/cron.d/pihole"
|
||||
|
||||
#=================================================
|
||||
# BACKUP SPECIFIC FILES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing specific files..."
|
||||
|
||||
ynh_backup --src_path="/usr/local/bin/pihole"
|
||||
ynh_backup --src_path="/etc/bash_completion.d/pihole"
|
||||
|
@ -96,4 +94,4 @@ ynh_backup --src_path="/usr/share/yunohost/hooks/conf_regen/50-dnsmasq_$app"
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last
|
||||
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
||||
|
|
|
@ -31,7 +31,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." --weight=11
|
||||
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=11
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
|
@ -75,7 +75,7 @@ fi
|
|||
#=================================================
|
||||
# MODIFY URL IN NGINX CONF
|
||||
#=================================================
|
||||
ynh_script_progression --message="Updating nginx web server configuration..." --weight=4
|
||||
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=4
|
||||
|
||||
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
||||
|
||||
|
@ -109,7 +109,7 @@ fi
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..."
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
|
|
@ -66,14 +66,16 @@ ynh_app_setting_set --app=$app --key=admin_mail_html --value=1
|
|||
#=================================================
|
||||
# FIND AND OPEN A PORT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring firewall..." --weight=12
|
||||
ynh_script_progression --message="Finding an available port..." --weight=12
|
||||
|
||||
# Find a free port
|
||||
port=$(ynh_find_port --port=4711)
|
||||
if [ $port -gt 4720 ]
|
||||
then
|
||||
ynh_die --message="The ports 4711 to 4720 are already in use. Pi-hole can't works on another port. Please try to free one of this ports."
|
||||
ynh_die --message="The ports 4711 to 4720 are already in use. Pi-hole can't work on another port. Please try to free one of these ports."
|
||||
fi
|
||||
|
||||
ynh_script_progression --message="Configuring firewall..." --weight=1
|
||||
# Open this port
|
||||
ynh_exec_fully_quiet yunohost firewall allow --no-upnp TCP $port
|
||||
ynh_app_setting_set --app=$app --key=port --value=$port
|
||||
|
@ -238,14 +240,14 @@ then
|
|||
# Version 3.3.1
|
||||
cp -a $pihole_local_repo/advanced/pihole-FTL.service /etc/init.d/pihole-FTL
|
||||
chmod +x /etc/init.d/pihole-FTL
|
||||
ynh_exec_warn_less systemctl enable pihole-FTL
|
||||
ynh_exec_warn_less systemctl enable pihole-FTL --quiet
|
||||
else
|
||||
# Last version available
|
||||
# Stopped dnsmasq to replace it by pihole-FTL
|
||||
ynh_systemd_action --action=stop --service_name=dnsmasq
|
||||
|
||||
# Disable the real dnsmasq service
|
||||
ynh_exec_warn_less systemctl disable dnsmasq
|
||||
ynh_exec_warn_less systemctl disable dnsmasq --quiet
|
||||
|
||||
# And move the files that make the service available in systemd to really disable it
|
||||
mv /lib/systemd/system/dnsmasq.service /lib/systemd/system/.dnsmasq.service.backup_by_pihole
|
||||
|
@ -260,7 +262,7 @@ else
|
|||
|
||||
cp -a $pihole_local_repo/advanced/Templates/pihole-FTL.service /etc/init.d/pihole-FTL
|
||||
chmod +x /etc/init.d/pihole-FTL
|
||||
ynh_exec_warn_less systemctl enable pihole-FTL
|
||||
ynh_exec_warn_less systemctl enable pihole-FTL --quiet
|
||||
|
||||
# Replace the service dnsmasq by pihole-FTL
|
||||
# That way, YunoHost can continue to use dnsmasq by actually using pihole-FTL
|
||||
|
@ -447,7 +449,7 @@ cp ../conf/dnsmasq_regenconf_hook /usr/share/yunohost/hooks/conf_regen/50-dnsmas
|
|||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
yunohost service add pihole-FTL --description "PiHole backend service" --log "/var/log/pihole-FTL.log"
|
||||
yunohost service add pihole-FTL --description="PiHole backend service" --log="/var/log/pihole-FTL.log"
|
||||
|
||||
#=================================================
|
||||
# RESTRAIN THE ACCESS TO THE ADMIN ONLY
|
||||
|
@ -459,7 +461,7 @@ ynh_permission_update --permission="main" --add="$admin" --remove="all_users"
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..." --weight=3
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=3
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ ynh_script_progression --message="Stop and remove the service"
|
|||
if [ "$pihole_version" == "Last 3.X" ]
|
||||
then
|
||||
ynh_systemd_action --action=stop --service_name=pihole-FTL
|
||||
ynh_exec_warn_less systemctl disable pihole-FTL
|
||||
ynh_exec_warn_less systemctl disable pihole-FTL --quiet
|
||||
else
|
||||
ynh_systemd_action --action=stop --service_name=pihole-FTL
|
||||
|
||||
|
@ -58,7 +58,7 @@ else
|
|||
mv /lib/systemd/system/.dnsmasq.service.backup_by_pihole /lib/systemd/system/dnsmasq.service
|
||||
mv /etc/init.d/.dnsmasq.backup_by_pihole /etc/init.d/dnsmasq
|
||||
|
||||
ynh_exec_warn_less systemctl enable dnsmasq
|
||||
ynh_exec_warn_less systemctl enable dnsmasq --quiet
|
||||
# Reload systemd config
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
|
@ -93,7 +93,7 @@ ynh_secure_remove --file="/etc/.pihole"
|
|||
#=================================================
|
||||
# REMOVE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing nginx web server configuration..."
|
||||
ynh_script_progression --message="Removing NGINX web server configuration..."
|
||||
|
||||
# Remove the dedicated nginx config
|
||||
ynh_remove_nginx_config
|
||||
|
@ -101,7 +101,7 @@ ynh_remove_nginx_config
|
|||
#=================================================
|
||||
# REMOVE PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing php-fpm configuration..." --weight=2
|
||||
ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=2
|
||||
|
||||
# Remove the dedicated php-fpm config
|
||||
ynh_remove_fpm_config
|
||||
|
@ -109,7 +109,7 @@ ynh_remove_fpm_config
|
|||
#=================================================
|
||||
# CLOSE PORTS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Closing port $port et 67..." --weight=13
|
||||
ynh_script_progression --message="Closing ports $port et 67..." --weight=13
|
||||
|
||||
if yunohost firewall list | grep -q "\- $port$"
|
||||
then
|
||||
|
|
|
@ -97,7 +97,7 @@ chown root: -R "/etc/pihole/logrotate"
|
|||
#=================================================
|
||||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reconfiguring php-fpm..." --weight=7
|
||||
ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=7
|
||||
|
||||
# Restore the file first, so it can have a backup if different
|
||||
ynh_restore_file --origin_path="$fpm_config_dir/php-fpm-$app.conf"
|
||||
|
@ -119,7 +119,7 @@ ynh_install_app_dependencies $app_depencencies
|
|||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
yunohost service add pihole-FTL --description "PiHole backend service" --log "/var/log/pihole-FTL.log"
|
||||
yunohost service add pihole-FTL --description="PiHole backend service" --log="/var/log/pihole-FTL.log"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE CRON FILE
|
||||
|
@ -162,7 +162,7 @@ then
|
|||
ynh_systemd_action --action=stop --service_name=dnsmasq
|
||||
|
||||
# Disable the real dnsmasq service
|
||||
ynh_exec_warn_less systemctl disable dnsmasq
|
||||
ynh_exec_warn_less systemctl disable dnsmasq --quiet
|
||||
|
||||
# And move the files that make the service available in systemd to really disable it
|
||||
mv /lib/systemd/system/dnsmasq.service /lib/systemd/system/.dnsmasq.service.backup_by_pihole
|
||||
|
@ -178,7 +178,7 @@ then
|
|||
pihole_local_repo="/etc/.pihole"
|
||||
cp -a $pihole_local_repo/advanced/Templates/pihole-FTL.service /etc/init.d/pihole-FTL
|
||||
chmod +x /etc/init.d/pihole-FTL
|
||||
ynh_exec_warn_less systemctl enable pihole-FTL
|
||||
ynh_exec_warn_less systemctl enable pihole-FTL --quiet
|
||||
|
||||
# Replace the service dnsmasq by pihole-FTL
|
||||
# That way, YunoHost can continue to use dnsmasq by actually using pihole-FTL
|
||||
|
@ -257,7 +257,7 @@ ynh_store_file_checksum --file="$setupVars"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Restarting PiHole-FTL..." --weight=2
|
||||
|
||||
ynh_exec_warn_less systemctl enable pihole-FTL
|
||||
ynh_exec_warn_less systemctl enable pihole-FTL --quiet
|
||||
ynh_systemd_action --action=restart --service_name=pihole-FTL
|
||||
|
||||
#=================================================
|
||||
|
@ -265,7 +265,7 @@ ynh_systemd_action --action=restart --service_name=pihole-FTL
|
|||
#=================================================
|
||||
# RELOAD NGINX AND PHP-FPM
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server and php-fpm..."
|
||||
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..."
|
||||
|
||||
ynh_systemd_action --service_name=$fpm_service --action=reload
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
@ -286,7 +286,7 @@ admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)
|
|||
|
||||
if [ $enable_dhcp -eq 1 ]
|
||||
then
|
||||
dhcp_alert="You asked to use the internal DHCP server of dnsmasq with PiHole.
|
||||
dhcp_alert="You asked to use the internal DHCP server of Dnsmasq with PiHole.
|
||||
You should really read the __URL_TAG1__documentation about that__URL_TAG2__https://github.com/YunoHost-Apps/pihole_ynh/blob/master/dhcp.md__URL_TAG3__
|
||||
|
||||
"
|
||||
|
|
|
@ -109,13 +109,6 @@ ynh_clean_setup () {
|
|||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# CHECK THE PATH
|
||||
#=================================================
|
||||
|
||||
# Normalize the URL path syntax
|
||||
path_url=$(ynh_normalize_url_path --path_url=$path_url)
|
||||
|
||||
#=================================================
|
||||
# ACTIVATE MAINTENANCE MODE
|
||||
#=================================================
|
||||
|
@ -171,7 +164,7 @@ chown $app:www-data "$final_path"
|
|||
# Overwrite the nginx configuration only if it's allowed
|
||||
if [ $overwrite_nginx -eq 1 ]
|
||||
then
|
||||
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2
|
||||
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
fi
|
||||
|
@ -183,7 +176,7 @@ fi
|
|||
# Overwrite the php-fpm configuration only if it's allowed
|
||||
if [ $overwrite_phpfpm -eq 1 ]
|
||||
then
|
||||
ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=3
|
||||
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3
|
||||
# Create a dedicated php-fpm config
|
||||
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --dedicated_service
|
||||
fi
|
||||
|
@ -284,14 +277,14 @@ then
|
|||
# Version 3.3.1
|
||||
cp -a $pihole_local_repo/advanced/pihole-FTL.service /etc/init.d/pihole-FTL
|
||||
chmod +x /etc/init.d/pihole-FTL
|
||||
ynh_exec_warn_less systemctl enable pihole-FTL
|
||||
ynh_exec_warn_less systemctl enable pihole-FTL --quiet
|
||||
else
|
||||
# Last version available
|
||||
# Stopped dnsmasq to replace it by pihole-FTL
|
||||
ynh_systemd_action --action=stop --service_name=dnsmasq
|
||||
|
||||
# Disable the real dnsmasq service
|
||||
ynh_exec_warn_less systemctl disable dnsmasq
|
||||
ynh_exec_warn_less systemctl disable dnsmasq --quiet
|
||||
|
||||
# And move the files that make the service available in systemd to really disable it
|
||||
if [ ! -e "/lib/systemd/system/.dnsmasq.service.backup_by_pihole" ]; then
|
||||
|
@ -312,7 +305,7 @@ else
|
|||
|
||||
cp -a $pihole_local_repo/advanced/Templates/pihole-FTL.service /etc/init.d/pihole-FTL
|
||||
chmod +x /etc/init.d/pihole-FTL
|
||||
ynh_exec_warn_less systemctl enable pihole-FTL
|
||||
ynh_exec_warn_less systemctl enable pihole-FTL --quiet
|
||||
|
||||
# Replace the service dnsmasq by pihole-FTL
|
||||
# That way, YunoHost can continue to use dnsmasq by actually using pihole-FTL
|
||||
|
@ -377,7 +370,7 @@ ynh_systemd_action --action=restart --service_name=pihole-FTL
|
|||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
yunohost service add pihole-FTL --description "PiHole backend service" --log "/var/log/pihole-FTL.log"
|
||||
yunohost service add pihole-FTL --description="PiHole backend service" --log="/var/log/pihole-FTL.log"
|
||||
|
||||
#=================================================
|
||||
# UPDATE CONF_REGEN HOOK
|
||||
|
@ -388,7 +381,7 @@ cp ../conf/dnsmasq_regenconf_hook /usr/share/yunohost/hooks/conf_regen/50-dnsmas
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..."
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
|
||||
ynh_systemd_action --action=reload --service_name=nginx
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue