├── LICENSE
├── README.md
└── examples
├── backup-daily-export-to-s3-bucket
├── README.md
└── backup-daily-export-to-s3.sh
├── backup-raw-data-to-s3-bucket
├── README.md
└── backup-to-s3.sh
├── docker
├── multiple-nodes-with-multitenancy
│ ├── 11-piler.conf
│ ├── README.md
│ ├── install.sh
│ ├── master
│ │ ├── docker-compose.yaml
│ │ └── manticore.conf
│ └── worker0
│ │ ├── docker-compose.yaml
│ │ ├── manticore.conf
│ │ └── piler.conf.worker0
├── multiple-piler-containers-with-multitenancy
│ ├── 11-piler.conf
│ ├── README.md
│ ├── docker-compose.yaml
│ ├── manticore-worker.conf
│ └── manticore.conf
└── piler-with-traefik
│ ├── README.md
│ ├── acme.json
│ ├── docker-compose.yaml
│ ├── manticore.conf
│ └── traefik.yaml
├── goss
├── README.md
└── goss.yaml
├── lets-encrypt-with-traefik
├── README.md
├── nginx.conf
├── piler-nginx.conf
├── traefik.service
└── traefik.yaml
├── saml2
├── README.md
└── saml2.php
├── waf
├── README.md
├── docker-compose.yaml
├── traefik.yaml
└── waf.log.json
└── zentyal
├── README.md
├── docker-compose.yaml
├── mail.postsetconf
└── main.cf.mas.diff
/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 | # Examples of piler configurations
2 |
3 | Examples:
4 | * How to obtain an A-grade Let's Encrypt certificate with traefik edge router
5 | * How to run piler enterprise in a dockerized environment
6 | * How to setup a OWASP ModSecurity WAF implementation
7 |
--------------------------------------------------------------------------------
/examples/backup-daily-export-to-s3-bucket/README.md:
--------------------------------------------------------------------------------
1 | How to backup piler enterprise data to an S3 bucket
2 |
3 | The below script uploads the daily exported emails encrypted.
4 |
5 | Pros:
6 | * You only upload one day (=the previous day) of emails at one time
7 |
8 | Cons:
9 | * When restoring you need to start from scratch, and the import takes a while
10 |
11 | ## Prerequisites
12 |
13 | * Have an S3 compatible object store either in the cloud or using minio on premise
14 | * Get the minio client from [https://min.io/download#/linux](https://min.io/download#/linux)
15 | * Create a config to your bucket using mc alias
16 |
17 | ### Create the encryption key
18 |
19 | ```
20 | openssl rand -hex 64 > /etc/piler/backup.key
21 | chown piler:piler /etc/piler/backup.key
22 | chmod 600 /etc/piler/backup.key
23 | ```
24 |
25 | Fix the BUCKET_PREFIX variable in backup-daily-export-to-s3.sh script, eg.
26 |
27 | ```
28 | ### Make sure, your bucket prefix is unique especially when using a cloud provider
29 | BUCKET_PREFIX="s3/your-bucket-prefix"
30 | ```
31 |
32 | ## Create a cron entry for user piler
33 |
34 | ```
35 | 50 3 * * * /usr/local/bin/backup-daily-export-to-s3.sh
36 | ```
37 |
38 | ## Notes
39 |
40 | The backup script appends the customer name to the prefix, eg. s3/company-name-piler-backup-${customer}.
41 |
42 | Be sure to backup the encryption key, otherwise your backup is as good as gone.
43 |
--------------------------------------------------------------------------------
/examples/backup-daily-export-to-s3-bucket/backup-daily-export-to-s3.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -o errexit
4 | set -o pipefail
5 | set -o nounset
6 |
7 | SCRIPT_PATH="$(readlink -f "$0")"
8 | SCRIPT_NAME="${SCRIPT_PATH##*/}"
9 | SPHINX_DATA_DIR="/var/piler/sphinx"
10 | PRIORITY="mail.info"
11 | EXPORT_DIR="/var/piler/export"
12 | CUSTOMERS=()
13 | LICENSE_FILE="/etc/piler/piler.lic"
14 | SERVERID="xx"
15 | YESTERDAY="$(date -d yesterday +%Y.%m.%d)"
16 | MIN_XZ_SIZE=100
17 | ENCRYPTION_KEY="/etc/piler/backup.key"
18 |
19 | ## Be sure to fix this!!!
20 | BUCKET_PREFIX="s3/your-bucket-prefix"
21 |
22 |
23 | error() {
24 | echo "$*"
25 | exit 1
26 | }
27 |
28 | log() {
29 | logger -i -t "$SCRIPT_NAME" -p "$PRIORITY" <<< "$@"
30 | }
31 |
32 | get_server_id() {
33 | [[ -f "$LICENSE_FILE" ]] || error "No license file found"
34 |
35 | SERVERID=$(head -1 "$LICENSE_FILE" | sed 's/,/\n/g' | grep server_id | cut -f2 -d '=')
36 | SERVERID=$(printf "%02x" "$SERVERID")
37 |
38 | if [[ "$SERVERID" == "xx" ]]; then error "Invalid license file"; fi
39 | }
40 |
41 | get_customer_list() {
42 | local customer
43 |
44 | for customer in "$SPHINX_DATA_DIR"/*; do
45 | if [[ -d "$customer" ]]; then
46 | CUSTOMERS+=( "$(basename "$customer")" )
47 | fi
48 | done
49 | }
50 |
51 | backup_daily() {
52 | local customer="$1"
53 | local f
54 | local e
55 | local s3_bucket
56 |
57 | pushd "$EXPORT_DIR" >/dev/null
58 |
59 | s3_bucket="${BUCKET_PREFIX}-${customer}"
60 |
61 | log "s3 bucket: ${s3_bucket}"
62 |
63 | if mc stat "$s3_bucket" > /dev/null; then
64 | log "creating s3 bucket: ${s3_bucket}"
65 | mc -q mb "${s3_bucket}"
66 | fi
67 |
68 | f="${customer}-${YESTERDAY}.xz"
69 | e="${f}.enc"
70 |
71 | log "running export for ${customer}"
72 |
73 | pilerexport -W "$customer" -a "$YESTERDAY" -b "$YESTERDAY" -o | xz -c > "$f"
74 |
75 | log "checking size of ${f}"
76 |
77 | if [[ $(stat -c '%s' "$f") -gt $MIN_XZ_SIZE ]]; then
78 | log "encrypting ${f}"
79 | openssl enc -e -aes-256-ofb -in "$f" -out "$e" -pass "file:${ENCRYPTION_KEY}" -pbkdf2
80 | log "uploading ${e}"
81 | mc -q cp "$e" "$s3_bucket" || true
82 | log "uploaded ${e}"
83 | else
84 | log "skipping ${f}"
85 | fi
86 |
87 | rm -f "$f" "$e"
88 |
89 | popd >/dev/null
90 |
91 | }
92 |
93 | main() {
94 | local customer
95 |
96 | get_server_id
97 | get_customer_list
98 |
99 | for customer in "${CUSTOMERS[@]}"; do
100 | log "processing ${customer}"
101 | backup_daily "$customer"
102 | done
103 | }
104 |
105 | main "$@"
106 |
--------------------------------------------------------------------------------
/examples/backup-raw-data-to-s3-bucket/README.md:
--------------------------------------------------------------------------------
1 | How to backup piler enterprise data to an S3 bucket
2 |
3 | The below script uploads the raw piler data files (both emails and attachments), and the mysql and sphinx databases.
4 |
5 | Pros:
6 | * Once you have everything restored you have a fully functional archive
7 | * No need for a time consuming reindex process
8 |
9 | Cons:
10 | * You need to upload the attachments data every time
11 |
12 | ## Prerequisites
13 |
14 | * Have an S3 compatible object store either in the cloud or using minio on premise
15 | * Get the minio client from [https://min.io/download#/linux](https://min.io/download#/linux)
16 | * Create a config to your bucket using mc alias
17 |
18 | Fix the BUCKET_PREFIX variable in backup-to-s3.sh script, eg.
19 |
20 | ```
21 | ### Make sure, your bucket prefix is unique especially when using a cloud provider
22 | BUCKET_PREFIX="s3/your-bucket-prefix"
23 | ```
24 |
25 | ## Create a cron entry for user piler
26 |
27 | ```
28 | 50 3 * * * /usr/local/bin/backup-to-s3.sh
29 | ```
30 |
31 | ## Notes
32 |
33 | The script copies only the last 2 top level store folders (eg. /var/piler/store/00/piler/605) to the S3 bucket.
34 | For the first use be sure to fix the store level dir in the 125th line to make sure all store data is copied.
35 |
36 | ```
37 | backup_customer_dir "$customer" "$STORE_DIR" "store" 200
38 | ```
39 |
40 | After the first run, you may revert it to "2", because older directories don't change.
41 |
42 | The backup script appends the customer name to the prefix, eg. s3/company-name-piler-backup-${customer}
43 |
--------------------------------------------------------------------------------
/examples/backup-raw-data-to-s3-bucket/backup-to-s3.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -o errexit
4 | set -o pipefail
5 | set -o nounset
6 |
7 | SCRIPT_PATH="$(readlink -f "$0")"
8 | SCRIPT_NAME="${SCRIPT_PATH##*/}"
9 | SPHINX_DATA_DIR="/var/piler/sphinx"
10 | PRIORITY="mail.info"
11 | EXPORT_DIR="/var/piler/export"
12 | CUSTOMERS=()
13 | LICENSE_FILE="/etc/piler/piler.lic"
14 | SERVERID="xx"
15 |
16 | ## Be sure to fix this!!!
17 | BUCKET_PREFIX="s3/your-bucket-prefix"
18 |
19 | error() {
20 | echo "$*"
21 | exit 1
22 | }
23 |
24 | log() {
25 | logger -i -t "$SCRIPT_NAME" -p "$PRIORITY" <<< "$@"
26 | }
27 |
28 | get_server_id() {
29 | [[ -f "$LICENSE_FILE" ]] || error "No license file found"
30 |
31 | SERVERID=$(head -1 "$LICENSE_FILE" | sed 's/,/\n/g' | grep server_id | cut -f2 -d '=')
32 | SERVERID=$(printf "%02x" "$SERVERID")
33 |
34 | if [[ "$SERVERID" == "xx" ]]; then error "Invalid license file"; fi
35 |
36 | STORE_DIR="/var/piler/store/${SERVERID}"
37 | ASTORE_DIR="/var/piler/astore/${SERVERID}"
38 | }
39 |
40 | get_customer_list() {
41 | local customer
42 |
43 | for customer in "$SPHINX_DATA_DIR"/*; do
44 | if [[ -d "$customer" ]]; then
45 | CUSTOMERS+=( "$(basename "$customer")" )
46 | fi
47 | done
48 | }
49 |
50 | backup_customer_dir() {
51 | local customer="$1"
52 | local basedir="$2"
53 | local prefix="$3"
54 | local level="$4"
55 | local dir
56 | local f
57 | local s3_uri
58 |
59 | pushd "${basedir}/${customer}" >/dev/null
60 |
61 | s3_uri="${BUCKET_PREFIX}-${customer}"
62 |
63 | if ! mc stat "$s3_uri" > /dev/null; then
64 | mc -q mb "$s3_uri"
65 | fi
66 |
67 | # We use "ls" because there are only alphanumeric directories to process
68 | # shellcheck disable=SC2012
69 |
70 | while read -r dir; do
71 | dir="${dir//\.\//}"
72 | f="${prefix}-${SERVERID}-${customer}-${dir}.tar"
73 |
74 | tar cf "$f" "$dir"
75 | mc -q cp "$f" "$s3_uri"
76 | rm -f "$f"
77 | done < <(ls -1t|head "-${level}")
78 |
79 | popd >/dev/null
80 |
81 | }
82 |
83 | backup_database() {
84 | local customer="$1"
85 | local f
86 | local s3_uri
87 |
88 | f="${EXPORT_DIR}/db-${SERVERID}-${customer}.xz"
89 |
90 | s3_uri="${BUCKET_PREFIX}-${customer}"
91 |
92 | mysqldump --defaults-file=/etc/piler/.my.cnf -B "$customer" | xz -c > "$f"
93 | mc -q cp "$f" "$s3_uri"
94 | rm -f "$f"
95 | }
96 |
97 | backup_sphinx() {
98 | local customer="$1"
99 | local f
100 | local s3_uri
101 |
102 | f="${EXPORT_DIR}/main1-${SERVERID}-${customer}.tar.xz"
103 |
104 | s3_uri="${BUCKET_PREFIX}-${customer}"
105 |
106 | pushd "${SPHINX_DATA_DIR}/${customer}" >/dev/null
107 |
108 | tar cfJ "$f" main1.*
109 |
110 | mc -q cp "$f" "$s3_uri"
111 | rm -f "$f"
112 |
113 | popd >/dev/null
114 | }
115 |
116 | main() {
117 | local customer
118 |
119 | get_server_id
120 | get_customer_list
121 |
122 | for customer in "${CUSTOMERS[@]}"; do
123 | log "processing ${customer}"
124 | backup_customer_dir "$customer" "$ASTORE_DIR" "astore" 256
125 | backup_customer_dir "$customer" "$STORE_DIR" "store" 2
126 | backup_database "$customer"
127 | backup_sphinx "$customer"
128 | done
129 | }
130 |
131 | main "$@"
132 |
--------------------------------------------------------------------------------
/examples/docker/multiple-nodes-with-multitenancy/11-piler.conf:
--------------------------------------------------------------------------------
1 | $WorkDirectory /var/spool/rsyslog # where to place spool files
2 | $ActionQueueFileName fwdRule1 # unique name prefix for spool files
3 | $ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible)
4 | $ActionQueueSaveOnShutdown on # save messages to disk on shutdown
5 | $ActionQueueType LinkedList # run asynchronously
6 | $ActionResumeRetryCount -1 # infinite retries if host is down
7 |
8 | template(name="PilerFormat" type="string" string="<%pri%>%HOSTNAME% %syslogtag%%msg%\n")
9 | action(type="omfwd" protocol="tcp" target="syslog.example.com" port="514" template="PilerFormat")
10 |
--------------------------------------------------------------------------------
/examples/docker/multiple-nodes-with-multitenancy/README.md:
--------------------------------------------------------------------------------
1 | # Deploying piler enterprise containers on multiple nodes
2 |
3 | ## The layout
4 |
5 | This setup features the following hosts:
6 | * master.example.com
7 | * worker0.example.com
8 |
9 | Containers on the master node:
10 | - piler
11 | - manticore
12 | - mysql
13 | - memcached
14 |
15 | Containers on the worker node:
16 | - piler
17 | - manticore
18 | - mysql
19 | - memcached
20 | - tika
21 |
22 | ## Deployment
23 |
24 | Install the mysql encryption stuff and docker on both master and worker nodes
25 |
26 | ```
27 | ./install.sh
28 | ```
29 |
30 | Copy 11-piler.conf to both nodes to enable centralised logging. Be sure to fix the target hostname.
31 |
32 | ## Setup the master node
33 |
34 | Copy master dir contents to the master node.
35 |
36 | ```
37 | scp master/* master.example.com:~
38 | ```
39 |
40 | Customize docker-compose.yaml, and be sure to update
41 | - PILER_HOSTNAME
42 | - WORKERS
43 | - MANTICORE_WORKERS
44 | - AUTH_CODE
45 | - mysql passwords
46 |
47 | Create the required docker volumes:
48 |
49 | ```
50 | docker volume create piler_db
51 | docker volume create piler_manticore
52 | docker volume create piler_etc
53 | ```
54 |
55 | Run the containers
56 |
57 | ```
58 | docker compose up -d
59 | ```
60 |
61 | ## Setup the worker node (worker0)
62 |
63 | Copy worker0 dir contents to the worker node.
64 |
65 | ```
66 | scp worker0/* worker0.example.com:~
67 | ```
68 |
69 | Create the required docker volumes:
70 |
71 | ```
72 | docker volume create piler_db
73 | docker volume create piler_manticore
74 | docker volume create piler_etc
75 | docker volume create piler_store
76 | docker volume create piler_astore
77 | ```
78 |
79 | Customize docker-compose.yaml, and be sure to update
80 | - PILER_HOSTNAME
81 | - MASTER_NODE
82 | - AUTH_CODE
83 | - mysql passwords
84 |
85 | Note that "AUTH_CODE" must be the same on both the master and the worker nodes.
86 |
87 | Customize piler.conf.worker0 as well, set the passwords, crypt_key, etc.
88 |
89 | Get the license files for worker0.example.com, and save it as worker0.example.com.lic
90 |
91 | Run the containers
92 |
93 | ```
94 | docker compose up -d
95 | ```
96 |
97 | ## Exposed ports on the nodes
98 |
99 | Master node:
100 | - 80/tcp
101 | - 3306/tcp
102 |
103 | Worker node:
104 | - 25/tcp
105 | - 80/tcp
106 | - 9312/tcp
107 |
108 | ## Further improvements
109 |
110 | Use https protocol on the nodes. You may update /etc/piler/piler-nginx.conf
111 | with the tls setup, and put the certificate(s) and key on the piler_etc volume.
112 |
113 | Or another option might be running traefik on the nodes and terminate https connections.
114 |
115 | Enable https between the master and worker node. To do that edit /etc/piler/config-site.php,
116 | and set the API_PROTO variable to use https:
117 |
118 | ```
119 | $config['API_PROTO'] = 'https://';
120 | ```
121 |
122 | Enable tls in transit for mysql
123 |
124 | You may increase the memory limits set in the docker-compose.yaml files to match your workload.
125 |
--------------------------------------------------------------------------------
/examples/docker/multiple-nodes-with-multitenancy/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 |
4 | set -o nounset
5 | set -o errexit
6 | set -o pipefail
7 |
8 | SCRIPT_PATH="$(readlink -f "$0")"
9 | SCRIPT_DIR="${SCRIPT_PATH%/*}"
10 |
11 | setup_mysql_encryption() {
12 | local s
13 | local encrypt_cfg_dir="${SCRIPT_DIR}/encrypt"
14 |
15 | echo "${FUNCNAME[0]}"
16 |
17 | ### See https://mariadb.com/kb/en/file-key-management-encryption-plugin/ for more
18 |
19 | mkdir -p "$encrypt_cfg_dir"
20 | s="$(openssl rand -hex 32)"
21 | echo "1;${s}" > "${encrypt_cfg_dir}/keyfile"
22 | openssl rand -hex 128 > "${encrypt_cfg_dir}/keyfile.key"
23 | openssl enc -aes-256-cbc -md sha1 -pass file:"${encrypt_cfg_dir}/keyfile.key" -in "${encrypt_cfg_dir}/keyfile" -out "${encrypt_cfg_dir}/keyfile.enc"
24 | rm -f "${encrypt_cfg_dir}/keyfile"
25 |
26 | cat > "${SCRIPT_DIR}/99-encrypt.cnf" << ENCRYPT_CNF
27 | [mariadb]
28 |
29 | plugin_load_add = file_key_management
30 | loose_file_key_management_filename = /etc/mysql/encrypt/keyfile.enc
31 | loose_file_key_management_filekey = FILE:/etc/mysql/encrypt/keyfile.key
32 | loose_file_key_management_encryption_algorithm = AES_CBC
33 | ENCRYPT_CNF
34 | }
35 |
36 | setup_dot_profile() {
37 | echo "${FUNCNAME[0]}"
38 |
39 | cat > "${HOME}/.profile" << EOF
40 | umask 0022
41 | alias ls='ls -lAF'
42 | EOF
43 | }
44 |
45 | ##setup_dot_profile
46 | setup_mysql_encryption
47 |
48 | umask 0022
49 |
50 | sudo mkdir -m 0755 -p /etc/apt/keyrings
51 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
52 | echo \
53 | "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
54 | $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
55 | sudo apt-get update
56 | sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
57 |
58 | #sudo usermod -g docker ubuntu
59 |
--------------------------------------------------------------------------------
/examples/docker/multiple-nodes-with-multitenancy/master/docker-compose.yaml:
--------------------------------------------------------------------------------
1 | x-small-containers: &small-containers
2 | networks:
3 | - piler
4 | deploy:
5 | resources:
6 | limits:
7 | memory: 64M
8 |
9 | x-mysql-containers: &mysql-containers
10 | image: mariadb:11.6.2
11 | networks:
12 | - piler
13 | cap_drop:
14 | - ALL
15 | cap_add:
16 | - dac_override
17 | - setuid
18 | - setgid
19 | deploy:
20 | resources:
21 | limits:
22 | memory: 1024M
23 | environment:
24 | - MYSQL_ROOT_PASSWORD=abcde123
25 | - MYSQL_DATABASE=aaaaa
26 | - MYSQL_USER=piler
27 | - MYSQL_PASSWORD=piler123
28 | volumes:
29 | - ./encrypt:/etc/mysql/encrypt:ro
30 | - ./99-encrypt.cnf:/etc/mysql/mariadb.conf.d/99-encrypt.cnf:ro
31 | - piler_db:/var/lib/mysql
32 |
33 | command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --plugin-load=file_key_management
34 | ports:
35 | - "3306:3306"
36 |
37 | x-manticore-contains: &manticore-containers
38 | image: manticoresearch/manticore:7.4.6
39 | volumes:
40 | - piler_manticore:/var/lib/manticore
41 | networks:
42 | - piler
43 |
44 | x-master-containers: &master-containers
45 | image: sutoj/piler-ee:${VERSION:-1.8.4}
46 | volumes:
47 | - piler_etc:/etc/piler
48 | networks:
49 | - piler
50 | deploy:
51 | resources:
52 | limits:
53 | memory: 1024M
54 |
55 | services:
56 | mysql-gui:
57 | container_name: mysql-gui
58 | <<: *mysql-containers
59 |
60 | manticore-gui:
61 | container_name: manticore-gui
62 | volumes:
63 | - ./manticore.conf:/etc/manticoresearch/manticore.conf
64 | <<: *manticore-containers
65 |
66 | piler-gui:
67 | <<: *master-containers
68 | hostname: piler-gui
69 | container_name: piler-gui
70 | environment:
71 | - PILER_HOSTNAME=master.example.com
72 | - NODE_TYPE=MASTER
73 | - PRIMARY_MASTER=1
74 | - MULTINODES=1
75 | - MULTITENANCY=1
76 | - SERVER_ID=0
77 | - MYSQL_HOSTNAME=mysql-gui
78 | - MYSQL_USER=piler
79 | - MYSQL_PASSWORD=piler123
80 | - MYSQL_ROOT_PASSWORD=abcde123
81 | - MEMCACHED_HOSTNAME=memcached
82 | - MANTICORE_HOST=manticore-gui
83 | - ENCRYPTED_SQL=1
84 | - DYNAMIC_INDEX=1
85 | - RT=1
86 | - WORKERS=worker0.example.com
87 | - MANTICORE_WORKERS=worker0.example.com
88 | - AUTH_CODE=ki9b0hDh2bl93j3yYIEs4iESePjBEi7YLaApUaNdBmSYDdgtEDAsqZPXmXwmHM0dEXWmMu95lCcuFyKC6lE4l
89 | volumes:
90 | - ./11-piler.conf:/etc/rsyslog.d/11-piler.conf:ro
91 | ports:
92 | - "80:80"
93 | depends_on:
94 | - mysql-gui
95 | - manticore-gui
96 | - memcached
97 |
98 | memcached:
99 | image: memcached
100 | container_name: memcached
101 | command: -m 64
102 | <<: *small-containers
103 |
104 | volumes:
105 | piler_db:
106 | external: true
107 | piler_etc:
108 | external: true
109 | piler_manticore:
110 | external: true
111 |
112 | networks:
113 | piler:
114 | name: piler
115 |
--------------------------------------------------------------------------------
/examples/docker/multiple-nodes-with-multitenancy/master/manticore.conf:
--------------------------------------------------------------------------------
1 | searchd
2 | {
3 | agent_connect_timeout = 3000
4 | agent_query_timeout = 9000
5 | listen = 9306:mysql
6 | listen = 9307:mysql_readonly
7 | listen = 9308:http
8 | log = /var/lib/manticore/manticore.log
9 | binlog_flush = 2
10 | binlog_path = /var/lib/manticore
11 | binlog_max_log_size = 256M
12 | data_dir = /var/lib/manticore
13 | query_log = /var/lib/manticore/manticore.log
14 | network_timeout = 10
15 | max_packet_size = 32M
16 | pid_file = /var/lib/manticore/manticore.pid
17 | seamless_rotate = 1
18 | preopen_tables = 1
19 | unlink_old = 1
20 | thread_stack = 512k
21 | # https://manticoresearch.com/blog/manticoresearch-buddy-intro/
22 | # Comment out the next line if you want to enable manticore-buddy
23 | buddy_path =
24 | rt_flush_period = 300
25 | }
26 |
--------------------------------------------------------------------------------
/examples/docker/multiple-nodes-with-multitenancy/worker0/docker-compose.yaml:
--------------------------------------------------------------------------------
1 | x-small-containers: &small-containers
2 | networks:
3 | - piler
4 | deploy:
5 | resources:
6 | limits:
7 | memory: 64M
8 |
9 | x-big-containers: &big-containers
10 | networks:
11 | - piler
12 | deploy:
13 | resources:
14 | limits:
15 | memory: 1024M
16 |
17 | x-mysql-containers: &mysql-containers
18 | image: mariadb:11.6.2
19 | networks:
20 | - piler
21 | cap_drop:
22 | - ALL
23 | cap_add:
24 | - dac_override
25 | - setuid
26 | - setgid
27 | deploy:
28 | resources:
29 | limits:
30 | memory: 1024M
31 | environment:
32 | - MYSQL_ROOT_PASSWORD=abcde123
33 | - MYSQL_DATABASE=aaaaa
34 | - MYSQL_USER=piler
35 | - MYSQL_PASSWORD=piler123
36 | volumes:
37 | - ./encrypt:/etc/mysql/encrypt:ro
38 | - ./99-encrypt.cnf:/etc/mysql/mariadb.conf.d/99-encrypt.cnf:ro
39 | - piler_db:/var/lib/mysql
40 | command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --plugin-load=file_key_management
41 |
42 | x-manticore-contains: &manticore-containers
43 | image: manticoresearch/manticore:7.4.6
44 | ports:
45 | - "9312:9312"
46 | networks:
47 | - piler
48 |
49 | x-worker-containers: &worker-containers
50 | image: sutoj/piler-ee:${VERSION:-1.8.4}
51 | networks:
52 | - piler
53 | deploy:
54 | resources:
55 | limits:
56 | memory: 1024M
57 | healthcheck:
58 | test: ["CMD", "curl", "-s", "smtp://localhost"]
59 | interval: 20s
60 | timeout: 3s
61 | retries: 3
62 | start_period: 10s
63 |
64 | services:
65 | mysql-worker0:
66 | container_name: mysql-worker0
67 | <<: *mysql-containers
68 |
69 | manticore-worker0:
70 | container_name: manticore-worker0
71 | volumes:
72 | - ./manticore.conf:/etc/manticoresearch/manticore.conf
73 | - piler_manticore:/var/lib/manticore
74 | <<: *manticore-containers
75 |
76 | piler-worker0:
77 | <<: *worker-containers
78 | hostname: piler-worker0
79 | container_name: piler-worker0
80 | environment:
81 | - PILER_HOSTNAME=worker0.example.com
82 | - MASTER_NODE=master.example.com
83 | - MULTINODES=1
84 | - MULTITENANCY=1
85 | - SERVER_ID=0
86 | - MYSQL_HOSTNAME=mysql-worker0
87 | - MASTER_MYSQL_NODE=mysql-gui
88 | - MYSQL_USER=piler
89 | - MYSQL_PASSWORD=piler123
90 | - MYSQL_ROOT_PASSWORD=abcde123
91 | - MEMCACHED_HOSTNAME=memcached
92 | - MANTICORE_HOST=manticore-worker0
93 | - ENCRYPTED_SQL=1
94 | - DYNAMIC_INDEX=1
95 | - RT=1
96 | - AUTH_CODE=ki9b0hDh2bl93j3yYIEs4iESePjBEi7YLaApUaNdBmSYDdgtEDAsqZPXmXwmHM0dEXWmMu95lCcuFyKC6lE4l
97 | - S3=${S3:-false}
98 | volumes:
99 | - ./worker0.example.com.lic:/etc/piler/piler.lic:ro
100 | - ./piler.conf.worker0:/etc/piler/piler.conf
101 | - ./11-piler.conf:/etc/rsyslog.d/11-piler.conf:ro
102 | - piler_etc:/etc/piler
103 | - piler_store:/var/piler/store
104 | - piler_astore:/var/piler/astore
105 | ports:
106 | - "25:25"
107 | - "80:80"
108 | depends_on:
109 | - mysql-worker0
110 | - manticore-worker0
111 |
112 | memcached:
113 | image: memcached
114 | container_name: memcached
115 | command: -m 64
116 | <<: *small-containers
117 |
118 | tika:
119 | image: apache/tika:3.0.0.0
120 | container_name: tika
121 | deploy:
122 | resources:
123 | limits:
124 | memory: 1024M
125 | networks:
126 | - piler
127 | cap_drop:
128 | - ALL
129 |
130 | volumes:
131 | piler_astore:
132 | external: true
133 | piler_db:
134 | external: true
135 | piler_etc:
136 | external: true
137 | piler_manticore:
138 | external: true
139 | piler_store:
140 | external: true
141 |
142 | networks:
143 | piler:
144 | name: piler
145 |
--------------------------------------------------------------------------------
/examples/docker/multiple-nodes-with-multitenancy/worker0/manticore.conf:
--------------------------------------------------------------------------------
1 | searchd
2 | {
3 | agent_connect_timeout = 3000
4 | agent_query_timeout = 9000
5 | listen = 9306:mysql
6 | listen = 9307:mysql_readonly
7 | listen = 9312
8 | log = /var/lib/manticore/manticore.log
9 | binlog_flush = 2
10 | binlog_path = /var/lib/manticore
11 | binlog_max_log_size = 256M
12 | data_dir = /var/lib/manticore
13 | query_log = /var/lib/manticore/manticore.log
14 | network_timeout = 5
15 | max_packet_size = 32M
16 | pid_file = /var/lib/manticore/manticore.pid
17 | seamless_rotate = 1
18 | preopen_tables = 1
19 | unlink_old = 1
20 | thread_stack = 512k
21 | # https://manticoresearch.com/blog/manticoresearch-buddy-intro/
22 | # Comment out the next line if you want to enable manticore-buddy
23 | buddy_path =
24 | rt_flush_period = 300
25 | }
26 |
--------------------------------------------------------------------------------
/examples/docker/multiple-nodes-with-multitenancy/worker0/piler.conf.worker0:
--------------------------------------------------------------------------------
1 | archive_emails_not_having_message_id=0
2 | attachmentdir=/var/piler/astore
3 | backlog=20
4 | categorize=1
5 | cipher_list=ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
6 | clamd_socket=/var/run/clamav/clamd.ctl
7 | consolidated_store=0
8 | crypt_key=qSYP8G/937mh47odsvktscsuJRG/M/Cs
9 | default_retention_days=2557
10 | enable_chunking=0
11 | enable_cjk=0
12 | encrypt_messages=1
13 | extra_to_field=X-Envelope-To:
14 | extract_attachments=1
15 | listen_addr=0.0.0.0
16 | listen_port=25
17 | max_message_size=50000000
18 | max_requests_per_child=10000
19 | max_smtp_memory=500000000
20 | memcached_enable=0
21 | memcached_servers=127.0.0.1
22 | memcached_ttl=3600
23 | min_message_size=200
24 | min_word_len=1
25 | mysql_connect_timeout=2
26 | mysqldb=piler
27 | mysqlhost=mysql-worker0
28 | mysqlpwd=piler123
29 | mysqlsocket=
30 | mysqluser=piler
31 | number_of_worker_processes=2
32 | pemfile=/etc/piler/piler.pem
33 | pidfile=/var/run/piler/piler.pid
34 | piler_header_field=X-piler-id:
35 | queuedir=/var/piler/store
36 | rtindex=1
37 | s3_hostname=
38 | s3_region=us-east-1
39 | s3_access_key=root
40 | s3_secret_key=example156
41 | s3_secure=0
42 | s3_threads=10
43 | s3_bucket_prefix=xxx.
44 | s3_dir=/var/piler/s3
45 | s3_use_subdirs=1
46 | smtp_access_list=0
47 | spam_header_line=
48 | sphinxdir=/var/piler/manticore
49 | sphxhost=manticore-worker0
50 | sphxport=9306
51 | sphxroport=9307
52 | syslog_recipients=0
53 | tika_url=http://tika:9998/tika
54 | tls_enable=1
55 | tls_min_version=TLSv1.2
56 | username=piler
57 | verbosity=1
58 | workdir=/var/piler/tmp
59 |
--------------------------------------------------------------------------------
/examples/docker/multiple-piler-containers-with-multitenancy/11-piler.conf:
--------------------------------------------------------------------------------
1 | $WorkDirectory /var/spool/rsyslog # where to place spool files
2 | $ActionQueueFileName fwdRule1 # unique name prefix for spool files
3 | $ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible)
4 | $ActionQueueSaveOnShutdown on # save messages to disk on shutdown
5 | $ActionQueueType LinkedList # run asynchronously
6 | $ActionResumeRetryCount -1 # infinite retries if host is down
7 |
8 | template(name="PilerFormat" type="string" string="<%pri%>%HOSTNAME% %syslogtag%%msg%\n")
9 | action(type="omfwd" protocol="tcp" target="syslog.host" port="514" template="PilerFormat")
10 |
--------------------------------------------------------------------------------
/examples/docker/multiple-piler-containers-with-multitenancy/README.md:
--------------------------------------------------------------------------------
1 | # Deploying multiple piler enterprise containers
2 |
3 | ## The layout
4 |
5 | This setup features the following containers:
6 |
7 | * mariadb: storing metadata, user db, etc.
8 | * memcached: to cache some data
9 | * Apache tika: to extract textual attachment data
10 | * Piler enterprise 1.8.4: the email archive running piler
11 | * Manticoresearch: the search engine
12 | * syslog: collect logs from each host
13 |
14 | Port mappings to containers:
15 |
16 | - archive.example.com: 80/tcp
17 | - worker0: 2520/tcp -> 25/tcp
18 | - worker1: 2521/tcp -> 25/tcp
19 |
20 | No other port should be visible from the outside.
21 |
22 | ## Prerequisites
23 |
24 | * Get the license files for both worker0 and worker1 containers
25 |
26 | ## Setup
27 |
28 | ### Customize docker-compose.yaml
29 |
30 | Be sure to change passwords, the auth code, and increase the
31 | memory limits. Also replace archive.example.com hostname.
32 |
33 | ## Execute
34 |
35 | ```
36 | docker compose up -d
37 | ```
38 |
--------------------------------------------------------------------------------
/examples/docker/multiple-piler-containers-with-multitenancy/docker-compose.yaml:
--------------------------------------------------------------------------------
1 | x-big-containers: &big-containers
2 | networks:
3 | - piler
4 | deploy:
5 | resources:
6 | limits:
7 | memory: 512M
8 |
9 | x-mysql-containers: &mysql-containers
10 | image: mariadb:11.1.2
11 | networks:
12 | - piler
13 | cap_drop:
14 | - ALL
15 | cap_add:
16 | - dac_override
17 | - setuid
18 | - setgid
19 | deploy:
20 | resources:
21 | limits:
22 | memory: 256M
23 | environment:
24 | - MYSQL_ROOT_PASSWORD=abcde123
25 | - MYSQL_DATABASE=aaaaa
26 | - MYSQL_USER=piler
27 | - MYSQL_PASSWORD=piler123
28 | command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
29 |
30 | x-manticore-contains: &manticore-containers
31 | image: manticoresearch/manticore:6.3.6
32 | networks:
33 | - piler
34 |
35 | x-small-containers: &small-containers
36 | networks:
37 | - piler
38 | deploy:
39 | resources:
40 | limits:
41 | memory: 64M
42 |
43 | x-master-containers: &master-containers
44 | image: sutoj/piler-ee:1.8.4
45 | deploy:
46 | resources:
47 | limits:
48 | memory: 512M
49 | volumes:
50 | - ./11-piler.conf:/etc/rsyslog.d/11-piler.conf:ro
51 | healthcheck:
52 | test: ["CMD", "curl", "-s", "http://localhost"]
53 | interval: 20s
54 | timeout: 3s
55 | retries: 3
56 | start_period: 10s
57 |
58 | x-worker-containers: &worker-containers
59 | image: sutoj/piler-ee:1.8.4
60 | networks:
61 | - piler
62 | deploy:
63 | resources:
64 | limits:
65 | memory: 512M
66 | healthcheck:
67 | test: ["CMD", "curl", "-s", "smtp://localhost"]
68 | interval: 20s
69 | timeout: 3s
70 | retries: 3
71 | start_period: 10s
72 |
73 | services:
74 | syslog:
75 | image: sutoj/syslog
76 | container_name: syslog.host
77 | volumes:
78 | - syslog:/var/log
79 | <<: *small-containers
80 |
81 | mysql-gui:
82 | container_name: mysql-gui
83 | <<: *mysql-containers
84 |
85 | mysql-worker0:
86 | container_name: mysql-worker0
87 | <<: *mysql-containers
88 |
89 | mysql-worker1:
90 | container_name: mysql-worker1
91 | <<: *mysql-containers
92 |
93 | manticore-gui:
94 | container_name: manticore-gui
95 | volumes:
96 | - ./manticore.conf:/etc/manticoresearch/manticore.conf
97 | <<: *manticore-containers
98 |
99 | manticore-worker0:
100 | container_name: manticore-worker0
101 | volumes:
102 | - ./manticore-worker.conf:/etc/manticoresearch/manticore.conf
103 | <<: *manticore-containers
104 |
105 | manticore-worker1:
106 | container_name: manticore-worker1
107 | volumes:
108 | - ./manticore-worker.conf:/etc/manticoresearch/manticore.conf
109 | <<: *manticore-containers
110 |
111 | archive.example.com:
112 | <<: *master-containers
113 | container_name: archive.example.com
114 | hostname: archive.example.com
115 | networks:
116 | - piler
117 | environment:
118 | - PILER_HOSTNAME=archive.example.com
119 | - NODE_TYPE=MASTER
120 | - PRIMARY_MASTER=1
121 | - MULTINODES=1
122 | - MULTITENANCY=1
123 | - SERVER_ID=0
124 | - MYSQL_HOSTNAME=mysql-gui
125 | - MYSQL_USER=piler
126 | - MYSQL_PASSWORD=piler123
127 | - MYSQL_ROOT_PASSWORD=abcde123
128 | - MEMCACHED_HOSTNAME=memcached
129 | - MANTICORE_HOST=manticore-gui
130 | - ENCRYPTED_SQL=1
131 | - DYNAMIC_INDEX=1
132 | - RT=1
133 | - WORKERS=worker0,worker1
134 | - MANTICORE_WORKERS=manticore-worker0,manticore-worker1
135 | - AUTH_CODE=0Yh2hW1NDT9yDp6R7BAp8JmYhkBGI2PLIRUuoUEXWcM7c2L
136 | ports:
137 | - "80:80"
138 | depends_on:
139 | - syslog
140 | - memcached
141 | - tika
142 | - worker0
143 | - worker1
144 | - mysql-gui
145 | - manticore-gui
146 |
147 | worker0:
148 | <<: *worker-containers
149 | container_name: worker0
150 | hostname: worker0
151 | environment:
152 | - PILER_HOSTNAME=worker0
153 | - MASTER_NODE=archive.example.com
154 | - MULTINODES=1
155 | - MULTITENANCY=1
156 | - SERVER_ID=0
157 | - MYSQL_HOSTNAME=mysql-worker0
158 | - MASTER_MYSQL_NODE=mysql-gui
159 | - MYSQL_USER=piler
160 | - MYSQL_PASSWORD=piler123
161 | - MYSQL_ROOT_PASSWORD=abcde123
162 | - MEMCACHED_HOSTNAME=memcached
163 | - MANTICORE_HOST=manticore-worker0
164 | - ENCRYPTED_SQL=0
165 | - DYNAMIC_INDEX=1
166 | - RT=1
167 | - AUTH_CODE=0Yh2hW1NDT9yDp6R7BAp8JmYhkBGI2PLIRUuoUEXWcM7c2L
168 | volumes:
169 | - ./11-piler.conf:/etc/rsyslog.d/11-piler.conf:ro
170 | - ./worker0.lic:/etc/piler/piler.lic:ro
171 | ports:
172 | - "2520:25"
173 | depends_on:
174 | - mysql-worker0
175 | - manticore-worker0
176 |
177 | worker1:
178 | <<: *worker-containers
179 | container_name: worker1
180 | hostname: worker1
181 | environment:
182 | - PILER_HOSTNAME=worker1
183 | - MASTER_NODE=archive.example.com
184 | - MULTINODES=1
185 | - MULTITENANCY=1
186 | - SERVER_ID=1
187 | - MYSQL_HOSTNAME=mysql-worker1
188 | - MASTER_MYSQL_NODE=mysql-gui
189 | - MYSQL_USER=piler
190 | - MYSQL_PASSWORD=piler123
191 | - MYSQL_ROOT_PASSWORD=abcde123
192 | - MEMCACHED_HOSTNAME=memcached
193 | - MANTICORE_HOST=manticore-worker1
194 | - ENCRYPTED_SQL=0
195 | - DYNAMIC_INDEX=1
196 | - RT=1
197 | - AUTH_CODE=0Yh2hW1NDT9yDp6R7BAp8JmYhkBGI2PLIRUuoUEXWcM7c2L
198 | volumes:
199 | - ./11-piler.conf:/etc/rsyslog.d/11-piler.conf:ro
200 | - ./worker1.lic:/etc/piler/piler.lic:ro
201 | ports:
202 | - "2521:25"
203 | depends_on:
204 | - mysql-worker1
205 | - manticore-worker1
206 |
207 | memcached:
208 | image: memcached
209 | container_name: memcached
210 | command: -m 64
211 | <<: *small-containers
212 |
213 | tika:
214 | image: apache/tika:2.9.2.0
215 | container_name: tika
216 | deploy:
217 | resources:
218 | limits:
219 | memory: 1024M
220 | networks:
221 | - piler
222 | cap_drop:
223 | - ALL
224 |
225 | networks:
226 | piler:
227 | name: piler
228 |
229 | volumes:
230 | syslog:
231 | name: "syslog"
232 |
--------------------------------------------------------------------------------
/examples/docker/multiple-piler-containers-with-multitenancy/manticore-worker.conf:
--------------------------------------------------------------------------------
1 | searchd
2 | {
3 | agent_connect_timeout = 3000
4 | agent_query_timeout = 9000
5 | listen = 9306:mysql
6 | listen = 9307:mysql_readonly
7 | listen = 9312
8 | log = /var/lib/manticore/manticore.log
9 | binlog_flush = 2
10 | binlog_path = /var/lib/manticore
11 | binlog_max_log_size = 256M
12 | data_dir = /var/lib/manticore
13 | query_log = /var/lib/manticore/manticore.log
14 | network_timeout = 5
15 | max_packet_size = 32M
16 | pid_file = /var/lib/manticore/manticore.pid
17 | seamless_rotate = 1
18 | preopen_tables = 1
19 | unlink_old = 1
20 | thread_stack = 512k
21 | # https://manticoresearch.com/blog/manticoresearch-buddy-intro/
22 | # Comment out the next line if you want to enable manticore-buddy
23 | buddy_path =
24 | rt_flush_period = 300
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/examples/docker/multiple-piler-containers-with-multitenancy/manticore.conf:
--------------------------------------------------------------------------------
1 | searchd
2 | {
3 | agent_connect_timeout = 3000
4 | agent_query_timeout = 9000
5 | listen = 9306:mysql
6 | listen = 9307:mysql_readonly
7 | log = /var/lib/manticore/manticore.log
8 | binlog_flush = 2
9 | binlog_path = /var/lib/manticore
10 | binlog_max_log_size = 256M
11 | data_dir = /var/lib/manticore
12 | query_log = /var/lib/manticore/manticore.log
13 | network_timeout = 5
14 | max_packet_size = 32M
15 | pid_file = /var/lib/manticore/manticore.pid
16 | seamless_rotate = 1
17 | preopen_tables = 1
18 | unlink_old = 1
19 | thread_stack = 512k
20 | # https://manticoresearch.com/blog/manticoresearch-buddy-intro/
21 | # Comment out the next line if you want to enable manticore-buddy
22 | buddy_path =
23 | rt_flush_period = 300
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/examples/docker/piler-with-traefik/README.md:
--------------------------------------------------------------------------------
1 | # Deploying piler enterprise to docker with docker-compose
2 |
3 | ## The layout
4 |
5 | This setup features the following containers:
6 |
7 | * traefik: http and https entry point
8 | * mariadb: storing metadata, user db, etc.
9 | * memcached: to cache some data
10 | * Apache tika: to extract textual attachment data
11 | * Piler enterprise 1.8.4: the email archive running piler
12 | * Manticoresearch: the search engine
13 |
14 | Port mappings to containers:
15 |
16 | - traefik: 443/tcp
17 | - piler: 25/tcp
18 |
19 | No other port should be visible from the outside.
20 |
21 | ## Prerequisites
22 |
23 | * Get the license file to run piler enterprise
24 |
25 | ## Setup
26 |
27 | ### Customize traefik.yaml
28 |
29 | Edit traefik.yaml and replace admin@yourdomain.com and archive.yourdomain.com
30 | with your email and archive hostname.
31 |
32 | The acme.json file must be owned by root:root and have 0600 permissions:
33 |
34 | ```
35 | chmod 600 acme.json
36 | chown root:root acme.json
37 | ```
38 |
39 | ### Customize docker-compose.yaml
40 |
41 | Fix following values:
42 |
43 | * MYSQL_PILER_PASSWORD
44 | * MYSQL_ROOT_PASSWORD
45 | * PILER_HOSTNAME
46 | * MULTITENANCY
47 |
48 |
49 | If you preferred external volumes rather than docker-compose managed volumes,
50 | then fix the volumes section at the end:
51 |
52 | ```
53 | ...
54 |
55 | volumes:
56 | db_data:
57 | external: true
58 | name: db-data
59 | piler_etc:
60 | external: true
61 | name: piler-etc
62 | piler_mantiocore:
63 | external: true
64 | name: piler-manticore
65 | piler_store:
66 | external: true
67 | name: piler-store
68 | piler_astore:
69 | external: true
70 | name: piler-astore
71 | ```
72 |
73 |
74 | ## Execute
75 |
76 | ```
77 | docker compose up -d
78 | ```
79 |
80 | ## Final words
81 |
82 | You just got a https enabled piler deployment in a containerized environment.
83 |
84 | ## Piler open source edition
85 |
86 | If you want piler open source edition in a dockerized environment, then
87 | check out the [piler source directory](https://github.com/jsuto/piler/tree/master/docker).
88 |
--------------------------------------------------------------------------------
/examples/docker/piler-with-traefik/acme.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jsuto/piler-examples/c6c4c5578397ee45209d2c1952f6061b3225e2ec/examples/docker/piler-with-traefik/acme.json
--------------------------------------------------------------------------------
/examples/docker/piler-with-traefik/docker-compose.yaml:
--------------------------------------------------------------------------------
1 | services:
2 | traefik:
3 | image: traefik
4 | container_name: traefik
5 | restart: unless-stopped
6 | ports:
7 | - "443:443"
8 | volumes:
9 | - ./traefik.yaml:/etc/traefik/traefik.yaml:ro
10 | - ./acme.json:/etc/traefik/acme.json
11 |
12 | mysql:
13 | image: mariadb:11.6.2
14 | container_name: mysql
15 | restart: unless-stopped
16 | cap_drop:
17 | - ALL
18 | cap_add:
19 | - dac_override
20 | - setuid
21 | - setgid
22 | environment:
23 | - MYSQL_DATABASE=aaaaa
24 | - MYSQL_USER=piler
25 | - MYSQL_PASSWORD=piler123
26 | - MYSQL_ROOT_PASSWORD=abcde123
27 | command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
28 | volumes:
29 | - piler_db:/var/lib/mysql
30 |
31 | manticore:
32 | image: manticoresearch/manticore:6.3.8
33 | container_name: manticore
34 | restart: unless-stopped
35 | volumes:
36 | - ./manticore.conf:/etc/manticoresearch/manticore.conf
37 | - piler_manticore:/var/lib/manticore
38 |
39 | tika:
40 | image: apache/tika:3.0.0.0
41 | container_name: tika
42 | restart: unless-stopped
43 | cap_drop:
44 | - ALL
45 | deploy:
46 | resources:
47 | reservations:
48 | memory: 512M
49 | limits:
50 | memory: 1024M
51 |
52 | memcached:
53 | image: memcached:latest
54 | container_name: memcached
55 | restart: unless-stopped
56 | cap_drop:
57 | - ALL
58 | command: -m 64
59 |
60 | piler:
61 | image: sutoj/piler-ee:1.8.4
62 | container_name: piler
63 | init: true
64 | environment:
65 | - MYSQL_HOSTNAME=mysql
66 | - MYSQL_DATABASE=piler
67 | - MYSQL_USER=piler
68 | - MYSQL_PASSWORD=piler123
69 | - MYSQL_ROOT_PASSWORD=abcde123
70 | - TIKA_HOSTNAME=tika
71 | - PILER_HOSTNAME=archive.yourdomain.com
72 | - MULTITENANCY=0
73 | - MULTINODES=0
74 | - ENCRYPTED_SQL=0
75 | - DYNAMIC_INDEX=1
76 | - RT=1
77 | - MANTICORE_HOST=manticore
78 | - MEMCACHED_HOSTNAME=memcached
79 | - NODE_TYPE=WORKER
80 | ports:
81 | - "25:25"
82 | volumes:
83 | - piler_etc:/etc/piler
84 | - piler_store:/var/piler/store
85 | - piler_astore:/var/piler/astore
86 | - ./piler.lic:/etc/piler/piler.lic:ro
87 | healthcheck:
88 | test: curl -s smtp://localhost/
89 | interval: "60s"
90 | timeout: "3s"
91 | start_period: "15s"
92 | retries: 3
93 | deploy:
94 | resources:
95 | reservations:
96 | memory: 1024M
97 | limits:
98 | memory: 1024M
99 |
100 | depends_on:
101 | - "memcached"
102 | - "mysql"
103 | - "tika"
104 |
105 | volumes:
106 | piler_db: {}
107 | piler_etc: {}
108 | piler_manticore: {}
109 | piler_store: {}
110 | piler_astore: {}
111 |
--------------------------------------------------------------------------------
/examples/docker/piler-with-traefik/manticore.conf:
--------------------------------------------------------------------------------
1 | searchd
2 | {
3 | agent_connect_timeout = 3000
4 | agent_query_timeout = 9000
5 | listen = 9306:mysql
6 | listen = 9307:mysql_readonly
7 | log = /var/lib/manticore/manticore.log
8 | binlog_flush = 2
9 | binlog_path = /var/lib/manticore
10 | binlog_max_log_size = 256M
11 | data_dir = /var/lib/manticore
12 | query_log = /var/lib/manticore/manticore.log
13 | network_timeout = 5
14 | max_packet_size = 32M
15 | pid_file = /var/lib/manticore/manticore.pid
16 | seamless_rotate = 1
17 | preopen_tables = 1
18 | unlink_old = 1
19 | thread_stack = 512k
20 | # https://manticoresearch.com/blog/manticoresearch-buddy-intro/
21 | # Comment out the next line if you want to enable manticore-buddy
22 | buddy_path =
23 | rt_flush_period = 300
24 | }
25 |
--------------------------------------------------------------------------------
/examples/docker/piler-with-traefik/traefik.yaml:
--------------------------------------------------------------------------------
1 | log:
2 | level: INFO
3 |
4 | api:
5 | insecure: true
6 | dashboard: true
7 |
8 | entryPoints:
9 | web:
10 | address: ":443"
11 |
12 | providers:
13 | file:
14 | filename: "/etc/traefik/traefik.yaml"
15 |
16 | certificatesResolvers:
17 | le:
18 | acme:
19 | storage: "/etc/traefik/acme.json"
20 | email: admin@yourdomain.com
21 | tlsChallenge: {}
22 |
23 | tls:
24 | options:
25 | default:
26 | minVersion: VersionTLS13
27 |
28 | http:
29 | middlewares:
30 | piler_headers:
31 | headers:
32 | customResponseHeaders:
33 | Server: ""
34 | Strict-Transport-Security: "max-age=31536000"
35 |
36 | routers:
37 | piler:
38 | rule: "Host(`archive.yourdomain.com`)"
39 | service: piler
40 | middlewares:
41 | - "piler_headers"
42 | tls:
43 | certResolver: le
44 |
45 | services:
46 | piler:
47 | loadBalancer:
48 | servers:
49 | - url: "http://piler/"
50 |
51 |
--------------------------------------------------------------------------------
/examples/goss/README.md:
--------------------------------------------------------------------------------
1 | # Goss - Quick and Easy server validation
2 |
3 | ## Install goss
4 |
5 | ```
6 | curl -L https://github.com/goss-org/goss/releases/latest/download/goss-linux-amd64 -o /usr/local/bin/goss
7 | chmod +x /usr/local/bin/goss
8 | ```
9 |
10 | ## Copy goss.yaml to /etc/piler directory
11 |
12 | ## Run goss to validate your server's setup
13 |
14 | ```
15 | goss --vars /etc/piler/vars.yaml -g /etc/piler/goss.yaml validate
16 | ```
17 |
--------------------------------------------------------------------------------
/examples/goss/goss.yaml:
--------------------------------------------------------------------------------
1 | file:
2 | {{- range mkSlice "/usr/bin/pileraget" "/usr/bin/pilerexport" "/usr/bin/pilerget" "/usr/bin/pilerimport" "/usr/bin/pilertest"}}
3 | {{.}}:
4 | exists: true
5 | mode: "6755"
6 | owner: piler
7 | group: piler
8 | filetype: file
9 | contains: []
10 | {{end}}
11 | {{- range mkSlice "/usr/sbin/piler" "/usr/sbin/piler-smtp"}}
12 | {{.}}:
13 | exists: true
14 | mode: "0755"
15 | owner: root
16 | group: root
17 | filetype: file
18 | contains: []
19 | {{end}}
20 | /var/piler:
21 | exists: true
22 | mode: "0755"
23 | size: 4096
24 | owner: root
25 | group: root
26 | filetype: directory
27 | contains: []
28 | {{- range mkSlice "/var/piler/astore" "/var/piler/store" "/var/piler/tmp"}}
29 | {{.}}:
30 | exists: true
31 | mode: "0700"
32 | owner: piler
33 | group: piler
34 | filetype: directory
35 | contains: []
36 | {{end}}
37 | /etc/piler/config-site.php:
38 | exists: true
39 | mode: "0644"
40 | owner: root
41 | group: root
42 | filetype: file
43 | contains: []
44 | /etc/piler/piler.conf:
45 | exists: true
46 | mode: "0600"
47 | owner: piler
48 | group: piler
49 | filetype: file
50 | contains: []
51 | /etc/piler/piler.key:
52 | exists: true
53 | mode: "0640"
54 | size: 56
55 | owner: root
56 | group: piler
57 | filetype: file
58 | contains: []
59 | /etc/piler/piler.lic:
60 | exists: true
61 | mode: "0644"
62 | owner: root
63 | group: root
64 | filetype: file
65 | contains: []
66 | /etc/piler/piler.pem:
67 | exists: true
68 | mode: "0640"
69 | owner: root
70 | group: piler
71 | filetype: file
72 | contains: []
73 |
74 | package:
75 | {{- range mkSlice "manticore" "mariadb-server" "nginx" "php8.1-fpm" "piler-ee"}}
76 | {{.}}:
77 | installed: true
78 | {{end}}
79 | port:
80 | tcp:25:
81 | listening: true
82 | ip:
83 | - 0.0.0.0
84 | {{- range mkSlice "tcp:3306" "tcp:9306" "tcp:9307"}}
85 | {{.}}:
86 | listening: true
87 | ip:
88 | - 127.0.0.1
89 | {{end}}
90 | {{if eq .Vars.multinodes 1}}
91 | {{if eq .Vars.nodetype "WORKER"}}
92 | tcp:9312:
93 | listening: true
94 | ip:
95 | - 0.0.0.0
96 | {{end}}
97 | {{end}}
98 | service:
99 | {{- range mkSlice "mariadb" "memcached" "nginx" "php8.1-fpm" "piler" "piler-smtp" "pilersearch"}}
100 | {{.}}:
101 | enabled: true
102 | running: true
103 | {{end}}
104 | user:
105 | piler:
106 | exists: true
107 | groups:
108 | - piler
109 | home: /var/piler
110 | shell: /bin/bash
111 | group:
112 | piler:
113 | exists: true
114 | process:
115 | {{- range mkSlice "piler" "piler-smtp" "searchd"}}
116 | {{.}}:
117 | running: true
118 | {{end}}
119 | http:
120 | {{.Vars.tika_url}}:
121 | status: 200
122 | allow-insecure: false
123 | no-follow-redirects: false
124 | timeout: 5000
125 | body: []
126 | {{.Vars.piler_url}}:
127 | status: 200
128 | allow-insecure: true
129 | no-follow-redirects: false
130 | timeout: 5000
131 | body: []
132 |
133 | dns:
134 | {{.Vars.piler_host}}:
135 | resolvable: true
136 | timeout: 5000
137 | addr:
138 | tcp://{{.Vars.memcached_host}}:11211:
139 | reachable: true
140 | timeout: 500
141 |
--------------------------------------------------------------------------------
/examples/lets-encrypt-with-traefik/README.md:
--------------------------------------------------------------------------------
1 | # Setup Let's Encrypt certificate with traefik and nginx
2 |
3 | ## Install traefik edge router
4 |
5 | #### Setup the traefik binary
6 |
7 | ```bash
8 | wget https://github.com/traefik/traefik/releases/download/v2.10.7/traefik_v2.10.7_linux_amd64.tar.gz
9 | tar zxvf traefik_v2.10.7_linux_amd64.tar.gz
10 | cp traefik /usr/local/bin
11 | setcap cap_net_bind_service+ep /usr/local/bin/traefik
12 | ```
13 |
14 | #### Setup traefik configuration
15 |
16 | ```
17 | mkdir /usr/local/etc/traefik
18 | cp traefik.yaml /usr/local/etc/traefik
19 | touch /usr/local/etc/traefik/acme.json
20 | chmod 600 /usr/local/etc/traefik/acme.json
21 | chown www-data:www-data /usr/local/etc/traefik/acme.json
22 | ```
23 |
24 | Be sure to fix your IP-address and domain name in /usr/local/etc/traefik/traefik.yaml!
25 |
26 | #### Setup systemd service for traefik
27 |
28 | ```
29 | cp traefik.service /etc/systemd/system
30 | systemctl daemon-reload
31 | systemctl enable traefik
32 | systemctl start traefik
33 | ```
34 |
35 | See [https://doc.traefik.io/traefik/getting-started/install-traefik/](https://doc.traefik.io/traefik/getting-started/install-traefik/) for the detailed installation procedure.
36 |
37 | ## Fix nginx to listen on 127.0.0.1:80
38 |
39 | Set the listen address and port to 127.0.0.1:80 in /etc/piler/piler-nginx.conf,
40 | and fix the log format in nginx.conf to get the real IP-addresses, then restart nginx
41 |
42 | ```
43 | nginx -t
44 | nginx -s reload
45 | ```
46 |
47 | ## Final notes
48 |
49 | Traefik obtains you an A-grade https certificate, and automatically renews it before it expires.
50 |
51 | The traefik config yaml file uses TLS v1.3. If necessary you may lower the minVersion to your needs.
52 |
53 | Optionally visit [https://www.ssllabs.com/ssltest/](https://www.ssllabs.com/ssltest/) to verify it.
54 |
--------------------------------------------------------------------------------
/examples/lets-encrypt-with-traefik/nginx.conf:
--------------------------------------------------------------------------------
1 | user www-data;
2 | worker_processes auto;
3 | pid /run/nginx.pid;
4 | include /etc/nginx/modules-enabled/*.conf;
5 |
6 | events {
7 | worker_connections 768;
8 | # multi_accept on;
9 | }
10 |
11 | http {
12 |
13 | ##
14 | # Basic Settings
15 | ##
16 |
17 | sendfile on;
18 | tcp_nopush on;
19 | tcp_nodelay on;
20 | keepalive_timeout 65;
21 | types_hash_max_size 2048;
22 | # server_tokens off;
23 |
24 | # server_names_hash_bucket_size 64;
25 | # server_name_in_redirect off;
26 |
27 | include /etc/nginx/mime.types;
28 | default_type application/octet-stream;
29 |
30 | ##
31 | # SSL Settings
32 | ##
33 |
34 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
35 | ssl_prefer_server_ciphers on;
36 |
37 | ##
38 | # Logging Settings
39 | ##
40 |
41 | log_format my '$http_x_forwarded_for - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';
42 |
43 | access_log /var/log/nginx/access.log my;
44 | error_log /var/log/nginx/error.log;
45 |
46 | ##
47 | # Gzip Settings
48 | ##
49 |
50 | gzip on;
51 |
52 | # gzip_vary on;
53 | # gzip_proxied any;
54 | # gzip_comp_level 6;
55 | # gzip_buffers 16 8k;
56 | # gzip_http_version 1.1;
57 | # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
58 |
59 | ##
60 | # Virtual Host Configs
61 | ##
62 |
63 | include /etc/nginx/conf.d/*.conf;
64 | include /etc/nginx/sites-enabled/*;
65 | }
66 |
67 |
68 | #mail {
69 | # # See sample authentication script at:
70 | # # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
71 | #
72 | # # auth_http localhost/auth.php;
73 | # # pop3_capabilities "TOP" "USER";
74 | # # imap_capabilities "IMAP4rev1" "UIDPLUS";
75 | #
76 | # server {
77 | # listen localhost:110;
78 | # protocol pop3;
79 | # proxy on;
80 | # }
81 | #
82 | # server {
83 | # listen localhost:143;
84 | # protocol imap;
85 | # proxy on;
86 | # }
87 | #}
88 |
--------------------------------------------------------------------------------
/examples/lets-encrypt-with-traefik/piler-nginx.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 127.0.0.1:80;
3 | server_name archive.yourdomain.com;
4 |
5 | ...
6 | }
7 |
--------------------------------------------------------------------------------
/examples/lets-encrypt-with-traefik/traefik.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=Traefik edge router
3 | Documentation=https://docs.traefik.io/
4 | After=network-online.target
5 | Wants=network-online.target systemd-networkd-wait-online.service
6 |
7 | [Service]
8 | Restart=on-abnormal
9 |
10 | ; User and group the process will run as.
11 | User=www-data
12 | Group=www-data
13 |
14 | ExecStart=/usr/local/bin/traefik --configfile /usr/local/etc/traefik/traefik.yaml
15 | ExecReload=/bin/kill -USR1 $MAINPID
16 |
17 | ; Use graceful shutdown with a reasonable timeout
18 | KillMode=mixed
19 | KillSignal=SIGQUIT
20 | TimeoutStopSec=5s
21 |
22 | ; Limit the number of file descriptors; see `man systemd.exec` for more limit settings.
23 | LimitNOFILE=1048576
24 | ; Unmodified traefik is not expected to use more than that.
25 | LimitNPROC=512
26 |
27 | ; Use private /tmp and /var/tmp, which are discarded after traefik stops.
28 | PrivateTmp=true
29 | ; Use a minimal /dev (May bring additional security if switched to 'true', but it may not work on Raspberry Pi's or other devices, so it has been disabled in this dist.)
30 | PrivateDevices=false
31 | ; Hide /home, /root, and /run/user. Nobody will steal your SSH-keys.
32 | ProtectHome=true
33 | ; Make /usr, /boot, /etc and possibly some more folders read-only.
34 | ProtectSystem=full
35 | ; … except /usr/local/etc/traefik, because we want Letsencrypt-certificates there.
36 | ; This merely retains r/w access rights, it does not add any new. Must still be writable on the host!
37 | ReadWritePaths=/usr/local/etc/traefik
38 |
39 | ; The following additional security directives only work with systemd v229 or later.
40 | ; They further restrict privileges that can be gained by traefik. Uncomment if you like.
41 | ; Note that you may have to add capabilities required by any plugins in use.
42 | ;CapabilityBoundingSet=CAP_NET_BIND_SERVICE
43 | ;AmbientCapabilities=CAP_NET_BIND_SERVICE
44 | ;NoNewPrivileges=true
45 |
46 | [Install]
47 | WantedBy=multi-user.target
48 |
--------------------------------------------------------------------------------
/examples/lets-encrypt-with-traefik/traefik.yaml:
--------------------------------------------------------------------------------
1 | log:
2 | level: INFO
3 |
4 | entryPoints:
5 | websecure:
6 | address: "1.2.3.4:443"
7 |
8 | providers:
9 | file:
10 | filename: "/usr/local/etc/traefik/traefik.yaml"
11 |
12 | certificatesResolvers:
13 | le:
14 | acme:
15 | storage: "/usr/local/etc/traefik/acme.json"
16 | email: admin@example.com
17 | tlsChallenge: {}
18 |
19 | tls:
20 | options:
21 | default:
22 | minVersion: VersionTLS13
23 |
24 | http:
25 | middlewares:
26 | piler_headers:
27 | headers:
28 | customResponseHeaders:
29 | Server: ""
30 | Strict-Transport-Security: "max-age=31536000"
31 | X-Content-Type-Optionsi: "nosniff"
32 | Referrer-Policy: "same-origin"
33 | routers:
34 | piler:
35 | rule: "Host(`archive.example.com`)"
36 | service: piler
37 | middlewares:
38 | - "piler_headers"
39 | tls:
40 | certResolver: le
41 | services:
42 | piler:
43 | loadBalancer:
44 | servers:
45 | - url: "http://127.0.0.1:80/"
46 |
--------------------------------------------------------------------------------
/examples/saml2/README.md:
--------------------------------------------------------------------------------
1 | ## Generate a private key and certificate
2 |
3 | ```
4 | openssl req -newkey rsa:4096 -new -nodes -x509 -days 3650 -keyout private.key -out public.crt \
5 | -subj "/C=HU/ST=Budapest/L=Budapest/O=Example/CN=archive.example.com"
6 | ```
7 |
8 | ## Write both private key and certificate to saml2.php
9 |
10 | ```
11 | python3 -c 'import sys; print("".join(sys.stdin.read().splitlines()))' < private.key
12 | ```
13 |
14 | Put the output to $settings['sp']['privateKey']
15 |
16 | ```
17 | python3 -c 'import sys; print("".join(sys.stdin.read().splitlines()))' < public.crt
18 | ```
19 |
20 | Put the output to $settings['sp']['x509cert']
21 |
22 | ## Get the SAML2 IdP certificate
23 |
24 | Copy the certificate value from https://keycloak.example.com/realms/example-realm/protocol/saml/descriptor
25 | and put it to $settings['idp']['x509cert']
26 |
27 | ## Copy saml2.php to /etc/piler
28 |
29 | ```
30 | cp saml2.php /etc/piler
31 | ```
32 |
33 | ## Enable SAML 2 authentication
34 |
35 | Set the following to /etc/piler/config-site.php:
36 |
37 | ```
38 | $config['ENABLE_SAML2'] = 1;
39 | ```
40 |
--------------------------------------------------------------------------------
/examples/saml2/saml2.php:
--------------------------------------------------------------------------------
1 | [
5 | 'allowRepeatAttributeName' => true,
6 | 'authnRequestsSigned' => true,
7 | 'logoutRequestSigned' => true,
8 | 'logoutResponseSigned' => true,
9 | 'wantMessagesSigned' => true,
10 | ],
11 |
12 | 'sp' => [
13 | 'entityId' => 'piler-saml',
14 | 'NameIDFormat' => 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress',
15 | 'assertionConsumerService' => [
16 | 'url' => 'https://archive.example.com/callback-saml2',
17 | ],
18 | 'singleLogoutService' => [
19 | 'url' => 'https://archive.example.com/logout',
20 | ],
21 | 'x509cert' => '-----BEGIN CERTIFICATE-----MIIFlT....pgwxA=-----END CERTIFICATE-----',
22 | 'privateKey' => '-----BEGIN PRIVATE KEY-----MIIJQg...X4Lb18ZgPQ==-----END PRIVATE KEY-----',
23 | ],
24 |
25 | 'idp' => [
26 | 'entityId' => 'https://keycloak.example.com/realms/example-realm',
27 | 'singleSignOnService' => [
28 | 'url' => 'https://keycloak.example.com/realms/example-realm/protocol/saml',
29 | ],
30 | 'singleLogoutService' => [
31 | 'url' => 'https://keycloak.example.com/realms/example-realm/protocol/saml',
32 | ],
33 | 'x509cert' => '-----BEGIN CERTIFICATE-----MIICpTCC.....OEdfBU-----END CERTIFICATE-----',
34 | ],
35 | ];
36 |
--------------------------------------------------------------------------------
/examples/waf/README.md:
--------------------------------------------------------------------------------
1 | # How to add WAF support using traefik
2 |
3 | A Web Application Firewall (WAF) improves your security posture.
4 | It may block a wide range of attacks, eg. SQL injection, XSS, etc.
5 |
6 | OWASP ModSecurity is a viable solution to implement a WAF. They
7 | provide various docker images that integrates modsecurity to
8 | Apache or Nginx.
9 |
10 | In this tutorial we'll create an integration with Traefik.
11 | It supports both middlewares and plugins, and you may use them
12 | to have all incoming requests to be sent to the WAF for inspection.
13 |
14 | Docker compose features the following containers:
15 | - traefik: handles incoming requests
16 | - website: an example website we want to protect
17 | - waf: nginx with modsecurity
18 | - dummy: a helper companion for the waf container
19 |
20 | The traefik confiugration files defines
21 | - the modsecurity plugin
22 | - the WAF middleware to send the requests for inspection
23 | - the routers and services for each component
24 |
25 | ## Launch
26 |
27 | ```
28 | docker compose up
29 | ```
30 |
31 | ## Test
32 |
33 | Let's send a valid request
34 |
35 | ```
36 | curl -H 'Host: website' http://localhost:8000/status
37 | ```
38 |
39 | The result looks fine:
40 |
41 | ```
42 | server: 172.25.0.2
43 | time: 31/Mar/2024:07:07:03 +0000
44 | uri: /status
45 | ```
46 |
47 | Now let's try an XSS attempt:
48 |
49 | ```
50 | curl -H 'Host: website' "http://localhost:8000/status?waf"
51 | ```
52 |
53 | The result is a HTTP/403 response, the WAF rejected our attempt:
54 |
55 | ```
56 |
57 | 403 Forbidden
58 |
59 | 403 Forbidden
60 |
nginx
61 |
62 |
63 | ```
64 |
65 | You may check the WAF container's log why it blocked the request.
66 | It's a JSON format log. The excerpt is just below.
67 |
68 | Feel free to check the formatted JSON output in [waf.log.json](waf.log.json)
69 |
70 | ```
71 | "message": "XSS Attack Detected via libinjection",
72 | "details": {
73 | "match": "detected XSS using libinjection.",
74 | "reference": "v10,25t:utf8toUnicode,t:urlDecodeUni,t:htmlEntityDecode,t:jsDecode,t:cssDecode,t:removeNulls",
75 | "ruleId": "941100",
76 | "file": "/etc/modsecurity.d/owasp-crs/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf",
77 | "lineNumber": "80",
78 | "data": "Matched Data: XSS data found within ARGS:waf: ",
79 | "severity": "2",
80 | "ver": "OWASP_CRS/4.0.0",
81 | "rev": "",
82 | "tags": [
83 | "modsecurity",
84 | "application-multi",
85 | "language-multi",
86 | "platform-multi",
87 | "attack-xss",
88 | "xss-perf-disable",
89 | "paranoia-level/1",
90 | "OWASP_CRS",
91 | "capec/1000/152/242"
92 | ],
93 | "maturity": "0",
94 | "accuracy": "0"
95 | }
96 | ```
97 |
98 | ## Protecting a webapp not running in a container
99 |
100 | In the above example all components were running in docker. But what if your webapp
101 | doesn't run in a container? You may still achieve the same functionality. In this
102 | case run only the WAF and its companion in containers using a trimmed docker-compose.yaml
103 |
104 | ```
105 | services:
106 | waf:
107 | image: owasp/modsecurity-crs:nginx-alpine
108 | container_name: waf
109 | environment:
110 | - PARANOIA=2
111 | - ANOMALY_INBOUND=10
112 | - ANOMALY_OUTBOUND=5
113 | - BACKEND=http://dummy
114 | ports:
115 | - "127.0.0.1:8000:8080"
116 | dummy:
117 | image: traefik/whoami
118 | container_name: dummy
119 | ```
120 |
121 | Then configure traefik (running on the host) to access the WAF at http://127.0.0.1:8000
122 |
123 | ## Conclusion
124 |
125 | We have successfully protected our web app using the ModSecurity WAF.
126 | You may use any containerized or non-containerized application. [Piler enterprise](https://mailpiler.com)
127 | can run both in a container and natively on a host.
128 |
129 | ## README
130 |
131 | [Why does WAF matter in API security?](https://traefik.io/blog/why-does-waf-matter-in-api-security/)
132 |
133 | [Traefik proxy with Web Application Firewall (WAF)](https://korteke.medium.com/traefik-proxy-with-web-application-firewall-waf-cb4cd65f34f7)
134 |
135 | [Traefik reverse-proxy with ModSecurity](https://blog.xentoo.info/2022/01/22/traefik-reverse-proxy-with-modsecurity/)
136 |
137 | [OWASP CRS Docker Image documentation](https://github.com/coreruleset/modsecurity-crs-docker)
138 |
--------------------------------------------------------------------------------
/examples/waf/docker-compose.yaml:
--------------------------------------------------------------------------------
1 | services:
2 | traefik:
3 | image: traefik
4 | container_name: traefik
5 | ports:
6 | - "8000:80"
7 | - "8080:8080"
8 | volumes:
9 | - ./traefik.yaml:/etc/traefik/traefik.yaml:ro
10 |
11 | waf:
12 | image: owasp/modsecurity-crs:nginx-alpine
13 | container_name: waf
14 | environment:
15 | - PARANOIA=2
16 | - ANOMALY_INBOUND=10
17 | - ANOMALY_OUTBOUND=5
18 | - BACKEND=http://dummy
19 |
20 | website:
21 | image: sutoj/nginx:0.6
22 | container_name: website
23 |
24 | dummy:
25 | image: traefik/whoami
26 | container_name: dummy
27 |
--------------------------------------------------------------------------------
/examples/waf/traefik.yaml:
--------------------------------------------------------------------------------
1 | log:
2 | level: INFO
3 |
4 | api:
5 | insecure: true
6 | dashboard: true
7 |
8 | entryPoints:
9 | web:
10 | address: ":80"
11 |
12 | providers:
13 | file:
14 | filename: "/etc/traefik/traefik.yaml"
15 |
16 | experimental:
17 | plugins:
18 | traefik-modsecurity-plugin:
19 | moduleName: github.com/acouvreur/traefik-modsecurity-plugin
20 | version: v1.3.0
21 |
22 | http:
23 | middlewares:
24 | waf:
25 | plugin:
26 | traefik-modsecurity-plugin:
27 | modSecurityUrl: http://waf:8080
28 | maxBodySize: 10485760
29 |
30 | routers:
31 | dummy:
32 | rule: "Host(`dummy`)"
33 | service: dummy
34 | website:
35 | rule: "Host(`website`)"
36 | service: website
37 | middlewares:
38 | - waf
39 |
40 | waf:
41 | rule: "Host(`waf`)"
42 | service: waf
43 |
44 | services:
45 | dummy:
46 | loadBalancer:
47 | servers:
48 | - url: "http://dummy/"
49 | website:
50 | loadBalancer:
51 | servers:
52 | - url: "http://website/"
53 | waf:
54 | loadBalancer:
55 | servers:
56 | - url: "http://waf:8080/"
57 |
--------------------------------------------------------------------------------
/examples/waf/waf.log.json:
--------------------------------------------------------------------------------
1 | {
2 | "transaction": {
3 | "client_ip": "172.25.0.3",
4 | "time_stamp": "Sun Mar 31 07:08:42 2024",
5 | "server_id": "45ddceecbeaa00d3a1be955adda022c4c3f9a9e9",
6 | "client_port": 36054,
7 | "host_ip": "172.25.0.5",
8 | "host_port": 8080,
9 | "unique_id": "171186892262.040691",
10 | "request": {
11 | "method": "GET",
12 | "http_version": 1.1,
13 | "uri": "/?waf=",
14 | "headers": {
15 | "Host": "waf:8080",
16 | "User-Agent": "curl/7.81.0",
17 | "Accept": "*/*",
18 | "X-Forwarded-Host": "website",
19 | "X-Forwarded-Port": "80",
20 | "X-Forwarded-Proto": "http",
21 | "X-Forwarded-Server": "38b578184633",
22 | "X-Real-Ip": "172.25.0.1",
23 | "Accept-Encoding": "gzip"
24 | }
25 | },
26 | "response": {
27 | "body": "\r\n403 Forbidden\r\n\r\n403 Forbidden
\r\n
nginx\r\n\r\n\r\n",
28 | "http_code": 403,
29 | "headers": {
30 | "Server": "nginx",
31 | "Date": "Sun, 31 Mar 2024 07:08:42 GMT",
32 | "Content-Length": "146",
33 | "Content-Type": "text/html",
34 | "Connection": "keep-alive"
35 | }
36 | },
37 | "producer": {
38 | "modsecurity": "ModSecurity v3.0.12 (Linux)",
39 | "connector": "ModSecurity-nginx v1.0.3",
40 | "secrules_engine": "Enabled",
41 | "components": [
42 | "OWASP_CRS/4.0.0\""
43 | ]
44 | },
45 | "messages": [
46 | {
47 | "message": "XSS Attack Detected via libinjection",
48 | "details": {
49 | "match": "detected XSS using libinjection.",
50 | "reference": "v10,25t:utf8toUnicode,t:urlDecodeUni,t:htmlEntityDecode,t:jsDecode,t:cssDecode,t:removeNulls",
51 | "ruleId": "941100",
52 | "file": "/etc/modsecurity.d/owasp-crs/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf",
53 | "lineNumber": "80",
54 | "data": "Matched Data: XSS data found within ARGS:waf: ",
55 | "severity": "2",
56 | "ver": "OWASP_CRS/4.0.0",
57 | "rev": "",
58 | "tags": [
59 | "modsecurity",
60 | "application-multi",
61 | "language-multi",
62 | "platform-multi",
63 | "attack-xss",
64 | "xss-perf-disable",
65 | "paranoia-level/1",
66 | "OWASP_CRS",
67 | "capec/1000/152/242"
68 | ],
69 | "maturity": "0",
70 | "accuracy": "0"
71 | }
72 | },
73 | {
74 | "message": "XSS Filter - Category 1: Script Tag Vector",
75 | "details": {
76 | "match": "Matched \"Operator `Rx' with parameter `(?i)' )",
77 | "reference": "o0,8v10,25t:utf8toUnicode,t:urlDecodeUni,t:htmlEntityDecode,t:jsDecode,t:cssDecode,t:removeNulls",
78 | "ruleId": "941110",
79 | "file": "/etc/modsecurity.d/owasp-crs/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf",
80 | "lineNumber": "106",
81 | "data": "Matched Data: ",
82 | "severity": "2",
83 | "ver": "OWASP_CRS/4.0.0",
84 | "rev": "",
85 | "tags": [
86 | "modsecurity",
87 | "application-multi",
88 | "language-multi",
89 | "platform-multi",
90 | "attack-xss",
91 | "xss-perf-disable",
92 | "paranoia-level/1",
93 | "OWASP_CRS",
94 | "capec/1000/152/242"
95 | ],
96 | "maturity": "0",
97 | "accuracy": "0"
98 | }
99 | },
100 | {
101 | "message": "NoScript XSS InjectionChecker: HTML Injection",
102 | "details": {
103 | "match": "Matched \"Operator `Rx' with parameter `(?i)<[^0-9<>A-Z_a-z]*(?:[^\\s\\v\\\"'<>]*:)?[^0-9<>A-Z_a-z]*[^0-9A-Z_a-z]*?(?:s[^0-9A-Z_a-z]*?(?:c[^0-9A-Z_a-z]*?r[^0-9A-Z_a-z]*?i[^0-9A-Z_a-z]*?p[^0-9A-Z_a-z]*?t|t[^0-9A-Z_a-z]*?y[^0-9A-Z_a-z]*?l[^0-9A-Z (4336 characters omitted)' against variable `ARGS:waf' (Value: `' )",
104 | "reference": "o0,7v10,25t:utf8toUnicode,t:urlDecodeUni,t:htmlEntityDecode,t:jsDecode,t:cssDecode,t:removeNulls",
105 | "ruleId": "941160",
106 | "file": "/etc/modsecurity.d/owasp-crs/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf",
107 | "lineNumber": "198",
108 | "data": "Matched Data: ",
109 | "severity": "2",
110 | "ver": "OWASP_CRS/4.0.0",
111 | "rev": "",
112 | "tags": [
113 | "modsecurity",
114 | "application-multi",
115 | "language-multi",
116 | "platform-multi",
117 | "attack-xss",
118 | "xss-perf-disable",
119 | "paranoia-level/1",
120 | "OWASP_CRS",
121 | "capec/1000/152/242"
122 | ],
123 | "maturity": "0",
124 | "accuracy": "0"
125 | }
126 | },
127 | {
128 | "message": "Javascript method detected",
129 | "details": {
130 | "match": "Matched \"Operator `Rx' with parameter `(?i)\\b(?:eval|set(?:timeout|interval)|new[\\s\\v]+Function|a(?:lert|tob)|btoa|prompt|confirm)[\\s\\v]*\\(' against variable `ARGS:waf' (Value: `' )",
131 | "reference": "o8,6v10,25t:htmlEntityDecode,t:jsDecode",
132 | "ruleId": "941390",
133 | "file": "/etc/modsecurity.d/owasp-crs/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf",
134 | "lineNumber": "712",
135 | "data": "Matched Data: alert( found within ARGS:waf: ",
136 | "severity": "2",
137 | "ver": "OWASP_CRS/4.0.0",
138 | "rev": "",
139 | "tags": [
140 | "modsecurity",
141 | "application-multi",
142 | "language-multi",
143 | "attack-xss",
144 | "xss-perf-disable",
145 | "paranoia-level/1",
146 | "OWASP_CRS",
147 | "capec/1000/152/242"
148 | ],
149 | "maturity": "0",
150 | "accuracy": "0"
151 | }
152 | },
153 | {
154 | "message": "Inbound Anomaly Score Exceeded (Total Score: 20)",
155 | "details": {
156 | "match": "Matched \"Operator `Ge' with parameter `10' against variable `TX:BLOCKING_INBOUND_ANOMALY_SCORE' (Value: `20' )",
157 | "reference": "",
158 | "ruleId": "949110",
159 | "file": "/etc/modsecurity.d/owasp-crs/rules/REQUEST-949-BLOCKING-EVALUATION.conf",
160 | "lineNumber": "176",
161 | "data": "",
162 | "severity": "0",
163 | "ver": "OWASP_CRS/4.0.0",
164 | "rev": "",
165 | "tags": [
166 | "modsecurity",
167 | "anomaly-evaluation"
168 | ],
169 | "maturity": "0",
170 | "accuracy": "0"
171 | }
172 | }
173 | ]
174 | }
175 | }
176 |
--------------------------------------------------------------------------------
/examples/zentyal/README.md:
--------------------------------------------------------------------------------
1 | # Deploying piler to Zentyal using docker-compose
2 |
3 | ## The goal
4 |
5 | We are going to install piler in a dockerized environment.
6 | The GUI will authenticate users using the LDAP server (ie.
7 | Samba) running on Zentyal. Postfix will send a copy of each
8 | received email to the archive.
9 |
10 | ## The layout
11 |
12 | This setup features the following containers:
13 |
14 | * mariadb: storing metadata, user db, etc.
15 | * memcached: to cache some data
16 | * Piler 1.3.10: the email archive running piler and sphinxsearch
17 |
18 | Port mappings to containers:
19 |
20 | - piler: 8080/tcp, 2525/tcp
21 |
22 | No other port should be visible from the outside.
23 |
24 | ## Prerequisites
25 |
26 | * You have a working [Zentyal](https://zentyal.com/) deployment with mail support
27 |
28 | ## Install docker components
29 |
30 | ```
31 | apt-get install -y docker-compose docker.io
32 | ```
33 |
34 | ## Setup
35 |
36 | ### Customize docker-compose.yaml
37 |
38 | Fix the following values:
39 |
40 | * MYSQL_PILER_PASSWORD
41 | * PILER_HOSTNAME
42 |
43 |
44 | If you preferred external volumes rather than docker-compose managed volumes,
45 | then fix the volumes section at the end:
46 |
47 | ```
48 | ...
49 |
50 | volumes:
51 | db_data:
52 | external: true
53 | name: db-data
54 | piler_etc:
55 | external: true
56 | name: piler-etc
57 | piler_var:
58 | external: true
59 | name: piler-var
60 | ```
61 |
62 |
63 | ### Start the containers
64 |
65 | ```
66 | docker-compose up -d
67 | ```
68 |
69 |
70 | ### Create a transport map for piler
71 |
72 | ```
73 | echo "archive.yourdomain.com smtp:[127.0.0.1]:2525" > /etc/postfix/transport.piler
74 | ```
75 |
76 | ### Create piler related changes to the system
77 |
78 | ```
79 | cp /usr/share/zentyal/stubs/mail/main.cf.mas .
80 | patch < main.cf.mas.diff
81 | mkdir -p /etc/zentyal/stubs/mail
82 | cp main.cf.mas /etc/zentyal/stubs/mail
83 | cp mail.postsetconf /etc/zentyal/hooks
84 | chmod +x /etc/zentyal/hooks/mail.postsetconf
85 | ```
86 |
87 | ### Configure Bcc for your domains
88 |
89 | Select "Mail" menu, then "Virtual Mail Domains" on the Zentyal dashboard.
90 | Click on the "Settings" gear icons for the domain you want to archive emails.
91 |
92 | Select "Address to sent the copy" from the dropdown menu, and type
93 | "archive@archive.yourdomain.com", then click "Change", and "Save changes".
94 |
95 | ### Fix the piler GUI config
96 |
97 | Read /etc/postfix/valiases.cf to get the LDAP bind user parameters, then
98 | add the following settings to /var/lib/docker/volumes/u1_piler_etc/_data/config-site.php:
99 | (Your volume path might be different!)
100 |
101 | ```
102 | $config['ENABLE_LDAP_AUTH'] = 1;
103 | $config['LDAP_HOST'] = 'ldap://zentyal.yourdomain.com:389';
104 | $config['LDAP_HELPER_DN'] = 'CN=zentyal-mail-zentyal,CN=Users,DC=zentyal-domain,DC=lan';
105 | $config['LDAP_HELPER_PASSWORD'] = 'xxxxx';
106 | $config['LDAP_BASE_DN'] = 'DC=zentyal-domain,DC=lan';
107 | $config['LDAP_ACCOUNT_OBJECTCLASS'] = 'user';
108 | $config['LDAP_DISTRIBUTIONLIST_OBJECTCLASS'] = 'group';
109 | $config['LDAP_DISTRIBUTIONLIST_ATTR'] = 'member';
110 | $config['LDAP_MAIL_ATTR'] = 'mail';
111 | ```
112 |
113 | Also and add ":8080" (without quotes) to the SITE_URL parameter, eg.
114 |
115 | ```
116 | $config['SITE_URL'] = 'http://' . $config[SITE_NAME_CONST] . ':8080/';
117 | ```
118 |
119 |
120 | ### Add a firewall rule to allow users login to the GUI
121 |
122 | Select "Firewall" menu, then "Packet filter", and "Filtering rules from internal networks to Zentyal".
123 | Click on "Configure rules", and add a service and a rule to allow incoming requests to port 8080.
124 |
125 | ## Final words
126 |
127 | You just got a piler deployment in a containerized environment on Zentyal.
128 | Note that these settings are good enough to get going, however feel free
129 | to customize the archive, eg. add HTTPS support, etc.
130 |
--------------------------------------------------------------------------------
/examples/zentyal/docker-compose.yaml:
--------------------------------------------------------------------------------
1 | version: "3"
2 | services:
3 |
4 | mysql:
5 | image: mariadb:10.5
6 | restart: unless-stopped
7 | cap_drop:
8 | - ALL
9 | cap_add:
10 | - dac_override
11 | - setuid
12 | - setgid
13 | environment:
14 | - MYSQL_DATABASE=piler
15 | - MYSQL_USER=piler
16 | - MYSQL_PASSWORD=piler123
17 | - MYSQL_RANDOM_ROOT_PASSWORD=yes
18 | command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
19 | healthcheck:
20 | test: mysql --user=piler --password=piler123 piler --execute "show tables"
21 | interval: "60s"
22 | timeout: "5s"
23 | retries: 3
24 | volumes:
25 | - db_data:/var/lib/mysql
26 |
27 | memcached:
28 | image: memcached:latest
29 | restart: unless-stopped
30 | cap_drop:
31 | - ALL
32 | command: -m 64
33 |
34 | piler:
35 | image: sutoj/piler:1.3.11
36 | environment:
37 | - MYSQL_DATABASE=piler
38 | - MYSQL_USER=piler
39 | - MYSQL_PASSWORD=piler123
40 | - MYSQL_HOSTNAME=mysql
41 | - PILER_HOSTNAME=archive.yourdomain.com
42 | - MEMCACHED_HOST=memcached
43 | ports:
44 | - "2525:25"
45 | - "8080:80"
46 | volumes:
47 | - piler_etc:/etc/piler
48 | - piler_var:/var/piler
49 | healthcheck:
50 | test: curl -s smtp://localhost/
51 | interval: "60s"
52 | timeout: "3s"
53 | retries: 3
54 |
55 | depends_on:
56 | - "memcached"
57 | - "mysql"
58 |
59 | volumes:
60 | db_data: {}
61 | piler_etc: {}
62 | piler_var: {}
63 |
64 |
--------------------------------------------------------------------------------
/examples/zentyal/mail.postsetconf:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | postmap /etc/postfix/transport.piler
4 |
5 | exit 0
6 |
--------------------------------------------------------------------------------
/examples/zentyal/main.cf.mas.diff:
--------------------------------------------------------------------------------
1 | --- main.cf.mas.orig 2021-02-21 14:06:41.358115723 +0100
2 | +++ main.cf.mas 2021-02-21 14:07:22.638959741 +0100
3 | @@ -162,5 +162,7 @@
4 | % if ($bccMaps) {
5 | sender_bcc_maps = <% $bccMaps %>
6 | recipient_bcc_maps = <% $bccMaps %>
7 | +# Transport map for local archive
8 | +transport_maps = hash:/etc/postfix/transport.piler
9 | % }
10 |
--------------------------------------------------------------------------------