├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── package_linter.yml │ ├── update_master.yml │ ├── updater_ffmpeg-static.sh │ └── updater_ffmpeg-static.yml ├── .gitignore ├── LICENSE ├── README.md ├── conf ├── build-lock.json ├── env ├── immich-machine-learning-start.sh ├── immich-machine-learning.service ├── immich-server-start.sh ├── immich-server.service └── nginx.conf ├── doc ├── .gitkeep ├── DESCRIPTION.md ├── DESCRIPTION_fr.md ├── PRE_INSTALL.md ├── PRE_INSTALL_fr.md └── screenshots │ ├── .gitkeep │ └── immich-screenshots.png ├── manifest.toml ├── scripts ├── _common.sh ├── backup ├── change_url ├── install ├── remove ├── restore └── upgrade └── tests.toml /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. 4 | 5 | --- 6 | 7 | **How to post a meaningful bug report** 8 | 1. *Read this whole template first.* 9 | 2. *Determine if you are on the right place:* 10 | - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* 11 | - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* 12 | - *When in doubt, post here and we will figure it out together.* 13 | 3. *Delete the italic comments as you write over them below, and remove this guide.* 14 | --- 15 | 16 | ### Describe the bug 17 | 18 | *A clear and concise description of what the bug is.* 19 | 20 | ### Context 21 | 22 | - Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* 23 | - YunoHost version: x.x.x 24 | - I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* 25 | - Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* 26 | - If yes, please explain: 27 | - Using, or trying to install package version/branch: 28 | - If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* 29 | 30 | ### Steps to reproduce 31 | 32 | - *If you performed a command from the CLI, the command itself is enough. For example:* 33 | ```sh 34 | sudo yunohost app install the_app 35 | ``` 36 | - *If you used the webadmin, please perform the equivalent command from the CLI first.* 37 | - *If the error occurs in your browser, explain what you did:* 38 | 1. *Go to '...'* 39 | 2. *Click on '...'* 40 | 3. *Scroll down to '...'* 41 | 4. *See error* 42 | 43 | ### Expected behavior 44 | 45 | *A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* 46 | 47 | ### Logs 48 | 49 | *When an operation fails, YunoHost provides a simple way to share the logs.* 50 | - *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* 51 | - *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* 52 | 53 | *After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* 54 | 55 | *If applicable and useful, add screenshots to help explain your problem.* 56 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Problem 2 | 3 | - *Description of why you made this PR* 4 | 5 | ## Solution 6 | 7 | - *And how do you fix that problem* 8 | 9 | ## PR Status 10 | 11 | - [ ] Code finished and ready to be reviewed/tested 12 | - [ ] The fix/enhancement were manually tested (if applicable) 13 | 14 | ## Automatic tests 15 | 16 | Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization) 17 | -------------------------------------------------------------------------------- /.github/workflows/package_linter.yml: -------------------------------------------------------------------------------- 1 | name: YunoHost apps package linter 2 | 3 | on: 4 | # Allow to manually trigger the workflow 5 | workflow_dispatch: 6 | push: 7 | pull_request: 8 | 9 | jobs: 10 | test: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v4 14 | 15 | - name: Set up Python 16 | uses: actions/setup-python@v5 17 | with: 18 | python-version: '3.11' 19 | 20 | - name: Install dependencies 21 | run: | 22 | python -m pip install --upgrade pip 23 | pip install tomli pyparsing six jsonschema 24 | 25 | - name: 'Clone YunoHost apps package linter' 26 | run: | 27 | git clone --depth=1 https://github.com/YunoHost/package_linter ~/package_linter 28 | 29 | - name: 'Run linter' 30 | run: | 31 | ~/package_linter/package_linter.py . 32 | -------------------------------------------------------------------------------- /.github/workflows/update_master.yml: -------------------------------------------------------------------------------- 1 | name: Create master promotion pull request 2 | on: 3 | # Allow to manually trigger the workflow 4 | workflow_dispatch: 5 | # Run it when when someone pushes to testing 6 | push: 7 | branches: 8 | - testing 9 | jobs: 10 | masterPromotion: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v4 14 | with: 15 | ref: master 16 | - name: Reset promotion branch 17 | run: | 18 | git fetch origin testing:testing 19 | git reset --hard testing 20 | - name: Create Pull Request 21 | uses: peter-evans/create-pull-request@v6 22 | with: 23 | branch: master-promotion 24 | title: 'Upgrade master from testing' 25 | body: | 26 | Upgrade master from testing 27 | -------------------------------------------------------------------------------- /.github/workflows/updater_ffmpeg-static.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # FETCHING LATEST SHA256SUM 5 | #================================================= 6 | 7 | # Fetching information 8 | version_current=$(cat manifest.toml | tomlq -j '.version') 9 | # version_app=$(cat manifest.toml | tomlq -j '.version|split("~ynh")[0]') 10 | # version_ynh=$(cat manifest.toml | tomlq -j '.version|split("~ynh")[1]') 11 | # version_next="$version_app~ynh$(($version_ynh+1))" 12 | # version=$(echo "$version_next" | tr '~' '-') 13 | version=$(echo "$version_current" | tr '~' '-') 14 | repo=$(cat manifest.toml | tomlq -j '.upstream.code|split("https://github.com/")[1]') 15 | 16 | amd64_url=$(cat manifest.toml | tomlq -j '.resources.sources."ffmpeg-static".amd64.url') 17 | amd64_sha_current=$(cat manifest.toml | tomlq -j '.resources.sources."ffmpeg-static".amd64.sha256') 18 | amd64_sha_last=$(curl -fsSL --retry 3 "$amd64_url" | sha256sum - | cut -d " " -f1) 19 | 20 | arm64_url=$(cat manifest.toml | tomlq -j '.resources.sources."ffmpeg-static".arm64.url') 21 | arm64_sha_current=$(cat manifest.toml | tomlq -j '.resources.sources."ffmpeg-static".arm64.sha256') 22 | arm64_sha_last=$(curl -fsSL --retry 3 "$arm64_url" | sha256sum - | cut -d " " -f1) 23 | # For the time being, let's assume the script will fail 24 | echo "PROCEED=false" >> $GITHUB_ENV 25 | 26 | # Proceed only if the retrieved version is greater than the current one 27 | if [ "$amd64_sha_current" == "$amd64_sha_last" ] && [ "$arm64_sha_current" == "$arm64_sha_last" ] 28 | then 29 | echo "::warning ::No new version available" 30 | exit 0 31 | # Proceed only if a PR for this new version does not already exist 32 | elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-ffmpeg-static-sha-$version 33 | then 34 | echo "::warning ::A branch already exists for this update" 35 | exit 0 36 | fi 37 | 38 | # Print some infos 39 | echo "Current version: $version_current" 40 | echo "Current ffmpeg-static amd64 sha : $amd64_sha_current" 41 | echo "Last ffmpeg-static amd64 sha : $amd64_sha_last" 42 | echo "Current ffmpeg-static arm64 sha : $arm64_sha_current" 43 | echo "Last ffmpeg-static arm64 sha : $arm64_sha_last" 44 | # echo "Latest version: $version_next" 45 | 46 | # Setting up the environment variables 47 | echo "VERSION=$version" >> $GITHUB_ENV 48 | echo "REPO=$repo" >> $GITHUB_ENV 49 | 50 | #================================================= 51 | # GENERIC FINALIZATION 52 | #================================================= 53 | 54 | # Replace new version in manifest 55 | # sed -i "s/^version = .*/version = \"$version_next\"/" manifest.toml 56 | 57 | # Replace sha356sum in manifest 58 | sed -i "s@^\"amd64.sha256\" = .*@\"amd64.sha256\" = \"$amd64_sha_last\"@" manifest.toml 59 | sed -i "s@^\"arm64.sha256\" = .*@\"arm64.sha256\" = \"$arm64_sha_last\"@" manifest.toml 60 | 61 | # The Action will proceed only if the PROCEED environment variable is set to true 62 | echo "PROCEED=true" >> $GITHUB_ENV 63 | exit 0 64 | -------------------------------------------------------------------------------- /.github/workflows/updater_ffmpeg-static.yml: -------------------------------------------------------------------------------- 1 | # This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. 2 | # You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. 3 | # This file should be enough by itself, but feel free to tune it to your needs. 4 | # It calls updater.sh, which is where you should put the app-specific update steps. 5 | name: Check for new ffmpeg-static releases 6 | on: 7 | # Allow to manually trigger the workflow 8 | workflow_dispatch: 9 | # Run it every day at 6:00 UTC 10 | schedule: 11 | - cron: '0 6 * * *' 12 | jobs: 13 | updater: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Fetch the source code 17 | uses: actions/checkout@v4 18 | with: 19 | token: ${{ secrets.GITHUB_TOKEN }} 20 | - name: Set up Python 21 | uses: actions/setup-python@v5 22 | with: 23 | python-version: '3.9' 24 | - name: Install yq/tomlq 25 | id: install_yq 26 | run: pip install yq 27 | - name: Run the updater script 28 | id: run_updater 29 | run: | 30 | # Setting up Git user 31 | git config --global user.name 'yunohost-bot' 32 | git config --global user.email 'yunohost-bot@users.noreply.github.com' 33 | # Run the updater script 34 | /bin/bash .github/workflows/updater_ffmpeg-static.sh 35 | - name: Commit changes 36 | id: commit 37 | if: ${{ env.PROCEED == 'true' }} 38 | run: | 39 | git commit -am "Update ffmpeg-static sha for $VERSION" 40 | - name: Create Pull Request to testing 41 | id: cpr-testing 42 | if: ${{ env.PROCEED == 'true' }} 43 | uses: peter-evans/create-pull-request@v6 44 | with: 45 | token: ${{ secrets.GITHUB_TOKEN }} 46 | commit-message: Update ffmpeg-static sha for ${{ env.VERSION }} 47 | committer: 'yunohost-bot ' 48 | author: 'yunohost-bot ' 49 | signoff: false 50 | base: testing 51 | branch: ci-auto-update-ffmpeg-static-sha-${{ env.VERSION }} 52 | delete-branch: true 53 | title: 'Update ffmpeg-static sha for ${{ env.VERSION }}' 54 | body: | 55 | Update ffmpeg-static sha for ${{ env.VERSION }} 56 | draft: false 57 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.sw[op] 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 5 | 6 |

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

10 | 11 | Photo and video backup solution directly from your mobile phone 12 | 13 | [![🌐 Official app website](https://img.shields.io/badge/Official_app_website-darkgreen?style=for-the-badge)](https://immich.app) 14 | [![Version: 1.134.0~ynh1](https://img.shields.io/badge/Version-1.134.0~ynh1-rgba(0,150,0,1)?style=for-the-badge)](https://ci-apps.yunohost.org/ci/apps/immich/) 15 | 16 |
17 | 18 | 19 |
20 | 21 | ## 📦 Developer info 22 | 23 | [![Automatic tests level](https://apps.yunohost.org/badge/cilevel/immich)](https://ci-apps.yunohost.org/ci/apps/immich/) 24 | 25 | 🛠️ Upstream Immich repository: 26 | 27 | Pull request are welcome and should target the [`testing` branch](https://github.com/YunoHost-Apps/immich_ynh/tree/testing). 28 | 29 | The `testing` branch can be tested using: 30 | ``` 31 | # fresh install: 32 | sudo yunohost app install https://github.com/YunoHost-Apps/immich_ynh/tree/testing 33 | 34 | # upgrade an existing install: 35 | sudo yunohost app upgrade immich -u https://github.com/YunoHost-Apps/immich_ynh/tree/testing 36 | ``` 37 | 38 | ### 📚 App packaging documentation 39 | 40 | Please see for more information. -------------------------------------------------------------------------------- /conf/build-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "sources": [ 3 | { 4 | "name": "imagemagick", 5 | "version": "?" 6 | }, 7 | { 8 | "name": "libheif", 9 | "version": "?" 10 | }, 11 | { 12 | "name": "libraw", 13 | "version": "?" 14 | }, 15 | { 16 | "name": "libvips", 17 | "version": "?" 18 | } 19 | ], 20 | "packages": [ 21 | { 22 | "name": "ffmpeg", 23 | "version": "__FFMPEG_VERSION__" 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /conf/env: -------------------------------------------------------------------------------- 1 | ## General 2 | NODE_ENV=production 3 | UPLOAD_LOCATION=__DATA_DIR__ 4 | IMMICH_MEDIA_LOCATION=__DATA_DIR__ 5 | IMMICH_WEB_ROOT=__INSTALL_DIR__/app/www 6 | IMMICH_VERSION=release 7 | 8 | ## Ports 9 | IMMICH_HOST=127.0.0.1 10 | IMMICH_PORT=__PORT__ 11 | IMMICH_MACHINE_LEARNING_URL=http://127.0.0.1:__PORT_MACHINELEARNING__ 12 | 13 | ## Database 14 | DB_HOSTNAME=127.0.0.1 15 | DB_PORT=__DB_PORT__ 16 | DB_USERNAME=__APP__ 17 | DB_PASSWORD=__DB_PWD__ 18 | DB_DATABASE_NAME=__APP__ 19 | DB_VECTOR_EXTENSION=pgvector 20 | 21 | ## Redis 22 | REDIS_HOSTNAME=127.0.0.1 23 | 24 | ## Third-party information 25 | IMMICH_THIRD_PARTY_SOURCE_URL=https://github.com/YunoHost-Apps/immich_ynh/ 26 | IMMICH_THIRD_PARTY_BUG_FEATURE_URL=https://github.com/YunoHost-Apps/immich_ynh/issues 27 | -------------------------------------------------------------------------------- /conf/immich-machine-learning-start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -a 4 | source "__INSTALL_DIR__/env" 5 | set +a 6 | 7 | cd "__INSTALL_DIR__/app/machine-learning" 8 | source venv/bin/activate 9 | 10 | : "${IMMICH_HOST:=127.0.0.1}" 11 | : "${MACHINE_LEARNING_PORT:=__PORT_MACHINELEARNING__}" 12 | : "${MACHINE_LEARNING_WORKERS:=1}" 13 | : "${MACHINE_LEARNING_HTTP_KEEPALIVE_TIMEOUT_S:=2}" 14 | : "${MACHINE_LEARNING_WORKER_TIMEOUT:=300}" 15 | : "${MACHINE_LEARNING_CACHE_FOLDER:=__INSTALL_DIR__/.cache_ml}" 16 | : "${TRANSFORMERS_CACHE:=__INSTALL_DIR__/.cache_ml}" 17 | 18 | exec gunicorn immich_ml.main:app \ 19 | -k immich_ml.config.CustomUvicornWorker \ 20 | -c immich_ml/gunicorn_conf.py \ 21 | -b "$IMMICH_HOST":"$MACHINE_LEARNING_PORT" \ 22 | -w "$MACHINE_LEARNING_WORKERS" \ 23 | -t "$MACHINE_LEARNING_WORKER_TIMEOUT" \ 24 | --log-config-json log_conf.json \ 25 | --keep-alive "$MACHINE_LEARNING_HTTP_KEEPALIVE_TIMEOUT_S" \ 26 | --graceful-timeout 10 27 | -------------------------------------------------------------------------------- /conf/immich-machine-learning.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Immich machine-learning 3 | Documentation=https://github.com/immich-app/immich 4 | After=network.target 5 | PartOf=__APP__-server.service 6 | Before=__APP__-server.service 7 | 8 | [Service] 9 | Type=simple 10 | Restart=on-failure 11 | User=__APP__ 12 | Group=__APP__ 13 | WorkingDirectory=__INSTALL_DIR__/app 14 | EnvironmentFile=__INSTALL_DIR__/env 15 | ExecStart=__INSTALL_DIR__/app/machine-learning/start.sh 16 | SyslogIdentifier=immich-machine-learning 17 | StandardOutput=append:/var/log/__APP__/__APP__-machine-learning.log 18 | StandardError=append:/var/log/__APP__/__APP__-machine-learning.log 19 | Restart=on-failure 20 | UMask=0077 21 | 22 | # Sandboxing options to harden security 23 | # Depending on specificities of your service/app, you may need to tweak these 24 | # .. but this should be a good baseline 25 | # Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html 26 | NoNewPrivileges=yes 27 | PrivateTmp=yes 28 | PrivateDevices=yes 29 | RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 30 | RestrictNamespaces=yes 31 | RestrictRealtime=yes 32 | DevicePolicy=closed 33 | ProtectSystem=full 34 | ProtectControlGroups=yes 35 | ProtectKernelModules=yes 36 | ProtectKernelTunables=yes 37 | LockPersonality=yes 38 | SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap 39 | 40 | # Denying access to capabilities that should not be relevant for webapps 41 | # Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html 42 | CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD 43 | CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE 44 | CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT 45 | CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK 46 | CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM 47 | CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG 48 | CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE 49 | CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW 50 | CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG 51 | 52 | [Install] 53 | WantedBy=immich-server.service 54 | -------------------------------------------------------------------------------- /conf/immich-server-start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -a 4 | source "__INSTALL_DIR__/env" 5 | set +a 6 | 7 | cd "__INSTALL_DIR__/app" 8 | exec __NODEJS_DIR__/node "__INSTALL_DIR__/app/dist/main" "$@" 9 | -------------------------------------------------------------------------------- /conf/immich-server.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Immich server 3 | Documentation=https://github.com/immich-app/immich 4 | Requires=redis-server.service 5 | Requires=postgresql.service 6 | Requires=__APP__-machine-learning.service 7 | After=network.target 8 | 9 | [Service] 10 | Type=simple 11 | Restart=on-failure 12 | User=__APP__ 13 | Group=__APP__ 14 | WorkingDirectory=__INSTALL_DIR__/app 15 | Environment="PATH=__INSTALL_DIR__/ffmpeg-static:__PATH_WITH_NODEJS__" 16 | EnvironmentFile=__INSTALL_DIR__/env 17 | ExecStart=__NODEJS_DIR__/node __INSTALL_DIR__/app/dist/main 18 | SyslogIdentifier=immich-server 19 | StandardOutput=append:/var/log/__APP__/__APP__-server.log 20 | StandardError=append:/var/log/__APP__/__APP__-server.log 21 | Restart=on-failure 22 | UMask=0077 23 | 24 | # Sandboxing options to harden security 25 | # Depending on specificities of your service/app, you may need to tweak these 26 | # .. but this should be a good baseline 27 | # Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html 28 | NoNewPrivileges=yes 29 | PrivateTmp=yes 30 | PrivateDevices=yes 31 | RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 32 | RestrictNamespaces=yes 33 | RestrictRealtime=yes 34 | DevicePolicy=closed 35 | ProtectSystem=full 36 | ProtectControlGroups=yes 37 | ProtectKernelModules=yes 38 | ProtectKernelTunables=yes 39 | LockPersonality=yes 40 | SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap 41 | 42 | # Denying access to capabilities that should not be relevant for webapps 43 | # Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html 44 | CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD 45 | CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE 46 | CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT 47 | CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK 48 | CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM 49 | CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG 50 | CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE 51 | CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW 52 | CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG 53 | 54 | [Install] 55 | WantedBy=multi-user.target 56 | -------------------------------------------------------------------------------- /conf/nginx.conf: -------------------------------------------------------------------------------- 1 | location __PATH__/ { 2 | 3 | proxy_pass http://127.0.0.1:__PORT__; 4 | 5 | # allow large file uploads 6 | client_max_body_size 50G; 7 | client_body_timeout 600s; 8 | client_body_buffer_size 512k; 9 | 10 | # Set headers 11 | proxy_set_header Host $host; 12 | proxy_set_header X-Real-IP $remote_addr; 13 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 14 | proxy_set_header X-Forwarded-Proto $scheme; 15 | proxy_set_header X-Forwarded-Host $server_name; 16 | 17 | # enable websockets: http://nginx.org/en/docs/http/websocket.html 18 | proxy_http_version 1.1; 19 | proxy_set_header Upgrade $http_upgrade; 20 | proxy_set_header Connection "upgrade"; 21 | proxy_redirect off; 22 | 23 | # set timeout 24 | proxy_read_timeout 600s; 25 | proxy_send_timeout 600s; 26 | send_timeout 600s; 27 | } 28 | -------------------------------------------------------------------------------- /doc/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YunoHost-Apps/immich_ynh/38c8d63421c70ebef48d6668789d6bf2df64e338/doc/.gitkeep -------------------------------------------------------------------------------- /doc/DESCRIPTION.md: -------------------------------------------------------------------------------- 1 | Self-hosted photo and video management solution. 2 | 3 | ### Features 4 | 5 | - Simple-to-use backup tool with a native mobile app that can view photos and videos efficiently ; 6 | - Easy-to-use and friendly interface ; 7 | -------------------------------------------------------------------------------- /doc/DESCRIPTION_fr.md: -------------------------------------------------------------------------------- 1 | Solution d'autohébergement pour la gestion de vos photos et vidéos. 2 | 3 | ### Caractéristiques 4 | 5 | - Sauvegarde depuis l'applicaton mobile qui permet également de visualiser efficacement photos et vidéos ; 6 | - Interface conviviale et egronomique ; 7 | -------------------------------------------------------------------------------- /doc/PRE_INSTALL.md: -------------------------------------------------------------------------------- 1 | This package provides support for the JPEG, PNG, WebP, AVIF (limited to 8-bit depth), TIFF, GIF and SVG (input) image formats. 2 | **HEIC/HEIF file format is not supported** (see cf. https://github.com/YunoHost-Apps/immich_ynh/issues/40#issuecomment-2096788600). 3 | 4 | Please ensure **your mobile app and server are on the same version**. Otherwise, you won't be able to access the app. 5 | -------------------------------------------------------------------------------- /doc/PRE_INSTALL_fr.md: -------------------------------------------------------------------------------- 1 | Ce package supporte les formats d'images suivant : JPEG, PNG, WebP, AVIF (limité à profondeur de couleur de 8 bits), TIFF, GIF et SVG. 2 | **Le format HEIC/HEIF n'est pas supporté** (cf. https://github.com/YunoHost-Apps/immich_ynh/issues/40#issuecomment-2096788600). 3 | 4 | Assurez-vous que **l'application mobile et le serveur sont sur la même version**. Dans le cas contraire vous risquez de ne pas pouvoir accèder à l'application. 5 | -------------------------------------------------------------------------------- /doc/screenshots/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YunoHost-Apps/immich_ynh/38c8d63421c70ebef48d6668789d6bf2df64e338/doc/screenshots/.gitkeep -------------------------------------------------------------------------------- /doc/screenshots/immich-screenshots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YunoHost-Apps/immich_ynh/38c8d63421c70ebef48d6668789d6bf2df64e338/doc/screenshots/immich-screenshots.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 = "immich" 6 | name = "Immich" 7 | description.en = "Photo and video backup solution directly from your mobile phone" 8 | description.fr = "Sauvegarde de photos et de vidéos directement depuis votre mobile" 9 | 10 | version = "1.134.0~ynh1" 11 | 12 | maintainers = ["ewilly"] 13 | 14 | [upstream] 15 | license = "AGPL-3.0-or-later" 16 | website = "https://immich.app" 17 | admindoc = "https://github.com/immich-app/immich#getting-started" 18 | userdoc = "https://github.com/immich-app/immich#getting-started" 19 | code = "https://github.com/immich-app/immich" 20 | 21 | [integration] 22 | yunohost = ">= 12" 23 | helpers_version = "2.1" 24 | architectures = ["arm64", "amd64"] 25 | multi_instance = false 26 | 27 | ldap = false 28 | 29 | sso = false 30 | 31 | disk = "2G" 32 | ram.build = "2G" 33 | ram.runtime = "500M" 34 | 35 | [install] 36 | [install.domain] 37 | type = "domain" 38 | 39 | [install.init_main_permission] 40 | type = "group" 41 | default = "visitors" 42 | 43 | [resources] 44 | [resources.sources] 45 | 46 | [resources.sources.main] 47 | url = "https://github.com/immich-app/immich/archive/refs/tags/v1.134.0.tar.gz" 48 | sha256 = "7225ddd7876639258a675aad6967650fdd8ade8f1dad81e450c1644ec6ccbce2" 49 | 50 | autoupdate.strategy = "latest_github_release" 51 | 52 | [resources.sources.ffmpeg-static] 53 | amd64.url = "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz" 54 | amd64.sha256 = "abda8d77ce8309141f83ab8edf0596834087c52467f6badf376a6a2a4c87cf67" 55 | arm64.url = "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-arm64-static.tar.xz" 56 | arm64.sha256 = "f4149bb2b0784e30e99bdda85471c9b5930d3402014e934a5098b41d0f7201b1" 57 | 58 | # Autoupdate does not work as not finding tags 59 | #autoupdate.strategy = "latest_webpage_link" 60 | #autoupdate.upstream = "https://johnvansickle.com/ffmpeg/releases/" 61 | #autoupdate.asset.amd64 = "^ffmpeg-release-amd64-static.tar.xz$" 62 | #autoupdate.asset.arm64 = "^ffmpeg-release-arm64-static.tar.xz$" 63 | 64 | [resources.system_user] 65 | 66 | [resources.install_dir] 67 | 68 | [resources.data_dir] 69 | 70 | [resources.permissions] 71 | main.url = "/" 72 | api.url = "/api" 73 | api.allowed = "visitors" 74 | api.show_tile = false 75 | api.protected = true 76 | 77 | [resources.ports] 78 | main.default = 2283 79 | machinelearning.default = 3003 80 | 81 | [resources.apt] 82 | packages = [ 83 | "pipx", 84 | "curl", 85 | "postgresql", 86 | "redis-server", 87 | "python3", 88 | "python3-dev", 89 | "libssl-dev", 90 | "libffi-dev", 91 | "uuid-runtime", 92 | "autoconf", 93 | "build-essential", 94 | "unzip", 95 | "jq", 96 | "perl", 97 | "libnet-ssleay-perl", 98 | "libio-socket-ssl-perl", 99 | "libcapture-tiny-perl", 100 | "libfile-which-perl", 101 | "libfile-chdir-perl", 102 | "libpkgconfig-perl", 103 | "libffi-checklib-perl", 104 | "libtest-warnings-perl", 105 | "libtest-fatal-perl", 106 | "libtest-needs-perl", 107 | "libtest2-suite-perl", 108 | "libsort-versions-perl", 109 | "libpath-tiny-perl", 110 | "libtry-tiny-perl", 111 | "libterm-table-perl", 112 | "libany-uri-escape-perl", 113 | "libmojolicious-perl", 114 | "libfile-slurper-perl", 115 | "liblcms2-2", 116 | "wget", 117 | "yq" 118 | ] 119 | 120 | [resources.apt.extras.postgresql] 121 | repo = "deb https://apt.postgresql.org/pub/repos/apt __YNH_DEBIAN_VERSION__-pgdg main 16" 122 | key = "https://www.postgresql.org/media/keys/ACCC4CF8.asc" 123 | packages = [ 124 | "libpq5", 125 | "libpq-dev", 126 | "postgresql-16", 127 | "postgresql-16-pgvector", 128 | "postgresql-client-16" 129 | ] 130 | 131 | [resources.database] 132 | type = "postgresql" 133 | -------------------------------------------------------------------------------- /scripts/_common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # COMMON VARIABLES AND CUSTOM HELPERS 5 | #================================================= 6 | 7 | # App version 8 | app_version() { 9 | ynh_read_manifest "version" \ 10 | | cut -d'~' -f1 11 | } #1.101.0 12 | 13 | # NodeJS required version 14 | app_node_version() { 15 | cat "$source_dir/server/Dockerfile" \ 16 | | grep "FROM node:" \ 17 | | head -n1 \ 18 | | cut -d':' -f2 \ 19 | | cut -d'.' -f1 20 | } 21 | 22 | # Fail2ban 23 | failregex="$app-server.*Failed login attempt for user.+from ip address\s?" 24 | 25 | # PostgreSQL required version 26 | app_psql_version() { 27 | ynh_read_manifest "resources.apt.extras.postgresql.packages" \ 28 | | grep -o 'postgresql-[0-9][0-9]-pgvector' \ 29 | | head -n1 \ 30 | | cut -d'-' -f2 31 | } 32 | app_psql_port() { 33 | pg_lsclusters --no-header \ 34 | | grep "^$(app_psql_version)" \ 35 | | cut -d' ' -f3 36 | } 37 | 38 | # Python required version 39 | app_py_version() { 40 | cat "$source_dir/machine-learning/Dockerfile" \ 41 | | grep "FROM python:" \ 42 | | head -n1 \ 43 | | cut -d':' -f2 \ 44 | | cut -d'-' -f1 45 | } #3.11 46 | 47 | # Check hardware requirements 48 | myynh_check_hardware() { 49 | # CPU: Prebuilt binaries for linux-x64 require v2 microarchitecture 50 | local file_test="/lib64/ld-linux-x86-64.so.2" 51 | if [ -f "$file_test" ] 52 | then 53 | if [ -z "$( $file_test --help | grep 'x86-64-v2 (supported' )" ] 54 | then 55 | ynh_die "Your CPU is too old and not supported. Installation of $app is not possible on your system." 56 | fi 57 | fi 58 | } 59 | 60 | # Install immich 61 | myynh_install_immich() { 62 | # Thanks to https://github.com/arter97/immich-native 63 | # Check https://github.com/immich-app/base-images/blob/main/server/Dockerfile for changes 64 | 65 | # Add ffmpeg-static direcotry to $PATH 66 | PATH="$ffmpeg_static_dir:$PATH" 67 | 68 | # Define nodejs options 69 | ram_G=$((($(ynh_get_ram --total) - (1024/2))/1024)) 70 | ram_G=$(($ram_G > 1 ? $ram_G : 1)) 71 | export NODE_OPTIONS="--max_old_space_size=$(($ram_G*1024))" 72 | 73 | # Replace /usr/src 74 | cd "$source_dir" 75 | grep -Rl "/usr/src" | xargs -n1 sed -i -e "s@/usr/src@$install_dir@g" 76 | 77 | # Replace /build 78 | grep -RlE "\"/build\"|'/build'" \ 79 | | xargs -n1 sed -i -e "s@\"/build\"@\"$install_dir/app\"@g" -e "s@'/build'@'$install_dir/app'@g" 80 | 81 | # Install immich-server 82 | # Build server 83 | cd "$source_dir/server" 84 | ynh_hide_warnings npm ci 85 | ynh_hide_warnings npm run build 86 | ynh_hide_warnings npm prune --omit=dev --omit=optional 87 | # Build typescript 88 | cd "$source_dir/open-api/typescript-sdk" 89 | ynh_hide_warnings npm ci 90 | ynh_hide_warnings npm run build 91 | # Build web 92 | cd "$source_dir/web" 93 | ynh_hide_warnings npm ci 94 | ynh_hide_warnings npm run build 95 | # Copy built files 96 | mkdir -p "$install_dir/app/" 97 | cp -a "$source_dir/server/node_modules" "$install_dir/app/" 98 | cp -a "$source_dir/server/dist" "$install_dir/app/" 99 | cp -a "$source_dir/server/bin" "$install_dir/app/" 100 | cp -a "$source_dir/web/build" "$install_dir/app/www" 101 | cp -a "$source_dir/server/resources" "$install_dir/app/" 102 | cp -a "$source_dir/server/package.json" "$install_dir/app/" 103 | cp -a "$source_dir/server/package-lock.json" "$install_dir/app/" 104 | cp -a "$source_dir/LICENSE" "$install_dir/app/" 105 | cp -a "$source_dir/i18n" "$install_dir/" 106 | # Install custom start.sh script 107 | ynh_config_add --template="$app-server-start.sh" --destination="$install_dir/app/start.sh" 108 | # Clean 109 | cd "$install_dir/app/" 110 | ynh_hide_warnings npm cache clean --force 111 | 112 | # Install immich-machine-learning 113 | cd "$source_dir/machine-learning" 114 | mkdir -p "$install_dir/app/machine-learning" 115 | # Install uv 116 | PIPX_HOME="/opt/pipx" PIPX_BIN_DIR="/usr/local/bin" pipx install uv --force 2>&1 117 | PIPX_HOME="/opt/pipx" PIPX_BIN_DIR="/usr/local/bin" pipx upgrade uv --force 2>&1 118 | local uv="/usr/local/bin/uv" 119 | # Execute in a subshell 120 | ( 121 | # Create the virtual environment 122 | "$uv" venv --quiet "$install_dir/app/machine-learning/venv" --python "$(app_py_version)" 123 | # activate the virtual environment 124 | set +o nounset 125 | source "$install_dir/app/machine-learning/venv/bin/activate" 126 | set -o nounset 127 | # add pip 128 | "$uv" pip --quiet --no-cache-dir install --upgrade pip 129 | # add uv 130 | ynh_hide_warnings "$install_dir/app/machine-learning/venv/bin/pip" install --no-cache-dir --upgrade uv 131 | # uv install 132 | ynh_hide_warnings "$install_dir/app/machine-learning/venv/bin/uv" sync --quiet --no-install-project --no-install-workspace --extra cpu --no-cache --active --link-mode=copy 133 | ) 134 | # Copy built files 135 | cp -a "$source_dir/machine-learning/immich_ml" "$install_dir/app/machine-learning/" 136 | # Install custom start.sh script 137 | ynh_config_add --template="$app-machine-learning-start.sh" --destination="$install_dir/app/machine-learning/start.sh" 138 | # Create the cache direcotry 139 | mkdir -p "$install_dir/.cache_ml" 140 | 141 | # Install geonames 142 | mkdir -p "$source_dir/geonames" 143 | cd "$source_dir/geonames" 144 | # Download files 145 | curl -LO "https://download.geonames.org/export/dump/cities500.zip" 2>&1 146 | curl -LO "https://download.geonames.org/export/dump/admin1CodesASCII.txt" 2>&1 147 | curl -LO "https://download.geonames.org/export/dump/admin2Codes.txt" 2>&1 148 | curl -LO "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/v5.1.2/geojson/ne_10m_admin_0_countries.geojson" 2>&1 149 | unzip "cities500.zip" 150 | # Copy built files 151 | mkdir -p "$install_dir/app/geodata/" 152 | cp -a "$source_dir/geonames/cities500.txt" "$install_dir/app/geodata/" 153 | cp -a "$source_dir/geonames/admin1CodesASCII.txt" "$install_dir/app/geodata/" 154 | cp -a "$source_dir/geonames/admin2Codes.txt" "$install_dir/app/geodata/" 155 | cp -a "$source_dir/geonames/ne_10m_admin_0_countries.geojson" "$install_dir/app/geodata/" 156 | # Update geodata-date 157 | date --iso-8601=seconds | tr -d "\n" > "$install_dir/app/geodata/geodata-date.txt" 158 | 159 | # Install sharp 160 | cd "$install_dir/app" 161 | ynh_hide_warnings npm install sharp 162 | ynh_hide_warnings npm cache clean --force 163 | 164 | # Retrieve dependencies version 165 | ffmpeg_version=$("$install_dir/ffmpeg-static/ffmpeg" -version | grep "ffmpeg version" | cut -d" " -f3) 166 | 167 | # Cleanup 168 | ynh_safe_rm "$source_dir" 169 | } 170 | 171 | # Execute a psql command as root user 172 | # usage: myynh_execute_psql_as_root --sql=sql [--options=options] [--database=database] 173 | # | arg: -s, --sql= - the SQL command to execute 174 | # | arg: -o, --options= - the options to add to psql 175 | # | arg: -d, --database= - the database to connect to 176 | myynh_execute_psql_as_root() { 177 | # Declare an array to define the options of this helper. 178 | local legacy_args=sod 179 | local -A args_array=([s]=sql= [o]=options= [d]=database=) 180 | local sql 181 | local options 182 | local database 183 | # Manage arguments with getopts 184 | ynh_handle_getopts_args "$@" 185 | options="${options:-}" 186 | database="${database:-}" 187 | if [ -n "$database" ] 188 | then 189 | database="--dbname=$database" 190 | fi 191 | 192 | LC_ALL=C sudo --login --user=postgres PGUSER=postgres PGPASSWORD="$(cat $PSQL_ROOT_PWD_FILE)" \ 193 | psql --cluster="$(app_psql_version)/main" $options "$database" --command="$sql" 194 | } 195 | 196 | # Drop default db & user created by [resources.database] in manifest 197 | myynh_deprovision_default() { 198 | ynh_psql_database_exists $app && ynh_psql_drop_db $app || true 199 | ynh_psql_user_exists $app && ynh_psql_drop_user $app || true 200 | } 201 | 202 | # Create the cluster 203 | myynh_create_psql_cluster() { 204 | if [[ -z `pg_lsclusters | grep $(app_psql_version)` ]] 205 | then 206 | pg_createcluster $(app_psql_version) main --start 207 | fi 208 | } 209 | 210 | # Install the database 211 | myynh_create_psql_db() { 212 | myynh_execute_psql_as_root --sql="CREATE DATABASE $app;" 213 | myynh_execute_psql_as_root --sql="CREATE USER $app WITH ENCRYPTED PASSWORD '$db_pwd';" --database="$app" 214 | myynh_execute_psql_as_root --sql="GRANT ALL PRIVILEGES ON DATABASE $app TO $app;" --database="$app" 215 | myynh_execute_psql_as_root --sql="ALTER USER $app WITH SUPERUSER;" --database="$app" 216 | myynh_execute_psql_as_root --sql="CREATE EXTENSION IF NOT EXISTS vector;" --database="$app" 217 | } 218 | 219 | # Update the database 220 | myynh_update_psql_db() { 221 | databases=$(myynh_execute_psql_as_root --sql="SELECT datname FROM pg_database WHERE datistemplate = false OR datname = 'template1';" \ 222 | --options="--tuples-only --no-align" --database="postgres") 223 | 224 | for db in $databases 225 | do 226 | if ynh_hide_warnings myynh_execute_psql_as_root --sql=";" --database="$db" \ 227 | | grep -q "collation version mismatch" 228 | then 229 | ynh_hide_warnings myynh_execute_psql_as_root --sql="REINDEX DATABASE $db;" --database="$db" 230 | myynh_execute_psql_as_root --sql="ALTER DATABASE $db REFRESH COLLATION VERSION;" --database="$db" 231 | fi 232 | done 233 | } 234 | 235 | # Remove the database 236 | myynh_drop_psql_db() { 237 | myynh_execute_psql_as_root --sql="REVOKE CONNECT ON DATABASE $app FROM public;" 238 | myynh_execute_psql_as_root --sql="SELECT pg_terminate_backend (pg_stat_activity.pid) FROM pg_stat_activity \ 239 | WHERE pg_stat_activity.datname = '$app' AND pid <> pg_backend_pid();" 240 | myynh_execute_psql_as_root --sql="DROP DATABASE $app;" 241 | myynh_execute_psql_as_root --sql="DROP USER $app;" 242 | } 243 | 244 | # Dump the database 245 | myynh_dump_psql_db() { 246 | sudo --login --user=postgres pg_dump --cluster="$(app_psql_version)/main" --dbname="$app" > db.sql 247 | } 248 | 249 | # Restore the database 250 | myynh_restore_psql_db() { 251 | # https://github.com/immich-app/immich/issues/5630#issuecomment-1866581570 252 | ynh_replace --match="SELECT pg_catalog.set_config('search_path', '', false);" \ 253 | --replace="SELECT pg_catalog.set_config('search_path', 'public, pg_catalog', true);" --file="db.sql" 254 | 255 | sudo --login --user=postgres PGUSER=postgres PGPASSWORD="$(cat $PSQL_ROOT_PWD_FILE)" \ 256 | psql --cluster="$(app_psql_version)/main" --dbname="$app" < ./db.sql 257 | } 258 | 259 | 260 | # Set permissions 261 | myynh_set_permissions() { 262 | chown -R $app: "$install_dir" 263 | chmod u=rwX,g=rX,o= "$install_dir" 264 | chmod -R o-rwx "$install_dir" 265 | 266 | chmod +x "$install_dir/app/start.sh" 267 | chmod +x "$install_dir/app/machine-learning/start.sh" 268 | 269 | chown -R $app: "$data_dir" 270 | chmod u=rwX,g=rX,o= "$data_dir" 271 | chmod -R o-rwx "$data_dir" 272 | 273 | chown -R $app: "/var/log/$app" 274 | chmod u=rw,g=r,o= "/var/log/$app" 275 | } 276 | 277 | myynh_set_default_psql_cluster_to_debian_default() { 278 | local default_port=5432 279 | local config_file="/etc/postgresql-common/user_clusters" 280 | 281 | #retrieve informations about default psql cluster 282 | default_psql_version=$(pg_lsclusters --no-header | grep "$default_port" | cut -d' ' -f1) 283 | default_psql_cluster=$(pg_lsclusters --no-header | grep "$default_port" | cut -d' ' -f2) 284 | default_psql_database=$(pg_lsclusters --no-header | grep "$default_port" | cut -d' ' -f5) 285 | 286 | # Remove non commented lines 287 | sed -i'.bak' -e '/^#/!d' "$config_file" 288 | 289 | # Add new line USER GROUP VERSION CLUSTER DATABASE 290 | echo -e "* * $default_psql_version $default_psql_cluster $default_psql_database" >> "$config_file" 291 | 292 | # Remove the autoprovisionned db if not on right cluster 293 | if [ "$(app_psql_port)" -ne "$default_port" ] 294 | then 295 | if ynh_psql_database_exists "$app" 296 | then 297 | ynh_psql_drop_db "$app" 298 | fi 299 | if ynh_psql_user_exists "$app" 300 | then 301 | ynh_psql_drop_user "$app" 302 | fi 303 | fi 304 | } 305 | -------------------------------------------------------------------------------- /scripts/backup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # IMPORT GENERIC HELPERS 5 | #================================================= 6 | 7 | # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts 8 | source ../settings/scripts/_common.sh 9 | source /usr/share/yunohost/helpers 10 | 11 | ynh_print_info "Declaring files to be backed up..." 12 | 13 | #================================================= 14 | # BACKUP THE APP MAIN DIR 15 | #================================================= 16 | 17 | ynh_backup "$install_dir" 18 | 19 | #================================================= 20 | # BACKUP THE DATA DIR 21 | #================================================= 22 | 23 | ynh_backup "$data_dir" 24 | 25 | #================================================= 26 | # BACKUP SYSTEM CONFIGURATION 27 | #================================================= 28 | 29 | # Backup the NGINX configuration 30 | ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" 31 | 32 | # Backup the systemd service unit 33 | ynh_backup "/etc/systemd/system/$app-server.service" 34 | ynh_backup "/etc/systemd/system/$app-machine-learning.service" 35 | 36 | # Backup the logrotate configuration 37 | ynh_backup "/etc/logrotate.d/$app" 38 | 39 | # Backup the Fail2Ban config 40 | ynh_backup "/etc/fail2ban/jail.d/$app.conf" 41 | ynh_backup "/etc/fail2ban/filter.d/$app.conf" 42 | 43 | #================================================= 44 | # BACKUP VARIOUS FILES 45 | #================================================= 46 | ynh_backup "/var/log/$app/" 47 | 48 | #================================================= 49 | # BACKUP THE POSTGRESQL DATABASE 50 | #================================================= 51 | ynh_print_info "Backing up a PostgreSQL database..." 52 | 53 | myynh_update_psql_db 54 | myynh_dump_psql_db 55 | 56 | #================================================= 57 | # END OF SCRIPT 58 | #================================================= 59 | 60 | ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." 61 | -------------------------------------------------------------------------------- /scripts/change_url: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # IMPORT GENERIC HELPERS 5 | #================================================= 6 | 7 | source _common.sh 8 | source /usr/share/yunohost/helpers 9 | 10 | #================================================= 11 | # STOP SYSTEMD SERVICE 12 | #================================================= 13 | ynh_script_progression "Stopping $app's systemd service..." 14 | 15 | ynh_systemctl --service="$app-machine-learning" --action="stop" --log_path="/var/log/$app/$app-machine-learning.log" 16 | ynh_systemctl --service="$app-server" --action="stop" --log_path="/var/log/$app/$app-server.log" 17 | 18 | #================================================= 19 | # MODIFY URL IN NGINX CONF 20 | #================================================= 21 | ynh_script_progression "Updating NGINX web server configuration..." 22 | 23 | # this will most likely adjust NGINX config correctly 24 | ynh_config_change_url_nginx 25 | 26 | #================================================= 27 | # START SYSTEMD SERVICE 28 | #================================================= 29 | ynh_script_progression "Starting $app's systemd service..." 30 | 31 | ynh_systemctl --service="$app-machine-learning" --action="start" --wait_until="Application startup complete" --log_path="/var/log/$app/$app-machine-learning.log" 32 | ynh_systemctl --service="$app-server" --action="start" --wait_until="Immich Server is listening" --log_path="/var/log/$app/$app-server.log" 33 | 34 | #================================================= 35 | # END OF SCRIPT 36 | #================================================= 37 | 38 | ynh_script_progression "Change of URL completed for $app" 39 | -------------------------------------------------------------------------------- /scripts/install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # IMPORT GENERIC HELPERS 5 | #================================================= 6 | 7 | source _common.sh 8 | source /usr/share/yunohost/helpers 9 | 10 | #================================================= 11 | # CHECK HARDWARE REQUIREMENTS 12 | #================================================= 13 | ynh_script_progression "Checking hardware requirements..." 14 | 15 | myynh_check_hardware 16 | 17 | #================================================= 18 | # INITIALIZE AND STORE SETTINGS 19 | #================================================= 20 | 21 | #================================================= 22 | # DOWNLOAD, CHECK AND UNPACK SOURCE 23 | #================================================= 24 | ynh_script_progression "Setting up source files..." 25 | 26 | source_dir="$install_dir/source" 27 | ynh_setup_source --source_id="main" --dest_dir="$source_dir" 28 | 29 | ffmpeg_static_dir="$install_dir/ffmpeg-static" 30 | ynh_setup_source --source_id="ffmpeg-static" --dest_dir="$ffmpeg_static_dir" 31 | 32 | #================================================= 33 | # INSTALL NODEJS 34 | #================================================= 35 | ynh_script_progression "Installing nodejs..." 36 | 37 | nodejs_version=$(app_node_version) 38 | ynh_nodejs_install 39 | 40 | #================================================= 41 | # CREATE A POSTGRESQL DATABASE 42 | #================================================= 43 | ynh_script_progression "Creating a PostgreSQL database..." 44 | 45 | myynh_deprovision_default 46 | 47 | db_pwd=$(ynh_string_random) 48 | myynh_create_psql_cluster 49 | myynh_update_psql_db 50 | myynh_create_psql_db 51 | db_port=$(myynh_execute_psql_as_root --sql="\echo :PORT") 52 | ynh_app_setting_set --key=psql_pwd --value="$db_pwd" 53 | ynh_app_setting_set --key=psql_version --value="$(app_psql_version)" 54 | ynh_app_setting_set --key=psql_port --value="$(app_psql_port)" 55 | 56 | myynh_set_default_psql_cluster_to_debian_default 57 | 58 | #================================================= 59 | # MAKE INSTALL 60 | #================================================= 61 | ynh_script_progression "Making install..." 62 | 63 | myynh_install_immich 64 | 65 | #================================================= 66 | # APP INITIAL CONFIGURATION 67 | #================================================= 68 | ynh_script_progression "Adding $app's configuration files..." 69 | 70 | ynh_config_add --template="env" --destination="$install_dir/env" 71 | ynh_config_add --template="build-lock.json" --destination="$install_dir/app/build-lock.json" 72 | 73 | #================================================= 74 | # SYSTEM CONFIGURATION 75 | #================================================= 76 | ynh_script_progression "Adding system configurations related to $app..." 77 | 78 | ynh_config_add_nginx 79 | 80 | ynh_config_add_systemd --service="$app-server" --template="$app-server.service" 81 | ynh_config_add_systemd --service="$app-machine-learning" --template="$app-machine-learning.service" 82 | 83 | yunohost service add "$app-server" --description="Immich Server" --log="/var/log/$app/$app-server.log" 84 | yunohost service add "$app-machine-learning" --description="Immich Machine Learning" --log="/var/log/$app/$app-machine-learning.log" 85 | 86 | ynh_multimedia_build_main_dir 87 | ynh_multimedia_addaccess "$app" 88 | 89 | # Use logrotate to manage application logfile(s) 90 | ynh_config_add_logrotate 91 | 92 | # Create a dedicated Fail2Ban config 93 | ynh_config_add_fail2ban --logpath="/var/log/$app/$app-server.log" --failregex="$failregex" 94 | 95 | #================================================= 96 | # SET FILE OWNERSHIP / PERMISSIONS 97 | #================================================= 98 | 99 | myynh_set_permissions 100 | 101 | #================================================= 102 | # START SYSTEMD SERVICE 103 | #================================================= 104 | ynh_script_progression "Starting $app's systemd service..." 105 | 106 | ynh_systemctl --service="$app-machine-learning" --action="start" --wait_until="Application startup complete" --log_path="/var/log/$app/$app-machine-learning.log" 107 | ynh_systemctl --service="$app-server" --action="start" --wait_until="Immich Server is listening" --log_path="/var/log/$app/$app-server.log" --timeout=900 108 | 109 | #================================================= 110 | # END OF SCRIPT 111 | #================================================= 112 | 113 | ynh_script_progression "Installation of $app completed" 114 | -------------------------------------------------------------------------------- /scripts/remove: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # IMPORT GENERIC HELPERS 5 | #================================================= 6 | 7 | source _common.sh 8 | source /usr/share/yunohost/helpers 9 | 10 | #================================================= 11 | # REMOVE SYSTEM CONFIGURATION 12 | #================================================= 13 | ynh_script_progression "Removing system configurations related to $app..." 14 | 15 | ynh_config_remove_fail2ban 16 | 17 | ynh_config_remove_logrotate 18 | 19 | # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) 20 | if ynh_hide_warnings yunohost service status "$app-server" >/dev/null; then 21 | yunohost service remove "$app-server" 22 | fi 23 | ynh_config_remove_systemd "$app-server" 24 | 25 | if ynh_hide_warnings yunohost service status "$app-machine-learning" >/dev/null; then 26 | yunohost service remove "$app-machine-learning" 27 | fi 28 | ynh_config_remove_systemd "$app-machine-learning" 29 | 30 | ynh_config_remove_nginx 31 | 32 | myynh_drop_psql_db 33 | 34 | ynh_nodejs_remove 35 | 36 | #================================================= 37 | # END OF SCRIPT 38 | #================================================= 39 | 40 | ynh_script_progression "Removal of $app completed" 41 | -------------------------------------------------------------------------------- /scripts/restore: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # IMPORT GENERIC HELPERS 5 | #================================================= 6 | 7 | # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts 8 | source ../settings/scripts/_common.sh 9 | source /usr/share/yunohost/helpers 10 | 11 | #================================================= 12 | # CHECK HARDWARE REQUIREMENTS 13 | #================================================= 14 | ynh_script_progression "Checking hardware requirements..." 15 | 16 | myynh_check_hardware 17 | 18 | #================================================= 19 | # RESTORE THE APP MAIN DIR 20 | #================================================= 21 | ynh_script_progression "Restoring the app main directory..." 22 | 23 | ynh_restore "$install_dir" 24 | 25 | #================================================= 26 | # RESTORE THE DATA DIRECTORY 27 | #================================================= 28 | ynh_script_progression "Restoring the data directory..." 29 | 30 | ynh_restore "$data_dir" 31 | 32 | #================================================= 33 | # INSTALL NODEJS 34 | #================================================= 35 | ynh_script_progression "Reinstalling nodejs..." 36 | 37 | nodejs_version=$(yq -r .nodejs_version "../settings/settings.yml") 38 | ynh_nodejs_install 39 | 40 | #================================================= 41 | # RESTORE THE DATABASE 42 | #================================================= 43 | ynh_script_progression "Restoring the database..." 44 | 45 | myynh_deprovision_default 46 | 47 | db_pwd=$(ynh_app_setting_get --key=psql_pwd) 48 | myynh_create_psql_cluster 49 | myynh_update_psql_db 50 | myynh_create_psql_db 51 | myynh_restore_psql_db 52 | 53 | myynh_set_default_psql_cluster_to_debian_default 54 | 55 | #================================================= 56 | # RESTORE SYSTEM CONFIGURATION 57 | #================================================= 58 | ynh_script_progression "Restoring system configurations related to $app..." 59 | 60 | ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" 61 | 62 | ynh_restore "/etc/systemd/system/$app-server.service" 63 | ynh_restore "/etc/systemd/system/$app-machine-learning.service" 64 | 65 | systemctl enable "$app-server.service" --quiet 66 | systemctl enable "$app-machine-learning.service" --quiet 67 | 68 | yunohost service add "$app-server" --description="Immich Server" --log="/var/log/$app/$app-server.log" 69 | yunohost service add "$app-machine-learning" --description="Immich Machine Learning" --log="/var/log/$app/$app-machine-learning.log" 70 | 71 | ynh_multimedia_build_main_dir 72 | ynh_multimedia_addaccess "$app" 73 | 74 | ynh_restore "/etc/logrotate.d/$app" 75 | 76 | ynh_restore "/etc/fail2ban/jail.d/$app.conf" 77 | ynh_restore "/etc/fail2ban/filter.d/$app.conf" 78 | ynh_systemctl --service="fail2ban" --action="restart" 79 | 80 | #================================================= 81 | # RESTORE VARIOUS FILES 82 | #================================================= 83 | 84 | ynh_restore "/var/log/$app/" 85 | 86 | #================================================= 87 | # SET FILE OWNERSHIP / PERMISSIONS 88 | #================================================= 89 | 90 | myynh_set_permissions 91 | 92 | #================================================= 93 | # RELOAD NGINX AND PHP-FPM OR THE APP SERVICE 94 | #================================================= 95 | ynh_script_progression "Reloading NGINX web server and $app's service..." 96 | 97 | ynh_systemctl --service="$app-machine-learning" --action="start" --wait_until="Application startup complete" --log_path="/var/log/$app/$app-machine-learning.log" 98 | ynh_systemctl --service="$app-server" --action="start" --wait_until="Immich Server is listening" --log_path="/var/log/$app/$app-server.log" --timeout=900 99 | 100 | ynh_systemctl --service="nginx" --action="reload" 101 | 102 | #================================================= 103 | # END OF SCRIPT 104 | #================================================= 105 | 106 | ynh_script_progression "Restoration completed for $app" 107 | -------------------------------------------------------------------------------- /scripts/upgrade: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # IMPORT GENERIC HELPERS 5 | #================================================= 6 | 7 | source _common.sh 8 | source /usr/share/yunohost/helpers 9 | 10 | #================================================= 11 | # CHECK HARDWARE REQUIREMENTS 12 | #================================================= 13 | ynh_script_progression "Checking hardware requirements..." 14 | 15 | myynh_check_hardware 16 | 17 | #================================================= 18 | # STOP SYSTEMD SERVICE 19 | #================================================= 20 | ynh_script_progression "Stopping $app's systemd service..." 21 | 22 | ynh_systemctl --service="$app-server" --action="stop" 23 | 24 | #================================================= 25 | # ENSURE DOWNWARD COMPATIBILITY 26 | #================================================= 27 | ynh_script_progression "Ensuring downward compatibility..." 28 | 29 | if ynh_app_upgrading_from_version_before 1.118.2~ynh1 30 | then 31 | if ynh_hide_warnings yunohost service status "$app-microservices" >/dev/null 32 | then 33 | yunohost service remove "$app-microservices" 34 | fi 35 | ynh_config_remove_systemd "$app-microservices" 36 | find "/var/log/$app/" -name "$app-microservices.log*" -delete 37 | ynh_app_setting_delete --key="port_microservices" 38 | ynh_app_setting_delete --key="checksum__var_www_immich_env-machine-learning" 39 | ynh_app_setting_delete --key="checksum__var_www_immich_env-server" 40 | ynh_app_setting_delete --key="checksum__etc_systemd_system_immich-microservices.service" 41 | fi 42 | 43 | #================================================= 44 | # DOWNLOAD, CHECK AND UNPACK SOURCE 45 | #================================================= 46 | ynh_script_progression "Upgrading source files..." 47 | 48 | ynh_safe_rm "$install_dir" 49 | 50 | source_dir="$install_dir/source" 51 | ynh_setup_source --source_id="main" --dest_dir="$source_dir" --full_replace 52 | 53 | ffmpeg_static_dir="$install_dir/ffmpeg-static" 54 | ynh_setup_source --source_id="ffmpeg-static" --dest_dir="$ffmpeg_static_dir" --full_replace 55 | 56 | #================================================= 57 | # INSTALL NODEJS 58 | #================================================= 59 | ynh_script_progression "Installing nodejs..." 60 | 61 | nodejs_version=$(app_node_version) 62 | ynh_nodejs_install 63 | 64 | #================================================= 65 | # UPDATE A POSTGRESQL DATABASE 66 | #================================================= 67 | ynh_script_progression "Udpating a PostgreSQL database..." 68 | 69 | myynh_update_psql_db 70 | 71 | myynh_set_default_psql_cluster_to_debian_default 72 | 73 | #================================================= 74 | # MAKE INSTALL 75 | #================================================= 76 | ynh_script_progression "Making install..." 77 | 78 | myynh_install_immich 79 | 80 | #================================================= 81 | # UPDATE A CONFIG FILE 82 | #================================================= 83 | ynh_script_progression "Updating $app's configuration files..." 84 | 85 | db_pwd=$(ynh_app_setting_get --key=psql_pwd) 86 | db_port=$(ynh_app_setting_get --key=psql_port) 87 | 88 | ynh_config_add --template="env" --destination="$install_dir/env" 89 | ynh_config_add --template="build-lock.json" --destination="$install_dir/app/build-lock.json" 90 | 91 | #================================================= 92 | # REAPPLY SYSTEM CONFIGURATION 93 | #================================================= 94 | ynh_script_progression "Upgrading system configurations related to $app..." 95 | 96 | ynh_config_add_nginx 97 | 98 | ynh_config_add_systemd --service="$app-server" --template="$app-server.service" 99 | ynh_config_add_systemd --service="$app-machine-learning" --template="$app-machine-learning.service" 100 | 101 | yunohost service add "$app-server" --description="Immich Server" --log="/var/log/$app/$app-server.log" 102 | yunohost service add "$app-machine-learning" --description="Immich Machine Learning" --log="/var/log/$app/$app-machine-learning.log" 103 | 104 | ynh_multimedia_build_main_dir 105 | ynh_multimedia_addaccess "$app" 106 | 107 | ynh_config_add_logrotate 108 | 109 | ynh_config_add_fail2ban --logpath="/var/log/$app/$app-server.log" --failregex="$failregex" 110 | 111 | #================================================= 112 | # SET FILE OWNERSHIP / PERMISSIONS 113 | #================================================= 114 | 115 | myynh_set_permissions 116 | 117 | #================================================= 118 | # START SYSTEMD SERVICE 119 | #================================================= 120 | ynh_script_progression "Starting $app's systemd service..." 121 | 122 | ynh_systemctl --service="$app-machine-learning" --action="start" --wait_until="Application startup complete" --log_path="/var/log/$app/$app-machine-learning.log" 123 | ynh_systemctl --service="$app-server" --action="start" --wait_until="Immich Server is listening" --log_path="/var/log/$app/$app-server.log" --timeout=900 124 | 125 | #================================================= 126 | # END OF SCRIPT 127 | #================================================= 128 | 129 | ynh_script_progression "Upgrade of $app completed" 130 | -------------------------------------------------------------------------------- /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 | # ------------------------------- 12 | # Default args to use for install 13 | # ------------------------------- 14 | 15 | # ------------------------------- 16 | # Commits to test upgrade from 17 | # ------------------------------- 18 | 19 | test_upgrade_from.701d7ed420c6df058f468c645e7f4c1d8e24218f.name = "Upgrade from 1.130.2~ynh1" 20 | 21 | # ------------------------------- 22 | # Commits to test upgrade from 6c44cf52521b423739b1399102fcc9ead5be6eab 23 | # 1.117.0~ynh2 with separeted microservices container/process 24 | # ------------------------------- 25 | # test_upgrade_from.6c44cf5.name = "1.117.0~ynh2" 26 | # test_upgrade_from.6c44cf5.args.domain = "sub.domain.tld" 27 | # test_upgrade_from.6c44cf5.args.init_main_permission = "visitors" 28 | --------------------------------------------------------------------------------