├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── ALL_README.md ├── LICENSE ├── README.md ├── README_es.md ├── README_eu.md ├── README_fr.md ├── README_gl.md ├── README_id.md ├── README_it.md ├── README_nl.md ├── README_pl.md ├── README_ru.md ├── README_zh_Hans.md ├── conf ├── 02-pihole-dhcp.conf ├── adlists.default ├── dns-servers.conf ├── dnsmasq_regenconf_hook ├── extra_php-fpm.conf ├── nginx.conf ├── pihole-FTL.conf └── setupVars.conf ├── dhcp.md ├── doc ├── .gitkeep ├── ADMIN.md ├── ADMIN_fr.md ├── DESCRIPTION.md ├── DESCRIPTION_fr.md └── screenshots │ ├── .gitkeep │ └── dashboard.png ├── hooks ├── post_domain_add └── post_domain_remove ├── manifest.toml ├── scripts ├── _common.sh ├── backup ├── change_url ├── install ├── remove ├── restore └── upgrade └── tests.toml /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. 4 | 5 | --- 6 | 7 | **How to post a meaningful bug report** 8 | 1. *Read this whole template first.* 9 | 2. *Determine if you are on the right place:* 10 | - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* 11 | - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* 12 | - *When in doubt, post here and we will figure it out together.* 13 | 3. *Delete the italic comments as you write over them below, and remove this guide.* 14 | --- 15 | 16 | ### Describe the bug 17 | 18 | *A clear and concise description of what the bug is.* 19 | 20 | ### Context 21 | 22 | - Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* 23 | - YunoHost version: x.x.x 24 | - I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* 25 | - Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* 26 | - If yes, please explain: 27 | - Using, or trying to install package version/branch: 28 | - If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* 29 | 30 | ### Steps to reproduce 31 | 32 | - *If you performed a command from the CLI, the command itself is enough. For example:* 33 | ```sh 34 | sudo yunohost app install the_app 35 | ``` 36 | - *If you used the webadmin, please perform the equivalent command from the CLI first.* 37 | - *If the error occurs in your browser, explain what you did:* 38 | 1. *Go to '...'* 39 | 2. *Click on '...'* 40 | 3. *Scroll down to '...'* 41 | 4. *See error* 42 | 43 | ### Expected behavior 44 | 45 | *A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* 46 | 47 | ### Logs 48 | 49 | *When an operation fails, YunoHost provides a simple way to share the logs.* 50 | - *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* 51 | - *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* 52 | 53 | *After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* 54 | 55 | *If applicable and useful, add screenshots to help explain your problem.* 56 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Problem 2 | 3 | - *Description of why you made this PR* 4 | 5 | ## Solution 6 | 7 | - *And how do you fix that problem* 8 | 9 | ## PR Status 10 | 11 | - [ ] Code finished and ready to be reviewed/tested 12 | - [ ] The fix/enhancement were manually tested (if applicable) 13 | 14 | ## Automatic tests 15 | 16 | Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization) 17 | -------------------------------------------------------------------------------- /ALL_README.md: -------------------------------------------------------------------------------- 1 | # All available README files by language 2 | 3 | - [Read the README in English](README.md) 4 | - [Lea el README en español](README_es.md) 5 | - [Irakurri README euskaraz](README_eu.md) 6 | - [Lire le README en français](README_fr.md) 7 | - [Le o README en galego](README_gl.md) 8 | - [Baca README dalam bahasa bahasa Indonesia](README_id.md) 9 | - [Lees de README in het Nederlands](README_nl.md) 10 | - [Przeczytaj README w języku polski](README_pl.md) 11 | - [Прочитать README на русский](README_ru.md) 12 | - [阅读中文(简体)的 README](README_zh_Hans.md) 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Pi-hole for YunoHost 7 | 8 | [![Integration level](https://apps.yunohost.org/badge/integration/pihole)](https://ci-apps.yunohost.org/ci/apps/pihole/) 9 | ![Working status](https://apps.yunohost.org/badge/state/pihole) 10 | ![Maintenance status](https://apps.yunohost.org/badge/maintained/pihole) 11 | 12 | [![Install Pi-hole with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pihole) 13 | 14 | *[Read this README in other languages.](./ALL_README.md)* 15 | 16 | > *This package allows you to install Pi-hole quickly and simply on a YunoHost server.* 17 | > *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* 18 | 19 | ## Overview 20 | 21 | The Pi-hole® is a DNS sinkhole that protects your devices from unwanted content without installing any client-side software. 22 | 23 | **Shipped version:** 5.18.4~ynh1 24 | 25 | ## Screenshots 26 | 27 | ![Screenshot of Pi-hole](./doc/screenshots/dashboard.png) 28 | 29 | ## :red_circle: Antifeatures 30 | 31 | - **Package not maintained**: This YunoHost package is not actively maintained and needs adoption. This means that minimal maintenance is made by volunteers who don't use the app, so you should expect the app to lose reliability over time. You can [learn how to package](https://yunohost.org/packaging_apps_intro) if you'd like to adopt it. 32 | 33 | ## Documentation and resources 34 | 35 | - Official app website: 36 | - Official admin documentation: 37 | - Upstream app code repository: 38 | - YunoHost Store: 39 | - Report a bug: 40 | 41 | ## Developer info 42 | 43 | Please send your pull request to the [`testing` branch](https://github.com/YunoHost-Apps/pihole_ynh/tree/testing). 44 | 45 | To try the `testing` branch, please proceed like that: 46 | 47 | ```bash 48 | sudo yunohost app install https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 49 | or 50 | sudo yunohost app upgrade pihole -u https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 51 | ``` 52 | 53 | **More info regarding app packaging:** 54 | -------------------------------------------------------------------------------- /README_es.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Pi-hole para Yunohost 7 | 8 | [![Nivel de integración](https://apps.yunohost.org/badge/integration/pihole)](https://ci-apps.yunohost.org/ci/apps/pihole/) 9 | ![Estado funcional](https://apps.yunohost.org/badge/state/pihole) 10 | ![Estado En Mantención](https://apps.yunohost.org/badge/maintained/pihole) 11 | 12 | [![Instalar Pi-hole con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pihole) 13 | 14 | *[Leer este README en otros idiomas.](./ALL_README.md)* 15 | 16 | > *Este paquete le permite instalarPi-hole rapidamente y simplement en un servidor YunoHost.* 17 | > *Si no tiene YunoHost, visita [the guide](https://yunohost.org/install) para aprender como instalarla.* 18 | 19 | ## Descripción general 20 | 21 | The Pi-hole® is a DNS sinkhole that protects your devices from unwanted content without installing any client-side software. 22 | 23 | **Versión actual:** 5.18.4~ynh1 24 | 25 | ## Capturas 26 | 27 | ![Captura de Pi-hole](./doc/screenshots/dashboard.png) 28 | 29 | ## :red_circle: Características no deseables 30 | 31 | - **Package not maintained**: This YunoHost package is not actively maintained and needs adoption. This means that minimal maintenance is made by volunteers who don't use the app, so you should expect the app to lose reliability over time. You can [learn how to package](https://yunohost.org/packaging_apps_intro) if you'd like to adopt it. 32 | 33 | ## Documentaciones y recursos 34 | 35 | - Sitio web oficial: 36 | - Documentación administrador oficial: 37 | - Repositorio del código fuente oficial de la aplicación : 38 | - Catálogo YunoHost: 39 | - Reportar un error: 40 | 41 | ## Información para desarrolladores 42 | 43 | Por favor enviar sus correcciones a la [rama `testing`](https://github.com/YunoHost-Apps/pihole_ynh/tree/testing). 44 | 45 | Para probar la rama `testing`, sigue asÍ: 46 | 47 | ```bash 48 | sudo yunohost app install https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 49 | o 50 | sudo yunohost app upgrade pihole -u https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 51 | ``` 52 | 53 | **Mas informaciones sobre el empaquetado de aplicaciones:** 54 | -------------------------------------------------------------------------------- /README_eu.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Pi-hole YunoHost-erako 7 | 8 | [![Integrazio maila](https://apps.yunohost.org/badge/integration/pihole)](https://ci-apps.yunohost.org/ci/apps/pihole/) 9 | ![Funtzionamendu egoera](https://apps.yunohost.org/badge/state/pihole) 10 | ![Mantentze egoera](https://apps.yunohost.org/badge/maintained/pihole) 11 | 12 | [![Instalatu Pi-hole YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pihole) 13 | 14 | *[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)* 15 | 16 | > *Pakete honek Pi-hole YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.* 17 | > *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.* 18 | 19 | ## Aurreikuspena 20 | 21 | The Pi-hole® is a DNS sinkhole that protects your devices from unwanted content without installing any client-side software. 22 | 23 | **Paketatutako bertsioa:** 5.18.4~ynh1 24 | 25 | ## Pantaila-argazkiak 26 | 27 | ![Pi-hole(r)en pantaila-argazkia](./doc/screenshots/dashboard.png) 28 | 29 | ## :red_circle: Ezaugarri zalantzagarriak 30 | 31 | - **Mantendu gabeko paketea**: YunoHost pakete honek ez du mantenduko duenik, bere gain hartuko duen norbaiten beharra dauka. Honek esan nahi duena da mantentze-lanak minimoak izango direla eta aplikazioa erabiltzen ez duten boluntarioek egingo dituztela lanok; denborak aurrera egin ahala fidagarri izateari utziko dio. [Aplikazioak nola paketatu](https://yunohost.org/packaging_apps_intro) ikas dezakezu, zure gain hartu nahi baduzu. 32 | 33 | ## Dokumentazioa eta baliabideak 34 | 35 | - Aplikazioaren webgune ofiziala: 36 | - Administratzaileen dokumentazio ofiziala: 37 | - Jatorrizko aplikazioaren kode-gordailua: 38 | - YunoHost Denda: 39 | - Eman errore baten berri: 40 | 41 | ## Garatzaileentzako informazioa 42 | 43 | Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/pihole_ynh/tree/testing). 44 | 45 | `testing` abarra probatzeko, ondorengoa egin: 46 | 47 | ```bash 48 | sudo yunohost app install https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 49 | edo 50 | sudo yunohost app upgrade pihole -u https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 51 | ``` 52 | 53 | **Informazio gehiago aplikazioaren paketatzeari buruz:** 54 | -------------------------------------------------------------------------------- /README_fr.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Pi-hole pour YunoHost 7 | 8 | [![Niveau d’intégration](https://apps.yunohost.org/badge/integration/pihole)](https://ci-apps.yunohost.org/ci/apps/pihole/) 9 | ![Statut du fonctionnement](https://apps.yunohost.org/badge/state/pihole) 10 | ![Statut de maintenance](https://apps.yunohost.org/badge/maintained/pihole) 11 | 12 | [![Installer Pi-hole avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pihole) 13 | 14 | *[Lire le README dans d'autres langues.](./ALL_README.md)* 15 | 16 | > *Ce package vous permet d’installer Pi-hole rapidement et simplement sur un serveur YunoHost.* 17 | > *Si vous n’avez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment l’installer et en profiter.* 18 | 19 | ## Vue d’ensemble 20 | 21 | Pi-hole® est un puits DNS qui protège vos appareils des contenus indésirables sans installer de logiciel côté client. 22 | 23 | 24 | **Version incluse :** 5.18.4~ynh1 25 | 26 | ## Captures d’écran 27 | 28 | ![Capture d’écran de Pi-hole](./doc/screenshots/dashboard.png) 29 | 30 | ## :red_circle: Anti-fonctionnalités 31 | 32 | - **Package non maintenu **: Ce package YunoHost n'est pas activement maintenu et a besoin d'être adopté. Cela veut dire que la maintenance minimale est réalisée par des bénévoles qui n'utilisent pas l'application, il faut donc s'attendre à ce que l'app perde en fiabilité avec le temps. Vous pouvez [apprendre comment packager](https://yunohost.org/packaging_apps_intro) si vous voulez l'adopter. 33 | 34 | ## Documentations et ressources 35 | 36 | - Site officiel de l’app : 37 | - Documentation officielle de l’admin : 38 | - Dépôt de code officiel de l’app : 39 | - YunoHost Store : 40 | - Signaler un bug : 41 | 42 | ## Informations pour les développeurs 43 | 44 | Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/pihole_ynh/tree/testing). 45 | 46 | Pour essayer la branche `testing`, procédez comme suit : 47 | 48 | ```bash 49 | sudo yunohost app install https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 50 | ou 51 | sudo yunohost app upgrade pihole -u https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 52 | ``` 53 | 54 | **Plus d’infos sur le packaging d’applications :** 55 | -------------------------------------------------------------------------------- /README_gl.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Pi-hole para YunoHost 7 | 8 | [![Nivel de integración](https://apps.yunohost.org/badge/integration/pihole)](https://ci-apps.yunohost.org/ci/apps/pihole/) 9 | ![Estado de funcionamento](https://apps.yunohost.org/badge/state/pihole) 10 | ![Estado de mantemento](https://apps.yunohost.org/badge/maintained/pihole) 11 | 12 | [![Instalar Pi-hole con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pihole) 13 | 14 | *[Le este README en outros idiomas.](./ALL_README.md)* 15 | 16 | > *Este paquete permíteche instalar Pi-hole de xeito rápido e doado nun servidor YunoHost.* 17 | > *Se non usas YunoHost, le a [documentación](https://yunohost.org/install) para saber como instalalo.* 18 | 19 | ## Vista xeral 20 | 21 | The Pi-hole® is a DNS sinkhole that protects your devices from unwanted content without installing any client-side software. 22 | 23 | **Versión proporcionada:** 5.18.4~ynh1 24 | 25 | ## Capturas de pantalla 26 | 27 | ![Captura de pantalla de Pi-hole](./doc/screenshots/dashboard.png) 28 | 29 | ## :red_circle: Debes considerar 30 | 31 | - **Package not maintained**: This YunoHost package is not actively maintained and needs adoption. This means that minimal maintenance is made by volunteers who don't use the app, so you should expect the app to lose reliability over time. You can [learn how to package](https://yunohost.org/packaging_apps_intro) if you'd like to adopt it. 32 | 33 | ## Documentación e recursos 34 | 35 | - Web oficial da app: 36 | - Documentación oficial para admin: 37 | - Repositorio de orixe do código: 38 | - Tenda YunoHost: 39 | - Informar dun problema: 40 | 41 | ## Info de desenvolvemento 42 | 43 | Envía a túa colaboración á [rama `testing`](https://github.com/YunoHost-Apps/pihole_ynh/tree/testing). 44 | 45 | Para probar a rama `testing`, procede deste xeito: 46 | 47 | ```bash 48 | sudo yunohost app install https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 49 | ou 50 | sudo yunohost app upgrade pihole -u https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 51 | ``` 52 | 53 | **Máis info sobre o empaquetado da app:** 54 | -------------------------------------------------------------------------------- /README_id.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Pi-hole untuk YunoHost 7 | 8 | [![Tingkat integrasi](https://apps.yunohost.org/badge/integration/pihole)](https://ci-apps.yunohost.org/ci/apps/pihole/) 9 | ![Status kerja](https://apps.yunohost.org/badge/state/pihole) 10 | ![Status pemeliharaan](https://apps.yunohost.org/badge/maintained/pihole) 11 | 12 | [![Pasang Pi-hole dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pihole) 13 | 14 | *[Baca README ini dengan bahasa yang lain.](./ALL_README.md)* 15 | 16 | > *Paket ini memperbolehkan Anda untuk memasang Pi-hole secara cepat dan mudah pada server YunoHost.* 17 | > *Bila Anda tidak mempunyai YunoHost, silakan berkonsultasi dengan [panduan](https://yunohost.org/install) untuk mempelajari bagaimana untuk memasangnya.* 18 | 19 | ## Ringkasan 20 | 21 | The Pi-hole® is a DNS sinkhole that protects your devices from unwanted content without installing any client-side software. 22 | 23 | **Versi terkirim:** 5.18.4~ynh1 24 | 25 | ## Tangkapan Layar 26 | 27 | ![Tangkapan Layar pada Pi-hole](./doc/screenshots/dashboard.png) 28 | 29 | ## :red_circle: Antifitur 30 | 31 | - **Package not maintained**: This YunoHost package is not actively maintained and needs adoption. This means that minimal maintenance is made by volunteers who don't use the app, so you should expect the app to lose reliability over time. You can [learn how to package](https://yunohost.org/packaging_apps_intro) if you'd like to adopt it. 32 | 33 | ## Dokumentasi dan sumber daya 34 | 35 | - Website aplikasi resmi: 36 | - Dokumentasi admin resmi: 37 | - Depot kode aplikasi hulu: 38 | - Gudang YunoHost: 39 | - Laporkan bug: 40 | 41 | ## Info developer 42 | 43 | Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/pihole_ynh/tree/testing). 44 | 45 | Untuk mencoba branch `testing`, silakan dilanjutkan seperti: 46 | 47 | ```bash 48 | sudo yunohost app install https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 49 | atau 50 | sudo yunohost app upgrade pihole -u https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 51 | ``` 52 | 53 | **Info lebih lanjut mengenai pemaketan aplikasi:** 54 | -------------------------------------------------------------------------------- /README_it.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Pi-hole per YunoHost 7 | 8 | [![Livello di integrazione](https://dash.yunohost.org/integration/pihole.svg)](https://dash.yunohost.org/appci/app/pihole) ![Stato di funzionamento](https://ci-apps.yunohost.org/ci/badges/pihole.status.svg) ![Stato di manutenzione](https://ci-apps.yunohost.org/ci/badges/pihole.maintain.svg) 9 | 10 | [![Installa Pi-hole con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pihole) 11 | 12 | *[Leggi questo README in altre lingue.](./ALL_README.md)* 13 | 14 | > *Questo pacchetto ti permette di installare Pi-hole su un server YunoHost in modo semplice e veloce.* 15 | > *Se non hai YunoHost, consulta [la guida](https://yunohost.org/install) per imparare a installarlo.* 16 | 17 | ## Panoramica 18 | 19 | The Pi-hole® is a DNS sinkhole that protects your devices from unwanted content without installing any client-side software. 20 | 21 | **Versione pubblicata:** 5.14.2~ynh4 22 | 23 | ## Screenshot 24 | 25 | ![Screenshot di Pi-hole](./doc/screenshots/dashboard.png) 26 | 27 | ## Attenzione/informazioni importanti 28 | 29 | ## Configuration 30 | 31 | 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*. 32 | 33 | ## Limitations 34 | 35 | * Activate DHCP with Pi-hole needs manual configuration of your router. 36 | 37 | ## Using Pi-hole as your DHCP server 38 | 39 | > **Be careful, you should considering that playing with your DHCP may break your network. 40 | In case your server is down, you will lose your dns resolution and ip address. 41 | So, you will lose any internet connection and even the connection to your router.** 42 | 43 | > **If you encounter this kind of problem, please see "How to restore my network" at the end of this document.** 44 | 45 | ### How to configure Pi-hole 46 | 47 | There're two ways to configure Pi-hole to be used as your DHCP server. 48 | - Either you can choose to use it when you install the app. 49 | - Or you can activate the DHCP server afterwards in the "Settings" tab, "Pi-hole DHCP Server" part. 50 | In this second case, it can be better to set the ip of the server to a static address 51 | 52 | ### How to configure my router 53 | 54 | Your personal router or ISP's router has a DHCP server enabled by default. 55 | If you keep this DHCP, along with Pi-hole's one, you will have transparent conflicts between them. 56 | The first DHCP to respond will distribute its own ip and settings. 57 | So you have to turn off the DHCP of your router to let Pi-hole managed your network. 58 | 59 | #### Why should I use only the DHCP of Pi-hole ? 60 | 61 | 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. 62 | 63 | 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). 64 | 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. 65 | 66 | ### How to restore my network 67 | 68 | > Oh crap ! 69 | Your Pi-hole server is down, and you don't have a DHCP anymore. 70 | Don't panic, We'll get through it. \o/ 71 | 72 | Use your favorite terminal on your desktop computer. 73 | And first, get your main interface (usually `eth0`). 74 | ``` bash 75 | sudo ifconfig 76 | ``` 77 | 78 | Then, set your ip as a static ip. 79 | ``` bash 80 | sudo ifconfig eth0 192.168.1.100 81 | ``` 82 | 83 | Now, you can connect to your router and turn on its DHCP server to use it again. 84 | You can now reset your ip and get a dynamic address. 85 | ``` bash 86 | sudo ifconfig eth0 0.0.0.0 && sudo dhclient eth0 87 | ``` 88 | 89 | > Don't forget to turn off the DHCP of your router if your server is working again. 90 | ## Documentazione e risorse 91 | 92 | - Sito web ufficiale dell’app: 93 | - Documentazione ufficiale per gli amministratori: 94 | - Repository upstream del codice dell’app: 95 | - Store di YunoHost: 96 | - Segnala un problema: 97 | 98 | ## Informazioni per sviluppatori 99 | 100 | Si prega di inviare la tua pull request alla [branch di `testing`](https://github.com/YunoHost-Apps/pihole_ynh/tree/testing). 101 | 102 | Per provare la branch di `testing`, si prega di procedere in questo modo: 103 | 104 | ```bash 105 | sudo yunohost app install https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 106 | o 107 | sudo yunohost app upgrade pihole -u https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 108 | ``` 109 | 110 | **Maggiori informazioni riguardo il pacchetto di quest’app:** 111 | -------------------------------------------------------------------------------- /README_nl.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Pi-hole voor Yunohost 7 | 8 | [![Integratieniveau](https://apps.yunohost.org/badge/integration/pihole)](https://ci-apps.yunohost.org/ci/apps/pihole/) 9 | ![Mate van functioneren](https://apps.yunohost.org/badge/state/pihole) 10 | ![Onderhoudsstatus](https://apps.yunohost.org/badge/maintained/pihole) 11 | 12 | [![Pi-hole met Yunohost installeren](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pihole) 13 | 14 | *[Deze README in een andere taal lezen.](./ALL_README.md)* 15 | 16 | > *Met dit pakket kun je Pi-hole snel en eenvoudig op een YunoHost-server installeren.* 17 | > *Als je nog geen YunoHost hebt, lees dan [de installatiehandleiding](https://yunohost.org/install), om te zien hoe je 'm installeert.* 18 | 19 | ## Overzicht 20 | 21 | The Pi-hole® is a DNS sinkhole that protects your devices from unwanted content without installing any client-side software. 22 | 23 | **Geleverde versie:** 5.18.4~ynh1 24 | 25 | ## Schermafdrukken 26 | 27 | ![Schermafdrukken van Pi-hole](./doc/screenshots/dashboard.png) 28 | 29 | ## :red_circle: Anti-eigenschappen 30 | 31 | - **Package not maintained**: This YunoHost package is not actively maintained and needs adoption. This means that minimal maintenance is made by volunteers who don't use the app, so you should expect the app to lose reliability over time. You can [learn how to package](https://yunohost.org/packaging_apps_intro) if you'd like to adopt it. 32 | 33 | ## Documentatie en bronnen 34 | 35 | - Officiele website van de app: 36 | - Officiele beheerdersdocumentatie: 37 | - Upstream app codedepot: 38 | - YunoHost-store: 39 | - Meld een bug: 40 | 41 | ## Ontwikkelaarsinformatie 42 | 43 | Stuur je pull request alsjeblieft naar de [`testing`-branch](https://github.com/YunoHost-Apps/pihole_ynh/tree/testing). 44 | 45 | Om de `testing`-branch uit te proberen, ga als volgt te werk: 46 | 47 | ```bash 48 | sudo yunohost app install https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 49 | of 50 | sudo yunohost app upgrade pihole -u https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 51 | ``` 52 | 53 | **Verdere informatie over app-packaging:** 54 | -------------------------------------------------------------------------------- /README_pl.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Pi-hole dla YunoHost 7 | 8 | [![Poziom integracji](https://apps.yunohost.org/badge/integration/pihole)](https://ci-apps.yunohost.org/ci/apps/pihole/) 9 | ![Status działania](https://apps.yunohost.org/badge/state/pihole) 10 | ![Status utrzymania](https://apps.yunohost.org/badge/maintained/pihole) 11 | 12 | [![Zainstaluj Pi-hole z YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pihole) 13 | 14 | *[Przeczytaj plik README w innym języku.](./ALL_README.md)* 15 | 16 | > *Ta aplikacja pozwala na szybką i prostą instalację Pi-hole na serwerze YunoHost.* 17 | > *Jeżeli nie masz YunoHost zapoznaj się z [poradnikiem](https://yunohost.org/install) instalacji.* 18 | 19 | ## Przegląd 20 | 21 | The Pi-hole® is a DNS sinkhole that protects your devices from unwanted content without installing any client-side software. 22 | 23 | **Dostarczona wersja:** 5.18.4~ynh1 24 | 25 | ## Zrzuty ekranu 26 | 27 | ![Zrzut ekranu z Pi-hole](./doc/screenshots/dashboard.png) 28 | 29 | ## :red_circle: Niepożądane funkcje 30 | 31 | - **Package not maintained**: This YunoHost package is not actively maintained and needs adoption. This means that minimal maintenance is made by volunteers who don't use the app, so you should expect the app to lose reliability over time. You can [learn how to package](https://yunohost.org/packaging_apps_intro) if you'd like to adopt it. 32 | 33 | ## Dokumentacja i zasoby 34 | 35 | - Oficjalna strona aplikacji: 36 | - Oficjalna dokumentacja dla administratora: 37 | - Repozytorium z kodem źródłowym: 38 | - Sklep YunoHost: 39 | - Zgłaszanie błędów: 40 | 41 | ## Informacje od twórców 42 | 43 | Wyślij swój pull request do [gałęzi `testing`](https://github.com/YunoHost-Apps/pihole_ynh/tree/testing). 44 | 45 | Aby wypróbować gałąź `testing` postępuj zgodnie z instrukcjami: 46 | 47 | ```bash 48 | sudo yunohost app install https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 49 | lub 50 | sudo yunohost app upgrade pihole -u https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 51 | ``` 52 | 53 | **Więcej informacji o tworzeniu paczek aplikacji:** 54 | -------------------------------------------------------------------------------- /README_ru.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Pi-hole для YunoHost 7 | 8 | [![Уровень интеграции](https://apps.yunohost.org/badge/integration/pihole)](https://ci-apps.yunohost.org/ci/apps/pihole/) 9 | ![Состояние работы](https://apps.yunohost.org/badge/state/pihole) 10 | ![Состояние сопровождения](https://apps.yunohost.org/badge/maintained/pihole) 11 | 12 | [![Установите Pi-hole с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pihole) 13 | 14 | *[Прочтите этот README на других языках.](./ALL_README.md)* 15 | 16 | > *Этот пакет позволяет Вам установить Pi-hole быстро и просто на YunoHost-сервер.* 17 | > *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.* 18 | 19 | ## Обзор 20 | 21 | The Pi-hole® is a DNS sinkhole that protects your devices from unwanted content without installing any client-side software. 22 | 23 | **Поставляемая версия:** 5.18.4~ynh1 24 | 25 | ## Снимки экрана 26 | 27 | ![Снимок экрана Pi-hole](./doc/screenshots/dashboard.png) 28 | 29 | ## :red_circle: Анти-функции 30 | 31 | - **Package not maintained**: This YunoHost package is not actively maintained and needs adoption. This means that minimal maintenance is made by volunteers who don't use the app, so you should expect the app to lose reliability over time. You can [learn how to package](https://yunohost.org/packaging_apps_intro) if you'd like to adopt it. 32 | 33 | ## Документация и ресурсы 34 | 35 | - Официальный веб-сайт приложения: 36 | - Официальная документация администратора: 37 | - Репозиторий кода главной ветки приложения: 38 | - Магазин YunoHost: 39 | - Сообщите об ошибке: 40 | 41 | ## Информация для разработчиков 42 | 43 | Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/pihole_ynh/tree/testing). 44 | 45 | Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого: 46 | 47 | ```bash 48 | sudo yunohost app install https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 49 | или 50 | sudo yunohost app upgrade pihole -u https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 51 | ``` 52 | 53 | **Больше информации о пакетировании приложений:** 54 | -------------------------------------------------------------------------------- /README_zh_Hans.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # YunoHost 上的 Pi-hole 7 | 8 | [![集成程度](https://apps.yunohost.org/badge/integration/pihole)](https://ci-apps.yunohost.org/ci/apps/pihole/) 9 | ![工作状态](https://apps.yunohost.org/badge/state/pihole) 10 | ![维护状态](https://apps.yunohost.org/badge/maintained/pihole) 11 | 12 | [![使用 YunoHost 安装 Pi-hole](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pihole) 13 | 14 | *[阅读此 README 的其它语言版本。](./ALL_README.md)* 15 | 16 | > *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 Pi-hole。* 17 | > *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。* 18 | 19 | ## 概况 20 | 21 | The Pi-hole® is a DNS sinkhole that protects your devices from unwanted content without installing any client-side software. 22 | 23 | **分发版本:** 5.18.4~ynh1 24 | 25 | ## 截图 26 | 27 | ![Pi-hole 的截图](./doc/screenshots/dashboard.png) 28 | 29 | ## :red_circle: 负面特征 30 | 31 | - **Package not maintained**: This YunoHost package is not actively maintained and needs adoption. This means that minimal maintenance is made by volunteers who don't use the app, so you should expect the app to lose reliability over time. You can [learn how to package](https://yunohost.org/packaging_apps_intro) if you'd like to adopt it. 32 | 33 | ## 文档与资源 34 | 35 | - 官方应用网站: 36 | - 官方管理文档: 37 | - 上游应用代码库: 38 | - YunoHost 商店: 39 | - 报告 bug: 40 | 41 | ## 开发者信息 42 | 43 | 请向 [`testing` 分支](https://github.com/YunoHost-Apps/pihole_ynh/tree/testing) 发送拉取请求。 44 | 45 | 如要尝试 `testing` 分支,请这样操作: 46 | 47 | ```bash 48 | sudo yunohost app install https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 49 | 或 50 | sudo yunohost app upgrade pihole -u https://github.com/YunoHost-Apps/pihole_ynh/tree/testing --debug 51 | ``` 52 | 53 | **有关应用打包的更多信息:** 54 | -------------------------------------------------------------------------------- /conf/02-pihole-dhcp.conf: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # DHCP SERVER CONFIG FILE AUTOMATICALLY POPULATED BY PI-HOLE WEB INTERFACE. # 3 | # ANY CHANGES MADE TO THIS FILE WILL BE LOST ON CHANGE # 4 | ############################################################################### 5 | dhcp-authoritative 6 | dhcp-range=__A_RANGE__,__B_RANGE__,24h 7 | dhcp-option=option:router,__GATEWAY__ 8 | dhcp-leasefile=/etc/pihole/dhcp.leases 9 | #quiet-dhcp 10 | 11 | domain=local 12 | -------------------------------------------------------------------------------- /conf/adlists.default: -------------------------------------------------------------------------------- 1 | # The below list amalgamates several lists we used previously. 2 | # See `https://github.com/StevenBlack/hosts` for details 3 | ##StevenBlack's list 4 | https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts 5 | 6 | ##Cameleon 7 | http://sysctl.org/cameleon/hosts 8 | 9 | ##Disconnect.me Tracking 10 | https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt 11 | 12 | ##Disconnect.me Ads 13 | https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt 14 | -------------------------------------------------------------------------------- /conf/dns-servers.conf: -------------------------------------------------------------------------------- 1 | (FR) FDN;80.67.169.12;80.67.169.40;2001:910:800::12;2001:910:800::40 2 | (FR) LDN;80.67.188.188;2001:913::8 3 | (FR) ARN;89.234.141.66;2a00:5881:8100:1000::3 4 | (FR) Aquilenet;185.233.100.100;185.233.100.101;2a0c:e300::100;2a0c:e300::101 5 | (FR) gozmail / grifon;80.67.190.200;80.67.190.200;2a00:5884:8218::1;2a00:5884:8218::1 6 | (DE) FoeBud / Digital Courage;85.214.20.141;85.214.20.141 7 | (DE) CCC Berlin;195.160.173.53;195.160.173.53 8 | (DE) AS250;194.150.168.168;194.150.168.168;2001:4ce8::53;2001:4ce8::53 9 | (DE) Ideal-Hosting;84.200.69.80;84.200.70.40;2001:1608:10:25::1c04:b12f;2001:1608:10:25::9249:d69b 10 | (DK) censurfridns;91.239.100.100;89.233.43.71;2001:67c:28a4::;2a01:3a0:53:53:: 11 | -------------------------------------------------------------------------------- /conf/dnsmasq_regenconf_hook: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /usr/share/yunohost/helpers 4 | 5 | app="__APP__" 6 | 7 | action=$1 8 | pending_conf=$4/../dnsmasq 9 | 10 | [[ "$action" == "pre" ]] || exit 0 11 | [[ -d "$pending_conf" ]] || exit 0 12 | 13 | # 14 | # Regen /etc/dnsmasq.d/01-pihole.conf 15 | # 16 | dnsmasq_dir="${pending_conf}/etc/dnsmasq.d" 17 | mkdir -p "$dnsmasq_dir" 18 | 19 | main_iface=$(ip route | grep --max-count=1 default | awk '{print $5;}') 20 | 21 | cp -a "/etc/.pihole/advanced/01-pihole.conf" "$dnsmasq_dir/" 22 | 23 | ynh_replace_string --match_string="@DNS1@" --replace_string="" --target_file="$dnsmasq_dir/01-pihole.conf" 24 | ynh_replace_string --match_string="@DNS2@" --replace_string="" --target_file="$dnsmasq_dir/01-pihole.conf" 25 | ynh_replace_string --match_string="^no-resolv" --replace_string="#no-resolv" --target_file="$dnsmasq_dir/01-pihole.conf" 26 | ynh_replace_string --match_string="@INT@" --replace_string="$main_iface" --target_file="$dnsmasq_dir/01-pihole.conf" 27 | ynh_replace_string --match_string="@CACHE_SIZE@" --replace_string="1000" --target_file="$dnsmasq_dir/01-pihole.conf" 28 | query_logging=$(ynh_app_setting_get --app=$app --key=query_logging) 29 | if [ "$query_logging" = "true" ]; then 30 | ynh_replace_string --match_string="^#log-queries" --replace_string="log-queries" --target_file="$dnsmasq_dir/01-pihole.conf" 31 | else 32 | ynh_replace_string --match_string="^log-queries" --replace_string="#log-queries" --target_file="$dnsmasq_dir/01-pihole.conf" 33 | fi 34 | 35 | # 36 | # Tweak dnsmsasq's general conf cache-size 37 | # 38 | 39 | ynh_replace_string --match_string="^cache-size=" --replace_string="#pihole# cache-size=" --target_file="${pending_conf}/etc/dnsmasq.conf" 40 | ynh_replace_string --match_string="^listen-address=" --replace_string="#pihole# listen-address=" --target_file="${pending_conf}/etc/dnsmasq.conf" 41 | 42 | echo " 43 | conf-dir=/etc/dnsmasq.d/" >> "${pending_conf}/etc/dnsmasq.conf" 44 | 45 | # 46 | # Regen /etc/dnsmasq.d/02-pihole-dhcp.conf 47 | # 48 | 49 | enable_dhcp=$(ynh_app_setting_get --app=$app --key=enable_dhcp) 50 | if [ $enable_dhcp -eq 1 ] 51 | then 52 | 53 | # Get the default network interface 54 | # Find the IP associated to the network interface 55 | localipv4=$(ip address | grep "${main_iface}\$" | awk '{print $2;}' | cut -d/ -f1) 56 | 57 | max_dhcp_range=250 58 | dhcp_range=100 59 | 60 | # Define the dhcp range from the current ip 61 | ip_beginning_part=$(echo "$localipv4" | cut -d. -f1-3) 62 | ip_fourth_part=$(echo "$localipv4" | cut -d. -f4) 63 | b_range=$(( $ip_fourth_part + $dhcp_range )) 64 | if [ $b_range -gt $max_dhcp_range ]; then 65 | b_range=$max_dhcp_range 66 | fi 67 | a_range=$(( $b_range - $dhcp_range )) 68 | 69 | # Get the gateway 70 | gateway=$(ip route | grep default | awk '{print $3;}') 71 | # And the mac adress 72 | hw_adress=$(ip link | grep -A1 "$main_iface" | tail -n1 | awk '{print $2;}') 73 | 74 | # Copy the config file 75 | cp -a "/etc/yunohost/apps/$app/conf/02-pihole-dhcp.conf" "$dnsmasq_dir/" 76 | 77 | # And set the config 78 | ynh_replace_string --match_string="__A_RANGE__" --replace_string="$ip_beginning_part.$a_range" --target_file="${pending_conf}/etc/dnsmasq.d/02-pihole-dhcp.conf" 79 | ynh_replace_string --match_string="__B_RANGE__" --replace_string="$ip_beginning_part.$b_range" --target_file="${pending_conf}/etc/dnsmasq.d/02-pihole-dhcp.conf" 80 | ynh_replace_string --match_string="__GATEWAY__" --replace_string="$gateway" --target_file="${pending_conf}/etc/dnsmasq.d/02-pihole-dhcp.conf" 81 | 82 | # Set a static ip for the server. 83 | echo "dhcp-host=$hw_adress,$localipv4" > "${dnsmasq_dir}/04-pihole-static-dhcp.conf" 84 | fi 85 | exit 0 86 | -------------------------------------------------------------------------------- /conf/extra_php-fpm.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YunoHost-Apps/pihole_ynh/22e6708e48f7f61dd67a7fbf549894c616369b4b/conf/extra_php-fpm.conf -------------------------------------------------------------------------------- /conf/nginx.conf: -------------------------------------------------------------------------------- 1 | #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; 2 | location __PATH__/ { 3 | 4 | # Path to source 5 | alias __INSTALL_DIR__/web/; 6 | 7 | index index.html index.php; 8 | 9 | # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file 10 | #client_max_body_size 50M; 11 | 12 | try_files $uri $uri/ index.php; 13 | location ~ [^/]\.php(/|$) { 14 | fastcgi_split_path_info ^(.+?\.php)(/.*)$; 15 | fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; 16 | 17 | fastcgi_index index.php; 18 | include fastcgi_params; 19 | fastcgi_param REMOTE_USER $remote_user; 20 | fastcgi_param PATH_INFO $fastcgi_path_info; 21 | fastcgi_param SCRIPT_FILENAME $request_filename; 22 | } 23 | 24 | # Include SSOWAT user panel. 25 | include conf.d/yunohost_panel.conf.inc; 26 | } 27 | -------------------------------------------------------------------------------- /conf/pihole-FTL.conf: -------------------------------------------------------------------------------- 1 | #; Pi-hole FTL config file 2 | #; Comments should start with #; to avoid issues with PHP and bash reading this file 3 | 4 | #; Listen only for local socket connections or permit all connections 5 | #; localonly|all 6 | SOCKET_LISTENING=localonly 7 | 8 | #; On which port should FTL be listening? 9 | FTLPORT=__PORT__ 10 | 11 | #; Display all queries? Set to no to hide query display 12 | #; yes|no 13 | QUERY_DISPLAY=yes 14 | 15 | #; Allow FTL to analyze AAAA queries from pihole.log? 16 | #; yes|no 17 | AAAA_QUERY_ANALYSIS=yes 18 | 19 | #; How long should queries be stored in the database? Setting this to 0 disables the database altogether 20 | MAXDBDAYS=365 21 | 22 | #; Should FTL try to resolve IPv6 addresses to host names? 23 | #; yes|no 24 | RESOLVE_IPV6=yes 25 | 26 | #; Should FTL try to resolve IPv4 addresses to host names? 27 | #; yes|no 28 | RESOLVE_IPV4=yes 29 | 30 | #; How often do we store queries in FTL's database [minutes]? 31 | DBINTERVAL=1.0 32 | 33 | #; Specify path and filename of FTL's SQLite long-term database. Setting this to DBFILE= disables the database altogether 34 | DBFILE=/etc/pihole/pihole-FTL.db 35 | 36 | #; Up to how many hours of queries should be imported from the database and logs? Maximum is 744 (31 days) 37 | MAXLOGAGE=24.0 38 | -------------------------------------------------------------------------------- /conf/setupVars.conf: -------------------------------------------------------------------------------- 1 | PIHOLE_INTERFACE=__MAIN_IFACE__ 2 | IPV4_ADDRESS=127.0.0.1 3 | IPV6_ADDRESS=::1 4 | PIHOLE_DNS_1= 5 | PIHOLE_DNS_2= 6 | QUERY_LOGGING=__QUERY_LOGGING_STR__ 7 | INSTALL_WEB=true 8 | BLOCKING_ENABLED=true 9 | -------------------------------------------------------------------------------- /dhcp.md: -------------------------------------------------------------------------------- 1 | Using Pi-hole as your DHCP server 2 | ================== 3 | 4 | > **Be careful, you should considering that playing with your DHCP may break your network. 5 | In case your server is down, you will lose your dns resolution and ip address. 6 | So, you will lose any internet connection and even the connection to your router.** 7 | 8 | > **If you encounter this kind of problem, please see "How to restore my network" at the end of this document.** 9 | 10 | ### How to configure Pi-hole 11 | 12 | There're two ways to configure Pi-hole to be used as your DHCP server. 13 | - Either you can choose to use it when you install the app. 14 | - Or you can activate the DHCP server afterwards in the "Settings" tab, "Pi-hole DHCP Server" part. 15 | In this second case, it can be better to set the ip of the server to a static address 16 | 17 | ### How to configure my router 18 | 19 | Your personal router or ISP's router has a DHCP server enabled by default. 20 | If you keep this DHCP, along with Pi-hole's one, you will have transparent conflicts between them. 21 | The first DHCP to respond will distribute its own ip and settings. 22 | So you have to turn off the DHCP of your router to let Pi-hole managed your network. 23 | 24 | #### Why should I use only the DHCP of Pi-hole ? 25 | 26 | 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. 27 | 28 | 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). 29 | 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. 30 | 31 | ### How to restore my network 32 | 33 | > Oh crap ! 34 | Your Pi-hole server is down, and you don't have a DHCP anymore. 35 | Don't panic, We'll get through it. \o/ 36 | 37 | Use your favorite terminal on your desktop computer. 38 | And first, get your main interface (usually `eth0`). 39 | ``` bash 40 | sudo ifconfig 41 | ``` 42 | 43 | Then, set your ip as a static ip. 44 | ``` bash 45 | sudo ifconfig eth0 192.168.1.100 46 | ``` 47 | 48 | Now, you can connect to your router and turn on its DHCP server to use it again. 49 | You can now reset your ip and get a dynamic address. 50 | ``` bash 51 | sudo ifconfig eth0 0.0.0.0 && sudo dhclient eth0 52 | ``` 53 | 54 | > Don't forget to turn off the DHCP of your router if your server is working again. 55 | 56 | --- 57 | 58 | Faire de Pi-hole votre serveur DHCP 59 | ================== 60 | 61 | > **Attention, vous devez savoir que toucher à votre DHCP pourrait casser votre réseau. 62 | Dans le cas où votre serveur serait inaccessible, vous perdriez votre résolution dns et votre adresse IP. 63 | Ainsi, vous perdriez toute connexion à internet et même la connexion à votre routeur.** 64 | 65 | > **Si vous rencontrez ce genre de problèmes, merci de lire la section "Comment restaurer mon réseau" à la fin de ce document.** 66 | 67 | ### Comment configurer Pi-hole 68 | 69 | Il y a 2 manière de configurer Pi-hole pour qu'il soit utilisé comme votre serveur DHCP. 70 | - Soit vous pouvez choisir de l'utiliser lorsque vous installez l'application. 71 | - Soit vous pouvez activer le serveur DHCP par la suite dans l'onglet "Settings", partie "Pi-hole DHCP Server". 72 | Dans ce second cas, il peut être préférable de forcer l'ip du serveur à une adresse statique. 73 | 74 | ### Comment configurer mon routeur 75 | 76 | Votre routeur ou celui de votre FAI dispose d'un serveur DHCP activé par défaut. 77 | Si vous gardez ce DHCP, en même temps que celui de Pi-hole, vous allez avoir des conflits transparents entre eux. 78 | Le premier serveur DHCP à répondre va distribuer ses propres ip et paramètres. 79 | Donc vous devez éteindre le serveur DHCP de votre routeur et laisser Pi-hole gérer votre réseau. 80 | 81 | #### Pourquoi je devrais utiliser le DHCP de Pi-hole ? 82 | 83 | 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. 84 | 85 | 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). 86 | 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. 87 | 88 | ### Comment restaurer mon réseau 89 | 90 | > Oups ! 91 | Votre serveur Pi-hole est tombé, et vous n'avez plus de DHCP. 92 | Ne paniquez pas, on va surmonter ça \o/ 93 | 94 | Utilisez votre terminal favori sur votre ordinateur de bureau. 95 | Et tout d'abord, récupérer votre interface réseau (Le plus souvent `eth0`). 96 | ``` bash 97 | sudo ifconfig 98 | ``` 99 | 100 | Ensuite, changer votre ip pour une ip statique. 101 | ``` bash 102 | sudo ifconfig eth0 192.168.1.100 103 | ``` 104 | 105 | Maintenant, vous pouvez vous connecter à votre routeur et rallumer son serveur DHCP pour l'utiliser à nouveau. 106 | Vous pouvez maintenant retirer votre ip statique et réobtenir une ip dynamique. 107 | ``` bash 108 | sudo ifconfig eth0 0.0.0.0 && sudo dhclient eth0 109 | ``` 110 | 111 | > N'oubliez pas d'éteindre le DHCP de votre routeur si votre serveur fonctionne à nouveau. 112 | -------------------------------------------------------------------------------- /doc/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YunoHost-Apps/pihole_ynh/22e6708e48f7f61dd67a7fbf549894c616369b4b/doc/.gitkeep -------------------------------------------------------------------------------- /doc/ADMIN.md: -------------------------------------------------------------------------------- 1 | ## Configuration 2 | 3 | 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*. 4 | 5 | ## Limitations 6 | 7 | * Activate DHCP with Pi-hole needs manual configuration of your router. 8 | 9 | ## Using Pi-hole as your DHCP server 10 | 11 | > **Be careful, you should considering that playing with your DHCP may break your network. 12 | > In case your server is down, you will lose your dns resolution and ip address. 13 | > So, you will lose any internet connection and even the connection to your router.** 14 | > 15 | > **If you encounter this kind of problem, please see "How to restore my network" at the end of this document.** 16 | 17 | ### How to configure Pi-hole 18 | 19 | There're two ways to configure Pi-hole to be used as your DHCP server. 20 | 21 | - Either you can choose to use it when you install the app. 22 | - Or you can activate the DHCP server afterwards in the "Settings" tab, "Pi-hole DHCP Server" part. 23 | 24 | In this second case, it can be better to set the ip of the server to a static address 25 | 26 | ### How to configure my router 27 | 28 | Your personal router or ISP's router has a DHCP server enabled by default. 29 | If you keep this DHCP, along with Pi-hole's one, you will have transparent conflicts between them. 30 | The first DHCP to respond will distribute its own ip and settings. 31 | So you have to turn off the DHCP of your router to let Pi-hole managed your network. 32 | 33 | #### Why should I use only the DHCP of Pi-hole ? 34 | 35 | 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. 36 | 37 | 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). 38 | 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. 39 | 40 | ### How to restore my network 41 | 42 | > Oh crap ! 43 | Your Pi-hole server is down, and you don't have a DHCP anymore. 44 | Don't panic, We'll get through it. \o/ 45 | 46 | Use your favorite terminal on your desktop computer. 47 | And first, get your main interface (usually `eth0`). 48 | 49 | ``` bash 50 | sudo ifconfig 51 | ``` 52 | 53 | Then, set your ip as a static ip. 54 | 55 | ``` bash 56 | sudo ifconfig eth0 192.168.1.100 57 | ``` 58 | 59 | Now, you can connect to your router and turn on its DHCP server to use it again. 60 | You can now reset your ip and get a dynamic address. 61 | 62 | ``` bash 63 | sudo ifconfig eth0 0.0.0.0 && sudo dhclient eth0 64 | ``` 65 | 66 | > Don't forget to turn off the DHCP of your router if your server is working again. 67 | -------------------------------------------------------------------------------- /doc/ADMIN_fr.md: -------------------------------------------------------------------------------- 1 | ## Configuration 2 | 3 | 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*. 4 | 5 | ## Limitations 6 | 7 | * Activer DHCP avec Pi-hole nécessite une configuration manuelle de votre routeur. 8 | 9 | ## Faire de Pi-hole votre serveur DHCP 10 | 11 | > **Attention, vous devez savoir que toucher à votre DHCP pourrait casser votre réseau. 12 | > Dans le cas où votre serveur serait inaccessible, vous perdriez votre résolution dns et votre adresse IP. 13 | > Ainsi, vous perdriez toute connexion à internet et même la connexion à votre routeur.** 14 | > 15 | > **Si vous rencontrez ce genre de problèmes, merci de lire la section "Comment restaurer mon réseau" à la fin de ce document.** 16 | 17 | ### Comment configurer Pi-hole 18 | 19 | Il y a 2 manière de configurer Pi-hole pour qu'il soit utilisé comme votre serveur DHCP. 20 | 21 | - Soit vous pouvez choisir de l'utiliser lorsque vous installez l'application. 22 | - Soit vous pouvez activer le serveur DHCP par la suite dans l'onglet "Settings", partie "Pi-hole DHCP Server". 23 | 24 | Dans ce second cas, il peut être préférable de forcer l'ip du serveur à une adresse statique. 25 | 26 | ### Comment configurer mon routeur 27 | 28 | Votre routeur ou celui de votre FAI dispose d'un serveur DHCP activé par défaut. 29 | Si vous gardez ce DHCP, en même temps que celui de Pi-hole, vous allez avoir des conflits transparents entre eux. 30 | Le premier serveur DHCP à répondre va distribuer ses propres ip et paramètres. 31 | Donc vous devez éteindre le serveur DHCP de votre routeur et laisser Pi-hole gérer votre réseau. 32 | 33 | #### Pourquoi je devrais utiliser le DHCP de Pi-hole ? 34 | 35 | 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. 36 | 37 | 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). 38 | 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. 39 | 40 | ### Comment restaurer mon réseau 41 | 42 | > Oups ! 43 | Votre serveur Pi-hole est tombé, et vous n'avez plus de DHCP. 44 | Ne paniquez pas, on va surmonter ça \o/ 45 | 46 | Utilisez votre terminal favori sur votre ordinateur de bureau. 47 | Et tout d'abord, récupérer votre interface réseau (Le plus souvent `eth0`). 48 | 49 | ``` bash 50 | sudo ifconfig 51 | ``` 52 | 53 | Ensuite, changer votre ip pour une ip statique. 54 | 55 | ``` bash 56 | sudo ifconfig eth0 192.168.1.100 57 | ``` 58 | 59 | Maintenant, vous pouvez vous connecter à votre routeur et rallumer son serveur DHCP pour l'utiliser à nouveau. 60 | Vous pouvez maintenant retirer votre ip statique et réobtenir une ip dynamique. 61 | 62 | ``` bash 63 | sudo ifconfig eth0 0.0.0.0 && sudo dhclient eth0 64 | ``` 65 | 66 | > N'oubliez pas d'éteindre le DHCP de votre routeur si votre serveur fonctionne à nouveau. 67 | -------------------------------------------------------------------------------- /doc/DESCRIPTION.md: -------------------------------------------------------------------------------- 1 | The Pi-hole® is a DNS sinkhole that protects your devices from unwanted content without installing any client-side software. -------------------------------------------------------------------------------- /doc/DESCRIPTION_fr.md: -------------------------------------------------------------------------------- 1 | Pi-hole® est un puits DNS qui protège vos appareils des contenus indésirables sans installer de logiciel côté client. 2 | -------------------------------------------------------------------------------- /doc/screenshots/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YunoHost-Apps/pihole_ynh/22e6708e48f7f61dd67a7fbf549894c616369b4b/doc/screenshots/.gitkeep -------------------------------------------------------------------------------- /doc/screenshots/dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YunoHost-Apps/pihole_ynh/22e6708e48f7f61dd67a7fbf549894c616369b4b/doc/screenshots/dashboard.png -------------------------------------------------------------------------------- /hooks/post_domain_add: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | domain=$1 4 | 5 | # Trouve l'interface réseau par défaut 6 | main_iface=$(route | grep --max-count=1 default | awk '{print $8;}' | head -n1) 7 | # Trouve l'ipv4 associée à l'interface trouvée 8 | localipv4=$(ifconfig | grep -A 1 "$main_iface" | tail -1 | awk '{print $2;}' | cut -d: -f2) 9 | 10 | # Commente les résolutions du domaine sur 127.0.0.1, qui risquerait de bloquer la résolution sur le réseau local 11 | sed -i "s/^127.0.0.1.*$domain/#Commented by pihole# &/g" /etc/hosts 12 | 13 | # Et ajoute une résolution sur l'ip local à la place, si elle n'existe pas déjà 14 | grep -q "^$localipv4.*$domain" /etc/hosts || \ 15 | echo "$localipv4 $domain #Added by pihole#" >> /etc/hosts 16 | -------------------------------------------------------------------------------- /hooks/post_domain_remove: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | domain=$1 4 | 5 | # Restaure les résolutions qui avaient été commentées par pihole pour ce domaine 6 | sed -i "s/#Commented by pihole# \(.*domain1\)/\1/g" /etc/hosts 7 | # On utilise ici les sous-expressions sed pour supprimer seulement le début de la ligne. 8 | 9 | # Et supprime les lignes ajoutées par pihole pour ce domaine 10 | sed -i "/$domain #Added by pihole#/d" /etc/hosts 11 | -------------------------------------------------------------------------------- /manifest.toml: -------------------------------------------------------------------------------- 1 | #:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json 2 | 3 | packaging_format = 2 4 | 5 | id = "pihole" 6 | name = "Pi-hole" 7 | description.en = "Network-wide ad blocking via your own DNS server" 8 | description.fr = "Filtrage publicitaire via votre propre serveur DNS" 9 | 10 | version = "5.18.4~ynh1" 11 | 12 | maintainers = [] 13 | 14 | [upstream] 15 | license = "EUPL-1.2" 16 | website = "https://pi-hole.net/" 17 | admindoc = "https://docs.pi-hole.net" 18 | code = "https://github.com/pi-hole/pi-hole" 19 | fund = "https://pi-hole.net/donate/#donate" 20 | 21 | [integration] 22 | yunohost = ">= 11.2.4" 23 | architectures = "all" 24 | multi_instance = false 25 | ldap = "not_relevant" 26 | sso = "not_relevant" 27 | disk = "200M" 28 | ram.build = "600M" 29 | ram.runtime = "200M" 30 | 31 | [install] 32 | [install.domain] 33 | type = "domain" 34 | 35 | [install.path] 36 | type = "path" 37 | default = "/pihole" 38 | 39 | [install.query_logging] 40 | ask.en = "Do you want to log DNS queries?" 41 | ask.fr = "Voulez-vous enregistrer les requêtes DNS ?" 42 | help.en = "Keeping this option deactivate will render graphs on the admin page useless. But will respect the privacy of the other users." 43 | help.fr = "Garder cette option désactivée rendra les graphiques sur la page d'administration inutiles. Mais respectera la vie privée des autres utilisateurs." 44 | type = "boolean" 45 | default = false 46 | 47 | [install.enable_dhcp] 48 | ask.en = "Do you want to set Pi-Hole as your DHCP server?" 49 | ask.fr = "Voulez-vous utiliser Pi-Hole an tant que serveur DHCP ?" 50 | help.en = "If you want to do that, you really have to read this before!" 51 | help.fr = "Si vous voulez faire ça, vous devez vraiment lire cela avant !" 52 | type = "boolean" 53 | default = false 54 | 55 | [resources] 56 | [resources.sources] 57 | [resources.sources.main] 58 | url = "https://github.com/pi-hole/pi-hole/archive/refs/tags/v5.18.4.tar.gz" 59 | sha256 = "723ed042ae3703eaef8bc0e52ab6ab8d2062684af96c4e4ca09ddc513505df1f" 60 | 61 | autoupdate.upstream = "https://github.com/pi-hole/pi-hole" 62 | autoupdate.strategy = "latest_github_release" 63 | 64 | [resources.sources.pi-hole_web] 65 | url = "https://github.com/pi-hole/web/archive/refs/tags/v5.21.tar.gz" 66 | sha256 = "d8b5f8dd3842dd8b0f3f02a4422182740fd26c3db5ceba1dde9fcd122a36c7f0" 67 | 68 | autoupdate.upstream = "https://github.com/pi-hole/web" 69 | autoupdate.strategy = "latest_github_release" 70 | 71 | [resources.sources.pi-hole_ftl] 72 | url = "https://github.com/pi-hole/FTL/archive/refs/tags/v5.25.2.tar.gz" 73 | sha256 = "d14523c623a4a79afe48b64f3953f73eb454c688edeeded9d95b169b275d354d" 74 | 75 | autoupdate.upstream = "https://github.com/pi-hole/FTL" 76 | autoupdate.strategy = "latest_github_release" 77 | 78 | [resources.system_user] 79 | 80 | [resources.install_dir] 81 | 82 | [resources.permissions] 83 | main.url = "/" 84 | main.allowed = "admins" 85 | 86 | [resources.ports] 87 | main.default = 4711 88 | 89 | [resources.apt] 90 | packages = [ 91 | "php8.2-common", 92 | "php8.2-cgi", 93 | "php8.2-sqlite3", 94 | "php8.2-xml", 95 | "php8.2-intl", 96 | "cmake", 97 | "build-essential", 98 | "libgmp-dev", 99 | "libidn11-dev", 100 | "nettle-dev", 101 | "libreadline-dev", 102 | "sqlite3", 103 | "cron", 104 | "curl", 105 | "iputils-ping", 106 | "psmisc", 107 | "unzip", 108 | "idn2", 109 | "libcap2-bin", 110 | "dns-root-data", 111 | "libcap2", 112 | "netcat-openbsd", 113 | "procps", 114 | "jq", 115 | "xxd", 116 | ] 117 | -------------------------------------------------------------------------------- /scripts/_common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # COMMON VARIABLES 5 | #================================================= 6 | 7 | pihole_adminlte_version=5.18 8 | pihole_flt_version=5.20 9 | 10 | # This is hard-coded upstream... 11 | PI_HOLE_LOCAL_REPO="/etc/.pihole" 12 | PI_HOLE_INSTALL_DIR="/opt/pihole" 13 | PI_HOLE_CONFIG_DIR="/etc/pihole" 14 | PI_HOLE_BIN_DIR="/usr/local/bin" 15 | 16 | # Get the default network interface 17 | main_iface=$(ip route | grep --max-count=1 default | awk '{print $5;}') 18 | 19 | # Get the dnsmasq user to set log files permissions 20 | dnsmasq_user=$(grep DNSMASQ_USER= /etc/init.d/dnsmasq | cut -d'"' -f2) 21 | 22 | # Find the IP associated to the network interface 23 | localipv4=$(ip address | grep "${main_iface}\$" | awk '{print $2;}' | cut -d/ -f1) 24 | 25 | if [ "$query_logging" -eq 1 ]; then 26 | query_logging_str=true 27 | else 28 | query_logging_str=false 29 | fi 30 | 31 | #================================================= 32 | # PERSONAL HELPERS 33 | #================================================= 34 | 35 | _configure_ports() { 36 | if [ "$port" -gt 4720 ]; then 37 | 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." 38 | fi 39 | 40 | # Disable the port 53 for upnp 41 | ynh_exec_fully_quiet yunohost firewall disallow Both 53 --no-reload 42 | ynh_exec_fully_quiet yunohost firewall allow Both 53 --no-upnp 43 | 44 | # Open the UDP port 67 for dhcp 45 | ynh_exec_fully_quiet yunohost firewall allow UDP 67 --no-upnp 46 | } 47 | 48 | _add_cron_jobs() { 49 | install -D -m 644 -T -o root -g root "$PI_HOLE_LOCAL_REPO/advanced/Templates/pihole.cron" /etc/cron.d/pihole 50 | 51 | # Randomize gravity update time 52 | ynh_replace_string --target_file="/etc/cron.d/pihole" \ 53 | --match_string="59 1 " \ 54 | --replace_string="$((1 + RANDOM % 58)) $((3 + RANDOM % 2)) " 55 | 56 | # Randomize update checker time 57 | ynh_replace_string --target_file="/etc/cron.d/pihole" \ 58 | --match_string="59 17" \ 59 | --replace_string="$((1 + RANDOM % 58)) $((12 + RANDOM % 8))" 60 | 61 | # Remove git usage for version. Which fails because we use here a release instead of master. 62 | ynh_replace_string --target_file="/etc/cron.d/pihole" \ 63 | --match_string=".*updatechecker.*" \ 64 | --replace_string="#&" 65 | } 66 | 67 | _add_sudoers_config() { 68 | install -m 0640 "$PI_HOLE_LOCAL_REPO/advanced/Templates/pihole.sudo" /etc/sudoers.d/pihole 69 | echo "$app ALL=NOPASSWD: ${PI_HOLE_BIN_DIR}/pihole" >> /etc/sudoers.d/pihole 70 | } 71 | 72 | _add_logrotate_config() { 73 | install -D -m 644 -T "${PI_HOLE_LOCAL_REPO}"/advanced/Templates/logrotate "$PI_HOLE_CONFIG_DIR/logrotate" 74 | sed -i "/# su #/d;" "$PI_HOLE_CONFIG_DIR/logrotate" 75 | } 76 | 77 | #================================================= 78 | # EXPERIMENTAL HELPERS 79 | #================================================= 80 | 81 | ynh_maintenance_mode_ON () { 82 | mkdir -p /var/www/html/ 83 | 84 | # Create an html to serve as maintenance notice 85 | echo " 86 | 87 | 88 | 89 | Your app $app is currently under maintenance! 90 | 96 | 97 | 98 |

Your app $app is currently under maintenance!

99 |

This app has been put under maintenance by your administrator at $(date)

100 |

Please wait until the maintenance operation is done. This page will be reloaded as soon as your app will be back.

101 | 102 | 103 | " > "/var/www/html/maintenance.$app.html" 104 | 105 | # Create a new nginx config file to redirect all access to the app to the maintenance notice instead. 106 | echo "# All request to the app will be redirected to ${path}_maintenance and fall on the maintenance notice 107 | rewrite ^${path}/(.*)$ ${path}_maintenance/? redirect; 108 | # Use another location, to not be in conflict with the original config file 109 | location ${path}_maintenance/ { 110 | alias /var/www/html/ ; 111 | 112 | try_files maintenance.$app.html =503; 113 | 114 | # Include SSOWAT user panel. 115 | include conf.d/yunohost_panel.conf.inc; 116 | }" > "/etc/nginx/conf.d/$domain.d/maintenance.$app.conf" 117 | 118 | # The current config file will redirect all requests to the root of the app. 119 | # To keep the full path, we can use the following rewrite rule: 120 | # rewrite ^${path}/(.*)$ ${path}_maintenance/\$1? redirect; 121 | # The difference will be in the $1 at the end, which keep the following queries. 122 | # But, if it works perfectly for a html request, there's an issue with any php files. 123 | # This files are treated as simple files, and will be downloaded by the browser. 124 | # Would be really be nice to be able to fix that issue. So that, when the page is reloaded after the maintenance, the user will be redirected to the real page he was. 125 | 126 | systemctl reload nginx 127 | } 128 | 129 | ynh_maintenance_mode_OFF () { 130 | # Rewrite the nginx config file to redirect from ${path}_maintenance to the real url of the app. 131 | echo "rewrite ^${path}_maintenance/(.*)$ ${path}/\$1 redirect;" > "/etc/nginx/conf.d/$domain.d/maintenance.$app.conf" 132 | systemctl reload nginx 133 | 134 | # Sleep 4 seconds to let the browser reload the pages and redirect the user to the app. 135 | sleep 4 136 | 137 | # Then remove the temporary files used for the maintenance. 138 | rm "/var/www/html/maintenance.$app.html" 139 | rm "/etc/nginx/conf.d/$domain.d/maintenance.$app.conf" 140 | 141 | systemctl reload nginx 142 | } 143 | 144 | #================================================= 145 | # FUTURE OFFICIAL HELPERS 146 | #================================================= 147 | -------------------------------------------------------------------------------- /scripts/backup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # IMPORT GENERIC HELPERS 5 | #================================================= 6 | 7 | # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts 8 | source ../settings/scripts/_common.sh 9 | source /usr/share/yunohost/helpers 10 | 11 | #================================================= 12 | # DECLARE DATA AND CONF FILES TO BACKUP 13 | #================================================= 14 | ynh_print_info --message="Declaring files to be backed up..." 15 | 16 | #================================================= 17 | # BACKUP THE APP MAIN DIR 18 | #================================================= 19 | 20 | ynh_backup --src_path="$install_dir" 21 | 22 | #================================================= 23 | # BACKUP THE SYSTEM CONFIGURATION 24 | #================================================= 25 | 26 | ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" 27 | 28 | ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" 29 | 30 | ynh_backup --src_path="/etc/cron.d/pihole" 31 | 32 | ynh_backup --src_path="/etc/sudoers.d/pihole" 33 | 34 | ynh_backup --src_path="/etc/init.d/pihole-FTL" 35 | 36 | ynh_backup --src_path="/usr/share/yunohost/hooks/conf_regen/50-dnsmasq_$app" 37 | 38 | if test -e "/etc/dnsmasq.d/03-pihole-wildcard.conf"; then 39 | ynh_backup --src_path="/etc/dnsmasq.d/03-pihole-wildcard.conf" 40 | fi 41 | 42 | #================================================= 43 | # BACKUP VARIOUS FILES 44 | #================================================= 45 | 46 | ynh_backup --src_path="$PI_HOLE_LOCAL_REPO" 47 | ynh_backup --src_path="$PI_HOLE_CONFIG_DIR" 48 | ynh_backup --src_path="$PI_HOLE_INSTALL_DIR" 49 | 50 | ynh_backup --src_path="$PI_HOLE_BIN_DIR/pihole" 51 | ynh_backup --src_path="/etc/bash_completion.d/pihole" 52 | 53 | ynh_backup --src_path="/usr/bin/pihole-FTL" 54 | 55 | #================================================= 56 | # END OF SCRIPT 57 | #================================================= 58 | 59 | ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." 60 | -------------------------------------------------------------------------------- /scripts/change_url: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # IMPORT GENERIC HELPERS 5 | #================================================= 6 | 7 | source _common.sh 8 | source /usr/share/yunohost/helpers 9 | 10 | #================================================= 11 | # ACTIVATE MAINTENANCE MODE 12 | #================================================= 13 | ynh_script_progression --message="Activating maintenance mode..." --weight=1 14 | 15 | ynh_maintenance_mode_ON 16 | 17 | #================================================= 18 | # MODIFY URL IN NGINX CONF 19 | #================================================= 20 | ynh_script_progression --message="Updating NGINX web server configuration..." --weight=4 21 | 22 | ynh_change_url_nginx_config 23 | 24 | #================================================= 25 | # DEACTIVE MAINTENANCE MODE 26 | #================================================= 27 | ynh_script_progression --message="Disabling maintenance mode..." --weight=5 28 | 29 | ynh_maintenance_mode_OFF 30 | 31 | #================================================= 32 | # END OF SCRIPT 33 | #================================================= 34 | 35 | ynh_script_progression --message="Change of URL completed for $app" --last 36 | -------------------------------------------------------------------------------- /scripts/install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # IMPORT GENERIC HELPERS 5 | #================================================= 6 | 7 | source _common.sh 8 | source /usr/share/yunohost/helpers 9 | 10 | #================================================= 11 | # INITIALIZE AND STORE SETTINGS 12 | #================================================= 13 | 14 | ynh_app_setting_set --app="$app" --key="overwrite_setupvars" --value=1 15 | ynh_app_setting_set --app="$app" --key="overwrite_ftl" --value=1 16 | 17 | #================================================= 18 | # CHECK AVAILABLE PORT 19 | #================================================= 20 | 21 | _configure_ports 22 | 23 | #================================================= 24 | # DOWNLOAD, CHECK AND UNPACK SOURCE 25 | #================================================= 26 | ynh_script_progression --message="Setting up source files..." --weight=4 27 | 28 | # Download, check integrity, uncompress and patch the source from app.src 29 | ynh_setup_source --dest_dir="$PI_HOLE_LOCAL_REPO" 30 | ynh_setup_source --source_id="pi-hole_web" --dest_dir="$install_dir/web" 31 | ynh_setup_source --source_id="pi-hole_ftl" --dest_dir="$install_dir/ftl" 32 | 33 | chmod -R o-rwx "$install_dir" 34 | chown -R "$app:www-data" "$install_dir" 35 | 36 | touch /var/log/{pihole,pihole-FTL}.log 37 | chmod 644 /var/log/{pihole,pihole-FTL}.log 38 | chown "$dnsmasq_user:root" /var/log/{pihole,pihole-FTL}.log 39 | 40 | #================================================= 41 | # INSTALLATION OF PIHOLE-FTL 42 | #================================================= 43 | ynh_script_progression --message="Building PiHole-FTL..." --weight=30 44 | 45 | # Instead of downloading a binary file, we're going to compile it 46 | pushd "$install_dir/ftl" 47 | ynh_exec_warn_less cmake . 48 | ynh_exec_warn_less make 49 | ynh_exec_warn_less make install 50 | popd 51 | ynh_secure_remove --file="$install_dir/ftl" 52 | 53 | #================================================= 54 | # INSTALL THE SCRIPTS 55 | #================================================= 56 | ynh_script_progression --message="Installing Pihole..." --weight=1 57 | 58 | install -o "$app" -Dm755 -d "$PI_HOLE_INSTALL_DIR" 59 | install -o "$app" -Dm755 -t "$PI_HOLE_INSTALL_DIR" "$PI_HOLE_LOCAL_REPO/gravity.sh" 60 | install -o "$app" -Dm755 -t "$PI_HOLE_INSTALL_DIR" "$PI_HOLE_LOCAL_REPO/advanced/Scripts"/*.sh 61 | install -o "$app" -Dm755 -t "$PI_HOLE_INSTALL_DIR" "$PI_HOLE_LOCAL_REPO/advanced/Scripts/COL_TABLE" 62 | install -Dm644 -t /etc/bash_completion.d/ "$PI_HOLE_LOCAL_REPO/advanced/bash-completion/pihole" 63 | 64 | install -o "$app" -Dm755 -t "$PI_HOLE_BIN_DIR" "$PI_HOLE_LOCAL_REPO/pihole" 65 | 66 | #================================================= 67 | # INSTALL THE CONFIGS 68 | #================================================= 69 | ynh_script_progression --message="Installing $app's configuration files..." --weight=1 70 | 71 | install -d -m 0755 "$PI_HOLE_CONFIG_DIR" 72 | ynh_add_config --template="dns-servers.conf" --destination="$PI_HOLE_CONFIG_DIR/dns-servers.conf" 73 | ynh_add_config --template="pihole-FTL.conf" --destination="$PI_HOLE_CONFIG_DIR/pihole-FTL.conf" 74 | ynh_add_config --template="setupVars.conf" --destination="$PI_HOLE_CONFIG_DIR/setupVars.conf" 75 | 76 | chmod 644 "${PI_HOLE_CONFIG_DIR}/dns-servers.conf" 77 | 78 | #================================================= 79 | # SET VERSIONS FOR THE FOOTER OF THE WEB INTERFACE 80 | #================================================= 81 | ynh_script_progression --message="Setting versions for the footer of the web interface..." --weight=1 82 | 83 | echo "master master master" > "$PI_HOLE_CONFIG_DIR/localbranches" 84 | echo "$(ynh_app_upstream_version) $pihole_adminlte_version $pihole_flt_version" \ 85 | | tee "$PI_HOLE_CONFIG_DIR/"{GitHubVersions,localversions} > /dev/null 86 | 87 | #================================================= 88 | # BUILD THE LISTS WITH GRAVITY 89 | #================================================= 90 | ynh_script_progression --message="Building the lists with Gravity..." --weight=7 91 | 92 | ynh_add_config --template="adlists.default" --destination="$PI_HOLE_CONFIG_DIR/adlists.list" 93 | ynh_exec_warn_less "$PI_HOLE_INSTALL_DIR/gravity.sh" --force 94 | 95 | #================================================= 96 | # CONFIGURE DNS FOR THE LOCAL DOMAINS 97 | #================================================= 98 | ynh_script_progression --message="Configuring DNS for the local domains..." --weight=7 99 | 100 | # List all YunoHost domains 101 | while read -r perdomain; do 102 | # Comment domain resolution in /etc/hosts on 127.0.0.1, because they can interfere with the local network resolution. 103 | ynh_replace_string --match_string="^127.0.0.1.*$perdomain" --replace_string="#Commented by pihole# &" --target_file=/etc/hosts 104 | 105 | # And add a resolution on the local IP instead 106 | grep -q "^$localipv4.*$perdomain" /etc/hosts || \ 107 | echo "$localipv4 $perdomain #Added by pihole#" >> /etc/hosts 108 | done <<< "$(yunohost domain list | grep "\." | sed 's/.*: \|.*- //')" 109 | 110 | #================================================= 111 | # DISABLING DNSMASQ 112 | #================================================= 113 | ynh_script_progression --message="Disabling Dnsmasq in system and yunohost..." --weight=1 114 | 115 | # Stop dnsmasq to replace it by pihole-FTL 116 | ynh_systemd_action --service_name=dnsmasq --action=stop 117 | 118 | # Replace the service dnsmasq by pihole-FTL 119 | # That way, YunoHost can continue to use dnsmasq by actually using pihole-FTL 120 | #ln -sf /run/systemd/generator.late/pihole-FTL.service /etc/systemd/system/dnsmasq.service 121 | systemctl mask dnsmasq.service 122 | 123 | # Reload systemd config 124 | systemctl daemon-reload 125 | 126 | # Workaround for strings to not be replaced 127 | a_range="__A_RANGE__" 128 | b_range="__B_RANGE__" 129 | gateway="__GATEWAY__" 130 | ynh_add_config --template="dnsmasq_regenconf_hook" --destination="/usr/share/yunohost/hooks/conf_regen/50-dnsmasq_$app" 131 | ynh_exec_warn_less yunohost tools regen-conf dnsmasq 132 | 133 | #================================================= 134 | # SYSTEM CONFIGURATION 135 | #================================================= 136 | ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 137 | 138 | # Create a dedicated PHP-FPM config 139 | ynh_add_fpm_config 140 | 141 | # Create a dedicated NGINX config 142 | ynh_add_nginx_config 143 | 144 | # Create sudoers config 145 | _add_sudoers_config 146 | 147 | _add_cron_jobs 148 | 149 | _add_logrotate_config 150 | 151 | install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL.service" "/etc/init.d/pihole-FTL" 152 | install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL-prestart.sh" "${PI_HOLE_INSTALL_DIR}/pihole-FTL-prestart.sh" 153 | install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL-poststop.sh" "${PI_HOLE_INSTALL_DIR}/pihole-FTL-poststop.sh" 154 | 155 | ynh_exec_warn_less systemctl enable pihole-FTL --quiet 156 | yunohost service add pihole-FTL --description="PiHole backend service" --log="/var/log/pihole-FTL.log" --needs_exposed_ports 53 67 157 | 158 | #================================================= 159 | # START SYSTEMD SERVICE 160 | #================================================= 161 | ynh_script_progression --message="Starting $app's systemd service..." --weight=2 162 | 163 | ynh_systemd_action --service_name="pihole-FTL" --action=restart --log_path="/var/log/pihole-FTL.log" 164 | 165 | #================================================= 166 | # END OF SCRIPT 167 | #================================================= 168 | 169 | ynh_script_progression --message="Installation of $app completed" --last 170 | -------------------------------------------------------------------------------- /scripts/remove: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # IMPORT GENERIC HELPERS 5 | #================================================= 6 | 7 | source _common.sh 8 | source /usr/share/yunohost/helpers 9 | 10 | #================================================= 11 | # REMOVE SYSTEM CONFIGURATIONS 12 | #================================================= 13 | ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 14 | 15 | # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) 16 | if ynh_exec_warn_less yunohost service status "pihole-FTL" >/dev/null; then 17 | yunohost service remove "pihole-FTL" 18 | fi 19 | 20 | ynh_systemd_action --service_name="pihole-FTL" --action="stop" 21 | 22 | # Restore dnsmasq as main DNS resolver 23 | # Move dnsmasq back to its original place 24 | #if [ -e "/usr/sbin/dnsmasq.backup_by_pihole" ] 25 | #then # Remove dnsmasq only if we have its backup 26 | # ynh_secure_remove --file="/usr/sbin/dnsmasq" 27 | # mv /usr/sbin/dnsmasq.backup_by_pihole /usr/sbin/dnsmasq 28 | #fi 29 | 30 | # Move back the service configuration for dnsmasq 31 | #ynh_secure_remove --file="/etc/systemd/system/dnsmasq.service" 32 | #mv /lib/systemd/system/.dnsmasq.service.backup_by_pihole /lib/systemd/system/dnsmasq.service 33 | #mv /etc/init.d/.dnsmasq.backup_by_pihole /etc/init.d/dnsmasq 34 | systemctl unmask dnsmasq.service 35 | 36 | #ynh_exec_warn_less systemctl enable dnsmasq --quiet 37 | # Reload systemd config 38 | systemctl daemon-reload 39 | 40 | ynh_secure_remove --file="/etc/init.d/pihole-FTL" 41 | ynh_secure_remove --file="/usr/bin/pihole-FTL" 42 | ynh_secure_remove --file="/var/run/pihole-FTL.pid" 43 | ynh_secure_remove --file="/var/run/pihole-FTL.port" 44 | 45 | # Remove the dedicated NGINX config 46 | ynh_remove_nginx_config 47 | 48 | # Remove the dedicated PHP-FPM config 49 | ynh_remove_fpm_config 50 | 51 | #================================================= 52 | # CLOSE A PORT 53 | #================================================= 54 | 55 | if yunohost firewall list | grep -q "\- $port$"; then 56 | ynh_script_progression --message="Closing port $port..." --weight=1 57 | ynh_exec_warn_less yunohost firewall disallow TCP "$port" 58 | fi 59 | 60 | if yunohost firewall list | grep -q "\- 67$"; then 61 | ynh_script_progression --message="Closing port 67..." --weight=1 62 | ynh_exec_warn_less yunohost firewall disallow UDP 67 63 | fi 64 | 65 | #================================================= 66 | # REMOVE VARIOUS FILES 67 | #================================================= 68 | ynh_script_progression --message="Removing various files..." --weight=1 69 | 70 | # Remove a cron file 71 | ynh_secure_remove --file="/etc/cron.d/$app" 72 | 73 | # Remove main script 74 | ynh_secure_remove --file="$PI_HOLE_BIN_DIR/pihole" 75 | ynh_secure_remove --file="/etc/bash_completion.d/pihole" 76 | 77 | # Remove sudoer file 78 | ynh_secure_remove --file="/etc/sudoers.d/pihole" 79 | 80 | # Remove storage directory 81 | ynh_secure_remove --file="$PI_HOLE_CONFIG_DIR" 82 | # Remove app directory 83 | ynh_secure_remove --file="$PI_HOLE_INSTALL_DIR" 84 | # Remove local clone of the repository 85 | ynh_secure_remove --file="$PI_HOLE_LOCAL_REPO" 86 | 87 | #================================================= 88 | # REMOVE DNSMASQ CONFIG 89 | #================================================= 90 | ynh_script_progression --message="Removing Dnsmasq config..." --weight=2 91 | 92 | ynh_secure_remove --file="/etc/dnsmasq.d/03-pihole-wildcard.conf" 93 | 94 | #================================================= 95 | # CLEAN /etc/hosts 96 | #================================================= 97 | ynh_script_progression --message="Clean /etc/hosts" --weight=1 98 | 99 | # Uncomment lines in /etc/hosts 100 | ynh_replace_string --match_string="#Commented by pihole# " --replace_string="" --target_file=/etc/hosts 101 | 102 | # And remove extra lines, added by PiHole 103 | sed -i "/#Added by pihole#/d" /etc/hosts 104 | 105 | #================================================= 106 | # REMOVE CONF_REGEN HOOK 107 | #================================================= 108 | ynh_script_progression --message="Removing conf_regen hook..." --weight=1 109 | 110 | ynh_systemd_action --service_name=dnsmasq --action=stop 111 | 112 | ynh_secure_remove --file="/usr/share/yunohost/hooks/conf_regen/50-dnsmasq_$app" 113 | 114 | ynh_exec_warn_less yunohost tools regen-conf dnsmasq 115 | 116 | #================================================= 117 | # RESTART DNSMASQ 118 | #================================================= 119 | ynh_script_progression --message="Restarting Dnsmasq..." --weight=1 120 | 121 | ynh_systemd_action --service_name=dnsmasq --action=restart 122 | 123 | #================================================= 124 | # REMOVE DEDICATED USER 125 | #================================================= 126 | 127 | # Dirty hack to remove correctly the user 128 | killall -u "$app" 129 | 130 | #================================================= 131 | # END OF SCRIPT 132 | #================================================= 133 | 134 | ynh_script_progression --message="Removal of $app completed" --last 135 | -------------------------------------------------------------------------------- /scripts/restore: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # IMPORT GENERIC HELPERS 5 | #================================================= 6 | 7 | # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts 8 | source ../settings/scripts/_common.sh 9 | source /usr/share/yunohost/helpers 10 | 11 | #================================================= 12 | # INITIALIZE AND STORE SETTINGS 13 | #================================================= 14 | 15 | dnsmasq_user=$(grep DNSMASQ_USER= /etc/init.d/dnsmasq | cut -d'"' -f2) 16 | 17 | #================================================= 18 | # CHECK AVAILABLE PORT 19 | #================================================= 20 | 21 | _configure_ports 22 | 23 | #================================================= 24 | # ACTIVATE MAINTENANCE MODE 25 | #================================================= 26 | ynh_script_progression --message="Activating maintenance mode..." --weight=2 27 | 28 | ynh_maintenance_mode_ON 29 | 30 | #================================================= 31 | # RESTORE THE APP MAIN DIR 32 | #================================================= 33 | ynh_script_progression --message="Restoring the app main directory..." --weight=1 34 | 35 | ynh_restore_file --origin_path="$install_dir" 36 | 37 | chmod -R o-rwx "$install_dir" 38 | chown -R "$app:www-data" "$install_dir" 39 | 40 | touch /var/log/{pihole,pihole-FTL}.log 41 | chmod 644 /var/log/{pihole,pihole-FTL}.log 42 | chown "$dnsmasq_user:root" /var/log/{pihole,pihole-FTL}.log 43 | 44 | #================================================= 45 | # RESTORE SPECIFIC FILES 46 | #================================================= 47 | ynh_script_progression --message="Restoring specific files..." --weight=1 48 | 49 | ynh_restore_file --origin_path="$PI_HOLE_LOCAL_REPO" 50 | 51 | ynh_restore_file --origin_path="$PI_HOLE_CONFIG_DIR" 52 | chown "$app:" -R "$PI_HOLE_CONFIG_DIR" 53 | 54 | # $PI_HOLE_CONFIG_DIR/logrotate have to belong to root, otherwise logrotate will failed silently... 55 | chown root: -R "$PI_HOLE_CONFIG_DIR/logrotate" 56 | 57 | ynh_restore_file --origin_path="$PI_HOLE_INSTALL_DIR" 58 | 59 | ynh_restore_file --origin_path="$PI_HOLE_BIN_DIR/pihole" 60 | 61 | ynh_restore_file --origin_path="/etc/bash_completion.d/pihole" 62 | 63 | ynh_restore_file --origin_path="/usr/bin/pihole-FTL" 64 | 65 | #================================================= 66 | # FINAL EXPORTS 67 | #================================================= 68 | ynh_script_progression --message="Final exports..." --weight=1 69 | 70 | setupVars="$PI_HOLE_CONFIG_DIR/setupVars.conf" 71 | 72 | # Get the default network interface 73 | main_iface=$(ip route | grep --max-count=1 default | awk '{print $5;}') 74 | echo "PIHOLE_INTERFACE=$main_iface" > "$setupVars" 75 | ynh_replace_string --target_file="$setupVars" --match_string="^PIHOLE_INTERFACE=.*" --replace_string="PIHOLE_INTERFACE=$main_iface" 76 | ynh_replace_string --target_file="$setupVars" --match_string="^IPV4_ADDRESS=.*" --replace_string="IPV4_ADDRESS=127.0.0.1" 77 | 78 | # Calculate and store the config file checksum into the app settings 79 | ynh_store_file_checksum --file="$setupVars" 80 | 81 | #================================================= 82 | # CONFIGURE DNS FOR THE LOCAL DOMAINS 83 | #================================================= 84 | ynh_script_progression --message="Configuring DNS for the local domains..." --weight=2 85 | 86 | # Find the IP associated to the network interface 87 | localipv4=$(ip address | grep "${main_iface}\$" | awk '{print $2;}' | cut -d/ -f1) 88 | 89 | # List all YunoHost domains 90 | while read -r perdomain; do 91 | # Comment domain resolution in /etc/hosts on 127.0.0.1, because they can interfere with the local network resolution. 92 | ynh_replace_string --match_string="^127.0.0.1.*$perdomain" --replace_string="#Commented by pihole# &" --target_file=/etc/hosts 93 | 94 | # And add a resolution on the local IP instead 95 | grep -q "^$localipv4.*$perdomain" /etc/hosts || \ 96 | echo "$localipv4 $perdomain #Added by pihole#" >> /etc/hosts 97 | done <<< "$(yunohost domain list | grep "\." | sed 's/.*: \|.*- //')" 98 | 99 | #================================================= 100 | # DISABLING DNSMASQ 101 | #================================================= 102 | ynh_script_progression --message="Disabling Dnsmasq in system and yunohost..." --weight=1 103 | 104 | # Stopped dnsmasq to replace it by pihole-FTL 105 | ynh_systemd_action --service_name=dnsmasq --action=stop 106 | 107 | # Replace the service dnsmasq by pihole-FTL 108 | # That way, YunoHost can continue to use dnsmasq by actually using pihole-FTL 109 | #ln -sf /run/systemd/generator.late/pihole-FTL.service /etc/systemd/system/dnsmasq.service 110 | systemctl mask dnsmasq.service 111 | 112 | # Disable the real dnsmasq service 113 | #ynh_exec_warn_less systemctl disable dnsmasq --quiet 114 | 115 | # Reload systemd config 116 | systemctl daemon-reload 117 | 118 | test -e "${YNH_APP_BACKUP_DIR}/etc/dnsmasq.d/03-pihole-wildcard.conf" && ynh_restore_file --origin_path="/etc/dnsmasq.d/03-pihole-wildcard.conf" 119 | ynh_restore_file --origin_path="/usr/share/yunohost/hooks/conf_regen/50-dnsmasq_$app" 120 | ynh_exec_warn_less yunohost tools regen-conf dnsmasq 121 | 122 | #================================================= 123 | # RESTORE SYSTEM CONFIGURATIONS 124 | #================================================= 125 | ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 126 | 127 | ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" 128 | 129 | # Restore the file first, so it can have a backup if different 130 | ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" 131 | ynh_add_fpm_config 132 | 133 | ynh_restore_file --origin_path="/etc/cron.d/pihole" 134 | 135 | ynh_restore_file --origin_path="/etc/sudoers.d/pihole" 136 | 137 | ynh_restore_file --origin_path="/etc/init.d/pihole-FTL" 138 | # install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL.service" "/etc/init.d/pihole-FTL" 139 | systemctl daemon-reload 140 | ynh_exec_warn_less systemctl enable pihole-FTL --quiet 141 | yunohost service add pihole-FTL --description="PiHole backend service" --log="/var/log/pihole-FTL.log" --needs_exposed_ports 53 67 142 | 143 | #================================================= 144 | # RELOAD NGINX AND PHP-FPM OR THE APP SERVICE 145 | #================================================= 146 | ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 147 | 148 | ynh_systemd_action --service_name="pihole-FTL" --action="restart" --log_path="/var/log/pihole-FTL.log" 149 | 150 | ynh_systemd_action --service_name="php$phpversion-fpm" --action=reload 151 | 152 | ynh_systemd_action --service_name="nginx" --action=reload 153 | 154 | #================================================= 155 | # DEACTIVE MAINTENANCE MODE 156 | #================================================= 157 | ynh_script_progression --message="Disabling maintenance mode..." --weight=4 158 | 159 | ynh_maintenance_mode_OFF 160 | 161 | #================================================= 162 | # END OF SCRIPT 163 | #================================================= 164 | 165 | ynh_script_progression --message="Restoration completed for $app" --last 166 | -------------------------------------------------------------------------------- /scripts/upgrade: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # IMPORT GENERIC HELPERS 5 | #================================================= 6 | 7 | source _common.sh 8 | source /usr/share/yunohost/helpers 9 | 10 | #================================================= 11 | # ACTIVATE MAINTENANCE MODE 12 | #================================================= 13 | ynh_script_progression --message="Activating maintenance mode..." --weight=1 14 | 15 | ynh_maintenance_mode_ON 16 | 17 | #================================================= 18 | # STOP SYSTEMD SERVICE 19 | #================================================= 20 | ynh_script_progression --message="Stopping a systemd service..." --weight=1 21 | 22 | ynh_systemd_action --service_name=pihole-FTL --action="stop" --log_path="/var/log/pihole-FTL.log" 23 | 24 | #================================================= 25 | # ENSURE DOWNWARD COMPATIBILITY 26 | #================================================= 27 | ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 28 | 29 | # If overwrite_setupvars doesn't exist, create it 30 | if [ -z "${overwrite_setupvars:-}" ]; then 31 | overwrite_setupvars=1 32 | ynh_app_setting_set --app="$app" --key="overwrite_setupvars" --value="$overwrite_setupvars" 33 | fi 34 | 35 | # If overwrite_ftl doesn't exist, create it 36 | if [ -z "${overwrite_ftl:-}" ]; then 37 | overwrite_ftl=1 38 | ynh_app_setting_set --app="$app" --key="overwrite_ftl" --value="$overwrite_ftl" 39 | fi 40 | 41 | # If pihole_version doesn't exist, create it 42 | if [ -z "${pihole_version:-}" ]; then 43 | pihole_version="Last 3.X" 44 | ynh_app_setting_set --app="$app" --key="pihole_version" --value=""$pihole_version"" 45 | fi 46 | 47 | #================================================= 48 | # DOWNLOAD, CHECK AND UNPACK SOURCE 49 | #================================================= 50 | ynh_script_progression --message="Upgrading source files..." --weight=4 51 | 52 | # Download, check integrity, uncompress and patch the source from app.src 53 | ynh_setup_source --dest_dir="$PI_HOLE_LOCAL_REPO" 54 | ynh_setup_source --source_id="pi-hole_web" --dest_dir="$install_dir/web" 55 | ynh_setup_source --source_id="pi-hole_ftl" --dest_dir="$install_dir/ftl" 56 | 57 | chmod -R o-rwx "$install_dir" 58 | chown -R "$app:www-data" "$install_dir" 59 | 60 | touch /var/log/{pihole,pihole-FTL}.log 61 | chmod 644 /var/log/{pihole,pihole-FTL}.log 62 | chown "$dnsmasq_user:root" /var/log/{pihole,pihole-FTL}.log 63 | 64 | #================================================= 65 | # UPGRADE OF PIHOLE-FTL 66 | #================================================= 67 | ynh_script_progression --message="Rebuilding PiHole-FTL..." --weight=30 68 | 69 | # Instead of downloading a binary file, we're going to compile it 70 | pushd "$install_dir/ftl" 71 | ynh_exec_warn_less cmake . 72 | ynh_exec_warn_less make 73 | ynh_exec_warn_less make install 74 | popd 75 | ynh_secure_remove --file="$install_dir/ftl" 76 | 77 | #================================================= 78 | # UPDATE THE SCRIPTS 79 | #================================================= 80 | ynh_script_progression --message="Upgrading Pihole..." --weight=1 81 | 82 | install -o "$app" -Dm755 -d "$PI_HOLE_INSTALL_DIR" 83 | install -o "$app" -Dm755 -t "$PI_HOLE_INSTALL_DIR" "$PI_HOLE_LOCAL_REPO/gravity.sh" 84 | install -o "$app" -Dm755 -t "$PI_HOLE_INSTALL_DIR" "$PI_HOLE_LOCAL_REPO/advanced/Scripts"/*.sh 85 | install -o "$app" -Dm755 -t "$PI_HOLE_INSTALL_DIR" "$PI_HOLE_LOCAL_REPO/advanced/Scripts/COL_TABLE" 86 | install -Dm644 -t /etc/bash_completion.d/ "$PI_HOLE_LOCAL_REPO/advanced/bash-completion/pihole" 87 | 88 | install -o "$app" -Dm755 -t "$PI_HOLE_BIN_DIR" "$PI_HOLE_LOCAL_REPO/pihole" 89 | 90 | #================================================= 91 | # UPDATE THE CONFIGS 92 | #================================================= 93 | ynh_script_progression --message="Updating $app's configuration files..." --weight=1 94 | 95 | install -d -m 0755 "$PI_HOLE_CONFIG_DIR" 96 | ynh_add_config --template="dns-servers.conf" --destination="$PI_HOLE_CONFIG_DIR/dns-servers.conf" 97 | # Overwrite pihole-FTL config file only if it's allowed 98 | if [ "$overwrite_ftl" -eq 1 ]; then 99 | ynh_add_config --template="pihole-FTL.conf" --destination="$PI_HOLE_CONFIG_DIR/pihole-FTL.conf" 100 | fi 101 | # Overwrite the setupVars config file only if it's allowed 102 | if [ "$overwrite_setupvars" -eq 1 ]; then 103 | ynh_add_config --template="setupVars.conf" --destination="$PI_HOLE_CONFIG_DIR/setupVars.conf" 104 | fi 105 | 106 | chmod 644 "${PI_HOLE_CONFIG_DIR}/dns-servers.conf" 107 | 108 | #================================================= 109 | # SET VERSIONS FOR THE FOOTER OF THE WEB INTERFACE 110 | #================================================= 111 | ynh_script_progression --message="Setting versions for the footer of the web interface..." --weight=1 112 | 113 | echo "master master master" > "$PI_HOLE_CONFIG_DIR/localbranches" 114 | echo "$(ynh_app_upstream_version) $pihole_adminlte_version $pihole_flt_version" \ 115 | | tee "$PI_HOLE_CONFIG_DIR/"{GitHubVersions,localversions} > /dev/null 116 | 117 | #================================================= 118 | # BUILD THE LISTS WITH GRAVITY 119 | #================================================= 120 | ynh_script_progression --message="Building the lists with Gravity..." --weight=7 121 | 122 | ynh_add_config --template="adlists.default" --destination="$PI_HOLE_CONFIG_DIR/adlists.list" 123 | ynh_exec_warn_less "$PI_HOLE_INSTALL_DIR/gravity.sh" --force 124 | 125 | #================================================= 126 | # CONFIGURE DNS FOR THE LOCAL DOMAINS 127 | #================================================= 128 | ynh_script_progression --message="Configuring DNS for the local domains..." --weight=7 129 | 130 | # List all YunoHost domains 131 | while read -r perdomain; do 132 | # Comment domain resolution in /etc/hosts on 127.0.0.1, because they can interfere with the local network resolution. 133 | ynh_replace_string --match_string="^127.0.0.1.*$perdomain" --replace_string="#Commented by pihole# &" --target_file=/etc/hosts 134 | 135 | # And add a resolution on the local IP instead 136 | grep -q "^$localipv4.*$perdomain" /etc/hosts || \ 137 | echo "$localipv4 $perdomain #Added by pihole#" >> /etc/hosts 138 | done <<< "$(yunohost domain list | grep "\." | sed 's/.*: \|.*- //')" 139 | 140 | #================================================= 141 | # DISABLING DNSMASQ 142 | #================================================= 143 | ynh_script_progression --message="Disabling Dnsmasq in system and yunohost..." --weight=1 144 | 145 | # Stop dnsmasq to replace it by pihole-FTL 146 | ynh_systemd_action --service_name=dnsmasq --action=stop 147 | 148 | # Disable the real dnsmasq service 149 | #ynh_exec_warn_less systemctl disable dnsmasq --quiet 150 | 151 | # Replace the service dnsmasq by pihole-FTL 152 | # That way, YunoHost can continue to use dnsmasq by actually using pihole-FTL 153 | #ln -sf /run/systemd/generator.late/pihole-FTL.service /etc/systemd/system/dnsmasq.service 154 | systemctl mask dnsmasq.service 155 | 156 | # Reload systemd config 157 | systemctl daemon-reload 158 | 159 | # Workaround for strings to not be replaced 160 | a_range="__A_RANGE__" 161 | b_range="__B_RANGE__" 162 | gateway="__GATEWAY__" 163 | ynh_add_config --template="dnsmasq_regenconf_hook" --destination="/usr/share/yunohost/hooks/conf_regen/50-dnsmasq_$app" 164 | ynh_exec_warn_less yunohost tools regen-conf dnsmasq 165 | 166 | #================================================= 167 | # REAPPLY SYSTEM CONFIGURATIONS 168 | #================================================= 169 | ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 170 | 171 | # Create a dedicated PHP-FPM config 172 | ynh_add_fpm_config 173 | 174 | # Create a dedicated NGINX config 175 | ynh_add_nginx_config 176 | 177 | _add_sudoers_config 178 | 179 | _add_cron_jobs 180 | 181 | _add_logrotate_config 182 | 183 | install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL.service" "/etc/init.d/pihole-FTL" 184 | install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL-prestart.sh" "${PI_HOLE_INSTALL_DIR}/pihole-FTL-prestart.sh" 185 | install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL-poststop.sh" "${PI_HOLE_INSTALL_DIR}/pihole-FTL-poststop.sh" 186 | ynh_exec_warn_less systemctl enable pihole-FTL --quiet 187 | yunohost service add pihole-FTL --description="PiHole backend service" --log="/var/log/pihole-FTL.log" --needs_exposed_ports 53 67 188 | 189 | #================================================= 190 | # START SYSTEMD SERVICE 191 | #================================================= 192 | ynh_script_progression --message="Starting $app's systemd service..." --weight=2 193 | 194 | ynh_systemd_action --service_name=pihole-FTL --action=restart --log_path="/var/log/pihole-FTL.log" 195 | 196 | #================================================= 197 | # DEACTIVE MAINTENANCE MODE 198 | #================================================= 199 | ynh_script_progression --message="Disabling maintenance mode..." --weight=5 200 | 201 | ynh_maintenance_mode_OFF 202 | 203 | #================================================= 204 | # END OF SCRIPT 205 | #================================================= 206 | 207 | ynh_script_progression --message="Upgrade of $app completed" --last 208 | -------------------------------------------------------------------------------- /tests.toml: -------------------------------------------------------------------------------- 1 | #:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json 2 | 3 | test_format = 1.0 4 | 5 | [default] 6 | 7 | args.query_logging = 1 8 | args.enable_dhcp = 0 9 | 10 | # ------------ 11 | # Tests to run 12 | # ------------ 13 | 14 | [default.test_upgrade_from.5cc0fe9d7586001602bbaf87084c0ddbbaa041a6] 15 | name = "Last packagingv1 version" 16 | args.admin = "package_checker" 17 | args.domain = "domain.tld" 18 | args.path = "/" 19 | 20 | # ; Config_panel 21 | # main.overwrite_files.overwrite_setupvars=0|1 22 | # main.overwrite_files.overwrite_ftl=0|1 23 | # main.overwrite_files.overwrite_nginx=0|1 24 | # main.overwrite_files.overwrite_phpfpm=0|1 25 | # main.global_config.email_type=0|1 26 | # main.php_fpm_config.footprint=low|medium|high 27 | # main.php_fpm_config.free_footprint=20 28 | # main.php_fpm_config.usage=low|medium|high 29 | # main.php_fpm_config.force_max_children=20|0 30 | 31 | # actions=0 32 | # config_panel=0 33 | --------------------------------------------------------------------------------