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

Git backup over HTTPS fails if username/password contains special characters #1709

Closed
alubbock opened this issue Apr 12, 2020 · 2 comments
Closed
Assignees

Comments

@alubbock
Copy link

Describe the bug
Git backup fails if using HTTPS connection with basic auth if the username or password contains special characters, including #, /, & and others which are reserved in URLs.

To Reproduce
In Admin -> Storage -> Git, add a repo (e.g. on Github) and use HTTP basic auth (not SSH). Use a password on the git remote containing a special character.

Expected behavior
Git backup completes successfully.

Docker Logs

URL replaced with representative example.

wikijs_1  | 2020-04-12T20:22:58.544009323Z 2020-04-12T20:22:58.543Z [MASTER] info: (STORAGE/GIT) Initializing...
wikijs_1  | 2020-04-12T20:22:58.544687550Z 2020-04-12T20:22:58.544Z [MASTER] info: (STORAGE/GIT) Checking repository state...
wikijs_1  | 2020-04-12T20:22:58.568330568Z 2020-04-12T20:22:58.568Z [MASTER] info: (STORAGE/GIT) Listing existing remotes...
wikijs_1  | 2020-04-12T20:22:58.577111486Z 2020-04-12T20:22:58.576Z [MASTER] info: (STORAGE/GIT) Purging existing remotes...
wikijs_1  | 2020-04-12T20:22:58.587138257Z 2020-04-12T20:22:58.586Z [MASTER] info: (STORAGE/GIT) Setting SSL Verification config...
wikijs_1  | 2020-04-12T20:22:58.596042587Z 2020-04-12T20:22:58.595Z [MASTER] info: (STORAGE/GIT) Adding origin remote via HTTP/S...
wikijs_1  | 2020-04-12T20:22:58.604767385Z 2020-04-12T20:22:58.604Z [MASTER] info: (STORAGE/GIT) Fetch updates from remote...
wikijs_1  | 2020-04-12T20:22:58.627726256Z fatal: unable to access 'https://example.com/user/wiki.git': Could not resolve host: user
wikijs_1  | 2020-04-12T20:22:58.627773027Z error: Could not fetch origin

The message Could not resolve host: user appears because the URL is parsed incorrectly by git due to the presence of one or more special characters in the password.

Host Info (please complete the following information):

  • Environment: Docker
  • Wiki.js version: 2.2.51
  • Database engine: Postgres 12

Additional context
Can be fixed by replacing special characters in the username and password, as described in this blog post.

@fjch1997
Copy link

Same issue here. For me I was not able to change the PAT from Azure DevOps.

@NGPixel
Copy link
Member

NGPixel commented Apr 22, 2020

Fixed by 4308152

@NGPixel NGPixel closed this as completed Apr 22, 2020
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

No branches or pull requests

3 participants