Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add postgres support + migrations #628

Open
wants to merge 66 commits into
base: develop
Choose a base branch
from

Conversation

dr-carrot
Copy link

@dr-carrot dr-carrot commented Jan 19, 2024

Description

Screenshot (if UI-related)

To-Dos

  • Successful build yarn build
  • Translation keys yarn i18n:extract
  • Database migration (if required)

Issues Fixed or Closed

TODO:

  • An extra migration in the develop branch
  • Translation keys?
  • Docs
  • Test image - drcarrot/jellyseerr-postgres:latest
  • Move new docs from readme to the newer docs page
  • Switch date column types to remove timezone It is generally recommended to use timestamp with timezone aka timestampz

@dr-carrot dr-carrot changed the title V1.7.0/postgresql feat: add postgres support + migrations Jan 19, 2024
@Fallenbagel
Copy link
Owner

Whats the difference between this and #421?

@dr-carrot
Copy link
Author

Whats the difference between this and #421?

This PR contains all the changes in #421 plus changes from @ralgar that are also mentioned in that PR. Additionally, this PR contains the migration script required to get postgres running, documentation on how to configure postgres, and improved ssl configuration options

@nodadyoushutup
Copy link

I know that this is not the current priority to get in, but do we have even a hand wave idea of potentially how long it may be? I can continue to use the preview container but I am eagerly awaiting this not being a preview feature :)

@joaopedrocg27
Copy link

Is there a timeframe to merge this? Since running in kubernetes this is a deal breaker for now

@RyuunosukeDS3
Copy link

Chiming in to say, I migrated from Overseerr to Jellyseerr for this. I'm also running in Kubernetes, and I'm trying to move everything I can to postgres.

@juanlurie
Copy link

I’d like to add this to my docker stack as well. Quite keen to have it working with Postgres

@gauthier-th gauthier-th mentioned this pull request Aug 12, 2024
14 tasks
@github-actions github-actions bot removed the merge conflict Cannot merge due to merge conflicts label Aug 19, 2024
@gauthier-th
Copy link
Collaborator

gauthier-th commented Oct 7, 2024

@Fallenbagel could you run the GitHub checks please?

server/datasource.ts Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
server/utils/DbColumnHelper.ts Outdated Show resolved Hide resolved
server/utils/DbColumnHelper.ts Show resolved Hide resolved
server/utils/DbColumnHelper.ts Show resolved Hide resolved
@gauthier-th
Copy link
Collaborator

@nodadyoushutup @joaopedrocg27 I expect this to be merged in approximately 1 month. I can't promise anything though 😅

@github-actions github-actions bot added the merge conflict Cannot merge due to merge conflicts label Oct 26, 2024
Copy link

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

@gauthier-th
Copy link
Collaborator

@dr-carrot any update on this?

@github-actions github-actions bot removed the merge conflict Cannot merge due to merge conflicts label Nov 4, 2024
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be in the docs/extending-jellyseerr folder instead of docs/getting-started because it does not describe a setup process, but how to configure an additional tool.

Comment on lines 14 to 15
CONFIG_DIRECTORY="config" # The path to the config directory where the db file is stored
DB_LOG_QUERIES="false" # Whether to log the DB queries for debugging
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe write explicitly the default options?

Comment on lines 21 to 37
DB_TYPE="postgres" # Which DB engine to use, either "sqlite" or "postgres". The default is "sqlite". To use postgres, this needs to be set to "postgres"
DB_HOST="postgres" # The host (url) of the database
DB_PORT="5432" # The port to connect to
DB_USER="jellyseerr" # Username used to connect to the database
DB_PASS="postgres" # Password of the user used to connect to the database
DB_NAME="jellyseerr" # The name of the database to connect to
DB_LOG_QUERIES="false" # Whether to log the DB queries for debugging
DB_USE_SSL="false" # Whether to enable ssl for database connection

# The following options can be used to further configure ssl:
DB_SSL_REJECT_UNAUTHORIZED="true" # Whether to reject ssl connections with unverifiable certificates i.e. self-signed certificates without providing the below settings
DB_SSL_CA= # The CA certificate to verify the connection, provided as a string
DB_SSL_CA_FILE= # The path to a CA certificate to verify the connection
DB_SSL_KEY= # The private key for the connection in PEM format, provided as a string
DB_SSL_KEY_FILE= # Path to the private key for the connection in PEM format
DB_SSL_CERT= # Certificate chain in pem format for the private key, provided as a string
DB_SSL_CERT_FILE= # Path to certificate chain in pem format for the private key
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Write explicitly what is the default value, and if it mandatory (because for instance the default value of DB_USER is not jellyseerr).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some changes to hopefully make it a little more clear

@gauthier-th
Copy link
Collaborator

Could you please also take a look at the cypress tests? Looks like the PR is breaking them. Could you find out why and fix your code or the tests accordingly?

public lastSeasonChange: Date;

@Column({ type: 'datetime', nullable: true })
@DbAwareColumn({ type: 'datetime', default: () => 'now()' })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Genuine question: why is this DbAwareColumn only necessary here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Add support for external database connections