pingcap / ossinsight-lite

🚧[WIP] Yet another customizable free GitHub stats dashboard based on TiDB Serverless: https://ossinsight-lite.vercel.app, hand-drawn style.
https://ossinsight-lite.vercel.app
Apache License 2.0
383 stars 121 forks source link

TiDB password split error #120

Closed xiabee closed 1 year ago

xiabee commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Set up a user with special symbols in the password, such as "a!s@d#f$"
  2. Run the Git Action "GitHub Data Pipeline"
  3. See error
    Run hooopo/repo-track-pipeline@main
    /usr/bin/docker run --name a6c8cc9102aef0739402fa6f5aaae26760daf_ff7bdf --label 2a6c8c --workdir /github/workspace --rm -e "INPUT_ACCESS-TOKEN" -e "INPUT_DATABASE-URL" -e "INPUT_REPO-FULL-NAME" -e "DATABASE_URL" -e "ACCESS_TOKEN" -e "REPO_FULL_NAME" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/ossinsight-lite/ossinsight-lite":"/github/workspace" 2a6c8c:c9102aef0739402fa6f5aaae26760daf
    /github/workspace
    /usr/local/lib/ruby/3.2.0/uri/rfc2396_parser.rb:176:in `split': bad URI(is not URI?): mysql2://xxxxxxxxx.xidbcloud.com:4000/github_repos (URI::InvalidURIError)abee.github:a!s@d#f$@gateway01.ap-southeast-1.prod.aws.ti

    Expected behavior it should run successfully

hooopo commented 1 year ago

When your password contains special characters and you're using it in a URI for database connection, you need to URL encode the special characters in your password. URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits.

For example, if your password is p@ssword!, the "@" would be replaced with "%40" and "!" would be replaced with "%21". So your encoded password would then be p%40ssword%21.

Different programming languages have different built-in methods for URL encoding:

Please replace p@ssword! with your real password. After encoding your password, insert it into your connection URI.

hooopo commented 1 year ago

I see that your pipeline is running correctly now. I will close this issue for now. We will further improve the documentation subsequently. Thank you very much for your feedback.