├── .github
├── ISSUE_TEMPLATE.md
└── PULL_REQUEST_TEMPLATE.md
├── .gitlab-ci.yml
├── LICENSE
├── README.md
├── conf
├── arm.src.default
├── arm64.src.default
├── gitlab.13.rb
├── gitlab.rb
├── nginx.conf
└── x86-64.src.default
├── config_panel.toml
├── doc
├── ADMIN.md
├── ADMIN_fr.md
├── DESCRIPTION.md
├── DESCRIPTION_fr.md
└── screenshots
│ └── GitLab_running_11.0_(2018-07).png
├── manifest.toml
├── scripts
├── _common.sh
├── backup
├── change_url
├── config
├── install
├── remove
├── restore
├── upgrade
└── upgrade.d
│ ├── upgrade.11.last.sh
│ ├── upgrade.12.first.sh
│ ├── upgrade.12.last.sh
│ ├── upgrade.13.first.sh
│ ├── upgrade.13.last.sh
│ ├── upgrade.14.first.sh
│ ├── upgrade.14.last.sh
│ ├── upgrade.15.4.sh
│ ├── upgrade.15.first.sh
│ ├── upgrade.15.last.sh
│ ├── upgrade.16.3.sh
│ ├── upgrade.16.7.sh
│ ├── upgrade.16.first.sh
│ ├── upgrade.16.last.sh
│ ├── upgrade.17.3.sh
│ ├── upgrade.17.5.sh
│ ├── upgrade.17.8.sh
│ ├── upgrade.17.first.sh
│ ├── upgrade.17.last.sh
│ └── upgrade.last.sh
├── tests.toml
└── upgrade-versions.sh
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently.
4 |
5 | ---
6 |
7 | **How to post a meaningful bug report**
8 | 1. *Read this whole template first.*
9 | 2. *Determine if you are on the right place:*
10 | - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
11 | - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.*
12 | - *When in doubt, post here and we will figure it out together.*
13 | 3. *Delete the italic comments as you write over them below, and remove this guide.*
14 | ---
15 |
16 | ### Describe the bug
17 |
18 | *A clear and concise description of what the bug is.*
19 |
20 | ### Context
21 |
22 | - Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...*
23 | - YunoHost version: x.x.x
24 | - I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...*
25 | - Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes*
26 | - If yes, please explain:
27 | - Using, or trying to install package version/branch:
28 | - If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`*
29 |
30 | ### Steps to reproduce
31 |
32 | - *If you performed a command from the CLI, the command itself is enough. For example:*
33 | ```sh
34 | sudo yunohost app install the_app
35 | ```
36 | - *If you used the webadmin, please perform the equivalent command from the CLI first.*
37 | - *If the error occurs in your browser, explain what you did:*
38 | 1. *Go to '...'*
39 | 2. *Click on '...'*
40 | 3. *Scroll down to '...'*
41 | 4. *See error*
42 |
43 | ### Expected behavior
44 |
45 | *A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.*
46 |
47 | ### Logs
48 |
49 | *When an operation fails, YunoHost provides a simple way to share the logs.*
50 | - *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.*
51 | - *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.*
52 |
53 | *After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)*
54 |
55 | *If applicable and useful, add screenshots to help explain your problem.*
56 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Problem
2 |
3 | - *Description of why you made this PR*
4 |
5 | ## Solution
6 |
7 | - *And how do you fix that problem*
8 |
9 | ## PR Status
10 |
11 | - [ ] Code finished and ready to be reviewed/tested
12 | - [ ] The fix/enhancement were manually tested (if applicable)
13 |
14 | ## Automatic tests
15 |
16 | Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)
17 |
--------------------------------------------------------------------------------
/.gitlab-ci.yml:
--------------------------------------------------------------------------------
1 | image: python:3.5-alpine
2 | test:
3 | script:
4 | - apk update
5 | - apk add git
6 | - git clone https://github.com/YunoHost/package_linter
7 | - python package_linter/package_linter.py .
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU AFFERO GENERAL PUBLIC LICENSE
2 | Version 3, 19 November 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU Affero General Public License is a free, copyleft license for
11 | software and other kinds of works, specifically designed to ensure
12 | cooperation with the community in the case of network server software.
13 |
14 | The licenses for most software and other practical works are designed
15 | to take away your freedom to share and change the works. By contrast,
16 | our General Public Licenses are intended to guarantee your freedom to
17 | share and change all versions of a program--to make sure it remains free
18 | software for all its users.
19 |
20 | When we speak of free software, we are referring to freedom, not
21 | price. Our General Public Licenses are designed to make sure that you
22 | have the freedom to distribute copies of free software (and charge for
23 | them if you wish), that you receive source code or can get it if you
24 | want it, that you can change the software or use pieces of it in new
25 | free programs, and that you know you can do these things.
26 |
27 | Developers that use our General Public Licenses protect your rights
28 | with two steps: (1) assert copyright on the software, and (2) offer
29 | you this License which gives you legal permission to copy, distribute
30 | and/or modify the software.
31 |
32 | A secondary benefit of defending all users' freedom is that
33 | improvements made in alternate versions of the program, if they
34 | receive widespread use, become available for other developers to
35 | incorporate. Many developers of free software are heartened and
36 | encouraged by the resulting cooperation. However, in the case of
37 | software used on network servers, this result may fail to come about.
38 | The GNU General Public License permits making a modified version and
39 | letting the public access it on a server without ever releasing its
40 | source code to the public.
41 |
42 | The GNU Affero General Public License is designed specifically to
43 | ensure that, in such cases, the modified source code becomes available
44 | to the community. It requires the operator of a network server to
45 | provide the source code of the modified version running there to the
46 | users of that server. Therefore, public use of a modified version, on
47 | a publicly accessible server, gives the public access to the source
48 | code of the modified version.
49 |
50 | An older license, called the Affero General Public License and
51 | published by Affero, was designed to accomplish similar goals. This is
52 | a different license, not a version of the Affero GPL, but Affero has
53 | released a new version of the Affero GPL which permits relicensing under
54 | this license.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | TERMS AND CONDITIONS
60 |
61 | 0. Definitions.
62 |
63 | "This License" refers to version 3 of the GNU Affero General Public License.
64 |
65 | "Copyright" also means copyright-like laws that apply to other kinds of
66 | works, such as semiconductor masks.
67 |
68 | "The Program" refers to any copyrightable work licensed under this
69 | License. Each licensee is addressed as "you". "Licensees" and
70 | "recipients" may be individuals or organizations.
71 |
72 | To "modify" a work means to copy from or adapt all or part of the work
73 | in a fashion requiring copyright permission, other than the making of an
74 | exact copy. The resulting work is called a "modified version" of the
75 | earlier work or a work "based on" the earlier work.
76 |
77 | A "covered work" means either the unmodified Program or a work based
78 | on the Program.
79 |
80 | To "propagate" a work means to do anything with it that, without
81 | permission, would make you directly or secondarily liable for
82 | infringement under applicable copyright law, except executing it on a
83 | computer or modifying a private copy. Propagation includes copying,
84 | distribution (with or without modification), making available to the
85 | public, and in some countries other activities as well.
86 |
87 | To "convey" a work means any kind of propagation that enables other
88 | parties to make or receive copies. Mere interaction with a user through
89 | a computer network, with no transfer of a copy, is not conveying.
90 |
91 | An interactive user interface displays "Appropriate Legal Notices"
92 | to the extent that it includes a convenient and prominently visible
93 | feature that (1) displays an appropriate copyright notice, and (2)
94 | tells the user that there is no warranty for the work (except to the
95 | extent that warranties are provided), that licensees may convey the
96 | work under this License, and how to view a copy of this License. If
97 | the interface presents a list of user commands or options, such as a
98 | menu, a prominent item in the list meets this criterion.
99 |
100 | 1. Source Code.
101 |
102 | The "source code" for a work means the preferred form of the work
103 | for making modifications to it. "Object code" means any non-source
104 | form of a work.
105 |
106 | A "Standard Interface" means an interface that either is an official
107 | standard defined by a recognized standards body, or, in the case of
108 | interfaces specified for a particular programming language, one that
109 | is widely used among developers working in that language.
110 |
111 | The "System Libraries" of an executable work include anything, other
112 | than the work as a whole, that (a) is included in the normal form of
113 | packaging a Major Component, but which is not part of that Major
114 | Component, and (b) serves only to enable use of the work with that
115 | Major Component, or to implement a Standard Interface for which an
116 | implementation is available to the public in source code form. A
117 | "Major Component", in this context, means a major essential component
118 | (kernel, window system, and so on) of the specific operating system
119 | (if any) on which the executable work runs, or a compiler used to
120 | produce the work, or an object code interpreter used to run it.
121 |
122 | The "Corresponding Source" for a work in object code form means all
123 | the source code needed to generate, install, and (for an executable
124 | work) run the object code and to modify the work, including scripts to
125 | control those activities. However, it does not include the work's
126 | System Libraries, or general-purpose tools or generally available free
127 | programs which are used unmodified in performing those activities but
128 | which are not part of the work. For example, Corresponding Source
129 | includes interface definition files associated with source files for
130 | the work, and the source code for shared libraries and dynamically
131 | linked subprograms that the work is specifically designed to require,
132 | such as by intimate data communication or control flow between those
133 | subprograms and other parts of the work.
134 |
135 | The Corresponding Source need not include anything that users
136 | can regenerate automatically from other parts of the Corresponding
137 | Source.
138 |
139 | The Corresponding Source for a work in source code form is that
140 | same work.
141 |
142 | 2. Basic Permissions.
143 |
144 | All rights granted under this License are granted for the term of
145 | copyright on the Program, and are irrevocable provided the stated
146 | conditions are met. This License explicitly affirms your unlimited
147 | permission to run the unmodified Program. The output from running a
148 | covered work is covered by this License only if the output, given its
149 | content, constitutes a covered work. This License acknowledges your
150 | rights of fair use or other equivalent, as provided by copyright law.
151 |
152 | You may make, run and propagate covered works that you do not
153 | convey, without conditions so long as your license otherwise remains
154 | in force. You may convey covered works to others for the sole purpose
155 | of having them make modifications exclusively for you, or provide you
156 | with facilities for running those works, provided that you comply with
157 | the terms of this License in conveying all material for which you do
158 | not control copyright. Those thus making or running the covered works
159 | for you must do so exclusively on your behalf, under your direction
160 | and control, on terms that prohibit them from making any copies of
161 | your copyrighted material outside their relationship with you.
162 |
163 | Conveying under any other circumstances is permitted solely under
164 | the conditions stated below. Sublicensing is not allowed; section 10
165 | makes it unnecessary.
166 |
167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168 |
169 | No covered work shall be deemed part of an effective technological
170 | measure under any applicable law fulfilling obligations under article
171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172 | similar laws prohibiting or restricting circumvention of such
173 | measures.
174 |
175 | When you convey a covered work, you waive any legal power to forbid
176 | circumvention of technological measures to the extent such circumvention
177 | is effected by exercising rights under this License with respect to
178 | the covered work, and you disclaim any intention to limit operation or
179 | modification of the work as a means of enforcing, against the work's
180 | users, your or third parties' legal rights to forbid circumvention of
181 | technological measures.
182 |
183 | 4. Conveying Verbatim Copies.
184 |
185 | You may convey verbatim copies of the Program's source code as you
186 | receive it, in any medium, provided that you conspicuously and
187 | appropriately publish on each copy an appropriate copyright notice;
188 | keep intact all notices stating that this License and any
189 | non-permissive terms added in accord with section 7 apply to the code;
190 | keep intact all notices of the absence of any warranty; and give all
191 | recipients a copy of this License along with the Program.
192 |
193 | You may charge any price or no price for each copy that you convey,
194 | and you may offer support or warranty protection for a fee.
195 |
196 | 5. Conveying Modified Source Versions.
197 |
198 | You may convey a work based on the Program, or the modifications to
199 | produce it from the Program, in the form of source code under the
200 | terms of section 4, provided that you also meet all of these conditions:
201 |
202 | a) The work must carry prominent notices stating that you modified
203 | it, and giving a relevant date.
204 |
205 | b) The work must carry prominent notices stating that it is
206 | released under this License and any conditions added under section
207 | 7. This requirement modifies the requirement in section 4 to
208 | "keep intact all notices".
209 |
210 | c) You must license the entire work, as a whole, under this
211 | License to anyone who comes into possession of a copy. This
212 | License will therefore apply, along with any applicable section 7
213 | additional terms, to the whole of the work, and all its parts,
214 | regardless of how they are packaged. This License gives no
215 | permission to license the work in any other way, but it does not
216 | invalidate such permission if you have separately received it.
217 |
218 | d) If the work has interactive user interfaces, each must display
219 | Appropriate Legal Notices; however, if the Program has interactive
220 | interfaces that do not display Appropriate Legal Notices, your
221 | work need not make them do so.
222 |
223 | A compilation of a covered work with other separate and independent
224 | works, which are not by their nature extensions of the covered work,
225 | and which are not combined with it such as to form a larger program,
226 | in or on a volume of a storage or distribution medium, is called an
227 | "aggregate" if the compilation and its resulting copyright are not
228 | used to limit the access or legal rights of the compilation's users
229 | beyond what the individual works permit. Inclusion of a covered work
230 | in an aggregate does not cause this License to apply to the other
231 | parts of the aggregate.
232 |
233 | 6. Conveying Non-Source Forms.
234 |
235 | You may convey a covered work in object code form under the terms
236 | of sections 4 and 5, provided that you also convey the
237 | machine-readable Corresponding Source under the terms of this License,
238 | in one of these ways:
239 |
240 | a) Convey the object code in, or embodied in, a physical product
241 | (including a physical distribution medium), accompanied by the
242 | Corresponding Source fixed on a durable physical medium
243 | customarily used for software interchange.
244 |
245 | b) Convey the object code in, or embodied in, a physical product
246 | (including a physical distribution medium), accompanied by a
247 | written offer, valid for at least three years and valid for as
248 | long as you offer spare parts or customer support for that product
249 | model, to give anyone who possesses the object code either (1) a
250 | copy of the Corresponding Source for all the software in the
251 | product that is covered by this License, on a durable physical
252 | medium customarily used for software interchange, for a price no
253 | more than your reasonable cost of physically performing this
254 | conveying of source, or (2) access to copy the
255 | Corresponding Source from a network server at no charge.
256 |
257 | c) Convey individual copies of the object code with a copy of the
258 | written offer to provide the Corresponding Source. This
259 | alternative is allowed only occasionally and noncommercially, and
260 | only if you received the object code with such an offer, in accord
261 | with subsection 6b.
262 |
263 | d) Convey the object code by offering access from a designated
264 | place (gratis or for a charge), and offer equivalent access to the
265 | Corresponding Source in the same way through the same place at no
266 | further charge. You need not require recipients to copy the
267 | Corresponding Source along with the object code. If the place to
268 | copy the object code is a network server, the Corresponding Source
269 | may be on a different server (operated by you or a third party)
270 | that supports equivalent copying facilities, provided you maintain
271 | clear directions next to the object code saying where to find the
272 | Corresponding Source. Regardless of what server hosts the
273 | Corresponding Source, you remain obligated to ensure that it is
274 | available for as long as needed to satisfy these requirements.
275 |
276 | e) Convey the object code using peer-to-peer transmission, provided
277 | you inform other peers where the object code and Corresponding
278 | Source of the work are being offered to the general public at no
279 | charge under subsection 6d.
280 |
281 | A separable portion of the object code, whose source code is excluded
282 | from the Corresponding Source as a System Library, need not be
283 | included in conveying the object code work.
284 |
285 | A "User Product" is either (1) a "consumer product", which means any
286 | tangible personal property which is normally used for personal, family,
287 | or household purposes, or (2) anything designed or sold for incorporation
288 | into a dwelling. In determining whether a product is a consumer product,
289 | doubtful cases shall be resolved in favor of coverage. For a particular
290 | product received by a particular user, "normally used" refers to a
291 | typical or common use of that class of product, regardless of the status
292 | of the particular user or of the way in which the particular user
293 | actually uses, or expects or is expected to use, the product. A product
294 | is a consumer product regardless of whether the product has substantial
295 | commercial, industrial or non-consumer uses, unless such uses represent
296 | the only significant mode of use of the product.
297 |
298 | "Installation Information" for a User Product means any methods,
299 | procedures, authorization keys, or other information required to install
300 | and execute modified versions of a covered work in that User Product from
301 | a modified version of its Corresponding Source. The information must
302 | suffice to ensure that the continued functioning of the modified object
303 | code is in no case prevented or interfered with solely because
304 | modification has been made.
305 |
306 | If you convey an object code work under this section in, or with, or
307 | specifically for use in, a User Product, and the conveying occurs as
308 | part of a transaction in which the right of possession and use of the
309 | User Product is transferred to the recipient in perpetuity or for a
310 | fixed term (regardless of how the transaction is characterized), the
311 | Corresponding Source conveyed under this section must be accompanied
312 | by the Installation Information. But this requirement does not apply
313 | if neither you nor any third party retains the ability to install
314 | modified object code on the User Product (for example, the work has
315 | been installed in ROM).
316 |
317 | The requirement to provide Installation Information does not include a
318 | requirement to continue to provide support service, warranty, or updates
319 | for a work that has been modified or installed by the recipient, or for
320 | the User Product in which it has been modified or installed. Access to a
321 | network may be denied when the modification itself materially and
322 | adversely affects the operation of the network or violates the rules and
323 | protocols for communication across the network.
324 |
325 | Corresponding Source conveyed, and Installation Information provided,
326 | in accord with this section must be in a format that is publicly
327 | documented (and with an implementation available to the public in
328 | source code form), and must require no special password or key for
329 | unpacking, reading or copying.
330 |
331 | 7. Additional Terms.
332 |
333 | "Additional permissions" are terms that supplement the terms of this
334 | License by making exceptions from one or more of its conditions.
335 | Additional permissions that are applicable to the entire Program shall
336 | be treated as though they were included in this License, to the extent
337 | that they are valid under applicable law. If additional permissions
338 | apply only to part of the Program, that part may be used separately
339 | under those permissions, but the entire Program remains governed by
340 | this License without regard to the additional permissions.
341 |
342 | When you convey a copy of a covered work, you may at your option
343 | remove any additional permissions from that copy, or from any part of
344 | it. (Additional permissions may be written to require their own
345 | removal in certain cases when you modify the work.) You may place
346 | additional permissions on material, added by you to a covered work,
347 | for which you have or can give appropriate copyright permission.
348 |
349 | Notwithstanding any other provision of this License, for material you
350 | add to a covered work, you may (if authorized by the copyright holders of
351 | that material) supplement the terms of this License with terms:
352 |
353 | a) Disclaiming warranty or limiting liability differently from the
354 | terms of sections 15 and 16 of this License; or
355 |
356 | b) Requiring preservation of specified reasonable legal notices or
357 | author attributions in that material or in the Appropriate Legal
358 | Notices displayed by works containing it; or
359 |
360 | c) Prohibiting misrepresentation of the origin of that material, or
361 | requiring that modified versions of such material be marked in
362 | reasonable ways as different from the original version; or
363 |
364 | d) Limiting the use for publicity purposes of names of licensors or
365 | authors of the material; or
366 |
367 | e) Declining to grant rights under trademark law for use of some
368 | trade names, trademarks, or service marks; or
369 |
370 | f) Requiring indemnification of licensors and authors of that
371 | material by anyone who conveys the material (or modified versions of
372 | it) with contractual assumptions of liability to the recipient, for
373 | any liability that these contractual assumptions directly impose on
374 | those licensors and authors.
375 |
376 | All other non-permissive additional terms are considered "further
377 | restrictions" within the meaning of section 10. If the Program as you
378 | received it, or any part of it, contains a notice stating that it is
379 | governed by this License along with a term that is a further
380 | restriction, you may remove that term. If a license document contains
381 | a further restriction but permits relicensing or conveying under this
382 | License, you may add to a covered work material governed by the terms
383 | of that license document, provided that the further restriction does
384 | not survive such relicensing or conveying.
385 |
386 | If you add terms to a covered work in accord with this section, you
387 | must place, in the relevant source files, a statement of the
388 | additional terms that apply to those files, or a notice indicating
389 | where to find the applicable terms.
390 |
391 | Additional terms, permissive or non-permissive, may be stated in the
392 | form of a separately written license, or stated as exceptions;
393 | the above requirements apply either way.
394 |
395 | 8. Termination.
396 |
397 | You may not propagate or modify a covered work except as expressly
398 | provided under this License. Any attempt otherwise to propagate or
399 | modify it is void, and will automatically terminate your rights under
400 | this License (including any patent licenses granted under the third
401 | paragraph of section 11).
402 |
403 | However, if you cease all violation of this License, then your
404 | license from a particular copyright holder is reinstated (a)
405 | provisionally, unless and until the copyright holder explicitly and
406 | finally terminates your license, and (b) permanently, if the copyright
407 | holder fails to notify you of the violation by some reasonable means
408 | prior to 60 days after the cessation.
409 |
410 | Moreover, your license from a particular copyright holder is
411 | reinstated permanently if the copyright holder notifies you of the
412 | violation by some reasonable means, this is the first time you have
413 | received notice of violation of this License (for any work) from that
414 | copyright holder, and you cure the violation prior to 30 days after
415 | your receipt of the notice.
416 |
417 | Termination of your rights under this section does not terminate the
418 | licenses of parties who have received copies or rights from you under
419 | this License. If your rights have been terminated and not permanently
420 | reinstated, you do not qualify to receive new licenses for the same
421 | material under section 10.
422 |
423 | 9. Acceptance Not Required for Having Copies.
424 |
425 | You are not required to accept this License in order to receive or
426 | run a copy of the Program. Ancillary propagation of a covered work
427 | occurring solely as a consequence of using peer-to-peer transmission
428 | to receive a copy likewise does not require acceptance. However,
429 | nothing other than this License grants you permission to propagate or
430 | modify any covered work. These actions infringe copyright if you do
431 | not accept this License. Therefore, by modifying or propagating a
432 | covered work, you indicate your acceptance of this License to do so.
433 |
434 | 10. Automatic Licensing of Downstream Recipients.
435 |
436 | Each time you convey a covered work, the recipient automatically
437 | receives a license from the original licensors, to run, modify and
438 | propagate that work, subject to this License. You are not responsible
439 | for enforcing compliance by third parties with this License.
440 |
441 | An "entity transaction" is a transaction transferring control of an
442 | organization, or substantially all assets of one, or subdividing an
443 | organization, or merging organizations. If propagation of a covered
444 | work results from an entity transaction, each party to that
445 | transaction who receives a copy of the work also receives whatever
446 | licenses to the work the party's predecessor in interest had or could
447 | give under the previous paragraph, plus a right to possession of the
448 | Corresponding Source of the work from the predecessor in interest, if
449 | the predecessor has it or can get it with reasonable efforts.
450 |
451 | You may not impose any further restrictions on the exercise of the
452 | rights granted or affirmed under this License. For example, you may
453 | not impose a license fee, royalty, or other charge for exercise of
454 | rights granted under this License, and you may not initiate litigation
455 | (including a cross-claim or counterclaim in a lawsuit) alleging that
456 | any patent claim is infringed by making, using, selling, offering for
457 | sale, or importing the Program or any portion of it.
458 |
459 | 11. Patents.
460 |
461 | A "contributor" is a copyright holder who authorizes use under this
462 | License of the Program or a work on which the Program is based. The
463 | work thus licensed is called the contributor's "contributor version".
464 |
465 | A contributor's "essential patent claims" are all patent claims
466 | owned or controlled by the contributor, whether already acquired or
467 | hereafter acquired, that would be infringed by some manner, permitted
468 | by this License, of making, using, or selling its contributor version,
469 | but do not include claims that would be infringed only as a
470 | consequence of further modification of the contributor version. For
471 | purposes of this definition, "control" includes the right to grant
472 | patent sublicenses in a manner consistent with the requirements of
473 | this License.
474 |
475 | Each contributor grants you a non-exclusive, worldwide, royalty-free
476 | patent license under the contributor's essential patent claims, to
477 | make, use, sell, offer for sale, import and otherwise run, modify and
478 | propagate the contents of its contributor version.
479 |
480 | In the following three paragraphs, a "patent license" is any express
481 | agreement or commitment, however denominated, not to enforce a patent
482 | (such as an express permission to practice a patent or covenant not to
483 | sue for patent infringement). To "grant" such a patent license to a
484 | party means to make such an agreement or commitment not to enforce a
485 | patent against the party.
486 |
487 | If you convey a covered work, knowingly relying on a patent license,
488 | and the Corresponding Source of the work is not available for anyone
489 | to copy, free of charge and under the terms of this License, through a
490 | publicly available network server or other readily accessible means,
491 | then you must either (1) cause the Corresponding Source to be so
492 | available, or (2) arrange to deprive yourself of the benefit of the
493 | patent license for this particular work, or (3) arrange, in a manner
494 | consistent with the requirements of this License, to extend the patent
495 | license to downstream recipients. "Knowingly relying" means you have
496 | actual knowledge that, but for the patent license, your conveying the
497 | covered work in a country, or your recipient's use of the covered work
498 | in a country, would infringe one or more identifiable patents in that
499 | country that you have reason to believe are valid.
500 |
501 | If, pursuant to or in connection with a single transaction or
502 | arrangement, you convey, or propagate by procuring conveyance of, a
503 | covered work, and grant a patent license to some of the parties
504 | receiving the covered work authorizing them to use, propagate, modify
505 | or convey a specific copy of the covered work, then the patent license
506 | you grant is automatically extended to all recipients of the covered
507 | work and works based on it.
508 |
509 | A patent license is "discriminatory" if it does not include within
510 | the scope of its coverage, prohibits the exercise of, or is
511 | conditioned on the non-exercise of one or more of the rights that are
512 | specifically granted under this License. You may not convey a covered
513 | work if you are a party to an arrangement with a third party that is
514 | in the business of distributing software, under which you make payment
515 | to the third party based on the extent of your activity of conveying
516 | the work, and under which the third party grants, to any of the
517 | parties who would receive the covered work from you, a discriminatory
518 | patent license (a) in connection with copies of the covered work
519 | conveyed by you (or copies made from those copies), or (b) primarily
520 | for and in connection with specific products or compilations that
521 | contain the covered work, unless you entered into that arrangement,
522 | or that patent license was granted, prior to 28 March 2007.
523 |
524 | Nothing in this License shall be construed as excluding or limiting
525 | any implied license or other defenses to infringement that may
526 | otherwise be available to you under applicable patent law.
527 |
528 | 12. No Surrender of Others' Freedom.
529 |
530 | If conditions are imposed on you (whether by court order, agreement or
531 | otherwise) that contradict the conditions of this License, they do not
532 | excuse you from the conditions of this License. If you cannot convey a
533 | covered work so as to satisfy simultaneously your obligations under this
534 | License and any other pertinent obligations, then as a consequence you may
535 | not convey it at all. For example, if you agree to terms that obligate you
536 | to collect a royalty for further conveying from those to whom you convey
537 | the Program, the only way you could satisfy both those terms and this
538 | License would be to refrain entirely from conveying the Program.
539 |
540 | 13. Remote Network Interaction; Use with the GNU General Public License.
541 |
542 | Notwithstanding any other provision of this License, if you modify the
543 | Program, your modified version must prominently offer all users
544 | interacting with it remotely through a computer network (if your version
545 | supports such interaction) an opportunity to receive the Corresponding
546 | Source of your version by providing access to the Corresponding Source
547 | from a network server at no charge, through some standard or customary
548 | means of facilitating copying of software. This Corresponding Source
549 | shall include the Corresponding Source for any work covered by version 3
550 | of the GNU General Public License that is incorporated pursuant to the
551 | following paragraph.
552 |
553 | Notwithstanding any other provision of this License, you have
554 | permission to link or combine any covered work with a work licensed
555 | under version 3 of the GNU General Public License into a single
556 | combined work, and to convey the resulting work. The terms of this
557 | License will continue to apply to the part which is the covered work,
558 | but the work with which it is combined will remain governed by version
559 | 3 of the GNU General Public License.
560 |
561 | 14. Revised Versions of this License.
562 |
563 | The Free Software Foundation may publish revised and/or new versions of
564 | the GNU Affero General Public License from time to time. Such new versions
565 | will be similar in spirit to the present version, but may differ in detail to
566 | address new problems or concerns.
567 |
568 | Each version is given a distinguishing version number. If the
569 | Program specifies that a certain numbered version of the GNU Affero General
570 | Public License "or any later version" applies to it, you have the
571 | option of following the terms and conditions either of that numbered
572 | version or of any later version published by the Free Software
573 | Foundation. If the Program does not specify a version number of the
574 | GNU Affero General Public License, you may choose any version ever published
575 | by the Free Software Foundation.
576 |
577 | If the Program specifies that a proxy can decide which future
578 | versions of the GNU Affero General Public License can be used, that proxy's
579 | public statement of acceptance of a version permanently authorizes you
580 | to choose that version for the Program.
581 |
582 | Later license versions may give you additional or different
583 | permissions. However, no additional obligations are imposed on any
584 | author or copyright holder as a result of your choosing to follow a
585 | later version.
586 |
587 | 15. Disclaimer of Warranty.
588 |
589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597 |
598 | 16. Limitation of Liability.
599 |
600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608 | SUCH DAMAGES.
609 |
610 | 17. Interpretation of Sections 15 and 16.
611 |
612 | If the disclaimer of warranty and limitation of liability provided
613 | above cannot be given local legal effect according to their terms,
614 | reviewing courts shall apply local law that most closely approximates
615 | an absolute waiver of all civil liability in connection with the
616 | Program, unless a warranty or assumption of liability accompanies a
617 | copy of the Program in return for a fee.
618 |
619 | END OF TERMS AND CONDITIONS
620 |
621 | How to Apply These Terms to Your New Programs
622 |
623 | If you develop a new program, and you want it to be of the greatest
624 | possible use to the public, the best way to achieve this is to make it
625 | free software which everyone can redistribute and change under these terms.
626 |
627 | To do so, attach the following notices to the program. It is safest
628 | to attach them to the start of each source file to most effectively
629 | state the exclusion of warranty; and each file should have at least
630 | the "copyright" line and a pointer to where the full notice is found.
631 |
632 |
633 | Copyright (C)
634 |
635 | This program is free software: you can redistribute it and/or modify
636 | it under the terms of the GNU Affero General Public License as published
637 | by the Free Software Foundation, either version 3 of the License, or
638 | (at your option) any later version.
639 |
640 | This program is distributed in the hope that it will be useful,
641 | but WITHOUT ANY WARRANTY; without even the implied warranty of
642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643 | GNU Affero General Public License for more details.
644 |
645 | You should have received a copy of the GNU Affero General Public License
646 | along with this program. If not, see .
647 |
648 | Also add information on how to contact you by electronic and paper mail.
649 |
650 | If your software can interact with users remotely through a computer
651 | network, you should also make sure that it provides a way for users to
652 | get its source. For example, if your program is a web application, its
653 | interface could display a "Source" link that leads users to an archive
654 | of the code. There are many ways you could offer source, and different
655 | solutions will be better for different programs; see section 13 for the
656 | specific requirements.
657 |
658 | You should also get your employer (if you work as a programmer) or school,
659 | if any, to sign a "copyright disclaimer" for the program, if necessary.
660 | For more information on this, and how to apply and follow the GNU AGPL, see
661 | .
662 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 | GitLab, packaged for YunoHost
9 |
10 |
11 | Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features
12 |
13 | [](https://gitlab.com)
14 | [](https://gitlab.com/explore)
15 | [?style=for-the-badge)](https://ci-apps.yunohost.org/ci/apps/gitlab/)
16 |
17 |
18 |

19 |

20 |
21 |
22 | ## 📦 Developer info
23 |
24 | [](https://ci-apps.yunohost.org/ci/apps/gitlab/)
25 |
26 | 🛠️ Upstream GitLab repository:
27 |
28 | Pull request are welcome and should target the [`testing` branch](https://github.com/YunoHost-Apps/gitlab_ynh/tree/testing).
29 |
30 | The `testing` branch can be tested using:
31 | ```
32 | # fresh install:
33 | sudo yunohost app install https://github.com/YunoHost-Apps/gitlab_ynh/tree/testing
34 |
35 | # upgrade an existing install:
36 | sudo yunohost app upgrade gitlab -u https://github.com/YunoHost-Apps/gitlab_ynh/tree/testing
37 | ```
38 |
39 | ### 📚 App packaging documentation
40 |
41 | Please see for more information.
--------------------------------------------------------------------------------
/conf/arm.src.default:
--------------------------------------------------------------------------------
1 | SOURCE_URL=https://packages.gitlab.com/gitlab/raspberry-pi2/packages/raspbian/__GITLAB_DEBIAN_VERSION__/gitlab-ce___GITLAB_VERSION__-ce.0_armhf.deb/download.deb
2 | SOURCE_SUM=__GITLAB_SOURCE_SHA256__
3 | SOURCE_SUM_PRG=sha256sum
4 | SOURCE_FILENAME=__GITLAB_FILENAME__
5 | SOURCE_EXTRACT=false
6 | SOURCE_FORMAT=deb
7 |
--------------------------------------------------------------------------------
/conf/arm64.src.default:
--------------------------------------------------------------------------------
1 | SOURCE_URL=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/__GITLAB_DEBIAN_VERSION__/gitlab-ce___GITLAB_VERSION__-ce.0_arm64.deb/download.deb
2 | SOURCE_SUM=__GITLAB_SOURCE_SHA256__
3 | SOURCE_SUM_PRG=sha256sum
4 | SOURCE_FILENAME=__GITLAB_FILENAME__
5 | SOURCE_EXTRACT=false
6 | SOURCE_FORMAT=deb
7 |
--------------------------------------------------------------------------------
/conf/nginx.conf:
--------------------------------------------------------------------------------
1 | location __PATH__/ {
2 | # Adapted from https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/lib/support/nginx/gitlab-ssl
3 |
4 | client_max_body_size __CLIENT_MAX_BODY_SIZE__;
5 | gzip off;
6 |
7 | ## https://github.com/gitlabhq/gitlabhq/issues/694
8 | ## Some requests take more than 30 seconds.
9 | proxy_read_timeout 300;
10 | proxy_connect_timeout 300;
11 | proxy_redirect off;
12 |
13 | proxy_http_version 1.1;
14 |
15 | proxy_pass http://localhost:__PORT__;
16 |
17 | proxy_set_header Host $host;
18 | proxy_set_header X-Real-IP $remote_addr;
19 | proxy_set_header X-Forwarded-Ssl on;
20 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
21 | proxy_set_header X-Forwarded-Proto $scheme;
22 | proxy_set_header Upgrade $http_upgrade;
23 | proxy_set_header Connection $connection_upgrade;
24 |
25 | # Include SSOWAT user panel.
26 | include conf.d/yunohost_panel.conf.inc;
27 | }
28 |
--------------------------------------------------------------------------------
/conf/x86-64.src.default:
--------------------------------------------------------------------------------
1 | SOURCE_URL=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/__GITLAB_DEBIAN_VERSION__/gitlab-ce___GITLAB_VERSION__-ce.0_amd64.deb/download.deb
2 | SOURCE_SUM=__GITLAB_SOURCE_SHA256__
3 | SOURCE_SUM_PRG=sha256sum
4 | SOURCE_FILENAME=__GITLAB_FILENAME__
5 | SOURCE_EXTRACT=false
6 | SOURCE_FORMAT=deb
7 |
--------------------------------------------------------------------------------
/config_panel.toml:
--------------------------------------------------------------------------------
1 | version = "1.0"
2 |
3 | [main]
4 | name = "GitLab configuration"
5 |
6 | [main.overwrite_files]
7 | name = "Overwriting config files"
8 |
9 | [main.overwrite_files.overwrite_nginx]
10 | ask = "Overwrite the NGINX config file?"
11 | type = "boolean"
12 | help = "If the file is overwritten, a backup will be created."
13 |
14 | [main.users]
15 | name = "External users"
16 |
17 | [main.users.use_web_account]
18 | ask = "Authorized external user creation?"
19 | type = "boolean"
--------------------------------------------------------------------------------
/doc/ADMIN.md:
--------------------------------------------------------------------------------
1 | ### Configuration
2 |
3 | How to configure GitLab:
4 |
5 | - With the GitLab admin panel.
6 | - By editing the configuration file `/etc/gitlab/gitlab-persistent.rb` (use `sudo gitlab-ctl reconfigure` after any modification of this file).
7 |
--------------------------------------------------------------------------------
/doc/ADMIN_fr.md:
--------------------------------------------------------------------------------
1 | ### Configuration
2 |
3 | Comment configurer GitLab :
4 |
5 | - Avec le panneau d'administration de GitLab.
6 | - En éditant le fichier de configuration `/etc/gitlab/gitlab-persistent.rb` et en éxécutant la commande `sudo gitlab-ctl reconfigure` pour réactualiser la configuration.
7 |
--------------------------------------------------------------------------------
/doc/DESCRIPTION.md:
--------------------------------------------------------------------------------
1 | Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features
--------------------------------------------------------------------------------
/doc/DESCRIPTION_fr.md:
--------------------------------------------------------------------------------
1 | Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD
--------------------------------------------------------------------------------
/doc/screenshots/GitLab_running_11.0_(2018-07).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YunoHost-Apps/gitlab_ynh/834ca07ce904809f54f4f65027742c0ca6dd563f/doc/screenshots/GitLab_running_11.0_(2018-07).png
--------------------------------------------------------------------------------
/manifest.toml:
--------------------------------------------------------------------------------
1 | packaging_format = 2
2 |
3 | id = "gitlab"
4 | name = "GitLab"
5 | description.en = "Git-repository manager providing wiki, issue-tracking and CI/CD pipeline features"
6 | description.fr = "Gestionnaire de dépôts Git proposant des fonctionnalités de wiki, suivi de bugs et de pipeline CI/CD"
7 |
8 | version = "18.0.1~ynh1"
9 |
10 | maintainers = ["kay0u"]
11 |
12 | [upstream]
13 | license = "MIT"
14 | website = "https://gitlab.com"
15 | demo = "https://gitlab.com/explore"
16 | admindoc = "https://docs.gitlab.com/"
17 | code = "https://gitlab.com/gitlab-org/gitlab"
18 | cpe = "cpe:2.3:a:gitlab:gitlab"
19 |
20 | [integration]
21 | yunohost = ">= 11.2.3"
22 | architectures = ["amd64", "armhf", "arm64"]
23 | multi_instance = false
24 | ldap = true
25 | sso = false
26 | disk = "500M"
27 | ram.build = "3000M"
28 | ram.runtime = "2000M"
29 |
30 | [install]
31 | [install.domain]
32 | # this is a generic question - ask strings are automatically handled by Yunohost's core
33 | type = "domain"
34 |
35 | [install.path]
36 | # this is a generic question - ask strings are automatically handled by Yunohost's core
37 | type = "path"
38 | default = "/gitlab"
39 |
40 | [install.admin]
41 | # this is a generic question - ask strings are automatically handled by Yunohost's core
42 | type = "user"
43 |
44 | [install.init_main_permission]
45 | help.en = "If your GitLab instance is set to visitors, anyone can see your public repositories."
46 | help.fr = "Si votre instance GitLab est définie sur visiteurs, tout le monde pourra voir vos dépôts publics."
47 | type = "group"
48 | default = "visitors"
49 |
50 | [install.use_web_account]
51 | ask.en = "Authorize account creation from GitLab web interface"
52 | ask.fr = "Autoriser la création de compte depuis l'interface web de GitLab ?"
53 | type = "boolean"
54 | default = false
55 |
56 | [resources]
57 | # [resources.sources]
58 | # [resources.sources.main]
59 | # extract = false
60 | # rename = "gitlab-ce-15.10.0.deb"
61 | # amd64.url = "https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/bullseye/gitlab-ce_15.10.0-ce.0_amd64.deb/download.deb"
62 | # amd64.sha256 = "c8f5aca04549d3f9ba636ca67e76e9bf2b5a6a249a4a16d79365d17856a53d4d"
63 | # armhf.url = "https://packages.gitlab.com/gitlab/raspberry-pi2/packages/raspbian/bullseye/gitlab-ce_15.10.0-ce.0_armhf.deb/download.deb"
64 | # armhf.sha256 = "a7a195bf8a74e6ca688de2debe23c0cd5482d989377dcaf7042df484731e10cc"
65 | # arm64.url = "https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/bullseye/gitlab-ce_15.10.0-ce.0_arm64.deb/download.deb"
66 | # arm64.sha256 = "63d29c92eb956631a478735a6c692bbb315c898b2041b2f545c12302b230c97f"
67 |
68 | [resources.system_user]
69 |
70 | [resources.install_dir]
71 | dir = "/opt/__APP__"
72 |
73 | [resources.permissions]
74 | main.url = "/"
75 | # Fix #264 and #267
76 | main.auth_header = false
77 |
78 | [resources.ports]
79 | main.default = 8080
80 | puma.default = 8081
81 | sidekiq.default = 8082
82 |
83 | [resources.apt]
84 | packages = "openssh-server"
85 |
--------------------------------------------------------------------------------
/scripts/_common.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #=================================================
4 | # EXPERIMENTAL HELPERS
5 | #=================================================
6 |
7 | # Add swap
8 | #
9 | # usage: ynh_add_swap --size=SWAP in Mb
10 | # | arg: -s, --size= - Amount of SWAP to add in Mb.
11 | ynh_add_swap () {
12 | # Declare an array to define the options of this helper.
13 | declare -Ar args_array=( [s]=size= )
14 | local size
15 | # Manage arguments with getopts
16 | ynh_handle_getopts_args "$@"
17 |
18 | local swap_max_size=$(( $size * 1024 ))
19 |
20 | local free_space=$(df --output=avail / | sed 1d)
21 | # Because we don't want to fill the disk with a swap file, divide by 2 the available space.
22 | local usable_space=$(( $free_space / 2 ))
23 |
24 | SD_CARD_CAN_SWAP=${SD_CARD_CAN_SWAP:-0}
25 |
26 | # Swap on SD card only if it's is specified
27 | if ynh_is_main_device_a_sd_card && [ "$SD_CARD_CAN_SWAP" == "0" ]
28 | then
29 | ynh_print_warn --message="The main mountpoint of your system '/' is on an SD card, swap will not be added to prevent some damage of this one, but that can cause troubles for the app $app. If you still want activate the swap, you can relaunch the command preceded by 'SD_CARD_CAN_SWAP=1'"
30 | return
31 | fi
32 |
33 | # Compare the available space with the size of the swap.
34 | # And set a acceptable size from the request
35 | if [ $usable_space -ge $swap_max_size ]
36 | then
37 | local swap_size=$swap_max_size
38 | elif [ $usable_space -ge $(( $swap_max_size / 2 )) ]
39 | then
40 | local swap_size=$(( $swap_max_size / 2 ))
41 | elif [ $usable_space -ge $(( $swap_max_size / 3 )) ]
42 | then
43 | local swap_size=$(( $swap_max_size / 3 ))
44 | elif [ $usable_space -ge $(( $swap_max_size / 4 )) ]
45 | then
46 | local swap_size=$(( $swap_max_size / 4 ))
47 | else
48 | echo "Not enough space left for a swap file" >&2
49 | local swap_size=0
50 | fi
51 |
52 | # If there's enough space for a swap, and no existing swap here
53 | if [ $swap_size -ne 0 ] && [ ! -e /swap_$app ]
54 | then
55 | # Preallocate space for the swap file, fallocate may sometime not be used, use dd instead in this case
56 | if ! fallocate -l ${swap_size}K /swap_$app
57 | then
58 | dd if=/dev/zero of=/swap_$app bs=1024 count=${swap_size}
59 | fi
60 | chmod 0600 /swap_$app
61 | # Create the swap
62 | mkswap /swap_$app
63 | # And activate it
64 | swapon /swap_$app
65 | # Then add an entry in fstab to load this swap at each boot.
66 | echo -e "/swap_$app swap swap defaults 0 0 #Swap added by $app" >> /etc/fstab
67 | fi
68 | }
69 |
70 | ynh_del_swap () {
71 | # If there a swap at this place
72 | if [ -e /swap_$app ]
73 | then
74 | # Clean the fstab
75 | sed -i "/#Swap added by $app/d" /etc/fstab
76 | # Desactive the swap file
77 | swapoff /swap_$app
78 | # And remove it
79 | rm /swap_$app
80 | fi
81 | }
82 |
83 | # Check if the device of the main mountpoint "/" is an SD card
84 | #
85 | # [internal]
86 | #
87 | # return 0 if it's an SD card, else 1
88 | ynh_is_main_device_a_sd_card () {
89 | local main_device=$(lsblk --output PKNAME --noheadings $(findmnt / --nofsroot --uniq --output source --noheadings --first-only))
90 |
91 | if echo $main_device | grep --quiet "mmc" && [ $(tail -n1 /sys/block/$main_device/queue/rotational) == "0" ]
92 | then
93 | return 0
94 | else
95 | return 1
96 | fi
97 | }
98 |
--------------------------------------------------------------------------------
/scripts/backup:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #=================================================
4 | # GENERIC START
5 | #=================================================
6 | # IMPORT GENERIC HELPERS
7 | #=================================================
8 |
9 | #Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
10 | source ../settings/scripts/_common.sh
11 | source /usr/share/yunohost/helpers
12 |
13 | #=================================================
14 | # DECLARE DATA AND CONF FILES TO BACKUP
15 | #=================================================
16 | ynh_print_info --message="Declaring files to be backed up..."
17 |
18 | #=================================================
19 | # BACKUP THE NGINX CONFIGURATION
20 | #=================================================
21 |
22 | ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
23 |
24 | #=================================================
25 | # BACKUP GITLAB DATABASE
26 | #=================================================
27 |
28 | # Use gitlab-backup to backup
29 | # For the complete doc: https://docs.gitlab.com/ce/raketasks/backup_restore.html
30 | # For the filename: https://docs.gitlab.com/ce/raketasks/backup_restore.html#backup-filename
31 | gitlab-backup create BACKUP=last
32 |
33 | ynh_backup --src_path="/var/opt/$app/backups/last_gitlab_backup.tar"
34 |
35 | #=================================================
36 | # BACKUP CONF FILES
37 | #=================================================
38 |
39 | config_path=/etc/$app
40 | ynh_backup --src_path="$config_path/gitlab-secrets.json"
41 | ynh_backup --src_path="$config_path/gitlab.rb"
42 | ynh_backup --src_path="$config_path/gitlab-persistent.rb"
43 |
44 | #=================================================
45 | # END OF SCRIPT
46 | #=================================================
47 |
48 | ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
49 |
--------------------------------------------------------------------------------
/scripts/change_url:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #=================================================
4 | # GENERIC STARTING
5 | #=================================================
6 | # IMPORT GENERIC HELPERS
7 | #=================================================
8 |
9 | source _common.sh
10 | source /usr/share/yunohost/helpers
11 |
12 | #=================================================
13 | # STANDARD MODIFICATIONS
14 | #=================================================
15 | # MODIFY URL IN NGINX CONF
16 | #=================================================
17 | ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
18 |
19 | #doc in: https://docs.gitlab.com/omnibus/settings/configuration.html#configure-the-external-url-for-gitlab
20 |
21 | ynh_change_url_nginx_config
22 |
23 | #=================================================
24 | # SPECIFIC MODIFICATIONS
25 | #=================================================
26 | # CHECK IF KERNEL IS READ-ONLY
27 | #=================================================
28 |
29 | modify_kernel_parameters="true"
30 |
31 | for value_to_check in "kernel.shmall" "kernel.shmmax" "kernel.sem" "net.core.somaxconn"
32 | do
33 | if ! ynh_exec_fully_quiet sysctl --write $value_to_check="$(sysctl --value $value_to_check)"; then
34 | modify_kernel_parameters="false"
35 | break
36 | fi
37 | done
38 |
39 | #=================================================
40 | # CONFIGURE GITLAB
41 | #=================================================
42 | ynh_script_progression --message="Configure GitLab..." --weight=28
43 |
44 | config_path=/etc/$app
45 | mkdir -p $config_path
46 | ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
47 | domain="$new_domain"
48 | path="$new_path"
49 |
50 | generated_external_url="https://$domain${path%/}"
51 |
52 | ynh_add_config --template="$YNH_APP_BASEDIR/conf/gitlab.rb" --destination="$config_path/gitlab.rb"
53 |
54 | #=================================================
55 | # RECONFIGURE GITLAB
56 | #=================================================
57 |
58 | ynh_exec_warn_less gitlab-ctl reconfigure
59 |
60 | #=================================================
61 | # WAITING GITLAB
62 | #=================================================
63 | ynh_script_progression --message="Waiting for GitLab..." --weight=15
64 |
65 | ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$port_puma" --timeout=300
66 |
67 | #=================================================
68 | # END OF SCRIPT
69 | #=================================================
70 |
71 | ynh_script_progression --message="Change of URL completed for GitLab" --last
72 |
--------------------------------------------------------------------------------
/scripts/config:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #=================================================
4 | # GENERIC STARTING
5 | #=================================================
6 | # IMPORT GENERIC HELPERS
7 | #=================================================
8 |
9 | source /usr/share/yunohost/helpers
10 |
11 | ynh_abort_if_errors
12 |
13 | #=================================================
14 | # RETRIEVE ARGUMENTS
15 | #=================================================
16 |
17 | #=================================================
18 | # SPECIFIC GETTERS FOR TOML SHORT KEY
19 | #=================================================
20 |
21 | #=================================================
22 | # SPECIFIC SETTERS FOR TOML SHORT KEYS
23 | #=================================================
24 |
25 | set__use_web_account() {
26 | if [ -n "${use_web_account}" ]
27 | then
28 | echo "ApplicationSetting.last.update(password_authentication_enabled_for_web: $use_web_account, signup_enabled: $use_web_account)" | gitlab-rails console
29 |
30 | # Update the config of the app
31 | ynh_app_setting_set --app=$app --key=use_web_account --value=$use_web_account
32 | fi
33 | }
34 |
35 | #=================================================
36 | # GENERIC FINALIZATION
37 | #=================================================
38 | ynh_app_config_run $1
--------------------------------------------------------------------------------
/scripts/install:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #=================================================
4 | # GENERIC START
5 | #=================================================
6 | # IMPORT GENERIC HELPERS
7 | #=================================================
8 |
9 | source _common.sh
10 | source /usr/share/yunohost/helpers
11 |
12 | #=================================================
13 | # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
14 | #=================================================
15 | ynh_script_progression --message="Validating installation parameters..." --weight=1
16 |
17 | config_path=/etc/$app
18 |
19 | # Detect the system architecture
20 | if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then
21 | architecture="arm64"
22 | elif [ -n "$(uname -m | grep x86_64)" ]; then
23 | architecture="x86-64"
24 | elif [ -n "$(uname -m | grep 86)" ]; then
25 | ynh_die "Gitlab is not compatible with x86 architecture"
26 | elif [ -n "$(uname -m | grep arm)" ]; then
27 | architecture="arm"
28 | else
29 | ynh_die --message="Unable to detect your achitecture, please open a bug describing \
30 | your hardware and the result of the command \"uname -m\"." 1
31 | fi
32 |
33 | # Could be an option?
34 | client_max_body_size="250m"
35 |
36 | #=================================================
37 | # STORE SETTINGS FROM MANIFEST
38 | #=================================================
39 | ynh_script_progression --message="Storing installation settings..." --weight=2
40 |
41 | ynh_app_setting_set --app=$app --key=architecture --value=$architecture
42 | ynh_app_setting_set --app=$app --key=client_max_body_size --value=$client_max_body_size
43 | ynh_app_setting_set --app=$app --key=overwrite_nginx --value="1"
44 | ynh_app_setting_set --key=protect_against_basic_auth_spoofing --value=false
45 |
46 | #=================================================
47 | # STANDARD MODIFICATIONS
48 | #=================================================
49 | # ADD SWAP IF NEEDED
50 | #=================================================
51 |
52 | total_ram=$(ynh_get_ram --total)
53 | swap_needed=0
54 |
55 | # https://docs.gitlab.com/ce/install/requirements.html#memory
56 | # Need at least 2Go of swap
57 | if [ $total_ram -lt 4096 ]; then
58 | swap_needed=2048
59 | fi
60 |
61 | if [ $swap_needed -gt 0 ]; then
62 | ynh_script_progression --message="Adding $swap_needed Mo to swap..."
63 | if ! ynh_add_swap --size=$swap_needed; then
64 | ynh_print_warn --message="Please add $swap_needed Mo to swap to make GitLab work properly"
65 | fi
66 | fi
67 |
68 | #=================================================
69 | # CHECK IF KERNEL IS READ-ONLY
70 | #=================================================
71 |
72 | modify_kernel_parameters="true"
73 |
74 | for value_to_check in "kernel.shmall" "kernel.shmmax" "kernel.sem" "net.core.somaxconn"
75 | do
76 | if ! ynh_exec_fully_quiet sysctl --write $value_to_check="$(sysctl --value $value_to_check)"; then
77 | modify_kernel_parameters="false"
78 | break
79 | fi
80 | done
81 |
82 | #=================================================
83 | # PRECONFIGURE GITLAB
84 | #=================================================
85 | ynh_script_progression --message="Preconfigure GitLab..." --weight=1
86 |
87 | mkdir -p $config_path
88 |
89 | touch "$config_path/gitlab-persistent.rb"
90 | chown root:root "$config_path/gitlab-persistent.rb"
91 | chmod 640 "$config_path/gitlab-persistent.rb"
92 |
93 | ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
94 |
95 | generated_external_url="https://$domain${path%/}"
96 |
97 | ynh_add_config --template="$YNH_APP_BASEDIR/conf/gitlab.rb" --destination="$config_path/gitlab.rb"
98 |
99 | #=================================================
100 | # DOWNLOAD, CHECK AND UNPACK SOURCE
101 | #=================================================
102 | ynh_script_progression --message="Setting up source files..." --weight=50
103 |
104 | source $YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.last.sh
105 | ynh_add_config --template="$YNH_APP_BASEDIR/conf/$architecture.src.default" --destination="$YNH_APP_BASEDIR/conf/$architecture.src"
106 |
107 | tempdir="$(mktemp -d)"
108 |
109 | ynh_setup_source --dest_dir=$tempdir --source_id=$architecture
110 |
111 | chmod 755 $install_dir
112 |
113 | # https://docs.gitlab.com/omnibus/settings/configuration.html#specify-the-external-url-at-the-time-of-installation
114 | EXTERNAL_URL="$generated_external_url" ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename
115 |
116 | ynh_secure_remove --file="$tempdir"
117 |
118 | #=================================================
119 | # NGINX CONFIGURATION
120 | #=================================================
121 | ynh_script_progression --message="Configuring NGINX web server..." --weight=2
122 |
123 | # Create a dedicated NGINX config
124 | ynh_add_nginx_config client_max_body_size
125 |
126 | #=================================================
127 | # SPECIFIC SETUP
128 | #=================================================
129 | # ADD USER AND CONFIGURE SIGN IN SYSTEM
130 | #=================================================
131 | ynh_script_progression --message="Creating an administrator user..." --weight=13
132 |
133 | mailAdmin=$(ynh_user_get_info --username=$admin --key=mail)
134 | fullnameAdmin=$(ynh_user_get_info --username=$admin --key=fullname)
135 | rdmPass=$(ynh_string_random --length=30)
136 |
137 | gitlab-rails runner "newuser = User.new(username: \"$admin\", email: \"$mailAdmin\", name: \"$fullnameAdmin\", password: \"$rdmPass\", admin: true, skip_confirmation: true);\
138 | newuser.assign_personal_namespace(Organizations::Organization.default_organization);\
139 | newuser.save!;\
140 | ApplicationSetting.last.update(password_authentication_enabled_for_web: $use_web_account, signup_enabled: $use_web_account);"
141 |
142 | #=================================================
143 | # RECONFIGURE TO TAKE INTO ACCOUNT CHANGES
144 | #=================================================
145 | ynh_script_progression --message="Reconfigure GitLab..." --weight=13
146 |
147 | ynh_exec_warn_less gitlab-ctl reconfigure
148 |
149 | # Allow ssh for git
150 | usermod -a -G "ssh.app" "git"
151 |
152 | #=================================================
153 | # GENERIC FINALIZATION
154 | #=================================================
155 | # ADVERTISE SERVICE IN ADMIN PANEL
156 | #=================================================
157 |
158 | yunohost service add "gitlab-runsvdir" --log "/var/log/$app/gitlab-rails/application.log" "/var/log/$app/gitlab-rails/api_json.log" "/var/log/$app/gitlab-rails/production.log" "/var/log/$app/gitlab-rails/production_json.log" "/var/log/$app/gitlab-rails/sidekiq.log" "/var/log/$app/puma/puma_stderr.log" "/var/log/$app/puma/current" "/var/log/$app/alertmanager/current" "/var/log/$app/gitaly/current" "/var/log/$app/gitlab-monitor/current" "/var/log/$app/gitlab-shell/gitlab-shell.log" "/var/log/$app/gitlab-workhorse/current" "/var/log/$app/logrotate/current" "/var/log/$app/nginx/current" "/var/log/$app/nginx/access.log" "/var/log/$app/nginx/error.log" "/var/log/$app/nginx/gitlab_access.log" "/var/log/$app/nginx/gitlab_error.log" "/var/log/$app/node-exporter/current" "/var/log/$app/postgres-exporter/current" "/var/log/$app/postgresql/current" "/var/log/$app/prometheus/current" "/var/log/$app/redis/current" "/var/log/$app/redis-exporter/current"
159 |
160 | #=================================================
161 | # RELOAD NGINX
162 | #=================================================
163 |
164 | ynh_systemd_action --action=reload --service_name=nginx
165 |
166 | #=================================================
167 | # RESTART GITLAB
168 | #=================================================
169 | ynh_script_progression --message="Restarting GitLab..." --weight=15
170 |
171 | ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$port_puma" --timeout=300
172 |
173 | #=================================================
174 | # END OF SCRIPT
175 | #=================================================
176 |
177 | ynh_script_progression --message="Installation of GitLab completed" --last
178 |
--------------------------------------------------------------------------------
/scripts/remove:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #=================================================
4 | # GENERIC START
5 | #=================================================
6 | # IMPORT GENERIC HELPERS
7 | #=================================================
8 |
9 | source _common.sh
10 | source /usr/share/yunohost/helpers
11 |
12 | # STANDARD REMOVE
13 | #=================================================
14 | # REMOVE SERVICE FROM ADMIN PANEL
15 | #=================================================
16 |
17 | if yunohost service status "gitlab-runsvdir" >/dev/null 2>&1
18 | then
19 | ynh_script_progression --message="Removing $app service" --weight=1
20 | yunohost service remove "gitlab-runsvdir"
21 | fi
22 |
23 | #=================================================
24 | # STOP GITLAB
25 | #=================================================
26 | ynh_script_progression --message="Stopping GitLab" --weight=8
27 |
28 | # I use gitlab-ctl and not ynh_systemd_action or systemctl to stop the service to avoid this error: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/common_installation_problems/README.md#reconfigure-freezes-at-ruby_blocksupervise_redis_sleep-action-run during the reinstall of the app
29 | gitlab-ctl stop
30 |
31 | #=================================================
32 | # REMOVE GITLAB
33 | #=================================================
34 | ynh_script_progression --message="Removing GitLab" --weight=4
35 |
36 | dpkg --remove gitlab-ce
37 |
38 | #=================================================
39 | # REMOVE APP MAIN DIR
40 | #=================================================
41 |
42 | # Remove the app directory securely
43 | config_path=/etc/$app
44 | ynh_secure_remove --file="$config_path"
45 |
46 | #=================================================
47 | # REMOVE NGINX CONFIGURATION
48 | #=================================================
49 | ynh_script_progression --message="Removing NGINX web server configuration" --weight=1
50 |
51 | # Remove the dedicated NGINX config
52 | ynh_remove_nginx_config
53 |
54 | #=================================================
55 | # SPECIFIC REMOVE
56 | #=================================================
57 | # REMOVE GITLAB FILES
58 | #=================================================
59 |
60 | ynh_secure_remove --file="/var/opt/$app"
61 |
62 | # Remove swap
63 | ynh_del_swap
64 |
65 | #=================================================
66 | # END OF SCRIPT
67 | #=================================================
68 |
69 | ynh_script_progression --message="Removal of GitLab completed" --last
70 |
--------------------------------------------------------------------------------
/scripts/restore:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #=================================================
4 | # GENERIC START
5 | #=================================================
6 | # IMPORT GENERIC HELPERS
7 | #=================================================
8 |
9 | #Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
10 | source ../settings/scripts/_common.sh
11 | source /usr/share/yunohost/helpers
12 |
13 | #=================================================
14 | # STANDARD RESTORATION STEPS
15 | #=================================================
16 | # RESTORE THE NGINX CONFIGURATION
17 | #=================================================
18 |
19 | ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
20 |
21 | #=================================================
22 | # ADD SWAP IF NEEDED
23 | #=================================================
24 |
25 | total_ram=$(ynh_get_ram --total)
26 | swap_needed=0
27 |
28 | # https://docs.gitlab.com/ce/install/requirements.html#memory
29 | # Need at least 2Go of swap
30 | if [ $total_ram -lt 4096 ]; then
31 | swap_needed=2048
32 | fi
33 |
34 | if [ $swap_needed -gt 0 ]; then
35 | ynh_script_progression --message="Adding $swap_needed Mo to swap..."
36 | if ! ynh_add_swap --size=$swap_needed; then
37 | ynh_print_warn --message="Please add $swap_needed Mo to swap to make GitLab work properly"
38 | fi
39 | fi
40 |
41 | #=================================================
42 | # RESTORE CONF FILES
43 | #=================================================
44 | ynh_script_progression --message="Restoring configuration files of GitLab..." --weight=1
45 |
46 | config_path=/etc/$app
47 | chmod 755 $install_dir
48 |
49 | ynh_restore_file --origin_path="$config_path/gitlab-secrets.json"
50 | ynh_restore_file --origin_path="$config_path/gitlab.rb"
51 | ynh_restore_file --origin_path="$config_path/gitlab-persistent.rb"
52 |
53 | #=================================================
54 | # RESTORE THE APP MAIN DIR
55 | #=================================================
56 | ynh_script_progression --message="Reinstalling GitLab..." --weight=50
57 |
58 | source $YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.last.sh
59 | ynh_add_config --template="$YNH_APP_BASEDIR/conf/$architecture.src.default" --destination="$YNH_APP_BASEDIR/conf/$architecture.src"
60 |
61 | tempdir="$(mktemp -d)"
62 |
63 | ynh_setup_source --dest_dir=$tempdir --source_id=$architecture
64 |
65 | if ! ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename ;
66 | then # This command will fail in lxc env
67 | package_check_action # defined in upgrade.d/upgrade.last.sh
68 | ynh_exec_warn_less dpkg --configure gitlab-ce
69 | fi
70 |
71 | #=================================================
72 | # SPECIFIC RESTORATION
73 | #=================================================
74 | # RESTORE GITLAB DATABASE
75 | #=================================================
76 | ynh_script_progression --message="Restoring GitLab..." --weight=35
77 |
78 | ynh_restore_file --origin_path="/var/opt/$app/backups/last_gitlab_backup.tar"
79 |
80 | last_backup="last"
81 |
82 | gitlab-ctl stop puma
83 | gitlab-ctl stop sidekiq
84 |
85 | # Use gitlab-rake to backup
86 | # Doc: https://docs.gitlab.com/ce/raketasks/backup_restore.html#restore-for-omnibus-gitlab-installations
87 | ynh_exec_warn_less gitlab-backup restore force=yes BACKUP=$last_backup
88 |
89 | # https://docs.gitlab.com/ce/raketasks/backup_restore.html#container-registry-push-failures-after-restoring-from-a-backup
90 | if ynh_system_user_exists --username="registry" && [ -d "/var/opt/gitlab/gitlab-rails/shared/registry/docker" ]; then
91 | chown -R registry:registry /var/opt/gitlab/gitlab-rails/shared/registry/docker
92 | fi
93 |
94 | #=================================================
95 | # GENERIC FINALIZATION
96 | #=================================================
97 | # ADVERTISE SERVICE IN ADMIN PANEL
98 | #=================================================
99 |
100 | yunohost service add "gitlab-runsvdir" --log "/var/log/$app/gitlab-rails/application.log" "/var/log/$app/gitlab-rails/api_json.log" "/var/log/$app/gitlab-rails/production.log" "/var/log/$app/gitlab-rails/production_json.log" "/var/log/$app/gitlab-rails/sidekiq.log" "/var/log/$app/puma/puma_stderr.log" "/var/log/$app/puma/current" "/var/log/$app/alertmanager/current" "/var/log/$app/gitaly/current" "/var/log/$app/gitlab-monitor/current" "/var/log/$app/gitlab-shell/gitlab-shell.log" "/var/log/$app/gitlab-workhorse/current" "/var/log/$app/logrotate/current" "/var/log/$app/nginx/current" "/var/log/$app/nginx/access.log" "/var/log/$app/nginx/error.log" "/var/log/$app/nginx/gitlab_access.log" "/var/log/$app/nginx/gitlab_error.log" "/var/log/$app/node-exporter/current" "/var/log/$app/postgres-exporter/current" "/var/log/$app/postgresql/current" "/var/log/$app/prometheus/current" "/var/log/$app/redis/current" "/var/log/$app/redis-exporter/current"
101 |
102 | #=================================================
103 | # WAITING GITLAB
104 | #=================================================
105 | ynh_script_progression --message="Waiting for GitLab..." --weight=14
106 |
107 | ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$port_puma" --timeout=300
108 |
109 | #=================================================
110 | # CHECK THE RESTORED DATA
111 | #=================================================
112 |
113 | gitlab-rake gitlab:check SANITIZE=true
114 |
115 | # Allow ssh for git
116 | usermod -a -G "ssh.app" "git"
117 |
118 | #=================================================
119 | # RELOAD NGINX
120 | #=================================================
121 | ynh_script_progression --message="Reloading NGINX web server..." --weight=1
122 |
123 | ynh_systemd_action --action=reload --service_name=nginx
124 |
125 | #=================================================
126 | # END OF SCRIPT
127 | #=================================================
128 |
129 | ynh_script_progression --message="Restoration completed for GitLab" --last
130 |
--------------------------------------------------------------------------------
/scripts/upgrade:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #=================================================
4 | # GENERIC START
5 | #=================================================
6 | # IMPORT GENERIC HELPERS
7 | #=================================================
8 |
9 | source _common.sh
10 | source /usr/share/yunohost/helpers
11 |
12 | #=================================================
13 | # CHECK VERSION
14 | #=================================================
15 |
16 | upgrade_type=$(ynh_check_app_version_changed)
17 |
18 | #=================================================
19 | # ENSURE DOWNWARD COMPATIBILITY
20 | #=================================================
21 |
22 | if [ -n $(ynh_app_setting_get --app=$app --key=web_port) ]
23 | then
24 | ynh_app_setting_set --app=$app --key=port --value=$(ynh_app_setting_get --app=$app --key=web_port)
25 | ynh_app_setting_delete --app=$app --key=web_port
26 | fi
27 |
28 | config_path=/etc/$app
29 | chmod 755 $install_dir
30 |
31 | if [ -n $(ynh_app_setting_get --app=$app --key=puma_worker_processes) ]
32 | then
33 | ynh_app_setting_delete --app=$app --key=puma_worker_processes
34 | fi
35 |
36 | if [ -n $(ynh_app_setting_get --app=$app --key=puma_max_threads) ]
37 | then
38 | ynh_app_setting_delete --app=$app --key=puma_max_threads
39 | fi
40 |
41 | if [ -n $(ynh_app_setting_get --app=$app --key=puma_min_threads) ]
42 | then
43 | ynh_app_setting_delete --app=$app --key=puma_min_threads
44 | fi
45 |
46 | # If architecture doesn't exist, create it
47 | if [ -z "$architecture" ]; then
48 | if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then
49 | architecture="arm64"
50 | elif [ -n "$(uname -m | grep x86_64)" ]; then
51 | architecture="x86-64"
52 | elif [ -n "$(uname -m | grep 86)" ]; then
53 | ynh_die "GitLab is not compatible with x86 architecture"
54 | elif [ -n "$(uname -m | grep arm)" ]; then
55 | architecture="arm"
56 | else
57 | ynh_die --message="Unable to detect your achitecture, please open a bug describing \
58 | your hardware and the result of the command \"uname -m\"." 1
59 | fi
60 | ynh_app_setting_set --app=$app --key=architecture --value=$architecture
61 | fi
62 |
63 | # If client_max_body_size doesn't exist, create it
64 | if [ -z "$client_max_body_size" ]; then
65 | client_max_body_size="250m"
66 | ynh_app_setting_set --app=$app --key=client_max_body_size --value=$client_max_body_size
67 | fi
68 |
69 | # if this source file exist, remove it
70 | if [ -e "/etc/apt/sources.list.d/gitlab-ce.list" ]; then
71 | ynh_secure_remove --file="/etc/apt/sources.list.d/gitlab-ce.list"
72 | fi
73 |
74 | ynh_app_setting_set --key=protect_against_basic_auth_spoofing --value=false
75 |
76 | #=================================================
77 | # STANDARD UPGRADE STEPS
78 | #=================================================
79 | # ADD SWAP IF NEEDED
80 | #=================================================
81 |
82 | total_ram=$(ynh_get_ram --total)
83 | swap_needed=0
84 |
85 | # https://docs.gitlab.com/ce/install/requirements.html#memory
86 | # Need at least 2Go of swap
87 | if [ $total_ram -lt 4096 ]; then
88 | swap_needed=2048
89 | fi
90 |
91 | if [ $swap_needed -gt 0 ]; then
92 | ynh_script_progression --message="Adding $swap_needed Mo to swap..."
93 | if ! ynh_add_swap --size=$swap_needed; then
94 | ynh_print_warn --message="Please add $swap_needed Mo to swap to make GitLab work properly"
95 | fi
96 | fi
97 |
98 | #=================================================
99 | # CHECK IF KERNEL IS READ-ONLY
100 | #=================================================
101 |
102 | modify_kernel_parameters="true"
103 |
104 | for value_to_check in "kernel.shmall" "kernel.shmmax" "kernel.sem" "net.core.somaxconn"
105 | do
106 | if ! ynh_exec_fully_quiet sysctl --write $value_to_check="$(sysctl --value $value_to_check)"; then
107 | modify_kernel_parameters="false"
108 | break
109 | fi
110 | done
111 |
112 | # For gitlab rb
113 |
114 | mkdir -p $config_path
115 | ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
116 |
117 | generated_external_url="https://$domain${path%/}"
118 |
119 | #=================================================
120 | # DOWNLOAD, CHECK AND UNPACK SOURCE
121 | #=================================================
122 |
123 | if [ "$upgrade_type" == "UPGRADE_APP" ]
124 | then
125 | ynh_script_progression --message="Setting up source files..." --weight=50
126 |
127 | # To avoid the automatic backup, already performed by YunoHost: https://docs.gitlab.com/omnibus/update/#updating-methods
128 | touch $config_path/skip-auto-backup
129 |
130 | current_version=$(grep gitlab-ce /opt/gitlab/version-manifest.txt | cut -d' ' -f2)
131 |
132 | # Load the last available version
133 | source $YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.last.sh
134 | last_version=$gitlab_version
135 |
136 | source_next_version () {
137 | # We start with the upgrade.$current_major_version.first.sh
138 | if [ -e "$YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.$current_major_version.first.sh" ]; then
139 | source $YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.$current_major_version.first.sh
140 | if dpkg --compare-versions "$gitlab_version" "gt" "$current_version"; then
141 | return
142 | fi
143 | fi
144 |
145 | # Then upgrade to all minor versions
146 | for minor_verion in $(ls $YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.$current_major_version* | grep -v -E ".first.sh$|.last.sh$" | sed -e "s@$YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.$current_major_version.@@" -e "s/.sh$//" | sort)
147 | do
148 | source $YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.$current_major_version.$minor_verion.sh
149 | if dpkg --compare-versions "$gitlab_version" "gt" "$current_version"
150 | then
151 | return
152 | fi
153 | done
154 |
155 | # Then end with upgrade.$current_major_version.last.sh
156 | if [ -e "$YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.$current_major_version.last.sh" ]; then
157 | source $YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.$current_major_version.last.sh
158 | if dpkg --compare-versions "$gitlab_version" "gt" "$current_version"
159 | then
160 | return
161 | fi
162 | else
163 | source $YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.last.sh
164 | if dpkg --compare-versions "$gitlab_version" "gt" "$current_version"
165 | then
166 | return
167 | fi
168 | fi
169 | # Increment the major version to upgrade to the next version
170 | if dpkg --compare-versions "$gitlab_version" "le" "$current_version"; then
171 | current_major_version=$(($current_major_version + 1))
172 | source_next_version
173 | fi
174 | }
175 |
176 | # To upgrade GitLab from a major version A to a major version B,
177 | # we need to follow a specific path described here https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/
178 | # A.last -> B.first -> -> B.X -> B.Y -> B.last
179 |
180 | # While the current version is not the last version, do an upgrade
181 | while [ "$last_version" != "$current_version" ]
182 | do
183 | # https://docs.gitlab.com/ee/update/background_migrations.html
184 | if dpkg --compare-versions "$current_version" "ge" "15.1"; then
185 | checkBatchedBackgroundMigration=1
186 | checkBackgroundMigration=0
187 | else
188 | checkBatchedBackgroundMigration=0
189 | checkBackgroundMigration=1
190 | fi
191 |
192 | counter=0
193 | while [ $checkBackgroundMigration -eq 1 ] || [ $checkBatchedBackgroundMigration -eq 1 ]
194 | do
195 | counter=$((counter + 1))
196 | if [ $counter -gt 1200 ]
197 | then
198 | ynh_print_warn --message="Timeout: a background migration runs for at least 20min !"
199 | break
200 | fi
201 |
202 | if [ $checkBackgroundMigration -eq 1 ] && ((gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining' | grep -q -w 0) || (gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.queued.count' | grep -q -w 0))
203 | then
204 | checkBackgroundMigration=0
205 | fi
206 |
207 | if [ $checkBatchedBackgroundMigration -eq 1 ] && gitlab-psql -c "SELECT job_class_name, table_name, column_name, job_arguments FROM batched_background_migrations WHERE status NOT IN(3, 6);" | grep -q -w 0
208 | then
209 | checkBatchedBackgroundMigration=0
210 | fi
211 | ynh_print_info --message="Wait for the migration in the background to finish"
212 | sleep 1
213 | done
214 |
215 | current_major_version=${current_version%%.*}
216 |
217 | source_next_version
218 |
219 | ynh_print_info --message="Upgrade from ${current_version} to ${gitlab_version}"
220 |
221 | ynh_add_config --template="$YNH_APP_BASEDIR/conf/$architecture.src.default" --destination="$YNH_APP_BASEDIR/conf/$architecture.src"
222 |
223 | tempdir="$(mktemp -d)"
224 |
225 | ynh_setup_source --dest_dir=$tempdir --source_id=$architecture
226 |
227 | if ! ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename; then # This command will fail in lxc env
228 | package_check_action # defined in upgrade.d/upgrade.X.sh
229 | ynh_exec_warn_less dpkg --configure gitlab-ce
230 | fi
231 |
232 | ynh_exec_warn_less ynh_secure_remove --file="$tempdir"
233 |
234 | current_version=$(grep gitlab-ce /opt/gitlab/version-manifest.txt | cut -d' ' -f2)
235 |
236 | # Sometimes we need to update the gitlab.rb configuration file in order to migrate to the next version.
237 | if [ -e "$YNH_APP_BASEDIR/conf/gitlab.$current_major_version.rb" ]; then
238 | if [ -e "$YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.$current_major_version.last.sh" ]; then
239 | source $YNH_APP_BASEDIR/scripts/upgrade.d/upgrade.$current_major_version.last.sh
240 | fi
241 | if dpkg --compare-versions "$gitlab_version" "ge" "$current_version"; then
242 | ynh_add_config --template="$YNH_APP_BASEDIR/conf/gitlab.$current_major_version.rb" --destination="$config_path/gitlab.rb"
243 |
244 | touch "$config_path/gitlab-persistent.rb"
245 | chown root:root "$config_path/gitlab-persistent.rb"
246 | chmod 640 "$config_path/gitlab-persistent.rb"
247 |
248 | # During large migrations, the logs are too big to be sent to paste.yunohost.org
249 | # Send the reconfigure logs in a file, and if the process succeeds, just delete it.
250 | gitlab-ctl reconfigure > "/tmp/gitlab_upgrade_$current_version.log"
251 | ynh_secure_remove --file="/tmp/gitlab_upgrade_$current_version.log"
252 | fi
253 | fi
254 | done
255 | fi
256 |
257 | #=================================================
258 | # RECONFIGURE GITLAB
259 | #=================================================
260 | ynh_script_progression --message="Reconfigure GitLab..." --weight=13
261 |
262 | ynh_add_config --template="$YNH_APP_BASEDIR/conf/gitlab.rb" --destination="$config_path/gitlab.rb"
263 |
264 | touch "$config_path/gitlab-persistent.rb"
265 | chown root:root "$config_path/gitlab-persistent.rb"
266 | chmod 640 "$config_path/gitlab-persistent.rb"
267 |
268 | ynh_exec_warn_less gitlab-ctl reconfigure
269 |
270 | # Allow ssh for git
271 | usermod -a -G "ssh.app" "git"
272 |
273 | #=================================================
274 | # NGINX CONFIGURATION
275 | #=================================================
276 |
277 | # Overwrite the nginx configuration only if it's allowed
278 | if [ $overwrite_nginx -eq 1 ]
279 | then
280 | ynh_script_progression --message="Configuring NGINX web server..." --weight=2
281 | # Create a dedicated nginx config
282 | ynh_add_nginx_config client_max_body_size
283 | fi
284 |
285 | #=================================================
286 | # GENERIC FINALIZATION
287 | #=================================================
288 | # ADVERTISE SERVICE IN ADMIN PANEL
289 | #=================================================
290 |
291 | yunohost service add "gitlab-runsvdir" --log "/var/log/$app/gitlab-rails/application.log" "/var/log/$app/gitlab-rails/api_json.log" "/var/log/$app/gitlab-rails/production.log" "/var/log/$app/gitlab-rails/production_json.log" "/var/log/$app/gitlab-rails/sidekiq.log" "/var/log/$app/puma/puma_stderr.log" "/var/log/$app/puma/current" "/var/log/$app/alertmanager/current" "/var/log/$app/gitaly/current" "/var/log/$app/gitlab-monitor/current" "/var/log/$app/gitlab-shell/gitlab-shell.log" "/var/log/$app/gitlab-workhorse/current" "/var/log/$app/logrotate/current" "/var/log/$app/nginx/current" "/var/log/$app/nginx/access.log" "/var/log/$app/nginx/error.log" "/var/log/$app/nginx/gitlab_access.log" "/var/log/$app/nginx/gitlab_error.log" "/var/log/$app/node-exporter/current" "/var/log/$app/postgres-exporter/current" "/var/log/$app/postgresql/current" "/var/log/$app/prometheus/current" "/var/log/$app/redis/current" "/var/log/$app/redis-exporter/current"
292 |
293 | #=================================================
294 | # WAITING GITLAB
295 | #=================================================
296 |
297 | if [ "$upgrade_type" == "UPGRADE_APP" ]
298 | then
299 | ynh_script_progression --message="Restarting GitLab..." --weight=15
300 |
301 | ynh_systemd_action --action=restart --service_name="gitlab-runsvdir" --log_path="/var/log/$app/puma/current" --line_match="Listening on http://127.0.0.1:$port_puma" --timeout=300
302 | fi
303 |
304 | #=================================================
305 | # RELOAD NGINX
306 | #=================================================
307 |
308 | ynh_systemd_action --action=reload --service_name=nginx
309 |
310 | #=================================================
311 | # END OF SCRIPT
312 | #=================================================
313 |
314 | ynh_script_progression --message="Upgrade of GitLab completed" --last
315 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.11.last.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="11.11.5"
4 |
5 | # There is no buster version for gitlab 11.X
6 | gitlab_debian_version="stretch"
7 |
8 | gitlab_x86_64_stretch_source_sha256="1ee3d6e8d2cc198f5466de0884c03f6016299db24859126af9a191501dbdef10"
9 |
10 | gitlab_arm_stretch_source_sha256="366e12b1f3d3b1694fcb6f13da9de908360ba93f75768d97e8d01e61e8652705"
11 |
12 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
13 |
14 | if [ "$architecture" = "x86-64" ]; then
15 | gitlab_source_sha256=$gitlab_x86_64_stretch_source_sha256
16 | elif [ "$architecture" = "arm" ]; then
17 | gitlab_source_sha256=$gitlab_arm_stretch_source_sha256
18 | fi
19 |
20 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
21 |
22 | # Action to do in case of failure of the package_check
23 | package_check_action() {
24 | local sysctl_file="$final_path/embedded/cookbooks/package/resources/sysctl.rb"
25 | ynh_replace_string --match_string="command \"sysctl -e \(.*\)\"" --replace_string="command \"sysctl -e \1 || true\"" --target_file=$sysctl_file
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.12.first.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # It's required to upgrade to the latest 12.0.x version before to another 12.X verion.
4 | gitlab_version="12.0.12"
5 |
6 | # There is no buster version for gitlab 12.0.X
7 | gitlab_debian_version="stretch"
8 |
9 | gitlab_x86_64_stretch_source_sha256="e80cda4c328c2627278a3d74dbdd53420e1fec9ecbeaeb5d4dcb4773726e5904"
10 |
11 | gitlab_arm_stretch_source_sha256="a0862e3c31b61d9274a55b7307d15daa5258473ccb97b8ae0d807f7474c971df"
12 |
13 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
14 |
15 | if [ "$architecture" = "x86-64" ]; then
16 | gitlab_source_sha256=$gitlab_x86_64_stretch_source_sha256
17 | elif [ "$architecture" = "arm" ]; then
18 | gitlab_source_sha256=$gitlab_arm_stretch_source_sha256
19 | fi
20 |
21 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
22 |
23 | # Action to do in case of failure of the package_check
24 | package_check_action() {
25 | local sysctl_file="$final_path/embedded/cookbooks/package/resources/sysctl.rb"
26 | ynh_replace_string --match_string="command \"sysctl -e \(.*\)\"" --replace_string="command \"sysctl -e \1 || true\"" --target_file=$sysctl_file
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.12.last.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="12.10.12"
4 |
5 | # sha256sum found here: https://packages.gitlab.com/gitlab
6 |
7 | gitlab_x86_64_buster_source_sha256="17df2dfa71678109f7f1031b43d7c4e30ae34749258b9f48dd49380dd9cc3488"
8 |
9 | gitlab_x86_64_stretch_source_sha256="fbe744d04544465f6c97fd6fbc0dc11fb36ce2a75c4e943d911027b189634bee"
10 |
11 | gitlab_arm_stretch_source_sha256="43fc988516251295653d660b927a311593c22df31b58e5d3d91f40c8164a08ee"
12 |
13 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
14 |
15 | if [ "$architecture" = "x86-64" ]; then
16 | gitlab_debian_version="$(lsb_release -sc)"
17 |
18 | if [ "$gitlab_debian_version" = "bullseye" ]
19 | then
20 | gitlab_debian_version="buster"
21 | fi
22 | if [ "$gitlab_debian_version" = "buster" ]
23 | then
24 | gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
25 | else
26 | gitlab_source_sha256=$gitlab_x86_64_stretch_source_sha256
27 | fi
28 | elif [ "$architecture" = "arm" ]; then
29 | gitlab_debian_version="stretch"
30 |
31 | gitlab_source_sha256=$gitlab_arm_stretch_source_sha256
32 | fi
33 |
34 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
35 |
36 | # Action to do in case of failure of the package_check
37 | package_check_action() {
38 | local sysctl_file="$final_path/embedded/cookbooks/package/resources/gitlab_sysctl.rb"
39 | ynh_replace_string --match_string="command \"sysctl -e \(.*\)\"" --replace_string="command \"sysctl -e \1 || true\"" --target_file=$sysctl_file
40 |
41 | sysctl_file="/opt/gitlab/embedded/cookbooks/package/recipes/sysctl.rb"
42 | ynh_replace_string --match_string="command \"sysctl -e \(.*\)\"" --replace_string="command \"sysctl -e \1 || true\"" --target_file=$sysctl_file
43 | }
44 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.13.first.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # It's required to upgrade to the latest 13.0.x version before to another 13.X verion.
4 | gitlab_version="13.0.12"
5 |
6 | # sha256sum found here: https://packages.gitlab.com/gitlab
7 |
8 | gitlab_x86_64_buster_source_sha256="b568a8f45fdcb0c94e125fcc1e393e3f7364a4ab04d195bcf9b0797e71e0a8dd"
9 |
10 | gitlab_x86_64_stretch_source_sha256="464b3d5923d945856fc851d0a01fc43fe223003a32a80bf90a84b599009fdce7"
11 |
12 | gitlab_arm_stretch_source_sha256="39d7af79b80da73f26c8d2fa1ff95dfbca1573d36d6ee362e6f8fadceb17325e"
13 |
14 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
15 |
16 | if [ "$architecture" = "x86-64" ]; then
17 | gitlab_debian_version="$(lsb_release -sc)"
18 |
19 | if [ "$gitlab_debian_version" = "bullseye" ]
20 | then
21 | gitlab_debian_version="buster"
22 | fi
23 | if [ "$gitlab_debian_version" = "buster" ]
24 | then
25 | gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
26 | else
27 | gitlab_source_sha256=$gitlab_x86_64_stretch_source_sha256
28 | fi
29 | elif [ "$architecture" = "arm" ]; then
30 | gitlab_debian_version="stretch"
31 |
32 | gitlab_source_sha256=$gitlab_arm_stretch_source_sha256
33 | fi
34 |
35 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
36 |
37 | # Action to do in case of failure of the package_check
38 | package_check_action() {
39 | local sysctl_file="$final_path/embedded/cookbooks/package/resources/gitlab_sysctl.rb"
40 | ynh_replace_string --match_string="command \"sysctl -e \(.*\)\"" --replace_string="command \"sysctl -e \1 || true\"" --target_file=$sysctl_file
41 |
42 | sysctl_file="/opt/gitlab/embedded/cookbooks/package/recipes/sysctl.rb"
43 | ynh_replace_string --match_string="command \"sysctl -e \(.*\)\"" --replace_string="command \"sysctl -e \1 || true\"" --target_file=$sysctl_file
44 | }
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.13.last.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="13.12.12"
4 |
5 | # sha256sum found here: https://packages.gitlab.com/gitlab
6 | gitlab_debian_version="buster"
7 |
8 | gitlab_x86_64_buster_source_sha256="75c74c2d7257d4247e5b0bc0aee774e616f69b58c25f1b48fba097078e971955"
9 |
10 | gitlab_arm64_buster_source_sha256="942191e6f4d4cbce90774c6ec294f6b9322a6c42d1b836826af752af76c88e31"
11 |
12 | gitlab_arm_buster_source_sha256="5ebc80181520ab24efe46842d41ada153d3970fd7164e2875afb37de85f2900e"
13 |
14 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
15 |
16 | if [ "$architecture" = "x86-64" ]; then
17 | gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
18 | elif [ "$architecture" = "arm64" ]; then
19 | gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
20 | elif [ "$architecture" = "arm" ]; then
21 | gitlab_source_sha256=$gitlab_arm_buster_source_sha256
22 | fi
23 |
24 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
25 |
26 | # Action to do in case of failure of the package_check
27 | package_check_action() {
28 | ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
29 | cat <> "$config_path/gitlab.rb"
30 | # Last chance to fix Gitlab
31 | package['modify_kernel_parameters'] = false
32 | EOF
33 | ynh_store_file_checksum --file="$config_path/gitlab.rb"
34 | }
35 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.14.first.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="14.0.11"
4 |
5 | # sha256sum found here: https://packages.gitlab.com/gitlab
6 | gitlab_debian_version="buster"
7 |
8 | gitlab_x86_64_buster_source_sha256="b001ff2bf406e44a85e0c799e4cbddb8bc3ccef07246502f7f267032aa77263d"
9 |
10 | gitlab_arm64_buster_source_sha256="f8d7a9ca77520b7ec045f414a7ac7b28407b9aa8a3825e50cb63cd877e91196a"
11 |
12 | gitlab_arm_buster_source_sha256="5f1de707c840e4a518e99c89b0e90a5c21c32cac91e853f1e12ef054696100dd"
13 |
14 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
15 |
16 | if [ "$architecture" = "x86-64" ]; then
17 | gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
18 | elif [ "$architecture" = "arm64" ]; then
19 | gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
20 | elif [ "$architecture" = "arm" ]; then
21 | gitlab_source_sha256=$gitlab_arm_buster_source_sha256
22 | fi
23 |
24 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
25 |
26 | # Action to do in case of failure of the package_check
27 | package_check_action() {
28 | ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
29 | cat <> "$config_path/gitlab.rb"
30 | # Last chance to fix Gitlab
31 | package['modify_kernel_parameters'] = false
32 | EOF
33 | ynh_store_file_checksum --file="$config_path/gitlab.rb"
34 | }
35 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.14.last.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="14.10.5"
4 |
5 | # sha256sum found here: https://packages.gitlab.com/gitlab
6 | gitlab_debian_version="$(lsb_release -sc)"
7 |
8 | gitlab_x86_64_bullseye_source_sha256="75a4a53afe53e8c0286523b2067c79da629b14afd1142ae5ed838945a80530e5"
9 | gitlab_x86_64_buster_source_sha256="1462b565780412f9f5776ac85cf2e07fe31d94af156a9232abfad280b1162dbc"
10 |
11 | gitlab_arm64_bullseye_source_sha256="03148ca8b71505545be74cc2aed14f2f252eadfb7c7a2c30f4da9d650f5e8fc8"
12 | gitlab_arm64_buster_source_sha256="bbb08026c00c00d6f8f797e15cc8b9d29baaab66d6ddf5642689b3321ed4a8c3"
13 |
14 | gitlab_arm_buster_source_sha256="24a1c3089bc2836591a153a38a04ae8e0f8807d7e877e5d7fa64987f84699d56"
15 |
16 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
17 |
18 | if [ "$architecture" = "x86-64" ]; then
19 | if [ "$gitlab_debian_version" = "bullseye" ]
20 | then
21 | gitlab_source_sha256=$gitlab_x86_64_bullseye_source_sha256
22 | elif [ "$gitlab_debian_version" = "buster" ]
23 | then
24 | gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
25 | fi
26 | elif [ "$architecture" = "arm64" ]; then
27 | if [ "$gitlab_debian_version" = "bullseye" ]
28 | then
29 | gitlab_source_sha256=$gitlab_arm64_bullseye_source_sha256
30 | elif [ "$gitlab_debian_version" = "buster" ]
31 | then
32 | gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
33 | fi
34 | elif [ "$architecture" = "arm" ]; then
35 | gitlab_source_sha256=$gitlab_arm_buster_source_sha256
36 | fi
37 |
38 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
39 |
40 | # Action to do in case of failure of the package_check
41 | package_check_action() {
42 | ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
43 | cat <> "$config_path/gitlab.rb"
44 | # Last chance to fix Gitlab
45 | package['modify_kernel_parameters'] = false
46 | EOF
47 | ynh_store_file_checksum --file="$config_path/gitlab.rb"
48 | }
49 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.15.4.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="15.4.6"
4 |
5 | # sha256sum found here: https://packages.gitlab.com/gitlab
6 | gitlab_debian_version="$(lsb_release -sc)"
7 |
8 | gitlab_x86_64_bullseye_source_sha256="1e328997adb13fca9fb829218d6556c14065d9889997e6b7330f554cf812455a"
9 | gitlab_x86_64_buster_source_sha256="9fd1cc1fde6dbc1ec3c5528eea74f57c355f098ed26d5ad914ce30e2acd5764e"
10 |
11 | gitlab_arm64_bullseye_source_sha256="fff8625d2cbdb45bc3d90e4414ac6b4b9023a24526ab73f0f86d7177e3129915"
12 | gitlab_arm64_buster_source_sha256="3c35b28717a06b17ce7854c76d0ab35dc73554061ad3881170be68b072a53cf7"
13 |
14 | gitlab_arm_buster_source_sha256="33a60e701921117542de771b8c0e2c83c7cbd2730f199e4c88c8adc6eb1c4579"
15 |
16 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
17 |
18 | if [ "$architecture" = "x86-64" ]; then
19 | if [ "$gitlab_debian_version" = "bullseye" ]
20 | then
21 | gitlab_source_sha256=$gitlab_x86_64_bullseye_source_sha256
22 | elif [ "$gitlab_debian_version" = "buster" ]
23 | then
24 | gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
25 | fi
26 | elif [ "$architecture" = "arm64" ]; then
27 | if [ "$gitlab_debian_version" = "bullseye" ]
28 | then
29 | gitlab_source_sha256=$gitlab_arm64_bullseye_source_sha256
30 | elif [ "$gitlab_debian_version" = "buster" ]
31 | then
32 | gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
33 | fi
34 | elif [ "$architecture" = "arm" ]; then
35 | gitlab_source_sha256=$gitlab_arm_buster_source_sha256
36 | fi
37 |
38 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
39 |
40 | # Action to do in case of failure of the package_check
41 | package_check_action() {
42 | ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
43 | cat <> "$config_path/gitlab.rb"
44 | # Last chance to fix Gitlab
45 | package['modify_kernel_parameters'] = false
46 | EOF
47 | ynh_store_file_checksum --file="$config_path/gitlab.rb"
48 | }
49 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.15.first.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="15.0.4"
4 |
5 | # sha256sum found here: https://packages.gitlab.com/gitlab
6 | gitlab_debian_version="$(lsb_release -sc)"
7 |
8 | gitlab_x86_64_bullseye_source_sha256="2958fc7f986ab0f6d71d297a0f9d1eca65b25c7a2da176c607db75f056cef5ca"
9 | gitlab_x86_64_buster_source_sha256="0c803fb16d4a3767cb9d29c9b7fd01480d203b0e633626692ec1b2cfab4e06dd"
10 |
11 | gitlab_arm64_bullseye_source_sha256="c9b5e4e8ce80f72f750bf0d9cbebcbc9042be8176eb805661db8f92e48041460"
12 | gitlab_arm64_buster_source_sha256="28caaa6bb0c55f06cfaf93ffea22d0567bfc1d5395a44bc2549318655b5243c8"
13 |
14 | gitlab_arm_buster_source_sha256="49a1d860eb533baa3e2037b0dd73ada0e5c6709ac4c9d53db2d045bc385f0292"
15 |
16 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
17 |
18 | if [ "$architecture" = "x86-64" ]; then
19 | if [ "$gitlab_debian_version" = "bullseye" ]
20 | then
21 | gitlab_source_sha256=$gitlab_x86_64_bullseye_source_sha256
22 | elif [ "$gitlab_debian_version" = "buster" ]
23 | then
24 | gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
25 | fi
26 | elif [ "$architecture" = "arm64" ]; then
27 | if [ "$gitlab_debian_version" = "bullseye" ]
28 | then
29 | gitlab_source_sha256=$gitlab_arm64_bullseye_source_sha256
30 | elif [ "$gitlab_debian_version" = "buster" ]
31 | then
32 | gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
33 | fi
34 | elif [ "$architecture" = "arm" ]; then
35 | gitlab_source_sha256=$gitlab_arm_buster_source_sha256
36 | fi
37 |
38 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
39 |
40 | # Action to do in case of failure of the package_check
41 | package_check_action() {
42 | ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
43 | cat <> "$config_path/gitlab.rb"
44 | # Last chance to fix Gitlab
45 | package['modify_kernel_parameters'] = false
46 | EOF
47 | ynh_store_file_checksum --file="$config_path/gitlab.rb"
48 | }
49 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.15.last.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="15.11.13"
4 |
5 | # sha256sum found here: https://packages.gitlab.com/gitlab
6 | gitlab_debian_version="$(lsb_release -sc)"
7 |
8 | gitlab_x86_64_bullseye_source_sha256="5c3cbe468cca4f1c90a53d59ffaeac147cb72c46eb5c48c4a3c235217c66d28d"
9 | gitlab_x86_64_buster_source_sha256="f8fd655c4e034c79ce2b2920f36b9a9aa6e796fde9861467e74e9de0fe87cabd"
10 |
11 | gitlab_arm64_bullseye_source_sha256="82dbb4b1084b6599b4cc01b085a70ae0a53b837be10573696ddd9dc51f337a65"
12 | gitlab_arm64_buster_source_sha256="725176c1dded56fc97ebf9c5eb4f1a1866302e5609c45934228a0226d919bb3e"
13 |
14 | gitlab_arm_buster_source_sha256="562a6db5270847d5aafb7e6c216746b9b9da22e5074bd431b6bd6444f89a768f"
15 | gitlab_arm_bullseye_source_sha256="cdd8cad053f8faa6cc33efda5e77e8698eec0c019c20b316ac19c5cb008022b0"
16 |
17 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
18 |
19 | if [ "$architecture" = "x86-64" ]; then
20 | if [ "$gitlab_debian_version" = "bullseye" ]
21 | then
22 | gitlab_source_sha256=$gitlab_x86_64_bullseye_source_sha256
23 | elif [ "$gitlab_debian_version" = "buster" ]
24 | then
25 | gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
26 | fi
27 | elif [ "$architecture" = "arm64" ]; then
28 | if [ "$gitlab_debian_version" = "bullseye" ]
29 | then
30 | gitlab_source_sha256=$gitlab_arm64_bullseye_source_sha256
31 | elif [ "$gitlab_debian_version" = "buster" ]
32 | then
33 | gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
34 | fi
35 | elif [ "$architecture" = "arm" ]; then
36 | if [ "$gitlab_debian_version" = "bullseye" ]
37 | then
38 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
39 | elif [ "$gitlab_debian_version" = "buster" ]
40 | then
41 | gitlab_source_sha256=$gitlab_arm_buster_source_sha256
42 | fi
43 | fi
44 |
45 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
46 |
47 | # Action to do in case of failure of the package_check
48 | package_check_action() {
49 | ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
50 | cat <> "$config_path/gitlab.rb"
51 | # Last chance to fix Gitlab
52 | package['modify_kernel_parameters'] = false
53 | EOF
54 | ynh_store_file_checksum --file="$config_path/gitlab.rb"
55 | }
56 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.16.3.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="16.3.7"
4 |
5 | # sha256sum found here: https://packages.gitlab.com/gitlab
6 | gitlab_debian_version="$(lsb_release -sc)"
7 |
8 | gitlab_x86_64_bullseye_source_sha256="4e702837d3e2add5a129ffb11828b53e17cbe4d8f1d33f748de52f869ec0d142"
9 | gitlab_x86_64_buster_source_sha256="21e18b883189b670ab1c67cc5cc9b238ad1b101e0caed2618183f440e795dff6"
10 |
11 | gitlab_arm64_bullseye_source_sha256="9189a30575b2d5a51a2304307c46eb4e5924cec1fbe0344b24715eae417976b7"
12 | gitlab_arm64_buster_source_sha256="d4197c6b76141939d2cfa7770f1723203564debd31b366762fc125d92babb2f2"
13 |
14 | gitlab_arm_buster_source_sha256="57d0934b4c603aac247a013fa4226a362684c8e7e9595359e6c858bf2f461443"
15 | gitlab_arm_bullseye_source_sha256="b311a008bae9a4ff23568bac847bf0e4571d201bc65ff305d58e7121b5bebd49"
16 |
17 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
18 |
19 | if [ "$architecture" = "x86-64" ]; then
20 | if [ "$gitlab_debian_version" = "bullseye" ]
21 | then
22 | gitlab_source_sha256=$gitlab_x86_64_bullseye_source_sha256
23 | elif [ "$gitlab_debian_version" = "buster" ]
24 | then
25 | gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
26 | fi
27 | elif [ "$architecture" = "arm64" ]; then
28 | if [ "$gitlab_debian_version" = "bullseye" ]
29 | then
30 | gitlab_source_sha256=$gitlab_arm64_bullseye_source_sha256
31 | elif [ "$gitlab_debian_version" = "buster" ]
32 | then
33 | gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
34 | fi
35 | elif [ "$architecture" = "arm" ]; then
36 | if [ "$gitlab_debian_version" = "bullseye" ]
37 | then
38 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
39 | elif [ "$gitlab_debian_version" = "buster" ]
40 | then
41 | gitlab_source_sha256=$gitlab_arm_buster_source_sha256
42 | fi
43 | fi
44 |
45 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
46 |
47 | # Action to do in case of failure of the package_check
48 | package_check_action() {
49 | ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
50 | cat <> "$config_path/gitlab.rb"
51 | # Last chance to fix Gitlab
52 | package['modify_kernel_parameters'] = false
53 | EOF
54 | ynh_store_file_checksum --file="$config_path/gitlab.rb"
55 | }
56 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.16.7.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="16.7.10"
4 |
5 | # sha256sum found here: https://packages.gitlab.com/gitlab
6 | gitlab_debian_version="$(lsb_release -sc)"
7 |
8 | gitlab_x86_64_bullseye_source_sha256="db442d21fc9f653a66990848e61fb5989902f06ca274cd194670082837338af9"
9 | gitlab_x86_64_buster_source_sha256="1a010819d9c4befadd576b9cba5a2c8cb179dc87169f9ba12492e953fbd9b0e1"
10 |
11 | gitlab_arm64_bullseye_source_sha256="1873eb333148c2b786697c81c317cde2ed87ad4d79b41077ae63526df4c129f4"
12 | gitlab_arm64_buster_source_sha256="d865000cb8026e72dcb018d29d68258c05e2049cd75d153ebf8b71de167d348d"
13 |
14 | gitlab_arm_buster_source_sha256="b8ce1cdd9cbc8c01dffb5fd8bff96bee8b38e38ea3765115935df36dd50deabd"
15 | gitlab_arm_bullseye_source_sha256="ff0d8639e55e484a87d082f06d5bbafea674841f94ef2b90277cd9f8ec7c1e40"
16 |
17 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
18 |
19 | if [ "$architecture" = "x86-64" ]; then
20 | if [ "$gitlab_debian_version" = "bullseye" ]
21 | then
22 | gitlab_source_sha256=$gitlab_x86_64_bullseye_source_sha256
23 | elif [ "$gitlab_debian_version" = "buster" ]
24 | then
25 | gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
26 | fi
27 | elif [ "$architecture" = "arm64" ]; then
28 | if [ "$gitlab_debian_version" = "bullseye" ]
29 | then
30 | gitlab_source_sha256=$gitlab_arm64_bullseye_source_sha256
31 | elif [ "$gitlab_debian_version" = "buster" ]
32 | then
33 | gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
34 | fi
35 | elif [ "$architecture" = "arm" ]; then
36 | if [ "$gitlab_debian_version" = "bullseye" ]
37 | then
38 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
39 | elif [ "$gitlab_debian_version" = "buster" ]
40 | then
41 | gitlab_source_sha256=$gitlab_arm_buster_source_sha256
42 | fi
43 | fi
44 |
45 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
46 |
47 | # Action to do in case of failure of the package_check
48 | package_check_action() {
49 | ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
50 | cat <> "$config_path/gitlab.rb"
51 | # Last chance to fix Gitlab
52 | package['modify_kernel_parameters'] = false
53 | EOF
54 | ynh_store_file_checksum --file="$config_path/gitlab.rb"
55 | }
56 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.16.first.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="16.1.6"
4 |
5 | # sha256sum found here: https://packages.gitlab.com/gitlab
6 | gitlab_debian_version="$(lsb_release -sc)"
7 |
8 | gitlab_x86_64_bullseye_source_sha256="482f1fef771939a9369f5be06ac8800b9b37562fd4569656f38ebe93705a7f74"
9 | gitlab_x86_64_buster_source_sha256="f800972861c42870c41ca005e5a068130d72cce32d20b71777725866582b7e0b"
10 |
11 | gitlab_arm64_bullseye_source_sha256="b68658cd488a459300bb546796a8ac84702c89cf7ad31ead4a28c7b8d2b1a655"
12 | gitlab_arm64_buster_source_sha256="af1a03f3b11c95a9466df27742b32106be2cafa0d56697122d7d4cf2a8dcfd18"
13 |
14 | gitlab_arm_buster_source_sha256="a688b26a70a4e51860770517dc773d1b046f33f93deb14687b7a2dc263e5ed82"
15 | gitlab_arm_bullseye_source_sha256="665e096669c7af0ae692ff7da8766dc47579b93664f18387765e8f947b1bc276"
16 |
17 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
18 |
19 | if [ "$architecture" = "x86-64" ]; then
20 | if [ "$gitlab_debian_version" = "bullseye" ]
21 | then
22 | gitlab_source_sha256=$gitlab_x86_64_bullseye_source_sha256
23 | elif [ "$gitlab_debian_version" = "buster" ]
24 | then
25 | gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
26 | fi
27 | elif [ "$architecture" = "arm64" ]; then
28 | if [ "$gitlab_debian_version" = "bullseye" ]
29 | then
30 | gitlab_source_sha256=$gitlab_arm64_bullseye_source_sha256
31 | elif [ "$gitlab_debian_version" = "buster" ]
32 | then
33 | gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
34 | fi
35 | elif [ "$architecture" = "arm" ]; then
36 | if [ "$gitlab_debian_version" = "bullseye" ]
37 | then
38 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
39 | elif [ "$gitlab_debian_version" = "buster" ]
40 | then
41 | gitlab_source_sha256=$gitlab_arm_buster_source_sha256
42 | fi
43 | fi
44 |
45 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
46 |
47 | # Action to do in case of failure of the package_check
48 | package_check_action() {
49 | ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
50 | cat <> "$config_path/gitlab.rb"
51 | # Last chance to fix Gitlab
52 | package['modify_kernel_parameters'] = false
53 | EOF
54 | ynh_store_file_checksum --file="$config_path/gitlab.rb"
55 | }
56 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.16.last.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="16.11.10"
4 |
5 | # Upgrade path: https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/
6 | # sha256sum found here: https://packages.gitlab.com/gitlab
7 | gitlab_debian_version="$(lsb_release -sc)"
8 |
9 | gitlab_x86_64_bookworm_source_sha256="4312fe0d2be18beaf3af927ed6e34cb5a4048275315c5415922adc600650c52f"
10 | gitlab_x86_64_bullseye_source_sha256="f069370fd9d8a893a628a66a1ea4e4d857440ab0fea43d289d2177182b65e0da"
11 | gitlab_x86_64_buster_source_sha256="4f7c9d78220678eb0f2e51e6160269d8f7dac8cc247e7f0f3fb808032ea2386e"
12 |
13 | gitlab_arm64_bookworm_source_sha256="5bc3c67dad538665ba11269fc7d1eb21234171822381f11d0d17b242fe5c8067"
14 | gitlab_arm64_bullseye_source_sha256="3da28c1d1d4f88e39bfc546a621aee984f5a90072f3dd8756587fa7b9c70aa40"
15 | gitlab_arm64_buster_source_sha256="9d15d02897c3488e9121dd300a0df90ea0e10ee9e0d74d98ffd3dd79831c7f06"
16 |
17 | gitlab_arm_bookworm_source_sha256=""
18 | gitlab_arm_bullseye_source_sha256="0dc39bd5a290cace83c0291c8577dbfe049db992b114689bfd8bf94b135a57ec"
19 | gitlab_arm_buster_source_sha256="951e00e6ab1a5889601e7a3732157f8b20f14cd74eb1eba26443c1785c07e1f7"
20 |
21 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
22 |
23 | # Evaluating indirect/reference variables https://mywiki.wooledge.org/BashFAQ/006#Indirection
24 | # ref=gitlab_${architecture}_${gitlab_debian_version}_source_sha256
25 | # gitlab_source_sha256=${!ref}
26 |
27 | if [ "$architecture" = "x86-64" ]; then
28 | if [ "$gitlab_debian_version" = "bookworm" ]
29 | then
30 | gitlab_source_sha256=$gitlab_x86_64_bookworm_source_sha256
31 | elif [ "$gitlab_debian_version" = "bullseye" ]
32 | then
33 | gitlab_source_sha256=$gitlab_x86_64_bullseye_source_sha256
34 | elif [ "$gitlab_debian_version" = "buster" ]
35 | then
36 | gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
37 | fi
38 | elif [ "$architecture" = "arm64" ]; then
39 | if [ "$gitlab_debian_version" = "bookworm" ]
40 | then
41 | gitlab_source_sha256=$gitlab_arm64_bookworm_source_sha256
42 | elif [ "$gitlab_debian_version" = "bullseye" ]
43 | then
44 | gitlab_source_sha256=$gitlab_arm64_bullseye_source_sha256
45 | elif [ "$gitlab_debian_version" = "buster" ]
46 | then
47 | gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
48 | fi
49 | elif [ "$architecture" = "arm" ]; then
50 | if [ "$gitlab_debian_version" = "bookworm" ]
51 | then
52 | gitlab_source_sha256=$gitlab_arm_bookworm_source_sha256
53 | if [ -z "$gitlab_arm_bookworm_source_sha256" ]
54 | then
55 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
56 | fi
57 | elif [ "$gitlab_debian_version" = "bullseye" ]
58 | then
59 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
60 | elif [ "$gitlab_debian_version" = "buster" ]
61 | then
62 | gitlab_source_sha256=$gitlab_arm_buster_source_sha256
63 | fi
64 | fi
65 |
66 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
67 |
68 | # Action to do in case of failure of the package_check
69 | package_check_action() {
70 | ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
71 | cat <> "$config_path/gitlab.rb"
72 | # Last chance to fix Gitlab
73 | package['modify_kernel_parameters'] = false
74 | EOF
75 | ynh_store_file_checksum --file="$config_path/gitlab.rb"
76 | }
77 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.17.3.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="17.3.7"
4 |
5 | # Upgrade path: https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/
6 | # sha256sum found here: https://packages.gitlab.com/gitlab
7 | gitlab_debian_version="$(lsb_release -sc)"
8 |
9 | gitlab_x86_64_bookworm_source_sha256="26ad3fd4533e648d8a0e393ef95c761da486aca6d84295c8ba99d0ee6afa989e"
10 | gitlab_x86_64_bullseye_source_sha256="e78c276952c6202c23b9baac8afe05ebcaf1c5f2639e51865157e5ebddbb9554"
11 | gitlab_x86_64_buster_source_sha256="44c7f77c33eb40543f1ebf68c42b07d643e1492399a9afc375018d5742834697"
12 |
13 | gitlab_arm64_bookworm_source_sha256="7fc3fc2b589f7f270f04d03bf0286d0b271f33346f521dc1174ced9d9b4d2561"
14 | gitlab_arm64_bullseye_source_sha256="f22a39ea10275d7be6b0abe02728ae92f99afdcce2220d1d6cf802332375b1f8"
15 | gitlab_arm64_buster_source_sha256="9a886b7f5a910ac95ce2b391504f23ddab15718656486ce0e76960609e5b3d4b"
16 |
17 | gitlab_arm_bookworm_source_sha256="97c6132b062a0cef707d0dc74bb67bc16eccc345bfce96d3513188fc5bdcc092"
18 | gitlab_arm_bullseye_source_sha256="3917ab066b55bdf3c4d3cf1dec3e91ed86d2d3cff3fcf570c4a553c405051d5e"
19 | gitlab_arm_buster_source_sha256="ae49a4136afa6fc321a40c2dca79e8e4ac4daf85ef6f4f90de7fadd0e004e28c"
20 |
21 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
22 |
23 | # Evaluating indirect/reference variables https://mywiki.wooledge.org/BashFAQ/006#Indirection
24 | # ref=gitlab_${architecture}_${gitlab_debian_version}_source_sha256
25 | # gitlab_source_sha256=${!ref}
26 |
27 | if [ "$architecture" = "x86-64" ]; then
28 | if [ "$gitlab_debian_version" = "bookworm" ]
29 | then
30 | gitlab_source_sha256=$gitlab_x86_64_bookworm_source_sha256
31 | elif [ "$gitlab_debian_version" = "bullseye" ]
32 | then
33 | gitlab_source_sha256=$gitlab_x86_64_bullseye_source_sha256
34 | elif [ "$gitlab_debian_version" = "buster" ]
35 | then
36 | gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
37 | fi
38 | elif [ "$architecture" = "arm64" ]; then
39 | if [ "$gitlab_debian_version" = "bookworm" ]
40 | then
41 | gitlab_source_sha256=$gitlab_arm64_bookworm_source_sha256
42 | elif [ "$gitlab_debian_version" = "bullseye" ]
43 | then
44 | gitlab_source_sha256=$gitlab_arm64_bullseye_source_sha256
45 | elif [ "$gitlab_debian_version" = "buster" ]
46 | then
47 | gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
48 | fi
49 | elif [ "$architecture" = "arm" ]; then
50 | if [ "$gitlab_debian_version" = "bookworm" ]
51 | then
52 | gitlab_source_sha256=$gitlab_arm_bookworm_source_sha256
53 | if [ -z "$gitlab_arm_bookworm_source_sha256" ]
54 | then
55 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
56 | fi
57 | elif [ "$gitlab_debian_version" = "bullseye" ]
58 | then
59 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
60 | elif [ "$gitlab_debian_version" = "buster" ]
61 | then
62 | gitlab_source_sha256=$gitlab_arm_buster_source_sha256
63 | fi
64 | fi
65 |
66 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
67 |
68 | # Action to do in case of failure of the package_check
69 | package_check_action() {
70 | ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
71 | cat <> "$config_path/gitlab.rb"
72 | # Last chance to fix Gitlab
73 | package['modify_kernel_parameters'] = false
74 | EOF
75 | ynh_store_file_checksum --file="$config_path/gitlab.rb"
76 | }
77 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.17.5.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="17.5.5"
4 |
5 | # Upgrade path: https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/
6 | # sha256sum found here: https://packages.gitlab.com/gitlab
7 | gitlab_debian_version="$(lsb_release -sc)"
8 |
9 | gitlab_x86_64_bookworm_source_sha256="cce4ebff28a0b76152922b09a2cb67fd4bc0cfdff22185654135bb93ce658bcf"
10 | gitlab_x86_64_bullseye_source_sha256="b0f40eb8a2d55634cff59125304df1fa1fda1601dec1bf3547a4351aabd81221"
11 | gitlab_x86_64_buster_source_sha256="30bcadafe193fdc670f024e1a527dd3a632f57173757d75120ae75c82b347dc9"
12 |
13 | gitlab_arm64_bookworm_source_sha256="51c8ca34a1c2d24b209b74f6f5dbf4e446d61cbe85de51f56c010e116c2468b3"
14 | gitlab_arm64_bullseye_source_sha256="8b9e8722e064889f9e20f781e61356ce8035cec5fe4cbe255b6aba97e7a7067c"
15 | gitlab_arm64_buster_source_sha256="db83b6e3b9689f9d584cb57a2c40a77deef8dfb0a638981af5fc8993f744720b"
16 |
17 | gitlab_arm_bookworm_source_sha256="a2b443f777030cc8dd9e1bd63879ac2d27091c7f91b2191b4504cda35efe8e30"
18 | gitlab_arm_bullseye_source_sha256="44183f66b822afabc5948065eb335d5ae5376811b48847614246ccec99638481"
19 | gitlab_arm_buster_source_sha256="3b4b4bfdfcfb65dc971c8ed6b89afa58303c129839f33d804a968ea60c19b91f"
20 |
21 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
22 |
23 | # Evaluating indirect/reference variables https://mywiki.wooledge.org/BashFAQ/006#Indirection
24 | # ref=gitlab_${architecture}_${gitlab_debian_version}_source_sha256
25 | # gitlab_source_sha256=${!ref}
26 |
27 | if [ "$architecture" = "x86-64" ]; then
28 | if [ "$gitlab_debian_version" = "bookworm" ]
29 | then
30 | gitlab_source_sha256=$gitlab_x86_64_bookworm_source_sha256
31 | elif [ "$gitlab_debian_version" = "bullseye" ]
32 | then
33 | gitlab_source_sha256=$gitlab_x86_64_bullseye_source_sha256
34 | elif [ "$gitlab_debian_version" = "buster" ]
35 | then
36 | gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
37 | fi
38 | elif [ "$architecture" = "arm64" ]; then
39 | if [ "$gitlab_debian_version" = "bookworm" ]
40 | then
41 | gitlab_source_sha256=$gitlab_arm64_bookworm_source_sha256
42 | elif [ "$gitlab_debian_version" = "bullseye" ]
43 | then
44 | gitlab_source_sha256=$gitlab_arm64_bullseye_source_sha256
45 | elif [ "$gitlab_debian_version" = "buster" ]
46 | then
47 | gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
48 | fi
49 | elif [ "$architecture" = "arm" ]; then
50 | if [ "$gitlab_debian_version" = "bookworm" ]
51 | then
52 | gitlab_source_sha256=$gitlab_arm_bookworm_source_sha256
53 | if [ -z "$gitlab_arm_bookworm_source_sha256" ]
54 | then
55 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
56 | fi
57 | elif [ "$gitlab_debian_version" = "bullseye" ]
58 | then
59 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
60 | elif [ "$gitlab_debian_version" = "buster" ]
61 | then
62 | gitlab_source_sha256=$gitlab_arm_buster_source_sha256
63 | fi
64 | fi
65 |
66 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
67 |
68 | # Action to do in case of failure of the package_check
69 | package_check_action() {
70 | ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
71 | cat <> "$config_path/gitlab.rb"
72 | # Last chance to fix Gitlab
73 | package['modify_kernel_parameters'] = false
74 | EOF
75 | ynh_store_file_checksum --file="$config_path/gitlab.rb"
76 | }
77 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.17.8.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="17.8.7"
4 |
5 | # Upgrade path: https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/
6 | # sha256sum found here: https://packages.gitlab.com/gitlab
7 | gitlab_debian_version="$(lsb_release -sc)"
8 |
9 | gitlab_x86_64_bookworm_source_sha256="b79063815bbf25f6461c55614f8ca1c2addc5f2b1a5dc6f8935d6af678c2f892"
10 | gitlab_x86_64_bullseye_source_sha256="f89b639420a28a4249a82f0ba56d244dbc8e6a6df3f06c6e44c86ee366222e99"
11 | gitlab_x86_64_buster_source_sha256=""
12 |
13 | gitlab_arm64_bookworm_source_sha256="851d75bbc1f60d3e6a22d0e7f2f3135ae0dcac4d44a32edab30ca9607a6df6ad"
14 | gitlab_arm64_bullseye_source_sha256="9190058d823f2295ed4632cb5fa2227e128e354254d80500838d10635e4bd704"
15 | gitlab_arm64_buster_source_sha256=""
16 |
17 | gitlab_arm_bookworm_source_sha256="dacb0a4a3f1ffeb6806ea83ae46cacf1260d3586e59d323ad583390cee083378"
18 | gitlab_arm_bullseye_source_sha256="77df8ccd174fd4a3fb8b4ea568077156427c86890bde568e7fc845b11764a6ec"
19 | gitlab_arm_buster_source_sha256=""
20 |
21 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
22 |
23 | # Evaluating indirect/reference variables https://mywiki.wooledge.org/BashFAQ/006#Indirection
24 | # ref=gitlab_${architecture}_${gitlab_debian_version}_source_sha256
25 | # gitlab_source_sha256=${!ref}
26 |
27 | if [ "$architecture" = "x86-64" ]; then
28 | if [ "$gitlab_debian_version" = "bookworm" ]
29 | then
30 | gitlab_source_sha256=$gitlab_x86_64_bookworm_source_sha256
31 | elif [ "$gitlab_debian_version" = "bullseye" ]
32 | then
33 | gitlab_source_sha256=$gitlab_x86_64_bullseye_source_sha256
34 | elif [ "$gitlab_debian_version" = "buster" ]
35 | then
36 | gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
37 | fi
38 | elif [ "$architecture" = "arm64" ]; then
39 | if [ "$gitlab_debian_version" = "bookworm" ]
40 | then
41 | gitlab_source_sha256=$gitlab_arm64_bookworm_source_sha256
42 | elif [ "$gitlab_debian_version" = "bullseye" ]
43 | then
44 | gitlab_source_sha256=$gitlab_arm64_bullseye_source_sha256
45 | elif [ "$gitlab_debian_version" = "buster" ]
46 | then
47 | gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
48 | fi
49 | elif [ "$architecture" = "arm" ]; then
50 | if [ "$gitlab_debian_version" = "bookworm" ]
51 | then
52 | gitlab_source_sha256=$gitlab_arm_bookworm_source_sha256
53 | if [ -z "$gitlab_arm_bookworm_source_sha256" ]
54 | then
55 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
56 | fi
57 | elif [ "$gitlab_debian_version" = "bullseye" ]
58 | then
59 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
60 | elif [ "$gitlab_debian_version" = "buster" ]
61 | then
62 | gitlab_source_sha256=$gitlab_arm_buster_source_sha256
63 | fi
64 | fi
65 |
66 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
67 |
68 | # Action to do in case of failure of the package_check
69 | package_check_action() {
70 | ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
71 | cat <> "$config_path/gitlab.rb"
72 | # Last chance to fix Gitlab
73 | package['modify_kernel_parameters'] = false
74 | EOF
75 | ynh_store_file_checksum --file="$config_path/gitlab.rb"
76 | }
77 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.17.first.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="17.1.8"
4 |
5 | # Upgrade path: https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/
6 | # sha256sum found here: https://packages.gitlab.com/gitlab
7 | gitlab_debian_version="$(lsb_release -sc)"
8 |
9 | gitlab_x86_64_bookworm_source_sha256="6a0c4466d43692491d3bd63a66f411ede7114ed73cc0d71649c0def1d1768e6b"
10 | gitlab_x86_64_bullseye_source_sha256="4aeefcae5fc886a83a5bca02f96b9ea15390d19f3dd5e60f43971d8e373830b3"
11 | gitlab_x86_64_buster_source_sha256="a7b89de5a29370d67d37e1ae1a0756c6fa6d6fb0b457f778c206d4818caa3824"
12 |
13 | gitlab_arm64_bookworm_source_sha256="64d92f60b00079f40f62dd5248e1bc6a1da0938b0e6fb22c921c4907e93b8b9c"
14 | gitlab_arm64_bullseye_source_sha256="fbbcad2475101deb46c2bdba3cf5cac01ac0816b23f0e1dea682912ce85d5b30"
15 | gitlab_arm64_buster_source_sha256="6a828fac7e8685dceb0f9c469bfa341fc51fcdadf3b2f7467657aaf091c1ca4d"
16 |
17 | gitlab_arm_bookworm_source_sha256=""
18 | gitlab_arm_bullseye_source_sha256="3788e4e70dd4b69b8bc39dc4c533189ae094a8491323f17c4cd4b8be42dfd7b6"
19 | gitlab_arm_buster_source_sha256="90c63f1ebaf3c28fe841e060873c452cab7150758e1e85785d09a53198b8c644"
20 |
21 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
22 |
23 | # Evaluating indirect/reference variables https://mywiki.wooledge.org/BashFAQ/006#Indirection
24 | # ref=gitlab_${architecture}_${gitlab_debian_version}_source_sha256
25 | # gitlab_source_sha256=${!ref}
26 |
27 | if [ "$architecture" = "x86-64" ]; then
28 | if [ "$gitlab_debian_version" = "bookworm" ]
29 | then
30 | gitlab_source_sha256=$gitlab_x86_64_bookworm_source_sha256
31 | elif [ "$gitlab_debian_version" = "bullseye" ]
32 | then
33 | gitlab_source_sha256=$gitlab_x86_64_bullseye_source_sha256
34 | elif [ "$gitlab_debian_version" = "buster" ]
35 | then
36 | gitlab_source_sha256=$gitlab_x86_64_buster_source_sha256
37 | fi
38 | elif [ "$architecture" = "arm64" ]; then
39 | if [ "$gitlab_debian_version" = "bookworm" ]
40 | then
41 | gitlab_source_sha256=$gitlab_arm64_bookworm_source_sha256
42 | elif [ "$gitlab_debian_version" = "bullseye" ]
43 | then
44 | gitlab_source_sha256=$gitlab_arm64_bullseye_source_sha256
45 | elif [ "$gitlab_debian_version" = "buster" ]
46 | then
47 | gitlab_source_sha256=$gitlab_arm64_buster_source_sha256
48 | fi
49 | elif [ "$architecture" = "arm" ]; then
50 | if [ "$gitlab_debian_version" = "bookworm" ]
51 | then
52 | gitlab_source_sha256=$gitlab_arm_bookworm_source_sha256
53 | if [ -z "$gitlab_arm_bookworm_source_sha256" ]
54 | then
55 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
56 | fi
57 | elif [ "$gitlab_debian_version" = "bullseye" ]
58 | then
59 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
60 | elif [ "$gitlab_debian_version" = "buster" ]
61 | then
62 | gitlab_source_sha256=$gitlab_arm_buster_source_sha256
63 | fi
64 | fi
65 |
66 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
67 |
68 | # Action to do in case of failure of the package_check
69 | package_check_action() {
70 | ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
71 | cat <> "$config_path/gitlab.rb"
72 | # Last chance to fix Gitlab
73 | package['modify_kernel_parameters'] = false
74 | EOF
75 | ynh_store_file_checksum --file="$config_path/gitlab.rb"
76 | }
77 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.17.last.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="17.11.3"
4 |
5 | # Upgrade path: https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/
6 | # sha256sum found here: https://packages.gitlab.com/gitlab
7 | gitlab_debian_version="$(lsb_release -sc)"
8 |
9 | gitlab_x86_64_bookworm_source_sha256="b3ae9f145b4126bc8deac719a1c19a656ae4a0b74f456eb1e3cb4b2a01d28dc9"
10 | gitlab_x86_64_bullseye_source_sha256="410b7bb8d8375f4b5e1818f62d34dcbcb0186b4413006e3c4d26292ce873fe71"
11 |
12 | gitlab_arm64_bookworm_source_sha256="39e7dee84fedf0558daba6925e3266e39083fd7b0bb8ac7c7d22f5e2b9cd1a17"
13 | gitlab_arm64_bullseye_source_sha256="01634ae1c4a49feb32c222c74b85fdfb9ab738718d1579c2f9caf3d433cae40e"
14 |
15 | gitlab_arm_bookworm_source_sha256="4aff840c17407b37ff9944e1bc2befb677c05379a880274fe4fd57f7ec3390e0"
16 | gitlab_arm_bullseye_source_sha256="e5db9ae193a3db25ac3c22588bc361432829542d9d5bdcfd2ce72dcbc698bdfe"
17 |
18 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
19 |
20 | # Evaluating indirect/reference variables https://mywiki.wooledge.org/BashFAQ/006#Indirection
21 | # ref=gitlab_${architecture}_${gitlab_debian_version}_source_sha256
22 | # gitlab_source_sha256=${!ref}
23 |
24 | if [ "$architecture" = "x86-64" ]; then
25 | if [ "$gitlab_debian_version" = "bookworm" ]
26 | then
27 | gitlab_source_sha256=$gitlab_x86_64_bookworm_source_sha256
28 | elif [ "$gitlab_debian_version" = "bullseye" ]
29 | then
30 | gitlab_source_sha256=$gitlab_x86_64_bullseye_source_sha256
31 | fi
32 | elif [ "$architecture" = "arm64" ]; then
33 | if [ "$gitlab_debian_version" = "bookworm" ]
34 | then
35 | gitlab_source_sha256=$gitlab_arm64_bookworm_source_sha256
36 | elif [ "$gitlab_debian_version" = "bullseye" ]
37 | then
38 | gitlab_source_sha256=$gitlab_arm64_bullseye_source_sha256
39 | fi
40 | elif [ "$architecture" = "arm" ]; then
41 | if [ "$gitlab_debian_version" = "bookworm" ]
42 | then
43 | gitlab_source_sha256=$gitlab_arm_bookworm_source_sha256
44 | if [ -z "$gitlab_arm_bookworm_source_sha256" ]
45 | then
46 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
47 | fi
48 | elif [ "$gitlab_debian_version" = "bullseye" ]
49 | then
50 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
51 | fi
52 | fi
53 |
54 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
55 |
56 | # Action to do in case of failure of the package_check
57 | package_check_action() {
58 | ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
59 | cat <> "$config_path/gitlab.rb"
60 | # Last chance to fix Gitlab
61 | package['modify_kernel_parameters'] = false
62 | EOF
63 | ynh_store_file_checksum --file="$config_path/gitlab.rb"
64 | }
65 |
--------------------------------------------------------------------------------
/scripts/upgrade.d/upgrade.last.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | gitlab_version="18.0.1"
4 |
5 | # Upgrade path: https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/
6 | # sha256sum found here: https://packages.gitlab.com/gitlab
7 | gitlab_debian_version="$(lsb_release -sc)"
8 |
9 | gitlab_x86_64_bookworm_source_sha256="01dd05efa98d278ed6178ab449ae477d2e70f552ceba4825c8e24b7572e20a79"
10 | gitlab_x86_64_bullseye_source_sha256="24ad242b559e3d8c432a082da1c0e1652263cca3ce065e0a819ddc3dadeceecf"
11 |
12 | gitlab_arm64_bookworm_source_sha256="72f80ce75344da0d5ba22301d57a24041195fd550902b719298e496ae8591516"
13 | gitlab_arm64_bullseye_source_sha256="31075a63ce82f9f6d3b2a82d4fd61b0d543e63a3f1dd3bdca48a915d314e8b86"
14 |
15 | gitlab_arm_bookworm_source_sha256=""
16 | gitlab_arm_bullseye_source_sha256=""
17 |
18 | architecture=$(ynh_app_setting_get --app="$app" --key=architecture)
19 |
20 | # Evaluating indirect/reference variables https://mywiki.wooledge.org/BashFAQ/006#Indirection
21 | # ref=gitlab_${architecture}_${gitlab_debian_version}_source_sha256
22 | # gitlab_source_sha256=${!ref}
23 |
24 | if [ "$architecture" = "x86-64" ]; then
25 | if [ "$gitlab_debian_version" = "bookworm" ]
26 | then
27 | gitlab_source_sha256=$gitlab_x86_64_bookworm_source_sha256
28 | elif [ "$gitlab_debian_version" = "bullseye" ]
29 | then
30 | gitlab_source_sha256=$gitlab_x86_64_bullseye_source_sha256
31 | fi
32 | elif [ "$architecture" = "arm64" ]; then
33 | if [ "$gitlab_debian_version" = "bookworm" ]
34 | then
35 | gitlab_source_sha256=$gitlab_arm64_bookworm_source_sha256
36 | elif [ "$gitlab_debian_version" = "bullseye" ]
37 | then
38 | gitlab_source_sha256=$gitlab_arm64_bullseye_source_sha256
39 | fi
40 | elif [ "$architecture" = "arm" ]; then
41 | if [ "$gitlab_debian_version" = "bookworm" ]
42 | then
43 | gitlab_source_sha256=$gitlab_arm_bookworm_source_sha256
44 | if [ -z "$gitlab_arm_bookworm_source_sha256" ]
45 | then
46 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
47 | fi
48 | elif [ "$gitlab_debian_version" = "bullseye" ]
49 | then
50 | gitlab_source_sha256=$gitlab_arm_bullseye_source_sha256
51 | fi
52 | fi
53 |
54 | gitlab_filename="gitlab-ce-${gitlab_version}.deb"
55 |
56 | # Action to do in case of failure of the package_check
57 | package_check_action() {
58 | ynh_backup_if_checksum_is_different --file="$config_path/gitlab.rb"
59 | cat <> "$config_path/gitlab.rb"
60 | # Last chance to fix Gitlab
61 | package['modify_kernel_parameters'] = false
62 | EOF
63 | ynh_store_file_checksum --file="$config_path/gitlab.rb"
64 | }
65 |
--------------------------------------------------------------------------------
/tests.toml:
--------------------------------------------------------------------------------
1 | test_format = 1.0
2 |
3 | [default]
4 | # -------------------------------
5 | # Commits to test upgrade from
6 | # -------------------------------
7 |
8 | test_upgrade_from.3be74724da5be7f00da62de399f61a21bef37657.name = "Upgrade from 16.9.0"
9 |
--------------------------------------------------------------------------------
/upgrade-versions.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # /!\ This is a quick and dirty bash script, which does not respect the YNH format.
4 |
5 | # This script will upgrade sha256sum, manifest, readme and config template
6 | # /!\ before committing the modifications, check if nothing is broken if files
7 | # Usage: ./upgrade-versions.sh path_to_upgrade_file version
8 | # Example: ./upgrade-versions.sh scripts/upgrade.d/upgrade.last.sh 13.3.1
9 |
10 | file=$(basename $1)
11 | debian_versions=("bullseye" "bookworm")
12 | version=$2
13 | current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
14 | gitlab_directory="$( cd "$( dirname "$current_dir/$1" )/../../" >/dev/null 2>&1 && pwd )"
15 |
16 | # Only replace the first occurrence
17 | sed -i -e "0,/gitlab_version=\"[^0-9.]*[0-9.]*[0-9.]\"/s//gitlab_version=\"$version\"/" $gitlab_directory/scripts/upgrade.d/$file
18 |
19 | for debian_version in "${debian_versions[@]}"
20 | do
21 |
22 | # x86_64
23 | url=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/${debian_version}/gitlab-ce_$version-ce.0_amd64.deb
24 |
25 | new_sha256=$(curl -s $url | sed -n '/SHA256$/,/<\/tr>$/{ /SHA256$/d; /<\/tr>$/d; p; }' | cut -d$'\n' -f3 | xargs)
26 |
27 | echo url: $url
28 | echo sha256: $new_sha256
29 |
30 | sed -i -e "s/gitlab_x86_64_${debian_version}_source_sha256=\".*\"/gitlab_x86_64_${debian_version}_source_sha256=\"$new_sha256\"/" $gitlab_directory/scripts/upgrade.d/$file
31 |
32 | # arm64
33 | url=https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/${debian_version}/gitlab-ce_$version-ce.0_arm64.deb
34 |
35 | new_sha256=$(curl -s $url | sed -n '/SHA256$/,/<\/tr>$/{ /SHA256$/d; /<\/tr>$/d; p; }' | cut -d$'\n' -f3 | xargs)
36 |
37 | echo url: $url
38 | echo sha256: $new_sha256
39 |
40 | sed -i -e "s/gitlab_arm64_${debian_version}_source_sha256=\".*\"/gitlab_arm64_${debian_version}_source_sha256=\"$new_sha256\"/" $gitlab_directory/scripts/upgrade.d/$file
41 |
42 | # arm
43 | url=https://packages.gitlab.com/gitlab/raspberry-pi2/packages/raspbian/${debian_version}/gitlab-ce_$version-ce.0_armhf.deb
44 |
45 | new_sha256=$(curl -s $url | sed -n '/SHA256$/,/<\/tr>$/{ /SHA256$/d; /<\/tr>$/d; p; }' | cut -d$'\n' -f3 | xargs)
46 |
47 | echo url: $url
48 | echo sha256: $new_sha256
49 |
50 | sed -i -e "s/gitlab_arm_${debian_version}_source_sha256=\".*\"/gitlab_arm_${debian_version}_source_sha256=\"$new_sha256\"/" $gitlab_directory/scripts/upgrade.d/$file
51 | done
52 |
53 |
54 | if [[ "$(basename $file)" == upgrade.last.sh ]]; then
55 | # Update manifest
56 | sed -i -e "s/version = \"[^0-9.]*[0-9.]*[0-9.]~ynh[0-9.]\"/version = \"$version~ynh1\"/" $gitlab_directory/manifest.toml
57 |
58 | # Don't, it's autogenerated now
59 | ## Update readme
60 | #sed -i -e "s/\*\*Shipped version:\*\* [^0-9.]*[0-9.]*[0-9.]/**Shipped version:** $version/" $gitlab_directory/README.md
61 | #sed -i -e "s/\*\*Version incluse :\*\* [^0-9.]*[0-9.]*[0-9.]/**Version incluse :** $version/" $gitlab_directory/README_fr.md
62 |
63 | # Update gitlab.rb
64 | conf_file=$gitlab_directory/conf/gitlab.rb
65 |
66 | url=https://gitlab.com/gitlab-org/omnibus-gitlab/-/raw/$version+ce.0/files/gitlab-config-template/gitlab.rb.template
67 |
68 | header="################################################################################
69 | ################################################################################
70 | ## FOR YUNOHOST USERS ##
71 | ################################################################################
72 | ################################################################################
73 |
74 | # Please do not modify this file, it will be reset with the next update.
75 | # You can create or modify the file:
76 | # /etc/gitlab/gitlab-persistent.rb
77 | # and add all the configuration you want.
78 | # Options you add in gitlab-presistent.rb will overide these one,
79 | # but you can use options and documentations in this file to know what
80 | # is it possible to do.
81 |
82 | ################################################################################
83 | ################################################################################
84 | "
85 |
86 | footer="
87 | from_file '/etc/gitlab/gitlab-persistent.rb'"
88 | echo "$header" > $conf_file
89 |
90 | curl -s "$url" >> $conf_file
91 |
92 | echo "$footer" >> $conf_file
93 |
94 | # Change external url
95 | sed -i "s/external_url 'GENERATED_EXTERNAL_URL'/external_url '__GENERATED_EXTERNAL_URL__'/" $conf_file
96 |
97 | # Activate ldap
98 | sed -i "s/# gitlab_rails\['ldap_enabled'\] = .*/gitlab_rails['ldap_enabled'] = true/" $conf_file
99 |
100 | ldap_conf="
101 | gitlab_rails['ldap_servers'] = YAML.load <<-'EOS' # remember to close this block with 'EOS' below
102 | main: # 'main' is the GitLab 'provider ID' of this LDAP server
103 | label: 'YunoHost LDAP'
104 | host: 'localhost'
105 | port: 389
106 | uid: 'uid'
107 | encryption: 'plain' # 'start_tls' or 'simple_tls' or 'plain'
108 | bind_dn: 'ou=users,dc=yunohost,dc=org'
109 | password: ''
110 | active_directory: false
111 | allow_username_or_email_login: false
112 | block_auto_created_users: false
113 | base: 'dc=yunohost,dc=org'
114 | user_filter: '(&(objectClass=posixAccount)(permission=cn=gitlab.main,ou=permission,dc=yunohost,dc=org))'
115 | timeout: 10
116 | attributes: {
117 | username: ['uid', 'sAMAccountName'],
118 | name: 'cn',
119 | first_name: 'givenName',
120 | last_name: 'sn'
121 | }
122 | EOS"
123 |
124 | # Add ldap conf
125 | sed -i "/^# EOS/r "<(echo "$ldap_conf") $conf_file
126 |
127 | # Change ssh port
128 | sed -i "s/# gitlab_rails\['gitlab_shell_ssh_port'\] = 22/gitlab_rails['gitlab_shell_ssh_port'] = __SSH_PORT__/" $conf_file
129 |
130 | # Change puma settings
131 | sed -i "s/# puma\['port'\] = .*/puma['port'] = __PORT_PUMA__/" $conf_file
132 |
133 | # Change sidekiq settings
134 | sed -i "s/# sidekiq\['listen_port'\] = .*/sidekiq['listen_port'] = __PORT_SIDEKIQ__/" $conf_file
135 |
136 | # Change nginx settings
137 | sed -i "s/# nginx\['client_max_body_size'\] = .*/nginx['client_max_body_size'] = '__CLIENT_MAX_BODY_SIZE__'/" $conf_file
138 | sed -i "s/# nginx\['listen_port'\] = .*/nginx['listen_port'] = __PORT__/" $conf_file
139 | sed -i "s/# nginx\['listen_https'\] = .*/nginx['listen_https'] = false/" $conf_file
140 |
141 | # Change modify kernel parameters settings
142 | sed -i "s/# package\['modify_kernel_parameters'\] = .*/package['modify_kernel_parameters'] = __MODIFY_KERNEL_PARAMETERS__/" $conf_file
143 | fi
144 |
--------------------------------------------------------------------------------