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

docker: Enable WEBLATE_GITLAB_CREDENTIALS environment variable #8132

Closed
calbasi opened this issue Sep 17, 2022 · 10 comments · Fixed by #9990
Closed

docker: Enable WEBLATE_GITLAB_CREDENTIALS environment variable #8132

calbasi opened this issue Sep 17, 2022 · 10 comments · Fixed by #9990
Labels
enhancement Adding or requesting a new feature. good first issue Opportunity for newcoming contributors. hacktoberfest This is suitable for Hacktoberfest. Don’t try to spam. help wanted Extra attention is needed.
Milestone

Comments

@calbasi
Copy link

calbasi commented Sep 17, 2022

Describe the problem

Right now it seems I can use gitlab_username and gitlab_token variables. But when I try to use gitlab_credentials:

  WEBLATE_GITLAB_CREDENTIALS: "git.duniter.org": {username: weblate,token: XXXXXXXXXXXXXXX}

I get this error:

ERROR: yaml.scanner.ScannerError: mapping values are not allowed here
in "./docker-compose.override.yml", line 17, column 52

Describe the solution you'd like

Add weblate_gitlab_credentials support

Describe alternatives you've considered

No response

Screenshots

No response

Additional context

No response

@nijel
Copy link
Member

nijel commented Sep 19, 2022

The error you get is from the docker-compose YAML parser, to have a valid YAML syntax it should be:

  WEBLATE_GITLAB_CREDENTIALS: "git.duniter.org: username: XXXXXXXX,token: XXXXXXXXXXXXXXX"

Still, this setting is currently not parsed from the environment, see https://docs.weblate.org/en/latest/admin/install/docker.html#docker-environment-variables for list of supported variables (you can use WEBLATE_GITLAB_USERNAME and WEBLATE_GITLAB_TOKEN).

PS: Posting question to multiple places is not a good practice. This duplicates #8128

@nijel nijel transferred this issue from WeblateOrg/docker-compose Sep 19, 2022
@nijel nijel transferred this issue from WeblateOrg/docker Sep 19, 2022
@nijel nijel changed the title Enable WEBLATE_GITLAB_CREDENTIALS environment variable docker: Enable WEBLATE_GITLAB_CREDENTIALS environment variable Sep 19, 2022
@nijel nijel added enhancement Adding or requesting a new feature. help wanted Extra attention is needed. good first issue Opportunity for newcoming contributors. labels Sep 19, 2022
@github-actions
Copy link

This issue seems to be a good fit for newbie contributors. You are welcome to contribute to Weblate! Don't hesitate to ask any questions you would have while implementing this.

You can learn about how to get started in our contributors documentation.

@nijel nijel added the hacktoberfest This is suitable for Hacktoberfest. Don’t try to spam. label Sep 19, 2022
@jatinmark
Copy link

I would like to work on this. Can you please assign this to me?

@nijel
Copy link
Member

nijel commented Oct 25, 2022

@jatinmark Yes, you're welcome.

@nijel
Copy link
Member

nijel commented Nov 4, 2022

You can now configure WEBLATE_GITLAB_CREDENTIALS for a single host by setting WEBLATE_GITLAB_HOST, WEBLATE_GITLAB_USERNAME and WEBLATE_GITLAB_TOKEN, see b299b88. Multiple host configuration is still not supported via environment variables.

@Dbhardwaj99
Copy link

Has Jatin closed this issue or Is it still open? I can work on this

@jatinmark
Copy link

Yes , you can work on this issue .

@jatinmark jatinmark removed their assignment Dec 23, 2022
@Dbhardwaj99
Copy link

Hello,

I would like to enable the WEBLATE_GITLAB_CREDENTIALS environment variable in the docker-compose.yml file. Currently, the file is not able to parse the value of this variable.

To fix the issue, I propose modifying the syntax of the WEBLATE_GITLAB_CREDENTIALS variable as follows:

environment:

  DJANGO_SETTINGS_MODULE: weblate.settings_docker

  WEBLATE_SITE_DOMAIN: ${WEBLATE_HOST}

  # Enable the WEBLATE_GITLAB_CREDENTIALS variable here:

  WEBLATE_GITLAB_CREDENTIALS: '"git.duniter.org": {username: $USERNAME,token: $TOKEN}'

@nijel
Copy link
Member

nijel commented Jan 6, 2023

Just to clarify it: There is currently no support for WEBLATE_GITLAB_CREDENTIALS in Docker. This issue is about adding it.

If you are configuring a single Gitlab instance, use WEBLATE_GITLAB_HOST, WEBLATE_GITLAB_USERNAME and WEBLATE_GITLAB_TOKEN.

@github-actions
Copy link

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

@nijel nijel added this to the 5.1 milestone Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature. good first issue Opportunity for newcoming contributors. hacktoberfest This is suitable for Hacktoberfest. Don’t try to spam. help wanted Extra attention is needed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants