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

7 | Logo of Friendica 8 | Friendica, packaged for YunoHost 9 |

10 | 11 | Decentralized Social Network 12 | 13 | [![🌐 Official app website](https://img.shields.io/badge/Official_app_website-darkgreen?style=for-the-badge)](http://friendi.ca) 14 | [![App Demo](https://img.shields.io/badge/App_Demo-blue?style=for-the-badge)](https://dir.friendica.social/servers) 15 | [![Version: 2024.12-1~ynh2](https://img.shields.io/badge/Version-2024.12--1~ynh2-rgba(0,150,0,1)?style=for-the-badge)](https://ci-apps.yunohost.org/ci/apps/friendica/) 16 | 17 |
18 | 19 | 20 |
21 | 22 | ## 📦 Developer info 23 | 24 | [![Automatic tests level](https://apps.yunohost.org/badge/cilevel/friendica)](https://ci-apps.yunohost.org/ci/apps/friendica/) 25 | 26 | 🛠️ Upstream Friendica repository: 27 | 28 | Pull request are welcome and should target the [`testing` branch](https://github.com/YunoHost-Apps/friendica_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/friendica_ynh/tree/testing 34 | 35 | # upgrade an existing install: 36 | sudo yunohost app upgrade friendica -u https://github.com/YunoHost-Apps/friendica_ynh/tree/testing 37 | ``` 38 | 39 | ### 📚 App packaging documentation 40 | 41 | Please see for more information. -------------------------------------------------------------------------------- /conf/addon.config.php: -------------------------------------------------------------------------------- 1 | [ 7 | 'ldap_server' => 'localhost', 8 | 'ldap_searchdn' => 'ou=users,dc=yunohost,dc=org', 9 | 'ldap_userattr' => 'uid', 10 | 'ldap_autocreateaccount_emailattribute' => 'mail', 11 | ], 12 | ]; 13 | -------------------------------------------------------------------------------- /conf/extra_php-fpm.conf: -------------------------------------------------------------------------------- 1 | ; Additional php.ini defines, specific to this pool of workers. 2 | 3 | php_admin_value[upload_max_filesize] = 50M 4 | php_admin_value[post_max_size] = 50M 5 | -------------------------------------------------------------------------------- /conf/local-sample.config.php: -------------------------------------------------------------------------------- 1 | [ 9 | 'hostname' => 'localhost', 10 | 'username' => '__DB_USER__', 11 | 'password' => '__DB_PWD__', 12 | 'database' => '__DB_NAME__', 13 | 'charset' => 'utf8mb4', 14 | ], 15 | 16 | // **************************************************************** 17 | // The configuration below will be overruled by the admin panel. 18 | // Changes made below will only have an effect if the database does 19 | // not contain any configuration for the friendica system. 20 | // **************************************************************** 21 | 22 | 'config' => [ 23 | 'php_path' => '/usr/bin/php__PHPVERSION__', 24 | 'admin_email' => '__EMAIL__', 25 | 'sitename' => 'Friendica Social Network', 26 | 'register_policy' => \Friendica\Module\Register::OPEN, 27 | 'max_import_size' => 200000, 28 | 'register_text' => '', 29 | ], 30 | 'system' => [ 31 | 'url' => 'https://__DOMAIN__', 32 | 'basepath' => '__INSTALL_DIR__', 33 | 'default_timezone' => '__TIMEZONE__', 34 | 'language' => '__LANGUAGE__', 35 | 'pidfile' => '__INSTALL_DIR__/daemon.pid', 36 | // Blocks search for users who are not logged in to prevent crawlers from blocking your system. 37 | 'local_search' => false, 38 | 'logfile' => '/var/log/friendica/friendica.log', 39 | 'loglevel' => 'notice', 40 | ], 41 | ]; 42 | -------------------------------------------------------------------------------- /conf/nginx.conf: -------------------------------------------------------------------------------- 1 | location __PATH__/ { 2 | 3 | alias __INSTALL_DIR__/; 4 | 5 | if (!-e $request_filename) { 6 | rewrite ^(.*)$ /index.php?pagename=$1; 7 | } 8 | 9 | #allow uploads up to 20MB in size 10 | client_max_body_size 50M; 11 | client_body_buffer_size 128k; 12 | 13 | #Default indexes and catch-all 14 | index index.php; 15 | 16 | # make sure webfinger and other well known services aren't blocked 17 | # by denying dot files and rewrite request to the front controller 18 | location ^~ /.well-known/ { 19 | allow all; 20 | if (!-e $request_filename) { 21 | rewrite ^(.*)$ /index.php?pagename=$1; 22 | } 23 | } 24 | 25 | include mime.types; 26 | 27 | # block these file types 28 | location ~* \.(tpl|md|tgz|log|out)$ { 29 | deny all; 30 | } 31 | 32 | #Execute and serve PHP files 33 | location ~* \.php$ { 34 | fastcgi_split_path_info ^(.+?\.php)(/.*)$; 35 | try_files $uri =404; 36 | fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; 37 | fastcgi_index index.php; 38 | include fastcgi_params; 39 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 40 | } 41 | 42 | # deny access to all dot files 43 | location ~ /\. { 44 | deny all; 45 | } 46 | 47 | #Include SSOWAT user panel. 48 | include conf.d/yunohost_panel.conf.inc; 49 | } 50 | -------------------------------------------------------------------------------- /conf/systemd.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Friendica daemon 3 | After=network.target mariadb.service 4 | Requires=network.target remote-fs.target nss-lookup.target 5 | 6 | [Service] 7 | User=__APP__ 8 | Group=__APP__ 9 | WorkingDirectory=__INSTALL_DIR__/ 10 | Type=simple 11 | StandardOutput=append:/var/log/__APP__/daemon.log 12 | StandardError=inherit 13 | ExecStart=/usr/bin/php__PHPVERSION__ __INSTALL_DIR__/bin/daemon.php start 14 | ExecStop=/usr/bin/php__PHPVERSION__ __INSTALL_DIR__/bin/daemon.php stop 15 | PIDFile=__INSTALL_DIR__/daemon.pid 16 | PrivateTmp=true 17 | InaccessibleDirectories=/home /root /boot /opt /mnt /media 18 | ReadOnlyDirectories=/etc /usr 19 | Restart=always 20 | RestartSec=10 21 | StartLimitBurst=1 22 | 23 | # Sandboxing options to harden security 24 | # Depending on specificities of your service/app, you may need to tweak these 25 | # .. but this should be a good baseline 26 | # Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html 27 | NoNewPrivileges=yes 28 | PrivateTmp=yes 29 | PrivateDevices=yes 30 | RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK 31 | RestrictNamespaces=yes 32 | RestrictRealtime=yes 33 | DevicePolicy=closed 34 | ProtectClock=yes 35 | ProtectHostname=yes 36 | ProtectProc=invisible 37 | ProtectSystem=full 38 | ProtectControlGroups=yes 39 | ProtectKernelModules=yes 40 | ProtectKernelTunables=yes 41 | LockPersonality=yes 42 | SystemCallArchitectures=native 43 | SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap @cpu-emulation @privileged 44 | 45 | # Denying access to capabilities that should not be relevant for webapps 46 | # Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html 47 | CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD 48 | CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE 49 | CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT 50 | CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK 51 | CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM 52 | CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG 53 | CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE 54 | CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW 55 | CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG 56 | 57 | [Install] 58 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /doc/ADMIN.md: -------------------------------------------------------------------------------- 1 | ## User with LDAP admin rights 2 | 3 | **For admin rights**: When installation is complete, you will need to visit your domain page and login with the **admin account username and password** which was entered at the time of installation process. You can then create your profile and access the admin panel. 4 | -------------------------------------------------------------------------------- /doc/ADMIN_fr.md: -------------------------------------------------------------------------------- 1 | ## Utilisateur avec des droits d'administrateur LDAP 2 | 3 | **Pour les droits d'administrateur** : une fois l'installation terminée, vous devrez visiter la page de votre domaine et vous connecter avec le **nom d'utilisateur et le mot de passe du compte administrateur** qui ont été saisis au moment du processus d'installation. Vous pouvez ensuite créer votre profil et accéder au panneau d'administration. 4 | -------------------------------------------------------------------------------- /doc/DESCRIPTION.md: -------------------------------------------------------------------------------- 1 | Friendica is a decentralised communications platform that integrates social communication. The platform links to independent social projects and corporate services. 2 | Friendica connects you effortlessly to a federated communications network of several thousand servers, with more than half a million user registrations. You can directly connect to anyone on Friendica, Mastodon, Diaspora, GnuSocial, Pleroma, or Hubzilla, regardless where each user profile is hosted. 3 | -------------------------------------------------------------------------------- /doc/DESCRIPTION_fr.md: -------------------------------------------------------------------------------- 1 | Friendica is a decentralised communications platform that integrates social communication. The platform links to independent social projects and corporate services. 2 | Friendica connects you effortlessly to a federated communications network of several thousand servers, with more than half a million user registrations. You can directly connect to anyone on Friendica, Mastodon, Diaspora, GnuSocial, Pleroma, or Hubzilla, regardless where each user profile is hosted. 3 | -------------------------------------------------------------------------------- /doc/POST_INSTALL.md: -------------------------------------------------------------------------------- 1 | You can now login to using any valid YunoHost user credentials. First login attempt may fail, just try again. 2 | -------------------------------------------------------------------------------- /doc/POST_INSTALL_fr.md: -------------------------------------------------------------------------------- 1 | Vous pouvez maintenant vous connecter sur https://__DOMAIN__ en utilisant n'importe quel identifiant Yunohost valide. La première tentative de connexion peut échouer, si tel est le cas, veuillez retenter. 2 | -------------------------------------------------------------------------------- /doc/PRE_UPGRADE.d/2023.12~ynh3.md: -------------------------------------------------------------------------------- 1 | This update will make your Friendica instance use a daemon to handle background tasks, instead of a cron. 2 | -------------------------------------------------------------------------------- /doc/screenshots/friendica-vier-profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YunoHost-Apps/friendica_ynh/4da9d6edd218ed4ec9b82bc53463e66edd437236/doc/screenshots/friendica-vier-profile.png -------------------------------------------------------------------------------- /manifest.toml: -------------------------------------------------------------------------------- 1 | #:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json 2 | 3 | packaging_format = 2 4 | 5 | id = "friendica" 6 | name = "Friendica" 7 | description.en = "Decentralized Social Network" 8 | description.fr = "Réseau social décentralisé" 9 | 10 | version = "2024.12-1~ynh2" 11 | 12 | maintainers = [] 13 | 14 | [upstream] 15 | license = "AGPL-3.0-only" 16 | website = "http://friendi.ca" 17 | demo = "https://dir.friendica.social/servers" 18 | admindoc = "https://github.com/friendica/friendica/wiki" 19 | userdoc = "https://wiki.friendi.ca/" 20 | code = "https://github.com/friendica/friendica" 21 | 22 | [integration] 23 | yunohost = ">= 11.2" 24 | architectures = "all" 25 | multi_instance = true 26 | 27 | ldap = true 28 | sso = true 29 | 30 | disk = "50M" 31 | ram.build = "150M" 32 | ram.runtime = "50M" 33 | 34 | [install] 35 | [install.domain] 36 | type = "domain" 37 | 38 | [install.admin] 39 | type = "user" 40 | 41 | [install.language] 42 | ask.en = "Choose the application language" 43 | ask.fr = "Choisissez la langue de l'application" 44 | type = "select" 45 | choices = [ "de", "en", "es", "fr", "it", "pt" ] 46 | default = "en" 47 | 48 | [resources] 49 | 50 | [resources.sources] 51 | [resources.sources.main] 52 | url = "https://github.com/friendica/friendica/archive/refs/tags/2024.12-1.tar.gz" 53 | sha256 = "44ab54499a66cd632761ce2734ca95afda0f192fd52906d1f9f3ef97d6a00ae0" 54 | autoupdate.strategy = "latest_github_release" 55 | 56 | [resources.sources.addons] 57 | url = "https://github.com/friendica/friendica-addons/archive/refs/tags/2024.12-1.tar.gz" 58 | sha256 = "f63cd7e3fa37d1c946f9bfef0783febfce29c8df26da464f7282cb6d0b15c1f6" 59 | autoupdate.upstream = "https://github.com/friendica/friendica-addons" 60 | autoupdate.strategy = "latest_github_tag" 61 | 62 | [resources.system_user] 63 | 64 | [resources.install_dir] 65 | 66 | [resources.permissions] 67 | main.url = "/" 68 | main.show_tile = true 69 | main.allowed = [ "visitors", "all_users" ] 70 | main.protected = true 71 | 72 | [resources.apt] 73 | packages = "mariadb-server, php8.2-curl, php8.2-mbstring, php8.2-imagick, php8.2-xml, php8.2-zip, php8.2-mysql, php8.2-gd, php8.2-gmp, php8.2-intl" 74 | 75 | [resources.database] 76 | type = "mysql" 77 | -------------------------------------------------------------------------------- /scripts/_common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # COMMON VARIABLES 5 | #================================================= 6 | 7 | #================================================= 8 | # EXPERIMENTAL HELPERS 9 | #================================================= 10 | 11 | #================================================= 12 | # FUTURE OFFICIAL HELPERS 13 | #================================================= 14 | -------------------------------------------------------------------------------- /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 | (cd "$install_dir" && ynh_exec_as "$app" "php$phpversion" bin/console.php maintenance 1) 19 | 20 | trap '(cd $install_dir && ynh_exec_as $app php$phpversion bin/console.php maintenance 0)' EXIT 21 | 22 | #================================================= 23 | # BACKUP THE APP MAIN DIR 24 | #================================================= 25 | 26 | ynh_backup --src_path="$install_dir" 27 | 28 | #================================================= 29 | # SYSTEM CONFIGURATION 30 | #================================================= 31 | 32 | ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" 33 | 34 | ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" 35 | 36 | ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" 37 | ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" 38 | 39 | ynh_backup --src_path="/etc/logrotate.d/$app" 40 | 41 | ynh_backup --src_path="/var/log/$app" 42 | ynh_backup --src_path="/etc/systemd/system/$app-daemon.service" 43 | 44 | #================================================= 45 | # BACKUP THE MYSQL DATABASE 46 | #================================================= 47 | ynh_print_info --message="Backing up the MySQL database..." 48 | 49 | ynh_mysql_dump_db --database="$db_name" > db.sql 50 | 51 | #================================================= 52 | # END OF SCRIPT 53 | #================================================= 54 | 55 | ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." 56 | -------------------------------------------------------------------------------- /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 | # MODIFY URL IN NGINX CONF 14 | #================================================= 15 | ynh_script_progression --message="Updating NGINX web server configuration..." --weight=3 16 | 17 | ynh_change_url_nginx_config 18 | 19 | #================================================= 20 | # MODIFY URL IN FRIENDICA CONF 21 | #================================================= 22 | 23 | ynh_print_info --message="Updating the Friendica config..." 24 | 25 | ynh_replace_string --match_string="'url' => 'https://.*'," --replace_string="'url' => 'https://$domain'," --target_file="$install_dir/config/local.config.php" 26 | ynh_store_file_checksum --file="$install_dir/config/local.config.php" 27 | 28 | #================================================= 29 | # END OF SCRIPT 30 | #================================================= 31 | 32 | ynh_script_progression --message="Change of URL completed for $app" --last 33 | -------------------------------------------------------------------------------- /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 | # RETRIEVE ARGUMENTS FROM THE MANIFEST 14 | #================================================= 15 | 16 | email=$(ynh_user_get_info --username="$admin" --key=mail) 17 | timezone=$(timedatectl show --value --property=Timezone) 18 | 19 | #================================================= 20 | # STORE SETTINGS FROM MANIFEST 21 | #================================================= 22 | ynh_script_progression --message="Storing installation settings..." --weight=1 23 | 24 | ynh_app_setting_set --app="$app" --key=email --value="$email" 25 | 26 | #================================================= 27 | # DOWNLOAD, CHECK AND UNPACK SOURCE 28 | #================================================= 29 | ynh_script_progression --message="Setting up source files..." --weight=5 30 | 31 | # Download, check integrity, uncompress and patch the source from app.src 32 | ynh_setup_source --dest_dir="$install_dir" 33 | ynh_setup_source --dest_dir="$install_dir/addon" --source_id="addons" 34 | 35 | mkdir -p "$install_dir/view/smarty3" 36 | 37 | chmod -R 775 "$install_dir/view/smarty3" 38 | chmod -R o-rwx "$install_dir" 39 | chown -R "$app:www-data" "$install_dir" 40 | 41 | ynh_add_config --template="local-sample.config.php" --destination="$install_dir/config/temp.config.php" 42 | 43 | #================================================= 44 | # SYSTEM CONFIGURATION 45 | #================================================= 46 | ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 47 | 48 | # Create a dedicated PHP-FPM configy 49 | ynh_add_fpm_config 50 | 51 | ynh_add_systemd_config --service="$app-daemon" 52 | 53 | # Create a dedicated nginx config 54 | ynh_add_nginx_config 55 | 56 | yunohost service add "$app-daemon" --description="Friendica daemon" --log="/var/log/$app/daemon.log" 57 | 58 | # Use logrotate to manage application logfile(s) 59 | ynh_use_logrotate 60 | 61 | # Create a dedicated Fail2Ban config 62 | ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^.*authenticate\: failed login attempt.*\"ip\"\:\"\".*$" 63 | 64 | #================================================= 65 | # ADD A CONFIGURATION 66 | #================================================= 67 | ynh_script_progression --message="Adding the LDAP Auth addon configuration file..." --weight=1 68 | 69 | # LDAP addon config 70 | ynh_add_config --template="addon.config.php" --destination="$install_dir/config/addon.config.php" 71 | 72 | #================================================= 73 | # INSTALL FRIENDICA 74 | #================================================= 75 | ynh_script_progression --message="Install Friendica..." --weight=1 76 | 77 | pushd "$install_dir" 78 | # Import Composer dependencies 79 | ynh_exec_as "$app" "php$phpversion" bin/composer.phar install --no-dev --quiet 80 | 81 | # Install application 82 | ynh_exec_as "$app" "php$phpversion" bin/console.php autoinstall -f "$install_dir/config/temp.config.php" 83 | ynh_secure_remove --file="$install_dir/config/temp.config.php" 84 | 85 | # Enable LDAP Auth addon 86 | ynh_exec_as "$app" "php$phpversion" bin/console.php addon enable ldapauth 87 | popd 88 | 89 | #================================================= 90 | # START SYSTEMD SERVICE 91 | #================================================= 92 | ynh_script_progression --message="Starting a systemd service..." --weight=1 93 | 94 | ynh_systemd_action --service_name="$app-daemon" --action="start" --log_path="/var/log/$app/daemon.log" 95 | 96 | #================================================= 97 | # END OF SCRIPT 98 | #================================================= 99 | 100 | ynh_script_progression --message="Installation of $app completed" --last 101 | -------------------------------------------------------------------------------- /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 | #================================================= 13 | # REMOVE SYSTEM CONFIGURATIONS 14 | #================================================= 15 | # REMOVE SERVICE INTEGRATION IN YUNOHOST 16 | #================================================= 17 | 18 | # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) 19 | if ynh_exec_warn_less yunohost service status "$app-daemon" >/dev/null 20 | then 21 | ynh_script_progression --message="Removing $app service integration..." --weight=1 22 | yunohost service remove "$app-daemon" 23 | fi 24 | 25 | #================================================= 26 | # REMOVE SYSTEMD SERVICE 27 | #================================================= 28 | ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 29 | 30 | # Remove the dedicated nginx config 31 | ynh_remove_nginx_config 32 | 33 | # Remove the dedicated PHP-FPM config 34 | ynh_remove_fpm_config 35 | 36 | # Remove the app-specific logrotate config 37 | ynh_remove_logrotate 38 | 39 | ynh_remove_fail2ban_config 40 | 41 | ynh_remove_systemd_config --service="$app-daemon" 42 | 43 | #================================================= 44 | # END OF SCRIPT 45 | #================================================= 46 | 47 | ynh_script_progression --message="Removal of $app completed" --last 48 | -------------------------------------------------------------------------------- /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 | # RESTORE THE APP MAIN DIR 15 | #================================================= 16 | ynh_script_progression --message="Restoring the app main directory..." --weight=1 17 | 18 | ynh_restore_file --origin_path="$install_dir" 19 | 20 | if [ -f "$install_dir/daemon.pid" ]; then ynh_secure_remove --file="$install_dir/daemon.pid"; fi 21 | 22 | chmod -R o-rwx "$install_dir" 23 | chown -R "$app:www-data" "$install_dir" 24 | chmod -R 775 "$install_dir/view/smarty3" 25 | 26 | #================================================= 27 | # RESTORE THE MYSQL DATABASE 28 | #================================================= 29 | ynh_script_progression --message="Restoring the MySQL database..." --weight=1 30 | 31 | ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql 32 | 33 | #================================================= 34 | # RESTORE SYSTEM CONFIGURATIONS 35 | #================================================= 36 | # RESTORE THE PHP-FPM CONFIGURATION 37 | #================================================= 38 | ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 39 | 40 | ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" 41 | 42 | ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" 43 | 44 | ynh_restore_file --origin_path="/etc/systemd/system/$app-daemon.service" 45 | systemctl enable "$app-daemon.service" --quiet 46 | 47 | yunohost service add "$app-daemon" --description="Friendica daemon" --log="/var/log/$app/daemon.log" 48 | 49 | ynh_restore_file --origin_path="/var/log/$app" 50 | 51 | ynh_restore_file --origin_path="/etc/logrotate.d/$app" 52 | 53 | ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" 54 | ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" 55 | ynh_systemd_action --action=restart --service_name=fail2ban 56 | 57 | #================================================= 58 | # GENERIC FINALIZATION 59 | #================================================= 60 | # RELOAD NGINX AND PHP-FPM OR THE APP SERVICE 61 | #================================================= 62 | ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 63 | 64 | ynh_systemd_action --service_name="php$phpversion-fpm" --action=reload 65 | 66 | ynh_systemd_action --service_name=nginx --action=reload 67 | 68 | ynh_systemd_action --service_name="$app-daemon" --action="start" --log_path="/var/log/$app/daemon.log" 69 | 70 | #============== 71 | # FINALIZATION 72 | #============== 73 | 74 | # exit maintenance mode since the app was backed up while in maintenance mode 75 | (cd "$install_dir" && ynh_exec_as "$app" "php$phpversion" bin/console.php maintenance 0) 76 | 77 | #================================================= 78 | # END OF SCRIPT 79 | #================================================= 80 | 81 | ynh_script_progression --message="Restoration completed for $app" --last 82 | -------------------------------------------------------------------------------- /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 | # STOP SYSTEMD SERVICE 14 | #================================================= 15 | ynh_script_progression --message="Stopping a systemd service..." --weight=1 16 | 17 | ynh_systemd_action --service_name="$app-daemon" --action="stop" --log_path="/var/log/$app/daemon.log" 18 | 19 | #================================================= 20 | # DOWNLOAD, CHECK AND UNPACK SOURCE 21 | #================================================= 22 | ynh_script_progression --message="Upgrading source files..." --weight=1 23 | 24 | # Download, check integrity, uncompress and patch the source from app.src 25 | ynh_setup_source --dest_dir="$install_dir" --keep="config/local.config.php" 26 | ynh_setup_source --dest_dir="$install_dir/addon" --source_id="addons" 27 | 28 | # clear the smarty cache 29 | # cf: https://github.com/friendica/friendica/issues/11212#issuecomment-1046051750 30 | ynh_secure_remove --file="$install_dir/view/smarty3/compiled" 31 | mkdir "$install_dir/view/smarty3/compiled" 32 | chmod -R 775 "$install_dir/view/smarty3" 33 | 34 | chmod -R o-rwx "$install_dir" 35 | chown -R "$app:www-data" "$install_dir" 36 | 37 | #================================================= 38 | # REAPPLY SYSTEM CONFIGURATIONS 39 | #================================================= 40 | ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 41 | 42 | # Create a dedicated NGINX config 43 | ynh_add_nginx_config 44 | 45 | # Create a dedicated PHP-FPM config 46 | ynh_add_fpm_config 47 | 48 | ynh_use_logrotate --non-append 49 | 50 | if [ -f "/etc/cron.d/$app" ]; then 51 | ynh_print_info --message="Removing the legacy cron..." 52 | ynh_secure_remove --file="/etc/cron.d/$app" 53 | fi 54 | 55 | ynh_add_systemd_config --service="$app-daemon" 56 | 57 | yunohost service add "$app-daemon" --description="Friendica daemon" --log="/var/log/$app/daemon.log" 58 | 59 | # Create a dedicated Fail2Ban config 60 | ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^.*authenticate\: failed login attempt.*\"ip\"\:\"\".*$" 61 | 62 | #================================================= 63 | # UPDATE A CONFIG FILE 64 | #================================================= 65 | ynh_script_progression --message="Updating a configuration file..." --weight=1 66 | 67 | # fix the url if necessary (there should be no trailing slash) 68 | if [ -f "$install_dir/config/local.config.php" ] && ! grep -q -e "'url' => 'https://$domain'," "$install_dir/config/local.config.php"; then 69 | ynh_print_info --message="Patching the Friendica config file: fix the domain setting..." 70 | ynh_replace_string --match_string="'url' => 'https://.*'," --replace_string="'url' => 'https://$domain'," --target_file="$install_dir/config/local.config.php" 71 | ynh_store_file_checksum --file="$install_dir/config/local.config.php" 72 | fi 73 | 74 | # add the path to the pidfile if missing 75 | if [ -f "$install_dir/config/local.config.php" ] && ! grep -q -e "pidfile" "$install_dir/config/local.config.php"; then 76 | ynh_print_info --message="Patching the Friendica config file: add the PID file path for the daemon..." 77 | ynh_replace_string --match_string="'basepath' => '$install_dir'," --replace_string="'basepath' => '$install_dir',\n 'pidfile' => '$install_dir/daemon.pid'," --target_file="$install_dir/config/local.config.php" 78 | ynh_store_file_checksum --file="$install_dir/config/local.config.php" 79 | fi 80 | 81 | # add log path to the config 82 | if [ -f "$install_dir/config/local.config.php" ] && ! grep -q -e "logfile" "$install_dir/config/local.config.php"; then 83 | ynh_print_info --message="Patching the Friendica config file: add the path for the Friendica logfile..." 84 | ynh_replace_string --match_string="'basepath' => '$install_dir'," --replace_string="'basepath' => '$install_dir',\n 'logfile' => '/var/log/friendica/friendica.log',\n 'loglevel' => 'notice'," --target_file="$install_dir/config/local.config.php" 85 | ynh_store_file_checksum --file="$install_dir/config/local.config.php" 86 | fi 87 | 88 | #================================================= 89 | # STORE THE CONFIG FILE CHECKSUM 90 | #================================================= 91 | 92 | # Run Composer 93 | pushd "$install_dir" 94 | ynh_exec_as "$app" "php$phpversion" bin/composer.phar install --no-dev --quiet 95 | ynh_exec_as "$app" "php$phpversion" bin/console.php dbstructure update 96 | popd 97 | 98 | #================================================= 99 | # START SYSTEMD SERVICE 100 | #================================================= 101 | ynh_script_progression --message="Starting a systemd service..." --weight=1 102 | 103 | ynh_systemd_action --service_name="$app-daemon" --action="start" --log_path="/var/log/$app/daemon.log" 104 | 105 | #================================================= 106 | # END OF SCRIPT 107 | #================================================= 108 | 109 | ynh_script_progression --message="Upgrade of $app completed" --last 110 | -------------------------------------------------------------------------------- /tags: -------------------------------------------------------------------------------- 1 | !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ 2 | !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ 3 | !_TAG_OUTPUT_FILESEP slash /slash or backslash/ 4 | !_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ 5 | !_TAG_PATTERN_LENGTH_LIMIT 96 /0 for no limit/ 6 | !_TAG_PROGRAM_AUTHOR Universal Ctags Team // 7 | !_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ 8 | !_TAG_PROGRAM_URL https://ctags.io/ /official site/ 9 | !_TAG_PROGRAM_VERSION 0.0.0 // 10 | 0 manifest.json /^ {$/;" o array:arguments.install 11 | 0 manifest.json /^ "nginx",$/;" s array:services 12 | 1 manifest.json /^ {$/;" o array:arguments.install 13 | 1 manifest.json /^ "php7.3-fpm",$/;" s array:services 14 | 2 manifest.json /^ "mysql"$/;" s array:services 15 | Developers info README.md /^## Developers info$/;" s chapter:Friendica for YunoHost 16 | Friendica README.md /^## Friendica$/;" s chapter:Friendica for YunoHost 17 | Friendica for YunoHost README.md /^# Friendica for YunoHost$/;" c 18 | Install Friendica README.md /^### Install Friendica$/;" S section:Friendica for YunoHost""Installation 19 | Installation README.md /^## Installation$/;" s chapter:Friendica for YunoHost 20 | Links README.md /^## Links$/;" s chapter:Friendica for YunoHost 21 | Overview README.md /^## Overview$/;" s chapter:Friendica for YunoHost 22 | PR Status pull_request_template.md /^## PR Status$/;" s 23 | Package_check results pull_request_template.md /^## Package_check results$/;" s 24 | Problem pull_request_template.md /^## Problem$/;" s 25 | Register a new domain and add it to YunoHost README.md /^### Register a new domain and add it to YunoHost$/;" S section:Friendica for YunoHost""Installation 26 | Solution pull_request_template.md /^## Solution$/;" s 27 | Supported architectures README.md /^#### Supported architectures$/;" t section:Friendica for YunoHost""User with ldap admin rights 28 | This app claims following features: README.md /^## This app claims following features:$/;" s chapter:Friendica for YunoHost 29 | User with ldap admin rights README.md /^## User with ldap admin rights$/;" s chapter:Friendica for YunoHost 30 | __NAMETOCHANGE__ conf/php-fpm.conf /^[__NAMETOCHANGE__]$/;" s 31 | arguments manifest.json /^ "arguments": {$/;" o 32 | ask manifest.json /^ "ask": {$/;" o object:arguments.install.0 33 | ask manifest.json /^ "ask": {$/;" o object:arguments.install.1 34 | chdir conf/php-fpm.conf /^chdir = __FINALPATH__$/;" k section:__NAMETOCHANGE__ 35 | db_data conf/htconfig.php /^ $db_data = getenv('MYSQL_DATABASE');$/;" v 36 | db_data conf/htconfig.php /^$db_data = 'mysqldatabasename';$/;" v 37 | db_host conf/htconfig.php /^ $db_host = getenv('MYSQL_HOST') . ':' . getenv('MYSQL_PORT');$/;" v 38 | db_host conf/htconfig.php /^$db_host = 'your.mysqlhost.com';$/;" v 39 | db_pass conf/htconfig.php /^ $db_pass = getenv('MYSQL_PASSWORD');$/;" v 40 | db_pass conf/htconfig.php /^$db_pass = 'mysqlpassword';$/;" v 41 | db_user conf/htconfig.php /^ $db_user = getenv('MYSQL_USER');$/;" v 42 | db_user conf/htconfig.php /^ $db_user = getenv('MYSQL_USERNAME');$/;" v 43 | db_user conf/htconfig.php /^$db_user = 'mysqlusername';$/;" v 44 | default_timezone conf/htconfig.php /^$default_timezone = 'America\/Los_Angeles';$/;" v 45 | description manifest.json /^ "description": {$/;" o 46 | email manifest.json /^ "email": ""$/;" s object:maintainer 47 | email manifest.json /^ "email": "aymhce@gmail.com"$/;" s object:previous_maintainers 48 | en manifest.json /^ "en": "Choose a domain for Friendica. Friendica must be installed on the ROOT domain/;" s object:arguments.install.0.ask 49 | en manifest.json /^ "en": "Choose the Friendica administrator (must be an existing YunoHost user)",$/;" s object:arguments.install.1.ask 50 | en manifest.json /^ "en": "Social Communication Server",$/;" s object:description 51 | example manifest.json /^ "example": "domain.org"$/;" s object:arguments.install.0 52 | example manifest.json /^ "example": "homer"$/;" s object:arguments.install.1 53 | fr manifest.json /^ "fr": "Choisissez l'administrateur pour Friendica (l'utilisateur YunoHost doit exist/;" s object:arguments.install.1.ask 54 | fr manifest.json /^ "fr": "Choisissez un domaine pour Friendica.Friendica doit etre installe a la racine/;" s object:arguments.install.0.ask 55 | fr manifest.json /^ "fr": "Serveur de Communication Social"$/;" s object:description 56 | group conf/php-fpm.conf /^group = __USER__$/;" k section:__NAMETOCHANGE__ 57 | group conf/php-fpm.conf /^listen.group = www-data$/;" k section:__NAMETOCHANGE__ 58 | id manifest.json /^ "id": "friendica",$/;" s 59 | install manifest.json /^ "install" : [$/;" a object:arguments 60 | is_there_enough_space scripts/_common.sh /^ is_there_enough_space () {$/;" f 61 | license manifest.json /^ "license": "AGPL-3.0-only",$/;" s 62 | listen conf/php-fpm.conf /^listen = \/var\/run\/php\/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock$/;" k section:__NAMETOCHANGE__ 63 | maintainer manifest.json /^ "maintainer": {$/;" o 64 | max_children conf/php-fpm.conf /^pm.max_children = 5$/;" k section:__NAMETOCHANGE__ 65 | max_spare_servers conf/php-fpm.conf /^pm.max_spare_servers = 3$/;" k section:__NAMETOCHANGE__ 66 | min_spare_servers conf/php-fpm.conf /^pm.min_spare_servers = 1$/;" k section:__NAMETOCHANGE__ 67 | multi_instance manifest.json /^ "multi_instance": true,$/;" b 68 | name manifest.json /^ "name": "admin",$/;" s object:arguments.install.1 69 | name manifest.json /^ "name": "domain",$/;" s object:arguments.install.0 70 | name manifest.json /^ "name": "Anmol Sharma",$/;" s object:maintainer 71 | name manifest.json /^ "name": "aymhce",$/;" s object:previous_maintainers 72 | name manifest.json /^ "name": "Friendica",$/;" s 73 | owner conf/php-fpm.conf /^listen.owner = www-data$/;" k section:__NAMETOCHANGE__ 74 | packaging_format manifest.json /^ "packaging_format": 1,$/;" n 75 | pm conf/php-fpm.conf /^pm = dynamic$/;" k section:__NAMETOCHANGE__ 76 | previous_maintainers manifest.json /^ "previous_maintainers": {$/;" o 77 | request_terminate_timeout conf/php-fpm.conf /^request_terminate_timeout = 1d$/;" k section:__NAMETOCHANGE__ 78 | requirements manifest.json /^ "requirements": {$/;" o 79 | services manifest.json /^ "services": [$/;" a 80 | start_servers conf/php-fpm.conf /^pm.start_servers = 2$/;" k section:__NAMETOCHANGE__ 81 | type manifest.json /^ "type": "domain",$/;" s object:arguments.install.0 82 | type manifest.json /^ "type": "user",$/;" s object:arguments.install.1 83 | url manifest.json /^ "url": "http:\/\/friendi.ca",$/;" s 84 | user conf/php-fpm.conf /^user = __USER__$/;" k section:__NAMETOCHANGE__ 85 | version manifest.json /^ "version": "2021.04~ynh2",$/;" s 86 | ynh_smart_mktemp scripts/_common.sh /^ynh_smart_mktemp () {$/;" f 87 | yunohost manifest.json /^ "yunohost": ">= 4.1.0"$/;" s object:requirements 88 | -------------------------------------------------------------------------------- /tests.toml: -------------------------------------------------------------------------------- 1 | #:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json 2 | 3 | test_format = 1.0 4 | 5 | [default] 6 | 7 | # ------------ 8 | # Tests to run 9 | # ------------ 10 | 11 | exclude = [ "install.private" ] 12 | 13 | # ------------------------------- 14 | # Default args to use for install 15 | # ------------------------------- 16 | 17 | # ------------------------------- 18 | # Commits to test upgrade from 19 | # ------------------------------- 20 | 21 | # test_upgrade_from.a93169d04583ff13ba7d29aa4962477fb7e3b468.name = "Upgrade from 2023.12~ynh3" 22 | test_upgrade_from.d679e756ddef5ce91417e14cc56c2082e31df07b.name = "Upgrade from 2024.12-1~ynh1" 23 | --------------------------------------------------------------------------------