From 2079583866d83d7baf6b2331f256806501ee0702 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 6 Aug 2022 23:42:50 -0500 Subject: [PATCH] Update installation method and documentation (#424) * Add installation script * Populate instsall.sh * format * Get IP address on both macos and linux * Update mobile version * Remove test folder * Added sed command for ios * Added sed command for ios * Fixed ios command * Fixed ios command * Added friendly debug message * Update README * Update Readme with new installation instruction * Update message on instsallation script --- README.md | 89 +++++++++++-------- install.sh | 83 +++++++++++++++++ mobile/android/fastlane/Fastfile | 2 +- mobile/ios/Runner.xcodeproj/project.pbxproj | 6 +- mobile/ios/Runner/Info.plist | 4 +- mobile/ios/fastlane/Fastfile | 2 +- mobile/ios/fastlane/report.xml | 14 +-- .../shared-components/navigation-bar.svelte | 2 +- 8 files changed, 150 insertions(+), 52 deletions(-) create mode 100755 install.sh diff --git a/README.md b/README.md index 4dc680685f..a912ddbf77 100644 --- a/README.md +++ b/README.md @@ -61,11 +61,11 @@ This project is under heavy development, there will be continuous functions, fea | | Mobile | Web | | - | - | - | | Upload and view videos and photos | Yes | Yes -| Auto backup when app is opened | Yes | N/A +| Auto backup when the app is opened | Yes | N/A | Selective album(s) for backup | Yes | N/A | Download photos and videos to local device | Yes | Yes | Multi-user support | Yes | Yes -| Album | No | Yes +| Album | Yes | Yes | Shared Albums | Yes | Yes | Quick navigation with draggable scrollbar | Yes | Yes | Support RAW (HEIC, HEIF, DNG, Apple ProRaw) | Yes | Yes @@ -82,9 +82,9 @@ This project is under heavy development, there will be continuous functions, fea **Core**: At least 2 cores, preffered 4 cores. -# Getting Started +# Technology Stack -You can use docker compose for development and testing out the application, there are several services that compose Immich: +There are several services that compose Immich: 1. **NestJs** - Backend of the application 2. **SvelteKit** - Web frontend of the application @@ -93,19 +93,51 @@ You can use docker compose for development and testing out the application, ther 5. **Nginx** - Load balancing and optimized file uploading. 6. **TensorFlow** - Object Detection (COCO SSD) and Image Classification (ImageNet). -## Step 1: Populate .env file +# Installing -Navigate to `docker` directory and run +## One-step installation - for evaluating only -``` -cp .env.example .env +*Applicable system: Ubuntu, Debian, MacOS* + +*This installation method is for evaluating Immich before futher customization to meet the users' needs.* + +In the shell, from the directory of your choice, run the following command: + +```bash +curl -o- https://raw.githubusercontent.com/immich-app/immich/main/install.sh | bash ``` -Then populate the value in there. +This script will download the `docker-compose.yml` file and the `.env` file, then populate the necessary information, and finally run the `docker-compose up` or `docker compose up` (based on your docker's version) command. -Notice that if set `ENABLE_MAPBOX` to `true`, you will have to provide `MAPBOX_KEY` for the server to run. +The web application will be available at `http://:2283`, and the server URL for the mobile app will be `http://:2283/api`. -Pay attention to the key `UPLOAD_LOCATION`, this directory must exist and is owned by the user that run the `docker-compose` command below. +The directory which is used to store the backup file is `./immich-app/immich-data`. + + +## Customize installation - for production usage + +### Step 1 - Download necessary files + +Create a directory called `immich-app` and cd into it. Then + +Get `docker-compose.yml` + +```bash +wget https://raw.githubusercontent.com/immich-app/immich/main/docker/docker-compose.yml +``` + +Get `.env` + +```bash +wget -O .env wget https://raw.githubusercontent.com/immich-app/immich/main/docker/.env.example +``` + +### Step 2 - Populate .env file with customed information + +* Populate customised database information if necessary. +* Populate `UPLOAD_LOCATION` as prefered location for storing backup assets. +* Populate a secret value for `JWT_SECRET` +* [Optional] Popluate Mapbox value. **Example** @@ -133,36 +165,15 @@ JWT_SECRET=randomstringthatissolongandpowerfulthatnoonecanguess # ENABLE_MAPBOX is either true of false -> if true, you have to provide MAPBOX_KEY ENABLE_MAPBOX=false MAPBOX_KEY= - -################################################################################### -# WEB -################################################################################### -# This is the URL of your vm/server where you host Immich, so that the web frontend -# know where can it make the request to. -# For example: If your server IP address is 10.1.11.50, the environment variable will -# be VITE_SERVER_ENDPOINT=http://10.1.11.50:2283/api -VITE_SERVER_ENDPOINT=http://192.168.1.216:2283/api ``` -## Step 2: Start the server +### Step 3 - Start the containers -To **start**, run +Run `docker-compose up` or `docker-compose up` (based on your docker's version) -```bash -docker-compose -f ./docker/docker-compose.yml up -``` +### Step 4 - Register admin user -To *update* docker-compose with newest image (if you have started the docker-compose previously) - -```bash -docker-compose -f ./docker/docker-compose.yml pull && docker-compose -f ./docker/docker-compose.yml up -``` - -The server will be running at `http://your-ip:2283/api` - -## Step 3: Register User - -Access the web interface at `http://your-ip:2283` to register an admin account. +Navigate to the web at `http://:2283` and follow the prompts to register admin user.

@@ -174,14 +185,16 @@ Additional accounts on the server can be created by the admin account.

-## Step 4: Run mobile app +### Step 5 - Access the mobile app -Login the mobile app with your server address +Login the mobile app with the server endpoint URL at `http://:2283/api`

+## Mobile app + ## F-Droid You can get the app on F-droid by clicking the image below. diff --git a/install.sh b/install.sh new file mode 100755 index 0000000000..5372948847 --- /dev/null +++ b/install.sh @@ -0,0 +1,83 @@ +echo "Starting Immich installation..." + +ip_address=$(hostname -I | awk '{print $1}') + +RED='\033[0;31m' +GREEN='\032[0;31m' +NC='\033[0m' # No Color + +machine_has() { + type "$1" >/dev/null 2>&1 +} + +create_immich_directory() { + echo "Creating Immich directory..." + mkdir -p ./immich-app/immich-data +} + +download_docker_compose_file() { + echo "Downloading docker-compose.yml..." + curl -L https://raw.githubusercontent.com/immich-app/immich/main/docker/docker-compose.yml -o ./immich-app/docker-compose.yml >/dev/null 2>&1 +} + +download_dot_env_file() { + echo "Downloading .env file..." + curl -L https://raw.githubusercontent.com/immich-app/immich/main/docker/.env.example -o ./immich-app/.env >/dev/null 2>&1 +} + +populate_upload_location() { + echo "Populating default UPLOAD_LOCATION value..." + + cd ./immich-app/immich-data + + upload_location=$(pwd) + + # Replace value of UPLOAD_LOCATION in .env with upload_location path + if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i '' "s|UPLOAD_LOCATION=.*|UPLOAD_LOCATION=$upload_location|" ../.env + else + sed -i "s|UPLOAD_LOCATION=.*|UPLOAD_LOCATION=$upload_location|" ../.env + fi + + cd .. +} + +start_docker_compose() { + echo "Starting Immich's docker containers" + + if machine_has "docker compose"; then { + docker compose up --remove-orphans -d + + show_friendly_message + exit 0 + }; fi + + if machine_has "docker-compose"; then + docker-compose up --remove-orphans -d + + show_friendly_message + exit 0 + fi +} + +show_friendly_message() { + echo "Succesfully deployed Immich!" + echo "You can access the website at http://$ip_address:2283 and the server URL for the mobile app is http://$ip_address:2283/api" + echo "The backup (or upload) location is $upload_location" + echo "---------------------------------------------------" + echo "If you want to confgure custom information of the server, including the database, Redis information, or the backup (or upload) location, etc. + + 1. First bring down the containers with the command 'docker-compose down' in the immich-app directory, + + 2. Then change the information that fits your needs in the '.env' file, + + 3. Finally, bring the containers back up with the command 'docker-compose up --remove-orphans -d' in the immich-app directory" + +} + +# MAIN +create_immich_directory +download_docker_compose_file +download_dot_env_file +populate_upload_location +start_docker_compose diff --git a/mobile/android/fastlane/Fastfile b/mobile/android/fastlane/Fastfile index 3ab753d410..d6ba2fb411 100644 --- a/mobile/android/fastlane/Fastfile +++ b/mobile/android/fastlane/Fastfile @@ -31,7 +31,7 @@ platform :android do build_type: 'Release', properties: { "android.injected.version.code" => 29, - "android.injected.version.name" => "1.19.0", + "android.injected.version.name" => "1.20.0", } ) upload_to_play_store(skip_upload_apk: true, skip_upload_images: true, skip_upload_screenshots: true, aab: '../build/app/outputs/bundle/release/app-release.aab') diff --git a/mobile/ios/Runner.xcodeproj/project.pbxproj b/mobile/ios/Runner.xcodeproj/project.pbxproj index a92e0b058e..4ed6cda265 100644 --- a/mobile/ios/Runner.xcodeproj/project.pbxproj +++ b/mobile/ios/Runner.xcodeproj/project.pbxproj @@ -360,7 +360,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 35; + CURRENT_PROJECT_VERSION = 38; DEVELOPMENT_TEAM = 2F67MQ8R79; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -495,7 +495,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 35; + CURRENT_PROJECT_VERSION = 38; DEVELOPMENT_TEAM = 2F67MQ8R79; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -522,7 +522,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 35; + CURRENT_PROJECT_VERSION = 38; DEVELOPMENT_TEAM = 2F67MQ8R79; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; diff --git a/mobile/ios/Runner/Info.plist b/mobile/ios/Runner/Info.plist index 642a32b862..a8b30d6563 100644 --- a/mobile/ios/Runner/Info.plist +++ b/mobile/ios/Runner/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.18.1 + 1.20.0 CFBundleSignature ???? CFBundleVersion - 35 + 38 LSRequiresIPhoneOS MGLMapboxMetricsEnabledSettingShownInApp diff --git a/mobile/ios/fastlane/Fastfile b/mobile/ios/fastlane/Fastfile index f89996dc13..d616d57ebe 100644 --- a/mobile/ios/fastlane/Fastfile +++ b/mobile/ios/fastlane/Fastfile @@ -19,7 +19,7 @@ platform :ios do desc "iOS Beta" lane :beta do increment_version_number( - version_number: "1.19.0" + version_number: "1.20.0" ) increment_build_number( build_number: latest_testflight_build_number + 1, diff --git a/mobile/ios/fastlane/report.xml b/mobile/ios/fastlane/report.xml index 030055c542..4e2d1d6a5d 100644 --- a/mobile/ios/fastlane/report.xml +++ b/mobile/ios/fastlane/report.xml @@ -5,32 +5,34 @@ - + - + - + - + - + - + + + diff --git a/web/src/lib/components/shared-components/navigation-bar.svelte b/web/src/lib/components/shared-components/navigation-bar.svelte index 61955fe703..cc71227449 100644 --- a/web/src/lib/components/shared-components/navigation-bar.svelte +++ b/web/src/lib/components/shared-components/navigation-bar.svelte @@ -93,7 +93,7 @@ > {#if shouldShowProfileImage} profile-img