pontoon icon indicating copy to clipboard operation
pontoon copied to clipboard

GOOGLE_APPLICATION_CREDENTIALS is not documented and not Docker friendly

Open flodolo opened this issue 1 year ago • 5 comments

Looks like Pontoon is set up in Heroku with a GOOGLE_CREDENTIALS setting that is unused.

I had to look into the code to find GOOGLE_APPLICATION_CREDENTIALS, which was introduced in #2873 but not documented. This is supposed to point to a local JSON file, which makes its use in Docker very complicated, as such file is removed every time the container is rebuilt. Not completely sure how that works on Heroku.

flodolo avatar Oct 24 '24 15:10 flodolo

I can't find any code or pull request that used GOOGLE_CREDENTIALS. Is it there just to store that info?

flodolo avatar Oct 25 '24 07:10 flodolo

We use https://github.com/gerynugrh/heroku-google-application-credentials-buildpack, which requires these variables. It is indeed not documented.

mathjazz avatar Oct 25 '24 07:10 mathjazz

Should we have a special hidden file that is copied over like the .env file?

flodolo avatar Oct 25 '24 10:10 flodolo

BTW, not sure how reliable this is

for env in $(grep -r 'os.environ.get("' pontoon --include="*.py" | sed -n 's/.*os.environ.get("\([^"]*\)".*/\1/p' | sort | uniq); do
  if ! grep -qr "$env" --include="*.rst" .; then
    echo "$env"
  fi
done

Some of these seem unrelated, but others should probably be documented

ADMIN_PASSWORD
DJANGO_LOG_LEVEL
DJANGO_SQL_LOG
GITHUB_CLIENT_ID
GITHUB_SECRET_KEY
GITLAB_CLIENT_ID
GITLAB_SECRET_KEY
GITLAB_URL
GOOGLE_APPLICATION_CREDENTIALS
GOOGLE_AUTOML_WARMUP_INTERVAL
GOOGLE_CLIENT_ID
GOOGLE_SECRET_KEY
HEROKU_DEMO
KEYCLOAK_CLIENT_ID
KEYCLOAK_CLIENT_SECRET
KEYCLOAK_REALM
KEYCLOAK_URL
RAYGUN_APIKEY
SENDGRID_USERNAME
SESSION_COOKIE_HTTPONLY
STATIC_ROOT
SYSTRAN_TRANSLATE_PROFILE_OWNER
SYSTRAN_TRANSLATE_SERVER
TERSER_BINARY
YUGLIFY_BINARY

flodolo avatar Nov 04 '24 09:11 flodolo

I'd only take care of documenting GOOGLE_APPLICATION_CREDENTIALS & Co. in this issue, and then work on #2234, #2386 and possibly file more related bugs as needed.

I'm not very opinionated on handling the file referenced by GOOGLE_APPLICATION_CREDENTIALS, because it's used rarely locally.

mathjazz avatar Nov 05 '24 00:11 mathjazz