-
Notifications
You must be signed in to change notification settings - Fork 2
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: config editor #193
feat: config editor #193
Conversation
aac876b
to
c3ad6dc
Compare
console.log('Try setup settings') | ||
await setup_settings() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting an error where setup_settings
is called before project is created.
The error occurs when code is tested with clean DB (empty MongoDB).
Shuffling the order fixes the problem for me:
@asynccontextmanager
async def lifespan(_app: FastAPI):
console.log('Try setup db')
await setup_db()
console.log('Try setup initial project')
await setup_project()
console.log('Try setup settings')
await setup_settings()
console.log('Try setup Sentry')
await setup_sentry()
console.log('Try setup file parser environment')
await setup_file_parser()
yield
console.log('😴 Unmounting app ...')
console.log('Shutting down Sentry')
client = Hub.current.client
if client is not None:
client.close(timeout=2.0)
payload = BrevoPayload.model_validate(payload.model_dump()) | ||
settings_service = SettingsServiceFactory().get_service() | ||
url = await settings_service.get_value(SettingKey.BREVO_API_URL) | ||
key = await settings_service.get_value(SettingKey.BREVO_API_KEY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
send_mail
raises requests.exceptions.InvalidHeader: Header part (SecretStr('**********')) from ('api-key', SecretStr('**********')) must be of type str or bytes, not <class 'pydantic.types.SecretStr'>
Might be cause by my test environment. There is a value set for FIXED_PIN
in my .env
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Remove BREVO_API_KEY
from .env
file (temp fix until settings
and .env
are completely separated, wip).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably also applies to OPENAI_API_KEY
and any other SecretStr
env var.
Added ability to edit (some) settings in frontend; very cool 😎.

Not all settings are migrated from
.env
to db yet - onlyFIXED_PIN
,OPENAI_API_KEY
,BREVO_API_URL
andBREVO_API_KEY
right now. Migration requires changing a lot of code since settings fetching is now async/db-dependent.BREAKING CHANGES
FIXED_PIN
can no longer beNone
- instead a blank value''
means "disabled".MAIL_CLIENT
no longer does anything - instead Brevo is always used as long asBREVO_API_KEY
is not blank (''
).