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

website/integrations: Pocketbase #12906

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nicedevil007
Copy link
Contributor

Heya @4d62,

here is my try on getting the "regular" PocketBase Documentation done.
This was suggested as better usecase for authentik vs. PocketBase in general than just creating the same documenation for all Pocketbase applications over and over again.

With this guide we can reference all those applications to this one here :)

This was done prior to this guide where the idea came up: #12905


Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • [] The code has been formatted (make web)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make website)

@nicedevil007 nicedevil007 requested a review from a team as a code owner January 31, 2025 21:37
Copy link

netlify bot commented Jan 31, 2025

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 07932ac
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/67c1fea5bd0aed0008c70482
😎 Deploy Preview https://deploy-preview-12906--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 31, 2025

Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit 07932ac
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/67c1fea5c53a8300081e338a

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.73%. Comparing base (60521d8) to head (07932ac).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12906      +/-   ##
==========================================
+ Coverage   92.71%   92.73%   +0.01%     
==========================================
  Files         793      793              
  Lines       40276    40276              
==========================================
+ Hits        37341    37348       +7     
+ Misses       2935     2928       -7     
Flag Coverage Δ
e2e 48.08% <ø> (+0.01%) ⬆️
integration 24.11% <ø> (ø)
unit 90.43% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@dominic-r dominic-r left a comment

Choose a reason for hiding this comment

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

Hi @nicedevil007, thanks for your contibution. It is greatly appreciated. Here are a few things I noticed. Please do let me know if you have any questions.

This documentation lists only the settings that you need to change from their default values. Be aware that any changes other than those explicitly mentioned in this guide could cause issues accessing your application.
:::

## authentik configuration
Copy link
Contributor

Choose a reason for hiding this comment

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

Note to tana: This should be left as-is for now and I'll update format /button names later on.


Take note of the Client ID and Client Secret, you'll need to give them to PocketBase later.

- Redirect URIs/Origins (RegEx): `https://_pocketbase.company_/api/oauth2-redirect`
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see anything in this redirect URI that would warrant it to be set to "regex" instead of "strict". It's best to set it to "strict" unless absolutely needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi and thank you for your Review. Maybe it my wrong understanding of the Wiki about contribution but I used all "placeholder variables" in italic Font. I switched between different Write options now through my last PRs and Never know what is wanted and what Not.

Can someone clear this up?

  • bold stuff for things on the SP side that can be found on the gui f.e.
  • itatlic for placeholders

That is what I understood so far. Now it seems to be yet another new formatation here. I get more and more confused.

Copy link
Contributor

Choose a reason for hiding this comment

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

The Fonts & Fonts styling section of our style guide gives an overview of what's expected. What do you mean by "new formatation here"?

Italic is to be used for variables, yes. Bold for stuff found in the GUI, yes. URLs should be in a codeblock and variables in them should be italicized and the easiest way to do that is the suggestion I gave.

Copy link
Contributor Author

@nicedevil007 nicedevil007 Feb 1, 2025

Choose a reason for hiding this comment

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

I mean this Part of the Guide

Use italic font for variables or placeholders to make it clear they need to be replaced. Choose placeholder names that highlight their purpose, ensuring users understand what to update.


Thank you for making this clear now :) So I can Go oder my last PRs to Match this Styling :) Will take a Bit of time, but I Like have it "the same" on everything

Copy link
Contributor

@dominic-r dominic-r Feb 1, 2025

Choose a reason for hiding this comment

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

Could you also address the original review comment? Thanks

I don't see anything in this redirect URI that would warrant it to be set to "regex" instead of "strict". It's best to set it to "strict" unless absolutely needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe I copy Pasted wrong line and it was Late at Night. Will get to it tomorrow. But I guess you are right :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I always wrote it like the menu entry is in authentik:
image

"Redirect URIs/Origins (RegEx)" is the setting we have to set. But it doesn't mean that we should choose RegEx on the dropdown, so how should I do it now?

Copy link
Contributor

@tanberry tanberry Feb 25, 2025

Choose a reason for hiding this comment

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

Hey, @nicedevil007, you make a good point about possible confusion. However, I'd say that RegEx is the overarching category (so it is good to have it on the label), andstrict is a form of Regex. So the field label makes sense to say Regex... then you have to specify whether you want to use regular regex or a strict expression. Does that make sense?

Copy link
Contributor

@dominic-r dominic-r left a comment

Choose a reason for hiding this comment

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

Hi, thanks for taking the time to write this documentation. Here are a few things I noticed. Please do LMK if you have any questions

- Set **Display name** to `authentik`.
- Set **Auth URL** to <kbd>https://<em>authentik.company</em>/application/o/authorize/</kbd>.
- Set **Token URL** to <kbd>https://<em>authentik.company</em>/application/o/token/</kbd>.
- Make sure **Fetch user info from** is set to `User info URL`, then set **User info URL** to <kbd>https://<em>authentik.company</em>/application/o/userinfo/</kbd>
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to add a Configuration validation section as outlined in the template?

Copy link
Contributor Author

@nicedevil007 nicedevil007 Feb 10, 2025

Choose a reason for hiding this comment

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

I had one for Test the login, and you told me that it is not possible to test the login like this because PB is only the backend and users are always redirected to the application.

#12906 (comment)

So I removed the part as you adviced and now I should add it back again?

Maybe I missunderstood your old comment on Beszel: #12905 (comment)

I would go the route to do the "backend stuff" here in this guide and if there is a part where the user can verify that he did everything correct, then this should be part of the guide of the frontend application like Beszel, what do you think?

Copy link
Contributor

@dominic-r dominic-r left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for your contribution to authentik!

@tanberry
Copy link
Contributor

Hi @nicedevil007 there's a merge conflict (a very easy-to-solve one, in the sidebarIntegrations.js file) that we need to resolve before I can merge. Do you want to resolve it in your local repo, and then push again? Or if you prefer I can do it, just let me know. And apologies, the merge conflict is probably there cause I took so long to merge this. ;-(

@nicedevil007
Copy link
Contributor Author

damn :( now I messed it up, wanted to take a look at it and had to discard 21 commits from my repo, now it is closed :(

@dominic-r
Copy link
Contributor

You could have rebased from the command line

@dominic-r
Copy link
Contributor

dominic-r commented Feb 28, 2025

try:

make sure the main branch of your fork is up to date

  1. git fetch origin
  2. git checkout -b restore-branch dc43e8144cbc72dab9fa58aac1bad70fdc23eda7
  3. git push -f origin restore-branch:pocketbase
  4. git checkout main
  5. git pull origin main
  6. git merge pocketbase
  7. resolve conflicts
  8. git add .
  9. git commit -m "fix conflicts"
  10. git push origin main

you should be able to reopen the same pr since the branch has the same name

@nicedevil007
Copy link
Contributor Author

nicedevil007 commented Feb 28, 2025

try:

make sure the main branch of your fork is up to date

  1. git fetch origin
  2. git checkout -b restore-branch dc43e8144cbc72dab9fa58aac1bad70fdc23eda7
  3. git push -f origin restore-branch:pocketbase
  4. git checkout main
  5. git pull origin main
  6. git merge pocketbase
  7. resolve conflicts
  8. git add .
  9. git commit -m "fix conflicts"
  10. git push origin main

you should be able to reopen the same pr since the branch has the same name

Thank you for trying to help me. I took a look @ the sidebarIntegrations.js file but I can't find the "issue" there
Maybe it is easier for me to just copy my index.md file to a complete new branch and do all the stuff again

@dominic-r
Copy link
Contributor

Your commit history for this branch is gone and all the work is discarded. The only way to restore your work, wether you choose to open a new PR or reopen this one, is rolling back your branch to a good commit and starting back from there

@nicedevil007
Copy link
Contributor Author

is this here working now?

@nicedevil007 nicedevil007 reopened this Feb 28, 2025
@nicedevil007 nicedevil007 requested a review from a team as a code owner February 28, 2025 18:15
@dominic-r
Copy link
Contributor

you did it 🎉 can you just revert changes to authentik/lib/sync/outgoing/models.py ? Might have been my command that caused this, I typed it up quickly

@nicedevil007
Copy link
Contributor Author

you did it 🎉 can you just revert changes to authentik/lib/sync/outgoing/models.py ? Might have been my command that caused this, I typed it up quickly

I deleted my branch, created a new one and then inserted my raw index.md again, was much easier to achieve for me.

This models.py => why is this happening all time? It is not done by myself, just after applying all the make website stuff and so on.

Can you tell me how I can stop this from happening in the future?
This is my command I use all time when I do the stuff in my CLI:

npm install prism-react-renderer @docusaurus/preset-classic @docusaurus/core @docusaurus/react-loadable remark-github remark-parse remark-stringify docusaurus-plugin-redoc react@18 react-dom@18 cross-env @docusaurus/theme-mermaid docusaurus-plugin-openapi-docs docusaurus-theme-openapi-docs react-feather react-before-after-slider-component --save-dev && make lint-fix && npx prettier --write ./website/integrations/services/pocketbase/index.md && make website && rm -rf node_modules package-lock.json

Signed-off-by: NiceDevil <17103076+nicedevil007@users.noreply.github.com>
@dominic-r
Copy link
Contributor

you did it 🎉 can you just revert changes to authentik/lib/sync/outgoing/models.py ? Might have been my command that caused this, I typed it up quickly

I deleted my branch, created a new one and then inserted my raw index.md again, was much easier to achieve for me.

This models.py => why is this happening all time? It is not done by myself, just after applying all the make website stuff and so on.

Can you tell me how I can stop this from happening in the future? This is my command I use all time when I do the stuff in my CLI:

npm install prism-react-renderer @docusaurus/preset-classic @docusaurus/core @docusaurus/react-loadable remark-github remark-parse remark-stringify docusaurus-plugin-redoc react@18 react-dom@18 cross-env @docusaurus/theme-mermaid docusaurus-plugin-openapi-docs docusaurus-theme-openapi-docs react-feather react-before-after-slider-component --save-dev && make lint-fix && npx prettier --write ./website/integrations/services/pocketbase/index.md && make website && rm -rf node_modules package-lock.json

why not just use the make commands to install deps?

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.

3 participants