Docs: add double quotes to cURL commands
Problem to solve
We have a lot of cURL examples in the docs, and some use double quotes for the URL, and others don't. In some edge cases, no quotes or single quotes won't work (if there are special characters in a URL). To be
Further details
This issue is to fix these examples to use double quotes:
File | Line | Excerpt |
---|---|---|
administration/consul.md |
80:1 | curl http://127.0.0.1:8500/v1/health/state/critical |
administration/invalidate_markdown_cache.md |
22:1 | curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/application/settings?local_markdown_version=<increased_number> |
administration/operations/fast_ssh_key_lookup.md |
142:4 | curl --remote-name https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.5p1.tar.gz |
administration/packages/container_registry.md |
1233:1 | curl --proxy http://localhost:9000 https://httpbin.org/status/200 |
administration/snippets/index.md |
67:1 | curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/application/settings?snippet_size_limit=52428800 |
administration/snippets/index.md |
73:1 | curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/application/settings |
administration/troubleshooting/linux_cheat_sheet.md |
306:1 | curl --head --location https://example.com |
administration/troubleshooting/gitlab_rails_cheat_sheet.md |
468:9 | curl and jq (up to a max 100, see pagination docs https://docs.gitlab.com/ee/api/#pagination |
administration/troubleshooting/test_environments.md |
106:42 | curl http://<IP_ADDRESS>:9200/_cat/health |
administration/troubleshooting/ssl.md |
24:3 | curl https://gitlab.domain.tld |
administration/troubleshooting/ssl.md |
114:5 | curl https://gitlab.domain.tld |
administration/troubleshooting/tracing_correlation_id.md |
62:6 | curl --verbose https://gitlab.example.com/api/v4/projects |
administration/wikis/index.md |
68:1 | curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/application/settings?wiki_page_max_content_bytes=52428800 |
administration/wikis/index.md |
74:1 | curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/application/settings |
api/audit_events.md |
261:1 | curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/projects/7/audit_events |
api/audit_events.md |
321:1 | curl --header "PRIVATE-TOKEN: <your_access_token>" https://primary.example.com/api/v4/projects/7/audit_events/5 |
api/feature_flags.md |
110:1 | curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/feature_flags/awesome_feature |
api/feature_flags_legacy.md |
39:1 | curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/feature_flags |
api/feature_flags_legacy.md |
177:1 | curl https://gitlab.example.com/api/v4/projects/1/feature_flags \ |
api/feature_flags_legacy.md |
247:1 | curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/feature_flags/new_live_trace |
api/feature_flags_legacy.md |
323:1 | curl --header "PRIVATE-TOKEN: <your_access_token>" --request DELETE https://gitlab.example.com/api/v4/projects/1/feature_flags/awesome_feature |
api/graphql/getting_started.md |
32:1 | curl 'https://gitlab.com/api/graphql' --header "Authorization: Bearer $GRAPHQL_TOKEN" --header "Content-Type: application/json" --request POST --data "{\"query\": \"query {currentUser {name}}\"}" |
api/jobs.md |
296:1 | curl --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/projects/1/pipelines/6/bridges?scope[]=pending&scope[]=running' |
api/lint.md |
249:3 | curl 'https://gitlab.com/api/v4/ci/lint?include_merged_yaml=true' \ |
api/lint.md |
296:3 | curl 'https://gitlab.com/api/v4/ci/lint?include_merged_yaml=true' \ |
api/metrics_user_starred_dashboards.md |
29:1 | curl --header 'Private-Token: <your_access_token>' https://gitlab.example.com/api/v4/projects/20/metrics/user_starred_dashboards \ |
api/metrics_user_starred_dashboards.md |
60:1 | curl --request DELETE --header 'Private-Token: <your_access_token>' https://gitlab.example.com/api/v4/projects/20/metrics/user_starred_dashboards \ |
api/scim.md |
42:1 | curl 'https://gitlab.example.com/api/scim/v2/groups/test_group/Users?filter=id%20eq%20"0b1d561c-21ff-4092-beab-8154b17f82f2"' --header "Authorization: Bearer <your_scim_token>" --header "Content-Type: application/scim+json" |
api/templates/dockerfiles.md |
23:1 | curl https://gitlab.example.com/api/v4/templates/dockerfiles |
api/templates/dockerfiles.md |
122:1 | curl https://gitlab.example.com/api/v4/templates/dockerfiles/Binary |
api/templates/gitignores.md |
25:1 | curl https://gitlab.example.com/api/v4/templates/gitignores |
api/templates/gitignores.md |
130:1 | curl https://gitlab.example.com/api/v4/templates/gitignores/Ruby |
api/templates/licenses.md |
28:1 | curl https://gitlab.example.com/api/v4/templates/licenses?popular=1 |
api/templates/licenses.md |
131:1 | curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/templates/licenses/mit?project=My+Cool+Project |
api/vulnerability_exports.md |
86:1 | curl --header POST "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/security/groups/1/vulnerability_exports |
api/vulnerability_exports.md |
119:1 | curl --header POST "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/security/vulnerability_exports |
ci/caching/index.md |
256:5 | `curl --show-error --silent https://getcomposer.org/installer |
ci/examples/php.md |
59:1 | curl --location --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit.phar |
ci/examples/laravel_with_gitlab_and_envoy/index.md |
420:5 | `curl --silent --show-error https://getcomposer.org/installer |
ci/triggers/README.md |
59:7 | curl --request POST --form "token=$CI_JOB_TOKEN" --form ref=master https://gitlab.example.com/api/v4/projects/9/trigger/pipeline |
ci/triggers/README.md |
167:8 | curl --request POST --form token=TOKEN --form ref=master https://gitlab.example.com/api/v4/projects/9/trigger/pipeline" |
ci/triggers/README.md |
260:12 | curl --request POST --form token=TOKEN --form ref=master https://gitlab.example.com/api/v4/projects/9/trigger/pipeline |
development/chaos_endpoints.md |
69:1 | curl http://localhost:3000/-/chaos/leakmem?memory_mb=1024&duration_s=10 --header 'X-Chaos-Secret: secret' |
development/chaos_endpoints.md |
70:1 | curl http://localhost:3000/-/chaos/leakmem?memory_mb=1024&duration_s=10&token=secret |
development/chaos_endpoints.md |
92:1 | curl http://localhost:3000/-/chaos/cpu_spin?duration_s=60 --header 'X-Chaos-Secret: secret' |
development/chaos_endpoints.md |
93:1 | curl http://localhost:3000/-/chaos/cpu_spin?duration_s=60&token=secret |
development/chaos_endpoints.md |
117:1 | curl http://localhost:3000/-/chaos/db_spin?interval_s=1&duration_s=60 --header 'X-Chaos-Secret: secret' |
development/chaos_endpoints.md |
118:1 | curl http://localhost:3000/-/chaos/db_spin?interval_s=1&duration_s=60&token=secret |
development/chaos_endpoints.md |
139:1 | curl http://localhost:3000/-/chaos/sleep?duration_s=60 --header 'X-Chaos-Secret: secret' |
development/chaos_endpoints.md |
140:1 | curl http://localhost:3000/-/chaos/sleep?duration_s=60&token=secret |
development/chaos_endpoints.md |
160:1 | curl http://localhost:3000/-/chaos/kill --header 'X-Chaos-Secret: secret' |
development/chaos_endpoints.md |
161:1 | curl http://localhost:3000/-/chaos/kill?token=secret |
development/gitaly.md |
348:7 | `curl --silent http://localhost:9236/metrics |
development/gitaly.md |
378:7 | `curl --silent http://localhost:9236/metrics |
development/internal_api.md |
63:1 | curl --request POST --header "Gitlab-Shared-Secret: <Base64 encoded token>" --data "key_id=11&project=gnuwget/wget2&action=git-upload-pack&protocol=ssh" http://localhost:3001/api/v4/internal/allowed |
development/internal_api.md |
111:1 | curl --request POST --header "Gitlab-Shared-Secret: <Base64 encoded token>" --data "key_id=11&project=gnuwget/wget2" http://localhost:3001/api/v4/internal/lfs_authenticate |
development/internal_api.md |
245:1 | curl --request POST --header "Gitlab-Shared-Secret: <Base64 encoded secret>" --data "key_id=7" http://localhost:3001/api/v4/internal/two_factor_recovery_codes |
development/internal_api.md |
292:1 | curl --request POST --header "Gitlab-Shared-Secret: <Base64 encoded secret>" --data "user_id=29&name=mytokenname&scopes[]=read_user&scopes[]=read_repository&expires_at=2020-07-24" http://localhost:3001/api/v4/internal/personal_access_token |
development/internal_api.md |
326:1 | curl --request POST --header "Gitlab-Shared-Secret: <Base64 encoded secret>" --data "gl_repository=project-7" http://localhost:3001/api/v4/internal/pre_receive |
development/internal_api.md |
358:1 | curl --request POST --header "Gitlab-Shared-Secret: <Base64 encoded secret>" --data "gl_repository=project-7" --data "identifier=user-1" --data "changes=0000000000000000000000000000000000000000 fd9e76b9136bdd9fe217061b497745792fe5a5ee gh-pages\n" http://localhost:3001/api/v4/internal/post_receive |
development/python_guide/index.md |
33:1 | `curl https://pyenv.run |
install/installation.md |
218:1 | curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.gz |
install/installation.md |
238:1 | curl --remote-name --progress https://dl.google.com/go/go1.13.5.linux-amd64.tar.gz |
install/installation.md |
260:1 | `curl --location https://deb.nodesource.com/setup_12.x |
install/installation.md |
263:1 | `curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg |
migrate_ci_to_ce/README.md |
327:5 | curl https://YOUR_GITLAB_SERVER_FQDN/ |
migrate_ci_to_ce/README.md |
328:5 | curl https://YOUR_CI_SERVER_FQDN/ |
topics/autodevops/customize.md |
665:5 | curl --data "value=true" --header "PRIVATE-TOKEN: <personal_access_token>" https://gitlab.example.com/api/v4/features/auto_devops_banner_disabled |
update/upgrading_from_source.md |
73:1 | curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.gz |
update/upgrading_from_source.md |
92:1 | `curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg |
update/upgrading_from_source.md |
112:1 | curl --remote-name --progress https://dl.google.com/go/go1.13.5.linux-amd64.tar.gz |
update/upgrading_from_source.md |
142:1 | curl --silent --show-error --location https://ftp.pcre.org/pub/pcre/pcre2-10.33.tar.gz --output pcre2.tar.gz |
update/upgrading_from_source.md |
152:1 | curl --remote-name --location --progress https://www.kernel.org/pub/software/scm/git/git-2.29.0.tar.gz |
user/admin_area/monitoring/health_check.md |
58:1 | curl 'https://gitlab.example.com/-/health' |
user/admin_area/monitoring/health_check.md |
85:1 | curl 'https://gitlab.example.com/-/readiness' |
user/admin_area/monitoring/health_check.md |
124:1 | curl 'https://gitlab.example.com/-/liveness' |
user/packages/container_registry/index.md |
576:3 | curl --request PUT --header 'Content-Type: application/json;charset=UTF-8' --header "PRIVATE-TOKEN: <your_access_token>" --data-binary '{"container_expiration_policy_attributes":{"cadence":"1month","enabled":true,"keep_n":1,"older_than":"14d","name_regex":"","name_regex_delete":".*","name_regex_keep":".*-master"}}' 'https://gitlab.example.com/api/v4/projects/2' |
user/project/clusters/serverless/aws.md |
160:1 | curl https://u768nzby1j.execute-api.us-east-1.amazonaws.com/production/hello |
user/project/clusters/serverless/aws.md |
203:1 | curl http://localhost:3000/hello |
user/project/clusters/serverless/aws.md |
447:4 | curl https://py4rg7qtlg.execute-api.us-east-1.amazonaws.com/Prod/hello/ |
user/project/clusters/serverless/aws.md |
499:1 | curl http://127.0.0.1:3000/hello |
user/project/clusters/serverless/index.md |
446:4 | curl http://localhost:8080 |
Proposed work
Since this is not complicated work, it'll be more efficient to do multiple pages per MR (20+ changes per MR is perfectly acceptable). It should only take 4'ish MRs to clean up all 82 examples.
Who can address the issue
Anyone. Please assign or @
mention @marcel.amirault for review.
Other links/references
Vale rule that identified these: https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/.vale/gitlab/CurlStringsQuoted.yml
Edited by Suzanne Selhorn