Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

doc: env-vars #509

Merged
merged 6 commits into from
Nov 2, 2023
Merged

doc: env-vars #509

merged 6 commits into from
Nov 2, 2023

Conversation

siddhantk232
Copy link
Collaborator

@siddhantk232 siddhantk232 commented Oct 28, 2023

@vercel
Copy link

vercel bot commented Oct 28, 2023

@siddhantk232 is attempting to deploy a commit to the fifthtry Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Oct 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fastncom ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2023 6:48am

FASTN.ftd Outdated Show resolved Hide resolved
best-practices/env-vars.ftd Outdated Show resolved Hide resolved
best-practices/env-vars.ftd Outdated Show resolved Hide resolved
@siddhantk232 siddhantk232 requested a review from amitu October 31, 2023 08:58
FASTN.ftd Outdated Show resolved Hide resolved
@siddhantk232 siddhantk232 requested a review from amitu October 31, 2023 09:13
FASTN.ftd Outdated Show resolved Hide resolved
@amitu
Copy link
Contributor

amitu commented Nov 1, 2023

@siddhantk232 this looks good so far. I was jus thinking maybe we should document all our environment variables in this file, currently we have documented a few in /sql/.

Let's create a component for every environment variable, the component will contain the docs for that variable, put the definition of the component in the /env/ related file, and import it from /sql/ one.

Eg, backend/env-vars.ftd


-- ds.h1: `.env` file

<docs of `.env` file in here>

-- ds.h1: Environment Variables

`fastn` supports the following environment variables:

-- fastn-pg-certificate:
-- fastn-pg-ssl-mode:
;; <etc>


-- component fastn-pg-certificate:

-- ftd.column:
;; you may have to tweak this [1]

-- ds.h2: `FASTN_PG_CERTIFICATE`

If you have access to root certificate of the certificate authority who issued
the certificate used by PostgreSQL.

Note that this is [not working right now when tested with
Supabase](https://github.com/fastn-stack/fastn/issues/1383).

Since this is not working, the only way to connect is by using
`FASTN_PG_DANGER_ALLOW_UNVERIFIED_CERTIFICATE=true` right now.

-- end: ftd.column

-- end: fastn-pg-certificate

And ftd-host/pg.ftd contains:

-- import: fastn.com/env ;; this may not work and is a bug [2]

<.. rest of the document >

-- ds.h1: Environment Variables

;; we currently have documentation in this file, now we will refer to just the component

-- env.fastn-pg-certificate:
-- env.fastn-pg-ssl-mode:

[1]: our component definition currently only accept one immediate child element, this is a problem as in this case the ftd.column we used resets the spacing between children (we can make it inherit the spacing, but we still have to create a wrapper div), it also does not use full width by default etc. I am not fond of this wrapper, and want to allow our components to have any number of children, and have fastn do the right thing.

[2]: when importing we should use the proper url of a document or the file path, currently only file path urls are allowed.

@siddhantk232
Copy link
Collaborator Author

@amitu please review this latest commit and let me know if I missed anything.

backend/env-vars.ftd Outdated Show resolved Hide resolved
@siddhantk232 siddhantk232 requested a review from amitu November 2, 2023 07:20
@amitu amitu merged commit 846354b into fastn-stack:main Nov 2, 2023
@siddhantk232 siddhantk232 deleted the doc/env-vars branch November 2, 2023 10:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants