Browse Source

Fist commit

Philippe Caseiro 11 months ago
commit
5ab6a7f2cb
8 changed files with 1706 additions and 0 deletions
  1. 231
    0
      LICENSE
  2. 27
    0
      Makefile
  3. 5
    0
      README.md
  4. 64
    0
      apps.mk
  5. 92
    0
      dicos/90_redis.xml
  6. 1
    0
      eole-redis.mk
  7. 231
    0
      eole.mk
  8. 1055
    0
      tmpl/redis.conf

+ 231
- 0
LICENSE View File

@@ -0,0 +1,231 @@
1
+GNU GENERAL PUBLIC LICENSE 
2
+Version 3, 29 June 2007
3
+Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
4
+
5
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
6
+
7
+Preamble
8
+
9
+The GNU General Public License is a free, copyleft license for software and other kinds of works.
10
+
11
+The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
12
+
13
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
14
+
15
+To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
16
+
17
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
18
+
19
+Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
20
+
21
+For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
22
+
23
+Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
24
+
25
+Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
26
+
27
+The precise terms and conditions for copying, distribution and modification follow.
28
+
29
+TERMS AND CONDITIONS
30
+
31
+0. Definitions.
32
+
33
+“This License” refers to version 3 of the GNU General Public License.
34
+
35
+“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
36
+
37
+“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
38
+
39
+To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
40
+
41
+A “covered work” means either the unmodified Program or a work based on the Program.
42
+
43
+To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
44
+
45
+To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
46
+
47
+An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
48
+
49
+1. Source Code. 
50
+The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
51
+
52
+A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
53
+
54
+The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
55
+
56
+The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
57
+
58
+The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
59
+
60
+The Corresponding Source for a work in source code form is that same work.
61
+
62
+2. Basic Permissions. 
63
+All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
64
+
65
+You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
66
+
67
+Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
68
+
69
+3. Protecting Users' Legal Rights From Anti-Circumvention Law. 
70
+No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
71
+
72
+When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
73
+
74
+4. Conveying Verbatim Copies. 
75
+You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
76
+
77
+You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
78
+
79
+5. Conveying Modified Source Versions. 
80
+You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
81
+
82
+a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
83
+
84
+b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
85
+
86
+c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
87
+
88
+d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
89
+
90
+A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
91
+
92
+6. Conveying Non-Source Forms. 
93
+You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
94
+
95
+a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
96
+
97
+b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
98
+
99
+c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
100
+
101
+d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
102
+
103
+e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
104
+
105
+A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
106
+
107
+A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
108
+
109
+“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
110
+
111
+If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
112
+
113
+The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
114
+
115
+Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
116
+
117
+7. Additional Terms. 
118
+“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
119
+
120
+When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
121
+
122
+Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
123
+
124
+a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
125
+
126
+b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
127
+
128
+c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
129
+
130
+d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
131
+
132
+e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
133
+
134
+f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
135
+
136
+All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
137
+
138
+If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
139
+
140
+Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
141
+
142
+8. Termination. 
143
+You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
144
+
145
+However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
146
+
147
+Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
148
+
149
+Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
150
+
151
+9. Acceptance Not Required for Having Copies. 
152
+You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
153
+
154
+10. Automatic Licensing of Downstream Recipients. 
155
+Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
156
+
157
+An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
158
+
159
+You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
160
+
161
+11. Patents. 
162
+A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
163
+
164
+A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
165
+
166
+Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
167
+
168
+In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
169
+
170
+If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
171
+
172
+If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
173
+
174
+A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
175
+
176
+Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
177
+
178
+12. No Surrender of Others' Freedom. 
179
+If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
180
+
181
+13. Use with the GNU Affero General Public License. 
182
+Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
183
+
184
+14. Revised Versions of this License. 
185
+The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
186
+
187
+Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
188
+
189
+If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
190
+
191
+Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
192
+
193
+15. Disclaimer of Warranty. 
194
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
195
+
196
+16. Limitation of Liability. 
197
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
198
+
199
+17. Interpretation of Sections 15 and 16. 
200
+If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
201
+
202
+END OF TERMS AND CONDITIONS
203
+
204
+How to Apply These Terms to Your New Programs
205
+
206
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
207
+
208
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
209
+
210
+<one line to give the program's name and a brief idea of what it does.> 
211
+Copyright (C) <year> <name of author>
212
+
213
+This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
214
+
215
+This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
216
+
217
+You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
218
+
219
+Also add information on how to contact you by electronic and paper mail.
220
+
221
+If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
222
+
223
+<program> Copyright (C) <year> <name of author> 
224
+This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 
225
+This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
226
+
227
+The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
228
+
229
+You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.
230
+
231
+The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.

+ 27
- 0
Makefile View File

@@ -0,0 +1,27 @@
1
+################################
2
+# Makefile pour eole-redis
3
+################################
4
+
5
+SOURCE=eole-redis
6
+VERSION=0.0.1
7
+EOLE_VERSION=2.6
8
+EOLE_RELEASE=2.6.2
9
+PKGAPPS=non
10
+#FLASK_MODULE=<APPLICATION>
11
+
12
+################################
13
+# Début de zone à ne pas éditer
14
+################################
15
+
16
+include eole.mk
17
+include apps.mk
18
+
19
+################################
20
+# Fin de zone à ne pas éditer
21
+################################
22
+
23
+# Makefile rules dedicated to application
24
+# if exists
25
+ifneq (, $(strip $(wildcard $(SOURCE).mk)))
26
+include $(SOURCE).mk
27
+endif

+ 5
- 0
README.md View File

@@ -0,0 +1,5 @@
1
+# eole-redis
2
+
3
+Redis EOLE integration
4
+
5
+## To fix :

+ 64
- 0
apps.mk View File

@@ -0,0 +1,64 @@
1
+# 
2
+# NE PAS EDITER CE FICHIER
3
+#
4
+# Voir Makefile
5
+
6
+
7
+##########################
8
+# Application web envole #
9
+##########################
10
+ifneq (, $(filter oui web, $(PKGAPPS)))
11
+#
12
+# Sanity check
13
+#
14
+ifeq (, $(filter-out X.X, $(strip $(VERSION))))
15
+$(error $$(VERSION) variable has incorrect value '$(VERSION)')
16
+endif
17
+
18
+# Where to store web application files
19
+WEB_PATH				:= $(DESTDIR)/var/www/html
20
+
21
+# Envole
22
+sharenvole_PROG_DIR			:= $(DESTDIR)/usr/share/envole/$(SOURCE)
23
+
24
+src_$(SOURCE)-$(VERSION)_REC_DIR	:= $(WEB_PATH)/$(SOURCE)
25
+src_plugins-$(VERSION)_REC_DIR		:= $(WEB_PATH)/$(SOURCE)/plugin
26
+src_lang-$(VERSION)_REC_DIR		:= $(WEB_PATH)/$(SOURCE)/lang
27
+
28
+endif
29
+
30
+##########################
31
+# Application EOLE flask #
32
+##########################
33
+ifneq (, $(filter flask, $(PKGAPPS)))
34
+#
35
+# Sanity check
36
+#
37
+ifeq (, $(filter-out XXX, $(strip $(FLASK_MODULE))))
38
+$(error $$(FLASK_MODULE) variable has incorrect value '$(FLASK_MODULE)')
39
+endif
40
+
41
+ifeq (, $(strip $(wildcard src/$(FLASK_MODULE).conf)))
42
+$(error missing eoleflask configuration file 'src/$(FLASK_MODULE).conf')
43
+endif
44
+
45
+# Everything is related to mount point
46
+APPS_MOUNT_POINT	:= $(shell sed -ne 's|^"MOUNT_POINT"[[:space:]]*:[[:space:]]*"/\([^"]*\)",|\1|p' \
47
+	src/$(FLASK_MODULE).conf)
48
+
49
+ifeq (, $(strip $(APPS_MOUNT_POINT)))
50
+$(error no "MOUNT_POINT" in eoleflask configuration file 'src/$(FLASK_MODULE).conf')
51
+endif
52
+
53
+# eole-flask configuration
54
+src_DATA_DIR		:= $(DESTDIR)/etc/eole/flask/available
55
+
56
+# Where to store flask application files
57
+FLASK_PATH		:= $(eole_DIR)/flask/$(APPS_MOUNT_POINT)
58
+
59
+# static files
60
+src_$(FLASK_MODULE)_static_REC_DIR	:= $(FLASK_PATH)/static
61
+src_$(FLASK_MODULE)_templates_REC_DIR	:= $(FLASK_PATH)/templates
62
+src_$(FLASK_MODULE)_instance_REC_DIR	:= $(FLASK_PATH)/resources
63
+
64
+endif

+ 92
- 0
dicos/90_redis.xml View File

@@ -0,0 +1,92 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<creole>
3
+    <files>
4
+        <!-- System configuration -->
5
+        <file filelist='redis' name='/etc/redis/redis.conf' mkdir='True' rm='True'/>
6
+        <service servicelist="svredis">redis-server</service>
7
+        <service_access service='redis-server'>
8
+            <port service_accesslist='saRedis' protocol='tcp' port_type='SymLinkOption'>redisPort</port>
9
+        </service_access>
10
+        <service_restriction service='ead_web'>
11
+               <ip interface='auto' netmask='rdClmask' netmask_type='SymLinkOption' ip_type='SymLinkOption'>rdClIP</ip>
12
+        </service_restriction>
13
+    </files>
14
+    <variables>
15
+        <family name='Services'>
16
+            <variable name='activer_redis' type='oui/non' description="Activer le service de cache Redis ?">
17
+                <value>oui</value>
18
+            </variable>
19
+        </family>
20
+        <family name="Redis">
21
+            <variable name='redisMode' type='string' description="Mode d'utilisation de Redis">
22
+                <value>Local</value>
23
+            </variable>
24
+			<variable name='redisPort' type='string' description="Port d'écoute du service Redis">
25
+				<value>6379</value>
26
+			</variable>
27
+            <variable name='redisMaxMemory' type='number' description="Quantité de mémoire utilisable par Redis en Mo">
28
+                <value>512</value>
29
+            </variable>
30
+            <variable name='redisMemoryPolicy' type='string' description='Méthode de libération de mémoire lorsque la maximum est atteint '>
31
+                <value>noeviction</value>
32
+            </variable>
33
+            <variable name='redisTCPKeepAlive' type='number' description="Intervalle entre le dernier envoi de paquet TCP et la réponse ACK (en secondes)">
34
+                <value>60</value>
35
+            </variable>
36
+            <variable name='rdClIP' type='ip' description="Adresse IP réseau autorisée a utiliser le service Redis" multi='True'/>
37
+            <variable name='rdClmask' type='ip' description="Masque de sous réseau"/>
38
+
39
+
40
+            <!-- Cluster configration Part -->
41
+            <variable name='redisRole' type='string' description="Role du serveur Redis">
42
+                <value>Leader</value>
43
+            </variable>
44
+            <variable name='redisMasterIP' type='ip' description="Adresse IP du Leader Redis"/>
45
+            <variable name='redisMasterPort' type='number' description="Port d'écoute du Leader Redis"/>
46
+            <variable name='redisMasterPassword' type='string' description="Passphrase d'accès à la grappe Redis"/>
47
+        </family>
48
+        <separators>
49
+            <separator name='rdClIP'>Autorisation d'accès au service Redis</separator>
50
+            <separator name='redisRole'>Grappe Redis</separator>
51
+        </separators>
52
+    </variables>
53
+    <constraints>
54
+        <condition name='disabled_if_in' source='activer_redis'>
55
+            <param>non</param>
56
+            <target type='filelist'>redis</target>
57
+            <target type='family'>Redis</target>
58
+            <target type='service_accesslist'>saredis</target>
59
+            <target type='servicelist'>svredis</target>
60
+        </condition>
61
+
62
+        <condition name='disabled_if_in' source='redisMode'>
63
+            <param>Local</param>
64
+            <target type='variable'>redisRole</target>
65
+            <target type='variable'>redisMasterIP</target>
66
+            <target type='variable'>redisMasterPort</target>
67
+            <target type='variable'>redisMasterPassword</target>
68
+        </condition>
69
+
70
+        <condition name='disabled_if_in' source='redisRole'>
71
+            <param>Leader</param>
72
+            <target type='variable'>redisMasterIP</target>
73
+            <target type='variable'>redisMasterPort</target>
74
+        </condition>
75
+
76
+        <group master='rdClIP'>
77
+            <slave>rdClmask</slave>
78
+        </group>
79
+        <check name="valid_enum" target="redisRole">
80
+            <param>['Leader','Node']</param>
81
+        </check>
82
+        <check name="valid_enum" target="redisMode">
83
+            <param>['Local','Cluster']</param>
84
+        </check>
85
+        <check name="valid_enum" target="redisMemoryPolicy">
86
+            <param>['noeviction', 'allkeys-lru','volatile-lru','volatile-random', 'allkeys-random','volatile-ttl']</param>
87
+        </check>
88
+    </constraints>
89
+    <help>
90
+        <variable name='activer_redis'>Activer le service de cache Redis</variable>
91
+    </help>
92
+</creole>

+ 1
- 0
eole-redis.mk View File

@@ -0,0 +1 @@
1
+creolefuncs_DATA_DIR := $(DESTDIR)/usr/share/creole/funcs

+ 231
- 0
eole.mk View File

@@ -0,0 +1,231 @@
1
+#
2
+# NE PAS EDITER CE FICHIER
3
+#
4
+# Utiliser <appli>.mk à inclure à la fin de Makefile
5
+
6
+#################
7
+# Sanity checks #
8
+#################
9
+
10
+ifeq (, $(DESTDIR))
11
+$(warning $$(DESTDIR) is empty, installation will be done in /)
12
+endif
13
+
14
+ifeq (, $(filter-out XXX-XXX, $(strip $(SOURCE))))
15
+$(error $$(SOURCE) variable has incorrect value '$(SOURCE)')
16
+endif
17
+
18
+ifeq (, $(filter-out 2.X, $(strip $(EOLE_VERSION))))
19
+$(error $$(EOLE_VERSION) variable has incorrect value '$(EOLE_VERSION)')
20
+endif
21
+
22
+ifeq (, $(filter-out 2.X.Y, $(strip $(EOLE_RELEASE))))
23
+$(error $$(EOLE_RELEASE) variable has incorrect value '$(EOLE_RELEASE)')
24
+endif
25
+
26
+#########################
27
+# Variables definitions #
28
+#########################
29
+
30
+INSTALL                 := install
31
+INSTALL_DATA            := install -m 644
32
+INSTALL_PROGRAM         := install -m 755
33
+INSTALL_DIRECTORY       := install -m 755 -d
34
+INSTALL_RECURSIVE       := cp -dr --no-preserve=ownership
35
+
36
+# Standard path
37
+bin_PROG_DIR		:= $(DESTDIR)/usr/bin
38
+sbin_PROG_DIR		:= $(DESTDIR)/usr/sbin
39
+man8_DATA_DIR		:= $(DESTDIR)/usr/share/man/fr.UTF-8/man8
40
+
41
+# Base
42
+eole_DIR                := $(DESTDIR)/usr/share/eole
43
+
44
+ifeq ($(strip $(EOLE_VERSION)), 2.3)
45
+diagnose_PROG_DIR       := $(eole_DIR)/diagnose/module
46
+else
47
+diagnose_PROG_DIR       := $(eole_DIR)/diagnose/
48
+endif
49
+
50
+# Creole
51
+creole_DIR              := $(eole_DIR)/creole
52
+dicos_DATA_DIR          := $(creole_DIR)/dicos
53
+tmpl_DATA_DIR           := $(creole_DIR)/distrib
54
+preservice_PROG_DIR     := $(eole_DIR)/preservice
55
+pretemplate_PROG_DIR    := $(eole_DIR)/pretemplate
56
+posttemplate_PROG_DIR   := $(eole_DIR)/posttemplate
57
+postservice_PROG_DIR    := $(eole_DIR)/postservice
58
+ifeq ($(strip $(EOLE_VERSION)), 2.3)
59
+firewall_DATA_DIR       := $(eole_DIR)/firewall
60
+endif
61
+bacula_restore_DATA_DIR := $(eole_DIR)/bacula/restore
62
+bareos_restore_DATA_DIR := $(eole_DIR)/bareos/restore
63
+bacula_fichier_DATA_DIR := $(DESTDIR)/etc/bacula/baculafichiers.d
64
+bareos_fichier_DATA_DIR	:= $(DESTDIR)/etc/bareos/bareosfichiers.d
65
+ifeq ($(strip $(EOLE_VERSION)), 2.3)
66
+schedule_pre_PROG_DIR   := $(eole_DIR)/schedule/pre
67
+schedule_post_PROG_DIR  := $(eole_DIR)/schedule/post
68
+else
69
+schedule_scripts_PROG_DIR	:= $(eole_DIR)/schedule/scripts
70
+endif
71
+extra_REC_DIR		:= $(creole_DIR)/extra
72
+
73
+# Zéphir
74
+zephir_DATA_DIR         := $(DESTDIR)/usr/share/zephir
75
+zephir_configs_DATA_DIR := $(zephir_DATA_DIR)/monitor/configs
76
+zephir_srv_DATA_DIR     := $(zephir_configs_DATA_DIR)/services
77
+zephir_scripts_PROG_DIR := $(zephir_DATA_DIR)/scripts
78
+
79
+# SSO
80
+sso_DATA_DIR            := $(DESTDIR)/usr/share/sso
81
+sso_filtres_DATA_DIR    := $(sso_DATA_DIR)/app_filters
82
+sso_user-info_DATA_DIR  := $(sso_DATA_DIR)/user_infos
83
+
84
+# EAD
85
+ead_DATA_DIR            := $(DESTDIR)/usr/share/ead2/backend/config
86
+ead_actions_DATA_DIR    := $(ead_DATA_DIR)/actions
87
+ead_perms_DATA_DIR      := $(ead_DATA_DIR)/perms
88
+ead_roles_DATA_DIR      := $(ead_DATA_DIR)/roles
89
+
90
+# Program libraries goes under /usr/lib/<PROGRAM>/
91
+lib_$(SOURCE)_DATA_DIR	:= $(DESTDIR)/usr/lib/$(SOURCE)
92
+
93
+# Scripts Eole
94
+scripts_PROG_DIR        := $(eole_DIR)/sbin
95
+lib_eole_DATA_DIR	:= $(DESTDIR)/usr/lib/eole
96
+
97
+# LDAP
98
+ldap_passwords_DATA_DIR := $(eole_DIR)/annuaire/password_files
99
+
100
+# LXC
101
+lxc_DATA_DIR            := $(eole_DIR)/lxc
102
+lxc_fstab_DATA_DIR      := $(lxc_DATA_DIR)/fstab
103
+lxc_hosts_DATA_DIR	:= $(lxc_DATA_DIR)/hosts
104
+
105
+# SQL
106
+sql_DATA_DIR            := $(eole_DIR)/mysql/$(SOURCE)
107
+sql_gen_DATA_DIR        := $(sql_DATA_DIR)/gen
108
+sql_updates_DATA_DIR    := $(sql_DATA_DIR)/updates
109
+
110
+sql_conf_gen_DATA_DIR		:= $(eole_DIR)/applications/gen
111
+sql_conf_passwords_DATA_DIR	:= $(eole_DIR)/applications/passwords
112
+sql_conf_updates_DATA_DIR	:= $(eole_DIR)/applications/updates/$(SOURCE)
113
+
114
+# EoleDB sql directory
115
+db_DIR               := $(eole_DIR)/db
116
+db_gen_DATA_DIR      := $(eole_DIR)/db/$(SOURCE)/gen
117
+db_updates_DATA_DIR  := $(eole_DIR)/db/$(SOURCE)/updates
118
+
119
+# Certifs
120
+certs_DATA_DIR		:= $(eole_DIR)/certs
121
+
122
+# Logrotate
123
+logrotate_DATA_DIR      := $(DESTDIR)/etc/logrotate.d
124
+
125
+# Cron
126
+cron_PROG_DIR 		:= $(DESTDIR)/etc/cron.daily
127
+
128
+# Python modules
129
+ifneq ($(DESTDIR),)
130
+PYTHON_OPTS     := --root $(DESTDIR)
131
+endif
132
+
133
+# Translation
134
+TRANSLATION_SRC := translation
135
+TRANSLATION_DEST := $(DESTDIR)/usr/share/locale
136
+PO_FILES = $(wildcard $(TRANSLATION_SRC)/*/*.po)
137
+MO_FOLDERS = $(addprefix $(TRANSLATION_DEST), $(addsuffix LC_MESSAGES,$(subst $(TRANSLATION_SRC),,$(dir $(PO_FILES)))))
138
+
139
+#############################################
140
+# Common directories and files installation #
141
+#############################################
142
+
143
+all:
144
+
145
+$(MO_FOLDERS):
146
+	$(INSTALL_DIRECTORY) $@
147
+
148
+$(PO_FILES): $(MO_FOLDERS)
149
+	msgfmt -o $(TRANSLATION_DEST)$(subst $(TRANSLATION_SRC),,$(addsuffix LC_MESSAGES,$(dir $@)))/$(notdir $(@:.po=.mo)) $@
150
+
151
+install-lang: $(PO_FILES)
152
+
153
+install:: install-dirs install-files install-lang
154
+
155
+# $1 = command to run
156
+# $2 = source directory
157
+# $3 = destination directory
158
+define fc_install_file
159
+	if [ -d $2 ]; then					\
160
+		for file in `ls -1 $2/`; do			\
161
+		   $1 $2/$$file $3 || true;			\
162
+	    done;						\
163
+	fi
164
+endef
165
+
166
+##
167
+## Directory creation
168
+##
169
+
170
+# use % to catch local name in $*
171
+# data, program and recursive directory require a corresponding
172
+# directory in local sources
173
+%_DATA_DIR %_PROG_DIR %REC_DIR:
174
+	test ! -d $(subst _,/,$*) || $(INSTALL_DIRECTORY) $($@)
175
+
176
+# Create the directory referenced by the variable without a local one.
177
+%_DIR:
178
+	@: # do nothing
179
+
180
+##
181
+## Install files present directly under data, program and recursive directories
182
+##
183
+
184
+# $*   : name of variable
185
+# $($*): value of variable
186
+%-instdata:
187
+	$(call fc_install_file, $(INSTALL_DATA), $(subst _,/,$(subst _DATA_DIR,,$*)), $($*))
188
+
189
+%-instprog:
190
+	$(call fc_install_file, $(INSTALL_PROGRAM), $(subst _,/,$(subst _PROG_DIR,,$*)), $($*))
191
+
192
+%-instrec:
193
+	$(call fc_install_file, $(INSTALL_RECURSIVE), $(subst _,/,$(subst _REC_DIR,,$*)), $($*))
194
+
195
+
196
+# Use second expansion as variables may be created in included
197
+# Makefiles
198
+.SECONDEXPANSION:
199
+
200
+# List of all directories
201
+installdirs_LIST	= $(foreach V, $(filter %_DIR, $(.VARIABLES)),	\
202
+				$(if $(filter file, $(origin $(V))),	\
203
+					$(V)))
204
+# List of data directories
205
+installdata_LIST	= $(filter %_DATA_DIR, $(installdirs_LIST))
206
+# List of program directories
207
+installprog_LIST	= $(filter %_PROG_DIR, $(installdirs_LIST))
208
+# List of recursive directories
209
+installrec_LIST	 	= $(filter %_REC_DIR, $(installdirs_LIST))
210
+
211
+# Expand directories to create as dependency
212
+# Use double-colon to permit user to define additionnal install-dirs
213
+install-dirs:: $$(installdirs_LIST)
214
+
215
+# Expand files to install as dependency
216
+# Use double-colon to permit user to define additionnal install-files
217
+install-files:: install-data-files install-prog-files install-rec-dirs
218
+
219
+install-data-files: $$(patsubst %,%-instdata,$$(installdata_LIST))
220
+
221
+install-prog-files: $$(patsubst %,%-instprog,$$(installprog_LIST))
222
+
223
+install-rec-dirs:   $$(patsubst %,%-instrec,$$(installrec_LIST))
224
+
225
+# Installation of python modules
226
+ifeq ($(shell test -f setup.py && echo 0), 0)
227
+install-files::
228
+	python setup.py install --no-compile --install-layout=deb $(PYTHON_OPTS)
229
+endif
230
+
231
+.PHONY: install install-dirs install-files install-data-files install-prog-files install-rec-dirs

+ 1055
- 0
tmpl/redis.conf View File

@@ -0,0 +1,1055 @@
1
+# Redis configuration file example.
2
+#
3
+# Note that in order to read the configuration file, Redis must be
4
+# started with the file path as first argument:
5
+#
6
+# ./redis-server /path/to/redis.conf
7
+
8
+# Note on units: when memory size is needed, it is possible to specify
9
+# it in the usual form of 1k 5GB 4M and so forth:
10
+#
11
+# 1k => 1000 bytes
12
+# 1kb => 1024 bytes
13
+# 1m => 1000000 bytes
14
+# 1mb => 1024*1024 bytes
15
+# 1g => 1000000000 bytes
16
+# 1gb => 1024*1024*1024 bytes
17
+#
18
+# units are case insensitive so 1GB 1Gb 1gB are all the same.
19
+
20
+################################## INCLUDES ###################################
21
+
22
+# Include one or more other config files here.  This is useful if you
23
+# have a standard template that goes to all Redis servers but also need
24
+# to customize a few per-server settings.  Include files can include
25
+# other files, so use this wisely.
26
+#
27
+# Notice option "include" won't be rewritten by command "CONFIG REWRITE"
28
+# from admin or Redis Sentinel. Since Redis always uses the last processed
29
+# line as value of a configuration directive, you'd better put includes
30
+# at the beginning of this file to avoid overwriting config change at runtime.
31
+#
32
+# If instead you are interested in using includes to override configuration
33
+# options, it is better to use include as the last line.
34
+#
35
+# include /path/to/local.conf
36
+# include /path/to/other.conf
37
+
38
+################################## NETWORK #####################################
39
+
40
+# By default, if no "bind" configuration directive is specified, Redis listens
41
+# for connections from all the network interfaces available on the server.
42
+# It is possible to listen to just one or multiple selected interfaces using
43
+# the "bind" configuration directive, followed by one or more IP addresses.
44
+#
45
+# Examples:
46
+#
47
+# bind 192.168.1.100 10.0.0.1
48
+# bind 127.0.0.1 ::1
49
+#
50
+# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
51
+# internet, binding to all the interfaces is dangerous and will expose the
52
+# instance to everybody on the internet. So by default we uncomment the
53
+# following bind directive, that will force Redis to listen only into
54
+# the IPv4 lookback interface address (this means Redis will be able to
55
+# accept connections only from clients running into the same computer it
56
+# is running).
57
+#
58
+# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
59
+# JUST COMMENT THE FOLLOWING LINE.
60
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61
+bind 0.0.0.0
62
+
63
+# Protected mode is a layer of security protection, in order to avoid that
64
+# Redis instances left open on the internet are accessed and exploited.
65
+#
66
+# When protected mode is on and if:
67
+#
68
+# 1) The server is not binding explicitly to a set of addresses using the
69
+#    "bind" directive.
70
+# 2) No password is configured.
71
+#
72
+# The server only accepts connections from clients connecting from the
73
+# IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain
74
+# sockets.
75
+#
76
+# By default protected mode is enabled. You should disable it only if
77
+# you are sure you want clients from other hosts to connect to Redis
78
+# even if no authentication is configured, nor a specific set of interfaces
79
+# are explicitly listed using the "bind" directive.
80
+protected-mode yes
81
+
82
+# Accept connections on the specified port, default is 6379 (IANA #815344).
83
+# If port 0 is specified Redis will not listen on a TCP socket.
84
+port %%redisPort
85
+
86
+# TCP listen() backlog.
87
+#
88
+# In high requests-per-second environments you need an high backlog in order
89
+# to avoid slow clients connections issues. Note that the Linux kernel
90
+# will silently truncate it to the value of /proc/sys/net/core/somaxconn so
91
+# make sure to raise both the value of somaxconn and tcp_max_syn_backlog
92
+# in order to get the desired effect.
93
+tcp-backlog 511
94
+
95
+# Unix socket.
96
+#
97
+# Specify the path for the Unix socket that will be used to listen for
98
+# incoming connections. There is no default, so Redis will not listen
99
+# on a unix socket when not specified.
100
+#
101
+# unixsocket /var/run/redis/redis.sock
102
+# unixsocketperm 700
103
+
104
+# Close the connection after a client is idle for N seconds (0 to disable)
105
+timeout 0
106
+
107
+# TCP keepalive.
108
+#
109
+# If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence
110
+# of communication. This is useful for two reasons:
111
+#
112
+# 1) Detect dead peers.
113
+# 2) Take the connection alive from the point of view of network
114
+#    equipment in the middle.
115
+#
116
+# On Linux, the specified value (in seconds) is the period used to send ACKs.
117
+# Note that to close the connection the double of the time is needed.
118
+# On other kernels the period depends on the kernel configuration.
119
+#
120
+# A reasonable value for this option is 300 seconds, which is the new
121
+# Redis default starting with Redis 3.2.1.
122
+tcp-keepalive %%redisTCPKeepAlive
123
+
124
+################################# GENERAL #####################################
125
+
126
+# By default Redis does not run as a daemon. Use 'yes' if you need it.
127
+# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
128
+daemonize yes
129
+
130
+# If you run Redis from upstart or systemd, Redis can interact with your
131
+# supervision tree. Options:
132
+#   supervised no      - no supervision interaction
133
+#   supervised upstart - signal upstart by putting Redis into SIGSTOP mode
134
+#   supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET
135
+#   supervised auto    - detect upstart or systemd method based on
136
+#                        UPSTART_JOB or NOTIFY_SOCKET environment variables
137
+# Note: these supervision methods only signal "process is ready."
138
+#       They do not enable continuous liveness pings back to your supervisor.
139
+supervised systemd
140
+
141
+# If a pid file is specified, Redis writes it where specified at startup
142
+# and removes it at exit.
143
+#
144
+# When the server runs non daemonized, no pid file is created if none is
145
+# specified in the configuration. When the server is daemonized, the pid file
146
+# is used even if not specified, defaulting to "/var/run/redis.pid".
147
+#
148
+# Creating a pid file is best effort: if Redis is not able to create it
149
+# nothing bad happens, the server will start and run normally.
150
+pidfile /var/run/redis/redis-server.pid
151
+
152
+# Specify the server verbosity level.
153
+# This can be one of:
154
+# debug (a lot of information, useful for development/testing)
155
+# verbose (many rarely useful info, but not a mess like the debug level)
156
+# notice (moderately verbose, what you want in production probably)
157
+# warning (only very important / critical messages are logged)
158
+loglevel notice
159
+
160
+# Specify the log file name. Also the empty string can be used to force
161
+# Redis to log on the standard output. Note that if you use standard
162
+# output for logging but daemonize, logs will be sent to /dev/null
163
+logfile /var/log/redis/redis-server.log
164
+
165
+# To enable logging to the system logger, just set 'syslog-enabled' to yes,
166
+# and optionally update the other syslog parameters to suit your needs.
167
+# syslog-enabled no
168
+
169
+# Specify the syslog identity.
170
+# syslog-ident redis
171
+
172
+# Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7.
173
+# syslog-facility local0
174
+
175
+# Set the number of databases. The default database is DB 0, you can select
176
+# a different one on a per-connection basis using SELECT <dbid> where
177
+# dbid is a number between 0 and 'databases'-1
178
+databases 16
179
+
180
+################################ SNAPSHOTTING  ################################
181
+#
182
+# Save the DB on disk:
183
+#
184
+#   save <seconds> <changes>
185
+#
186
+#   Will save the DB if both the given number of seconds and the given
187
+#   number of write operations against the DB occurred.
188
+#
189
+#   In the example below the behaviour will be to save:
190
+#   after 900 sec (15 min) if at least 1 key changed
191
+#   after 300 sec (5 min) if at least 10 keys changed
192
+#   after 60 sec if at least 10000 keys changed
193
+#
194
+#   Note: you can disable saving completely by commenting out all "save" lines.
195
+#
196
+#   It is also possible to remove all the previously configured save
197
+#   points by adding a save directive with a single empty string argument
198
+#   like in the following example:
199
+#
200
+#   save ""
201
+
202
+save 900 1
203
+save 300 10
204
+save 60 10000
205
+
206
+# By default Redis will stop accepting writes if RDB snapshots are enabled
207
+# (at least one save point) and the latest background save failed.
208
+# This will make the user aware (in a hard way) that data is not persisting
209
+# on disk properly, otherwise chances are that no one will notice and some
210
+# disaster will happen.
211
+#
212
+# If the background saving process will start working again Redis will
213
+# automatically allow writes again.
214
+#
215
+# However if you have setup your proper monitoring of the Redis server
216
+# and persistence, you may want to disable this feature so that Redis will
217
+# continue to work as usual even if there are problems with disk,
218
+# permissions, and so forth.
219
+stop-writes-on-bgsave-error yes
220
+
221
+# Compress string objects using LZF when dump .rdb databases?
222
+# For default that's set to 'yes' as it's almost always a win.
223
+# If you want to save some CPU in the saving child set it to 'no' but
224
+# the dataset will likely be bigger if you have compressible values or keys.
225
+rdbcompression yes
226
+
227
+# Since version 5 of RDB a CRC64 checksum is placed at the end of the file.
228
+# This makes the format more resistant to corruption but there is a performance
229
+# hit to pay (around 10%) when saving and loading RDB files, so you can disable it
230
+# for maximum performances.
231
+#
232
+# RDB files created with checksum disabled have a checksum of zero that will
233
+# tell the loading code to skip the check.
234
+rdbchecksum yes
235
+
236
+# The filename where to dump the DB
237
+dbfilename dump.rdb
238
+
239
+# The working directory.
240
+#
241
+# The DB will be written inside this directory, with the filename specified
242
+# above using the 'dbfilename' configuration directive.
243
+#
244
+# The Append Only File will also be created inside this directory.
245
+#
246
+# Note that you must specify a directory here, not a file name.
247
+dir /var/lib/redis
248
+
249
+%if %%getVar('redisRole','Leader') == "Node"
250
+################################# REPLICATION #################################
251
+
252
+# Master-Slave replication. Use slaveof to make a Redis instance a copy of
253
+# another Redis server. A few things to understand ASAP about Redis replication.
254
+#
255
+# 1) Redis replication is asynchronous, but you can configure a master to
256
+#    stop accepting writes if it appears to be not connected with at least
257
+#    a given number of slaves.
258
+# 2) Redis slaves are able to perform a partial resynchronization with the
259
+#    master if the replication link is lost for a relatively small amount of
260
+#    time. You may want to configure the replication backlog size (see the next
261
+#    sections of this file) with a sensible value depending on your needs.
262
+# 3) Replication is automatic and does not need user intervention. After a
263
+#    network partition slaves automatically try to reconnect to masters
264
+#    and resynchronize with them.
265
+#
266
+slaveof %%redisMasterIP %%redisMasterPort
267
+
268
+# If the master is password protected (using the "requirepass" configuration
269
+# directive below) it is possible to tell the slave to authenticate before
270
+# starting the replication synchronization process, otherwise the master will
271
+# refuse the slave request.
272
+#
273
+masterauth %%redisMasterPassword
274
+
275
+# When a slave loses its connection with the master, or when the replication
276
+# is still in progress, the slave can act in two different ways:
277
+#
278
+# 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will
279
+#    still reply to client requests, possibly with out of date data, or the
280
+#    data set may just be empty if this is the first synchronization.
281
+#
282
+# 2) if slave-serve-stale-data is set to 'no' the slave will reply with
283
+#    an error "SYNC with master in progress" to all the kind of commands
284
+#    but to INFO and SLAVEOF.
285
+#
286
+slave-serve-stale-data yes
287
+
288
+# You can configure a slave instance to accept writes or not. Writing against
289
+# a slave instance may be useful to store some ephemeral data (because data
290
+# written on a slave will be easily deleted after resync with the master) but
291
+# may also cause problems if clients are writing to it because of a
292
+# misconfiguration.
293
+#
294
+# Since Redis 2.6 by default slaves are read-only.
295
+#
296
+# Note: read only slaves are not designed to be exposed to untrusted clients
297
+# on the internet. It's just a protection layer against misuse of the instance.
298
+# Still a read only slave exports by default all the administrative commands
299
+# such as CONFIG, DEBUG, and so forth. To a limited extent you can improve
300
+# security of read only slaves using 'rename-command' to shadow all the
301
+# administrative / dangerous commands.
302
+slave-read-only yes
303
+
304
+# Replication SYNC strategy: disk or socket.
305
+#
306
+# -------------------------------------------------------
307
+# WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY
308
+# -------------------------------------------------------
309
+#
310
+# New slaves and reconnecting slaves that are not able to continue the replication
311
+# process just receiving differences, need to do what is called a "full
312
+# synchronization". An RDB file is transmitted from the master to the slaves.
313
+# The transmission can happen in two different ways:
314
+#
315
+# 1) Disk-backed: The Redis master creates a new process that writes the RDB
316
+#                 file on disk. Later the file is transferred by the parent
317
+#                 process to the slaves incrementally.
318
+# 2) Diskless: The Redis master creates a new process that directly writes the
319
+#              RDB file to slave sockets, without touching the disk at all.
320
+#
321
+# With disk-backed replication, while the RDB file is generated, more slaves
322
+# can be queued and served with the RDB file as soon as the current child producing
323
+# the RDB file finishes its work. With diskless replication instead once
324
+# the transfer starts, new slaves arriving will be queued and a new transfer
325
+# will start when the current one terminates.
326
+#
327
+# When diskless replication is used, the master waits a configurable amount of
328
+# time (in seconds) before starting the transfer in the hope that multiple slaves
329
+# will arrive and the transfer can be parallelized.
330
+#
331
+# With slow disks and fast (large bandwidth) networks, diskless replication
332
+# works better.
333
+repl-diskless-sync no
334
+
335
+# When diskless replication is enabled, it is possible to configure the delay
336
+# the server waits in order to spawn the child that transfers the RDB via socket
337
+# to the slaves.
338
+#
339
+# This is important since once the transfer starts, it is not possible to serve
340
+# new slaves arriving, that will be queued for the next RDB transfer, so the server
341
+# waits a delay in order to let more slaves arrive.
342
+#
343
+# The delay is specified in seconds, and by default is 5 seconds. To disable
344
+# it entirely just set it to 0 seconds and the transfer will start ASAP.
345
+repl-diskless-sync-delay 5
346
+
347
+# Slaves send PINGs to server in a predefined interval. It's possible to change
348
+# this interval with the repl_ping_slave_period option. The default value is 10
349
+# seconds.
350
+#
351
+# repl-ping-slave-period 10
352
+
353
+# The following option sets the replication timeout for:
354
+#
355
+# 1) Bulk transfer I/O during SYNC, from the point of view of slave.
356
+# 2) Master timeout from the point of view of slaves (data, pings).
357
+# 3) Slave timeout from the point of view of masters (REPLCONF ACK pings).
358
+#
359
+# It is important to make sure that this value is greater than the value
360
+# specified for repl-ping-slave-period otherwise a timeout will be detected
361
+# every time there is low traffic between the master and the slave.
362
+#
363
+# repl-timeout 60
364
+
365
+# Disable TCP_NODELAY on the slave socket after SYNC?
366
+#
367
+# If you select "yes" Redis will use a smaller number of TCP packets and
368
+# less bandwidth to send data to slaves. But this can add a delay for
369
+# the data to appear on the slave side, up to 40 milliseconds with
370
+# Linux kernels using a default configuration.
371
+#
372
+# If you select "no" the delay for data to appear on the slave side will
373
+# be reduced but more bandwidth will be used for replication.
374
+#
375
+# By default we optimize for low latency, but in very high traffic conditions
376
+# or when the master and slaves are many hops away, turning this to "yes" may
377
+# be a good idea.
378
+repl-disable-tcp-nodelay no
379
+
380
+# Set the replication backlog size. The backlog is a buffer that accumulates
381
+# slave data when slaves are disconnected for some time, so that when a slave
382
+# wants to reconnect again, often a full resync is not needed, but a partial
383
+# resync is enough, just passing the portion of data the slave missed while
384
+# disconnected.
385
+#
386
+# The bigger the replication backlog, the longer the time the slave can be
387
+# disconnected and later be able to perform a partial resynchronization.
388
+#
389
+# The backlog is only allocated once there is at least a slave connected.
390
+#
391
+# repl-backlog-size 1mb
392
+
393
+# After a master has no longer connected slaves for some time, the backlog
394
+# will be freed. The following option configures the amount of seconds that
395
+# need to elapse, starting from the time the last slave disconnected, for
396
+# the backlog buffer to be freed.
397
+#
398
+# A value of 0 means to never release the backlog.
399
+#
400
+# repl-backlog-ttl 3600
401
+
402
+# The slave priority is an integer number published by Redis in the INFO output.
403
+# It is used by Redis Sentinel in order to select a slave to promote into a
404
+# master if the master is no longer working correctly.
405
+#
406
+# A slave with a low priority number is considered better for promotion, so
407
+# for instance if there are three slaves with priority 10, 100, 25 Sentinel will
408
+# pick the one with priority 10, that is the lowest.
409
+#
410
+# However a special priority of 0 marks the slave as not able to perform the
411
+# role of master, so a slave with priority of 0 will never be selected by
412
+# Redis Sentinel for promotion.
413
+#
414
+# By default the priority is 100.
415
+slave-priority 100
416
+
417
+# It is possible for a master to stop accepting writes if there are less than
418
+# N slaves connected, having a lag less or equal than M seconds.
419
+#
420
+# The N slaves need to be in "online" state.
421
+#
422
+# The lag in seconds, that must be <= the specified value, is calculated from
423
+# the last ping received from the slave, that is usually sent every second.
424
+#
425
+# This option does not GUARANTEE that N replicas will accept the write, but
426
+# will limit the window of exposure for lost writes in case not enough slaves
427
+# are available, to the specified number of seconds.
428
+#
429
+# For example to require at least 3 slaves with a lag <= 10 seconds use:
430
+#
431
+# min-slaves-to-write 3
432
+# min-slaves-max-lag 10
433
+#
434
+# Setting one or the other to 0 disables the feature.
435
+#
436
+# By default min-slaves-to-write is set to 0 (feature disabled) and
437
+# min-slaves-max-lag is set to 10.
438
+
439
+# A Redis master is able to list the address and port of the attached
440
+# slaves in different ways. For example the "INFO replication" section
441
+# offers this information, which is used, among other tools, by
442
+# Redis Sentinel in order to discover slave instances.
443
+# Another place where this info is available is in the output of the
444
+# "ROLE" command of a masteer.
445
+#
446
+# The listed IP and address normally reported by a slave is obtained
447
+# in the following way:
448
+#
449
+#   IP: The address is auto detected by checking the peer address
450
+#   of the socket used by the slave to connect with the master.
451
+#
452
+#   Port: The port is communicated by the slave during the replication
453
+#   handshake, and is normally the port that the slave is using to
454
+#   list for connections.
455
+#
456
+# However when port forwarding or Network Address Translation (NAT) is
457
+# used, the slave may be actually reachable via different IP and port
458
+# pairs. The following two options can be used by a slave in order to
459
+# report to its master a specific set of IP and port, so that both INFO
460
+# and ROLE will report those values.
461
+#
462
+# There is no need to use both the options if you need to override just
463
+# the port or the IP address.
464
+#
465
+# slave-announce-ip 5.5.5.5
466
+# slave-announce-port 1234
467
+%end if
468
+################################## SECURITY ###################################
469
+
470
+# Require clients to issue AUTH <PASSWORD> before processing any other
471
+# commands.  This might be useful in environments in which you do not trust
472
+# others with access to the host running redis-server.
473
+#
474
+# This should stay commented out for backward compatibility and because most
475
+# people do not need auth (e.g. they run their own servers).
476
+#
477
+# Warning: since Redis is pretty fast an outside user can try up to
478
+# 150k passwords per second against a good box. This means that you should
479
+# use a very strong password otherwise it will be very easy to break.
480
+#
481
+requirepass %%redisMasterPassword
482
+
483
+# Command renaming.
484
+#
485
+# It is possible to change the name of dangerous commands in a shared
486
+# environment. For instance the CONFIG command may be renamed into something
487
+# hard to guess so that it will still be available for internal-use tools
488
+# but not available for general clients.
489
+#
490
+# Example:
491
+#
492
+# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
493
+#
494
+# It is also possible to completely kill a command by renaming it into
495
+# an empty string:
496
+#
497
+# rename-command CONFIG ""
498
+#
499
+# Please note that changing the name of commands that are logged into the
500
+# AOF file or transmitted to slaves may cause problems.
501
+
502
+################################### LIMITS ####################################
503
+
504
+# Set the max number of connected clients at the same time. By default
505
+# this limit is set to 10000 clients, however if the Redis server is not
506
+# able to configure the process file limit to allow for the specified limit
507
+# the max number of allowed clients is set to the current file limit
508
+# minus 32 (as Redis reserves a few file descriptors for internal uses).
509
+#
510
+# Once the limit is reached Redis will close all the new connections sending
511
+# an error 'max number of clients reached'.
512
+#
513
+# maxclients 10000
514
+
515
+# Don't use more memory than the specified amount of bytes.
516
+# When the memory limit is reached Redis will try to remove keys
517
+# according to the eviction policy selected (see maxmemory-policy).
518
+#
519
+# If Redis can't remove keys according to the policy, or if the policy is
520
+# set to 'noeviction', Redis will start to reply with errors to commands
521
+# that would use more memory, like SET, LPUSH, and so on, and will continue
522
+# to reply to read-only commands like GET.
523
+#
524
+# This option is usually useful when using Redis as an LRU cache, or to set
525
+# a hard memory limit for an instance (using the 'noeviction' policy).
526
+#
527
+# WARNING: If you have slaves attached to an instance with maxmemory on,
528
+# the size of the output buffers needed to feed the slaves are subtracted
529
+# from the used memory count, so that network problems / resyncs will
530
+# not trigger a loop where keys are evicted, and in turn the output
531
+# buffer of slaves is full with DELs of keys evicted triggering the deletion
532
+# of more keys, and so forth until the database is completely emptied.
533
+#
534
+# In short... if you have slaves attached it is suggested that you set a lower
535
+# limit for maxmemory so that there is some free RAM on the system for slave
536
+# output buffers (but this is not needed if the policy is 'noeviction').
537
+#
538
+maxmemory %{redisMaxMemory}mb
539
+
540
+# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
541
+# is reached. You can select among five behaviors:
542
+#
543
+# volatile-lru -> remove the key with an expire set using an LRU algorithm
544
+# allkeys-lru -> remove any key according to the LRU algorithm
545
+# volatile-random -> remove a random key with an expire set
546
+# allkeys-random -> remove a random key, any key
547
+# volatile-ttl -> remove the key with the nearest expire time (minor TTL)
548
+# noeviction -> don't expire at all, just return an error on write operations
549
+#
550
+# Note: with any of the above policies, Redis will return an error on write
551
+#       operations, when there are no suitable keys for eviction.
552
+#
553
+#       At the date of writing these commands are: set setnx setex append
554
+#       incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd
555
+#       sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby
556
+#       zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby
557
+#       getset mset msetnx exec sort
558
+#
559
+# The default is:
560
+#
561
+maxmemory-policy %%redisMemoryPolicy
562
+
563
+# LRU and minimal TTL algorithms are not precise algorithms but approximated
564
+# algorithms (in order to save memory), so you can tune it for speed or
565
+# accuracy. For default Redis will check five keys and pick the one that was
566
+# used less recently, you can change the sample size using the following
567
+# configuration directive.
568
+#
569
+# The default of 5 produces good enough results. 10 Approximates very closely
570
+# true LRU but costs a bit more CPU. 3 is very fast but not very accurate.
571
+#
572
+# maxmemory-samples 5
573
+
574
+############################## APPEND ONLY MODE ###############################
575
+
576
+# By default Redis asynchronously dumps the dataset on disk. This mode is
577
+# good enough in many applications, but an issue with the Redis process or
578
+# a power outage may result into a few minutes of writes lost (depending on
579
+# the configured save points).
580
+#
581
+# The Append Only File is an alternative persistence mode that provides
582
+# much better durability. For instance using the default data fsync policy
583
+# (see later in the config file) Redis can lose just one second of writes in a
584
+# dramatic event like a server power outage, or a single write if something
585
+# wrong with the Redis process itself happens, but the operating system is
586
+# still running correctly.
587
+#
588
+# AOF and RDB persistence can be enabled at the same time without problems.
589
+# If the AOF is enabled on startup Redis will load the AOF, that is the file
590
+# with the better durability guarantees.
591
+#
592
+# Please check http://redis.io/topics/persistence for more information.
593
+
594
+appendonly yes
595
+
596
+# The name of the append only file (default: "appendonly.aof")
597
+
598
+appendfilename "appendonly.aof"
599
+
600
+# The fsync() call tells the Operating System to actually write data on disk
601
+# instead of waiting for more data in the output buffer. Some OS will really flush
602
+# data on disk, some other OS will just try to do it ASAP.
603
+#
604
+# Redis supports three different modes:
605
+#
606
+# no: don't fsync, just let the OS flush the data when it wants. Faster.
607
+# always: fsync after every write to the append only log. Slow, Safest.
608
+# everysec: fsync only one time every second. Compromise.
609
+#
610
+# The default is "everysec", as that's usually the right compromise between
611
+# speed and data safety. It's up to you to understand if you can relax this to
612
+# "no" that will let the operating system flush the output buffer when
613
+# it wants, for better performances (but if you can live with the idea of
614
+# some data loss consider the default persistence mode that's snapshotting),
615
+# or on the contrary, use "always" that's very slow but a bit safer than
616
+# everysec.
617
+#
618
+# More details please check the following article:
619
+# http://antirez.com/post/redis-persistence-demystified.html
620
+#
621
+# If unsure, use "everysec".
622
+
623
+# appendfsync always
624
+appendfsync everysec
625
+# appendfsync no
626
+
627
+# When the AOF fsync policy is set to always or everysec, and a background
628
+# saving process (a background save or AOF log background rewriting) is
629
+# performing a lot of I/O against the disk, in some Linux configurations
630
+# Redis may block too long on the fsync() call. Note that there is no fix for
631
+# this currently, as even performing fsync in a different thread will block
632
+# our synchronous write(2) call.
633
+#
634
+# In order to mitigate this problem it's possible to use the following option
635
+# that will prevent fsync() from being called in the main process while a
636
+# BGSAVE or BGREWRITEAOF is in progress.
637
+#
638
+# This means that while another child is saving, the durability of Redis is
639
+# the same as "appendfsync none". In practical terms, this means that it is
640
+# possible to lose up to 30 seconds of log in the worst scenario (with the
641
+# default Linux settings).
642
+#
643
+# If you have latency problems turn this to "yes". Otherwise leave it as
644
+# "no" that is the safest pick from the point of view of durability.
645
+
646
+no-appendfsync-on-rewrite no
647
+
648
+# Automatic rewrite of the append only file.
649
+# Redis is able to automatically rewrite the log file implicitly calling
650
+# BGREWRITEAOF when the AOF log size grows by the specified percentage.
651
+#
652
+# This is how it works: Redis remembers the size of the AOF file after the
653
+# latest rewrite (if no rewrite has happened since the restart, the size of
654
+# the AOF at startup is used).
655
+#
656
+# This base size is compared to the current size. If the current size is
657
+# bigger than the specified percentage, the rewrite is triggered. Also
658
+# you need to specify a minimal size for the AOF file to be rewritten, this
659
+# is useful to avoid rewriting the AOF file even if the percentage increase
660
+# is reached but it is still pretty small.
661
+#
662
+# Specify a percentage of zero in order to disable the automatic AOF
663
+# rewrite feature.
664
+
665
+auto-aof-rewrite-percentage 100
666
+auto-aof-rewrite-min-size 64mb
667
+
668
+# An AOF file may be found to be truncated at the end during the Redis
669
+# startup process, when the AOF data gets loaded back into memory.
670
+# This may happen when the system where Redis is running
671
+# crashes, especially when an ext4 filesystem is mounted without the
672
+# data=ordered option (however this can't happen when Redis itself
673
+# crashes or aborts but the operating system still works correctly).
674
+#
675
+# Redis can either exit with an error when this happens, or load as much
676
+# data as possible (the default now) and start if the AOF file is found
677
+# to be truncated at the end. The following option controls this behavior.
678
+#
679
+# If aof-load-truncated is set to yes, a truncated AOF file is loaded and
680
+# the Redis server starts emitting a log to inform the user of the event.
681
+# Otherwise if the option is set to no, the server aborts with an error
682
+# and refuses to start. When the option is set to no, the user requires
683
+# to fix the AOF file using the "redis-check-aof" utility before to restart
684
+# the server.
685
+#
686
+# Note that if the AOF file will be found to be corrupted in the middle
687
+# the server will still exit with an error. This option only applies when
688
+# Redis will try to read more data from the AOF file but not enough bytes
689
+# will be found.
690
+aof-load-truncated yes
691
+
692
+################################ LUA SCRIPTING  ###############################
693
+
694
+# Max execution time of a Lua script in milliseconds.
695
+#
696
+# If the maximum execution time is reached Redis will log that a script is
697
+# still in execution after the maximum allowed time and will start to
698
+# reply to queries with an error.
699
+#
700
+# When a long running script exceeds the maximum execution time only the
701
+# SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be
702
+# used to stop a script that did not yet called write commands. The second
703
+# is the only way to shut down the server in the case a write command was
704
+# already issued by the script but the user doesn't want to wait for the natural
705
+# termination of the script.
706
+#
707
+# Set it to 0 or a negative value for unlimited execution without warnings.
708
+lua-time-limit 5000
709
+
710
+%if %%getVar('redisMode','Local') == "Cluster"
711
+################################ REDIS CLUSTER  ###############################
712
+#
713
+# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
714
+# WARNING EXPERIMENTAL: Redis Cluster is considered to be stable code, however
715
+# in order to mark it as "mature" we need to wait for a non trivial percentage
716
+# of users to deploy it in production.
717
+# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
718
+#
719
+# Normal Redis instances can't be part of a Redis Cluster; only nodes that are
720
+# started as cluster nodes can. In order to start a Redis instance as a
721
+# cluster node enable the cluster support uncommenting the following:
722
+#
723
+cluster-enabled yes
724
+
725
+# Every cluster node has a cluster configuration file. This file is not
726
+# intended to be edited by hand. It is created and updated by Redis nodes.
727
+# Every Redis Cluster node requires a different cluster configuration file.
728
+# Make sure that instances running in the same system do not have
729
+# overlapping cluster configuration file names.
730
+#
731
+cluster-config-file nodes.conf
732
+
733
+# Cluster node timeout is the amount of milliseconds a node must be unreachable
734
+# for it to be considered in failure state.
735
+# Most other internal time limits are multiple of the node timeout.
736
+#
737
+cluster-node-timeout 15000
738
+
739
+# A slave of a failing master will avoid to start a failover if its data
740
+# looks too old.
741
+#
742
+# There is no simple way for a slave to actually have a exact measure of
743
+# its "data age", so the following two checks are performed:
744
+#
745
+# 1) If there are multiple slaves able to failover, they exchange messages
746
+#    in order to try to give an advantage to the slave with the best
747
+#    replication offset (more data from the master processed).
748
+#    Slaves will try to get their rank by offset, and apply to the start
749
+#    of the failover a delay proportional to their rank.
750
+#
751
+# 2) Every single slave computes the time of the last interaction with
752
+#    its master. This can be the last ping or command received (if the master
753
+#    is still in the "connected" state), or the time that elapsed since the
754
+#    disconnection with the master (if the replication link is currently down).
755
+#    If the last interaction is too old, the slave will not try to failover
756
+#    at all.
757
+#
758
+# The point "2" can be tuned by user. Specifically a slave will not perform
759
+# the failover if, since the last interaction with the master, the time
760
+# elapsed is greater than:
761
+#
762
+#   (node-timeout * slave-validity-factor) + repl-ping-slave-period
763
+#
764
+# So for example if node-timeout is 30 seconds, and the slave-validity-factor
765
+# is 10, and assuming a default repl-ping-slave-period of 10 seconds, the
766
+# slave will not try to failover if it was not able to talk with the master
767
+# for longer than 310 seconds.
768
+#
769
+# A large slave-validity-factor may allow slaves with too old data to failover
770
+# a master, while a too small value may prevent the cluster from being able to
771
+# elect a slave at all.
772
+#
773
+# For maximum availability, it is possible to set the slave-validity-factor
774
+# to a value of 0, which means, that slaves will always try to failover the
775
+# master regardless of the last time they interacted with the master.
776
+# (However they'll always try to apply a delay proportional to their
777
+# offset rank).
778
+#
779
+# Zero is the only value able to guarantee that when all the partitions heal
780
+# the cluster will always be able to continue.
781
+#
782
+cluster-slave-validity-factor 10
783
+
784
+# Cluster slaves are able to migrate to orphaned masters, that are masters
785
+# that are left without working slaves. This improves the cluster ability
786
+# to resist to failures as otherwise an orphaned master can't be failed over
787
+# in case of failure if it has no working slaves.
788
+#
789
+# Slaves migrate to orphaned masters only if there are still at least a
790
+# given number of other working slaves for their old master. This number
791
+# is the "migration barrier". A migration barrier of 1 means that a slave
792
+# will migrate only if there is at least 1 other working slave for its master
793
+# and so forth. It usually reflects the number of slaves you want for every
794
+# master in your cluster.
795
+#
796
+# Default is 1 (slaves migrate only if their masters remain with at least
797
+# one slave). To disable migration just set it to a very large value.
798
+# A value of 0 can be set but is useful only for debugging and dangerous
799
+# in production.
800
+#
801
+cluster-migration-barrier 1
802
+
803
+# By default Redis Cluster nodes stop accepting queries if they detect there
804
+# is at least an hash slot uncovered (no available node is serving it).
805
+# This way if the cluster is partially down (for example a range of hash slots
806
+# are no longer covered) all the cluster becomes, eventually, unavailable.
807
+# It automatically returns available as soon as all the slots are covered again.
808
+#
809
+# However sometimes you want the subset of the cluster which is working,
810
+# to continue to accept queries for the part of the key space that is still
811
+# covered. In order to do so, just set the cluster-require-full-coverage
812
+# option to no.
813
+#
814
+cluster-require-full-coverage yes
815
+
816
+# In order to setup your cluster make sure to read the documentation
817
+# available at http://redis.io web site.
818
+%end if
819
+
820
+################################## SLOW LOG ###################################
821
+
822
+# The Redis Slow Log is a system to log queries that exceeded a specified
823
+# execution time. The execution time does not include the I/O operations
824
+# like talking with the client, sending the reply and so forth,
825
+# but just the time needed to actually execute the command (this is the only
826
+# stage of command execution where the thread is blocked and can not serve
827
+# other requests in the meantime).
828
+#
829
+# You can configure the slow log with two parameters: one tells Redis
830
+# what is the execution time, in microseconds, to exceed in order for the
831
+# command to get logged, and the other parameter is the length of the
832
+# slow log. When a new command is logged the oldest one is removed from the
833
+# queue of logged commands.
834
+
835
+# The following time is expressed in microseconds, so 1000000 is equivalent
836
+# to one second. Note that a negative number disables the slow log, while
837
+# a value of zero forces the logging of every command.
838
+slowlog-log-slower-than 10000
839
+
840
+# There is no limit to this length. Just be aware that it will consume memory.
841
+# You can reclaim memory used by the slow log with SLOWLOG RESET.
842
+slowlog-max-len 128
843
+
844
+################################ LATENCY MONITOR ##############################
845
+
846
+# The Redis latency monitoring subsystem samples different operations
847
+# at runtime in order to collect data related to possible sources of
848
+# latency of a Redis instance.
849
+#
850
+# Via the LATENCY command this information is available to the user that can
851
+# print graphs and obtain reports.
852
+#
853
+# The system only logs operations that were performed in a time equal or
854
+# greater than the amount of milliseconds specified via the
855
+# latency-monitor-threshold configuration directive. When its value is set
856
+# to zero, the latency monitor is turned off.
857
+#
858
+# By default latency monitoring is disabled since it is mostly not needed
859
+# if you don't have latency issues, and collecting data has a performance
860
+# impact, that while very small, can be measured under big load. Latency
861
+# monitoring can easily be enabled at runtime using the command
862
+# "CONFIG SET latency-monitor-threshold <milliseconds>" if needed.
863
+latency-monitor-threshold 0
864
+
865
+############################# EVENT NOTIFICATION ##############################
866
+
867
+# Redis can notify Pub/Sub clients about events happening in the key space.
868
+# This feature is documented at http://redis.io/topics/notifications
869
+#
870
+# For instance if keyspace events notification is enabled, and a client
871
+# performs a DEL operation on key "foo" stored in the Database 0, two
872
+# messages will be published via Pub/Sub:
873
+#
874
+# PUBLISH __keyspace@0__:foo del
875
+# PUBLISH __keyevent@0__:del foo
876
+#
877
+# It is possible to select the events that Redis will notify among a set
878
+# of classes. Every class is identified by a single character:
879
+#
880
+#  K     Keyspace events, published with __keyspace@<db>__ prefix.
881
+#  E     Keyevent events, published with __keyevent@<db>__ prefix.
882
+#  g     Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ...
883
+#  $     String commands
884
+#  l     List commands
885
+#  s     Set commands
886
+#  h     Hash commands
887
+#  z     Sorted set commands
888
+#  x     Expired events (events generated every time a key expires)
889
+#  e     Evicted events (events generated when a key is evicted for maxmemory)
890
+#  A     Alias for g$lshzxe, so that the "AKE" string means all the events.
891
+#
892
+#  The "notify-keyspace-events" takes as argument a string that is composed
893
+#  of zero or multiple characters. The empty string means that notifications
894
+#  are disabled.
895
+#
896
+#  Example: to enable list and generic events, from the point of view of the
897
+#           event name, use:
898
+#
899
+#  notify-keyspace-events Elg
900
+#
901
+#  Example 2: to get the stream of the expired keys subscribing to channel
902
+#             name __keyevent@0__:expired use:
903
+#
904
+#  notify-keyspace-events Ex
905
+#
906
+#  By default all notifications are disabled because most users don't need
907
+#  this feature and the feature has some overhead. Note that if you don't
908
+#  specify at least one of K or E, no events will be delivered.
909
+notify-keyspace-events ""
910
+
911
+############################### ADVANCED CONFIG ###############################
912
+
913
+# Hashes are encoded using a memory efficient data structure when they have a
914
+# small number of entries, and the biggest entry does not exceed a given
915
+# threshold. These thresholds can be configured using the following directives.
916
+hash-max-ziplist-entries 512
917
+hash-max-ziplist-value 64
918
+
919
+# Lists are also encoded in a special way to save a lot of space.
920
+# The number of entries allowed per internal list node can be specified
921
+# as a fixed maximum size or a maximum number of elements.
922
+# For a fixed maximum size, use -5 through -1, meaning:
923
+# -5: max size: 64 Kb  <-- not recommended for normal workloads
924
+# -4: max size: 32 Kb  <-- not recommended
925
+# -3: max size: 16 Kb  <-- probably not recommended
926
+# -2: max size: 8 Kb   <-- good
927
+# -1: max size: 4 Kb   <-- good
928
+# Positive numbers mean store up to _exactly_ that number of elements
929
+# per list node.
930
+# The highest performing option is usually -2 (8 Kb size) or -1 (4 Kb size),
931
+# but if your use case is unique, adjust the settings as necessary.
932
+list-max-ziplist-size -2
933
+
934
+# Lists may also be compressed.
935
+# Compress depth is the number of quicklist ziplist nodes from *each* side of
936
+# the list to *exclude* from compression.  The head and tail of the list
937
+# are always uncompressed for fast push/pop operations.  Settings are:
938
+# 0: disable all list compression
939
+# 1: depth 1 means "don't start compressing until after 1 node into the list,
940
+#    going from either the head or tail"
941
+#    So: [head]->node->node->...->node->[tail]
942
+#    [head], [tail] will always be uncompressed; inner nodes will compress.
943
+# 2: [head]->[next]->node->node->...->node->[prev]->[tail]
944
+#    2 here means: don't compress head or head->next or tail->prev or tail,
945
+#    but compress all nodes between them.
946
+# 3: [head]->[next]->[next]->node->node->...->node->[prev]->[prev]->[tail]
947
+# etc.
948
+list-compress-depth 0
949
+
950
+# Sets have a special encoding in just one case: when a set is composed
951
+# of just strings that happen to be integers in radix 10 in the range
952
+# of 64 bit signed integers.
953
+# The following configuration setting sets the limit in the size of the
954
+# set in order to use this special memory saving encoding.
955
+set-max-intset-entries 512
956
+
957
+# Similarly to hashes and lists, sorted sets are also specially encoded in
958
+# order to save a lot of space. This encoding is only used when the length and
959
+# elements of a sorted set are below the following limits:
960
+zset-max-ziplist-entries 128
961
+zset-max-ziplist-value 64
962
+
963
+# HyperLogLog sparse representation bytes limit. The limit includes the
964
+# 16 bytes header. When an HyperLogLog using the sparse representation crosses
965
+# this limit, it is converted into the dense representation.
966
+#
967
+# A value greater than 16000 is totally useless, since at that point the
968
+# dense representation is more memory efficient.
969
+#
970
+# The suggested value is ~ 3000 in order to have the benefits of
971
+# the space efficient encoding without slowing down too much PFADD,
972
+# which is O(N) with the sparse encoding. The value can be raised to
973
+# ~ 10000 when CPU is not a concern, but space is, and the data set is
974
+# composed of many HyperLogLogs with cardinality in the 0 - 15000 range.
975
+hll-sparse-max-bytes 3000
976
+
977
+# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in
978
+# order to help rehashing the main Redis hash table (the one mapping top-level
979
+# keys to values). The hash table implementation Redis uses (see dict.c)
980
+# performs a lazy rehashing: the more operation you run into a hash table
981
+# that is rehashing, the more rehashing "steps" are performed, so if the
982
+# server is idle the rehashing is never complete and some more memory is used
983
+# by the hash table.
984
+#
985
+# The default is to use this millisecond 10 times every second in order to
986
+# actively rehash the main dictionaries, freeing memory when possible.
987
+#
988
+# If unsure:
989
+# use "activerehashing no" if you have hard latency requirements and it is
990
+# not a good thing in your environment that Redis can reply from time to time
991
+# to queries with 2 milliseconds delay.
992
+#
993
+# use "activerehashing yes" if you don't have such hard requirements but
994
+# want to free memory asap when possible.
995
+activerehashing yes
996
+
997
+# The client output buffer limits can be used to force disconnection of clients
998
+# that are not reading data from the server fast enough for some reason (a
999
+# common reason is that a Pub/Sub client can't consume messages as fast as the
1000
+# publisher can produce them).
1001
+#
1002
+# The limit can be set differently for the three different classes of clients:
1003
+#
1004
+# normal -> normal clients including MONITOR clients
1005
+# slave  -> slave clients
1006
+# pubsub -> clients subscribed to at least one pubsub channel or pattern
1007
+#
1008
+# The syntax of every client-output-buffer-limit directive is the following:
1009
+#
1010
+# client-output-buffer-limit <class> <hard limit> <soft limit> <soft seconds>
1011
+#
1012
+# A client is immediately disconnected once the hard limit is reached, or if
1013
+# the soft limit is reached and remains reached for the specified number of
1014
+# seconds (continuously).
1015
+# So for instance if the hard limit is 32 megabytes and the soft limit is
1016
+# 16 megabytes / 10 seconds, the client will get disconnected immediately
1017
+# if the size of the output buffers reach 32 megabytes, but will also get
1018
+# disconnected if the client reaches 16 megabytes and continuously overcomes
1019
+# the limit for 10 seconds.
1020
+#
1021
+# By default normal clients are not limited because they don't receive data
1022
+# without asking (in a push way), but just after a request, so only
1023
+# asynchronous clients may create a scenario where data is requested faster
1024
+# than it can read.
1025
+#
1026
+# Instead there is a default limit for pubsub and slave clients, since
1027
+# subscribers and slaves receive data in a push fashion.
1028
+#
1029
+# Both the hard or the soft limit can be disabled by setting them to zero.
1030
+client-output-buffer-limit normal 0 0 0
1031
+client-output-buffer-limit slave 256mb 64mb 60
1032
+client-output-buffer-limit pubsub 32mb 8mb 60
1033
+
1034
+# Redis calls an internal function to perform many background tasks, like
1035
+# closing connections of clients in timeout, purging expired keys that are
1036
+# never requested, and so forth.
1037
+#
1038
+# Not all tasks are performed with the same frequency, but Redis checks for
1039
+# tasks to perform according to the specified "hz" value.
1040
+#
1041
+# By default "hz" is set to 10. Raising the value will use more CPU when
1042
+# Redis is idle, but at the same time will make Redis more responsive when
1043
+# there are many keys expiring at the same time, and timeouts may be
1044
+# handled with more precision.
1045
+#
1046
+# The range is between 1 and 500, however a value over 100 is usually not
1047
+# a good idea. Most users should use the default of 10 and raise this up to
1048
+# 100 only in environments where very low latency is required.
1049
+hz 10
1050
+
1051
+# When a child rewrites the AOF file, if the following option is enabled
1052
+# the file will be fsync-ed every 32 MB of data generated. This is useful
1053
+# in order to commit the file to the disk more incrementally and avoid
1054
+# big latency spikes.
1055
+aof-rewrite-incremental-fsync yes