Skip to content

Commit 6ee0082

Browse files
authored
Merge branch 'varun-raj:main' into main
2 parents d6bd5d2 + 54508b2 commit 6ee0082

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

.env.sample

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ DB_USERNAME="" # Postgress Database Username
44
DB_PASSWORD="" # Postgres Database Password
55
DB_HOST="" # Postgres Host (IP address or hostname of the database)
66
DB_PORT="" # Postgres Port number (Default: 5432)
7-
DB_DATABASE_NAME="" # Name of the database
7+
DB_DATABASE_NAME="" # Name of the database
8+
9+
# Additional configuration
10+
SECURE_COOKIE=false # Set to true to enable secure cookies

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ IMMICH_URL = "http://local-ip-of-immich:port" # Your immich instace ip address a
4141
EXTERNAL_IMMICH_URL = "https://external-address" # External address of immich
4242
```
4343
Refer here for obtaining Immich API Key: https://immich.app/docs/features/command-line-interface#obtain-the-api-key
44+
4445
#### Method 2 - Portainer
4546

4647
If you're using portainer, run the docker using `docker run` and add the power tools to the same network as immich.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "immich-power-tools",
3-
"version": "0.4.2",
3+
"version": "0.5.0",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",

src/config/environment.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export const ENV = {
44
IMMICH_API_KEY: process.env.IMMICH_API_KEY as string,
55
DATABASE_URL: (process.env.DATABASE_URL || `postgresql://${process.env.DB_USERNAME}:${process.env.DB_PASSWORD}@${(process.env.DB_HOST || 'immich_postgres')}:${(process.env.DB_PORT || '5432')}/${process.env.DB_DATABASE_NAME}`),
66
JWT_SECRET: process.env.JWT_SECRET as string,
7+
SECURE_COOKIE: process.env.SECURE_COOKIE === 'true',
78
};
89

910

src/lib/cookie.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ENV } from '@/config/environment'
12
import type { CookieSerializeOptions } from 'cookie'
23
import cookie from 'cookie'
34
import type { IncomingMessage } from 'http'
@@ -22,8 +23,7 @@ export const serializeCookie = (
2223
return cookie.serialize(name, String(value), {
2324
httpOnly: true,
2425
maxAge: 60 * 60 * 24 * 7,
25-
sameSite: process.env.NODE_ENV === 'production' ? 'none' : 'lax',
26-
secure: process.env.NODE_ENV === 'production',
26+
secure: ENV.SECURE_COOKIE,
2727
path: '/',
2828
...options,
2929
})

0 commit comments

Comments
 (0)