Skip to content

feat: implement initial root API token management #470

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jay7x
Copy link
Member

@jay7x jay7x commented Aug 1, 2025

This PR implements somehow hack-ish, but the only possible way to create an initial root API token during the Gitlab installation. This allows to start managing Gitlab resources via API immediately after it is installed.

While I understand how bad it looks, I guess the benefits are big enough..

Copy link
Member

@yakatz yakatz left a comment

Choose a reason for hiding this comment

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

I don't mind the "hack-ish" approach, but some other thoughts:

  • The documentation should have a warning about how this could be insecure.
  • A change like this needs an acceptance test to make sure the script actually works.
  • I would also like to see a test that it doesn't run the script twice - it shouldn't the way it is written now, but it would be good to have for the future.

Integer[0] $token_ttl_minutes,
Stdlib::AbsolutePath $token_file_path,
|-%>
# This scripts creates an initial root token and stores it to the
Copy link
Contributor

Choose a reason for hiding this comment

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

how about a shebang line?

Copy link
Member

Choose a reason for hiding this comment

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

It's executed through the Gitlab Rails Runner, so it shouldn't need one.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll add comment there to reduce confusion :)

@jay7x jay7x marked this pull request as draft August 5, 2025 09:58
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