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

[internal-1486] logto version upgrade and use logto schema #671

Merged
merged 22 commits into from
Feb 20, 2025

Conversation

SantanM
Copy link
Contributor

@SantanM SantanM commented Feb 17, 2025

A PR with relevant changes to the logto service is here.

Merge Checklist

Please cross check this list if additions / modifications needs to be done on top of your core changes and tick them off. Reviewer can as well glance through and help the developer if something is missed out.

  • Automated Tests (Jasmine integration tests, Unit tests, and/or Performance tests)
  • Updated Manual tests / Demo Config
  • Documentation (Application guide, Admin guide, Markdown, Readme and/or Wiki)
  • Verified that local development environment is working with latest changes (integrated with latest develop branch)
  • following best practices in code review doc

@SantanM SantanM marked this pull request as ready for review February 18, 2025 06:02
@SantanM SantanM requested a review from a team as a code owner February 18, 2025 06:02
@@ -452,6 +452,7 @@ services:
"+cdw_config": {},
"+dataflow": {},
"+db_credentials_mgr": {},
"+logto": {},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A schema for logto tables

@@ -473,7 +474,9 @@ services:
"reader": "${PG_WRITE_USER:-alp_pg_write_user}",
"readerPassword": "${PG_WRITE_PASSWORD}",
"writer": "${PG_WRITE_USER:-alp_pg_write_user}",
"writerPassword": "${PG_WRITE_PASSWORD}"
"writerPassword": "${PG_WRITE_PASSWORD}",
"logtoManager": "${PG_LOGTO_MANAGER:-logto_postgres}",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

PG user that manages logto schema. It has the following privileges - USAGE, CREATE and GRANT (can further grant privileges to other pg users) privileges.

@@ -719,14 +725,14 @@ services:
entrypoint:
- sh
- -c
- npm run cli db seed -- --swe && npx @logto/cli db alteration deploy 1.18.0 && npm start
- npm start
Copy link
Contributor Author

@SantanM SantanM Feb 18, 2025

Choose a reason for hiding this comment

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

see below alp-logto-seed

@@ -735,6 +741,28 @@ services:
PROJECT_NAME: ${PROJECT_NAME:-d2e}
PORT: 3001
TRUST_PROXY_HEADER: true
DATABASE_CONNECTION_TIMEOUT: 30000

alp-logto-seed:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Separate seeding and migration of logto schema to reduce the startup time of the container.

@@ -123,6 +125,11 @@ export class App {
pgUsers.managerPassword,
"Manager"
);
await this.userDao.createUserWithCreateRolePrivilege(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

logtoManager will need privileges to create new roles. Logto database migrations include creation of logto_tenant_<db>_default/admin users.

@@ -128,12 +148,15 @@ export default class PGUserDAO {
grantManagePrivilegesForSchema = async (
client: any,
schemaName: string,
user: string
user: string,
withGrantOption: boolean
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Flag - to allow the user to grant privileges to other users. logtoManage user needs the privileges to further grant rights to other users logto_tenant_<db>_default/admin.

@@ -12,10 +12,10 @@ RUN npm add --location=global pnpm@^9.0.0
RUN apk add --no-cache python3 make g++ rsync py3-setuptools git

## Git clone
RUN git clone --branch v1.18.0 https://github.com/logto-io/logto.git /etc/logto
# TODO: clone d2e logto instead of public repo
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Task created

@SantanM SantanM enabled auto-merge (squash) February 19, 2025 05:35
@SantanM SantanM disabled auto-merge February 19, 2025 06:00
@SantanM SantanM requested a review from a team as a code owner February 19, 2025 07:48
@SantanM SantanM force-pushed the SantanM/internal-1486_logto-schema branch from d87110f to ffadfeb Compare February 19, 2025 08:06
@SantanM SantanM force-pushed the SantanM/internal-1486_logto-schema branch from b542dac to 1edb5cf Compare February 19, 2025 11:12
@SantanM SantanM enabled auto-merge (squash) February 20, 2025 06:58
@SantanM SantanM disabled auto-merge February 20, 2025 06:58
@SantanM SantanM merged commit d017b51 into develop Feb 20, 2025
22 checks passed
@SantanM SantanM deleted the SantanM/internal-1486_logto-schema branch February 20, 2025 07:20
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.

4 participants