From 6305f1dc00870f6e0635e2e850538a00bbd00bda Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 30 Jan 2020 06:08:49 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- doc/update/upgrading_postgresql_using_slony.md | 54 +++++++++++----------- .../settings/account_and_limit_settings.md | 2 +- doc/user/admin_area/settings/protected_paths.md | 4 +- doc/user/application_security/index.md | 2 +- doc/user/clusters/crossplane.md | 26 +++++------ doc/user/discussions/index.md | 2 +- doc/user/gitlab_com/index.md | 8 ++-- doc/user/project/pages/introduction.md | 10 ++-- doc/user/project/pipelines/job_artifacts.md | 16 +++---- .../project/repository/gpg_signed_commits/index.md | 30 ++++++------ .../repository/reducing_the_repo_size_using_git.md | 20 ++++---- 11 files changed, 87 insertions(+), 87 deletions(-) (limited to 'doc') diff --git a/doc/update/upgrading_postgresql_using_slony.md b/doc/update/upgrading_postgresql_using_slony.md index cf3a389b149..8189f0cba51 100644 --- a/doc/update/upgrading_postgresql_using_slony.md +++ b/doc/update/upgrading_postgresql_using_slony.md @@ -26,7 +26,7 @@ To do so we'll generate a dump of our current database. This dump will only contain the structure, not any data. To generate this dump run the following command on your active database server: -```bash +```shell sudo -u gitlab-psql /opt/gitlab/embedded/bin/pg_dump -h /var/opt/gitlab/postgresql -p 5432 -U gitlab-psql -s -f /tmp/structure.sql gitlabhq_production ``` @@ -39,14 +39,14 @@ Once the structure dump is generated we also need to generate a dump for the can't be replicated easily by Slony. To generate this dump run the following command on your active database server: -```bash +```shell sudo -u gitlab-psql /opt/gitlab/embedded/bin/pg_dump -h /var/opt/gitlab/postgresql/ -p 5432 -U gitlab-psql -a -t schema_migrations -f /tmp/migrations.sql gitlabhq_production ``` Next we'll need to move these files somewhere accessible by the new database server. The easiest way is to simply download these files to your local system: -```bash +```shell scp your-user@production-database-host:/tmp/*.sql /tmp ``` @@ -63,7 +63,7 @@ install Slony using said package manager. When compiling Slony from source you *must* use the following commands to do so: -```bash +```shell ./configure --prefix=/path/to/installation/directory --with-perltools --with-pgconfigdir=/path/to/directory/containing/pg_config/bin make make install @@ -71,7 +71,7 @@ make install Omnibus users can use the following commands: -```bash +```shell ./configure --prefix=/opt/gitlab/embedded --with-perltools --with-pgconfigdir=/opt/gitlab/embedded/bin make make install @@ -81,7 +81,7 @@ This assumes you have installed GitLab into `/opt/gitlab`. To test if Slony is installed properly, run the following commands: -```bash +```shell test -f /opt/gitlab/embedded/bin/slonik && echo 'Slony installed' || echo 'Slony not installed' test -f /opt/gitlab/embedded/bin/slonik_init_cluster && echo 'Slony Perl tools are available' || echo 'Slony Perl tools are not available' /opt/gitlab/embedded/bin/slonik -v @@ -91,7 +91,7 @@ This assumes Slony was installed to `/opt/gitlab/embedded`. If Slony was installed properly the output of these commands will be (the mentioned "slonik" version may be different): -``` +```plaintext Slony installed Slony Perl tools are available slonik version 2.2.5 @@ -126,7 +126,7 @@ First we'll need to create some required directories and set the correct permissions. To do so, run the following commands on both the old and new database server: -```bash +```shell sudo mkdir -p /var/log/gitlab/slony /var/run/slony1 /var/opt/gitlab/postgresql/slony sudo chown gitlab-psql:root /var/log/gitlab/slony /var/run/slony1 /var/opt/gitlab/postgresql/slony ``` @@ -184,7 +184,7 @@ use it. The following placeholders should be replaced: The list of tables to replicate can be generated by running the following command on your old PostgreSQL database: -``` +```shell sudo gitlab-psql gitlabhq_production -c "select concat('\"', schemaname, '.', tablename, '\",') from pg_catalog.pg_tables where schemaname = 'public' and tableowner = 'gitlab' and tablename != 'schema_migrations' order by tablename asc;" -t ``` @@ -216,13 +216,13 @@ sure that the SQL files we generated earlier can be found in the `/tmp` directory of the new server. Once these files are in place start a `psql` session on this server: -``` +```shell sudo gitlab-psql gitlabhq_production ``` Now run the following commands: -``` +```plaintext \i /tmp/structure.sql \i /tmp/migrations.sql ``` @@ -231,7 +231,7 @@ To verify if the structure is in place close the session, start it again, then run `\d`. If all went well you should see output along the lines of the following: -``` +```plaintext List of relations Schema | Name | Type | Owner --------+---------------------------------------------+----------+------------- @@ -248,13 +248,13 @@ following: Now we can initialize the required tables and what not that Slony will use for its replication process. To do so, run the following on the old database: -``` +```shell sudo -u gitlab-psql /opt/gitlab/embedded/bin/slonik_init_cluster --conf /var/opt/gitlab/postgresql/slony/slon_tools.conf | /opt/gitlab/embedded/bin/slonik ``` If all went well this will produce something along the lines of: -``` +```plaintext :10: Set up replication nodes :13: Next: configure paths for each node/origin :16: Replication nodes prepared @@ -264,13 +264,13 @@ If all went well this will produce something along the lines of: Next we need to start a replication node on every server. To do so, run the following on the old database: -``` +```shell sudo -u gitlab-psql /opt/gitlab/embedded/bin/slon_start 1 --conf /var/opt/gitlab/postgresql/slony/slon_tools.conf ``` If all went well this will produce output such as: -``` +```plaintext Invoke slon for node 1 - /opt/gitlab/embedded/bin/slon -p /var/run/slony1/slony_replication_node1.pid -s 1000 -d2 slony_replication 'host=192.168.0.7 dbname=gitlabhq_production user=slony port=5432 password=hieng8ezohHuCeiqu0leeghai4aeyahp' > /var/log/gitlab/slony/node1/gitlabhq_production-2016-10-06.log 2>&1 & Slon successfully started for cluster slony_replication, node node1 PID [26740] @@ -279,7 +279,7 @@ Start the watchdog process as well... Next we need to run the following command on the _new_ database server: -``` +```shell sudo -u gitlab-psql /opt/gitlab/embedded/bin/slon_start 2 --conf /var/opt/gitlab/postgresql/slony/slon_tools.conf ``` @@ -288,13 +288,13 @@ This will produce similar output if all went well. Next we need to tell the new database server what it should replicate. This can be done by running the following command on the _new_ database server: -``` +```shell sudo -u gitlab-psql /opt/gitlab/embedded/bin/slonik_create_set 1 --conf /var/opt/gitlab/postgresql/slony/slon_tools.conf | /opt/gitlab/embedded/bin/slonik ``` This should produce output along the lines of the following: -``` +```plaintext :11: Subscription set 1 (set1) created :12: Adding tables to the subscription set :16: Add primary keyed table public.abuse_reports @@ -308,13 +308,13 @@ This should produce output along the lines of the following: Finally we can start the replication process by running the following on the _new_ database server: -``` +```shell sudo -u gitlab-psql /opt/gitlab/embedded/bin/slonik_subscribe_set 1 2 --conf /var/opt/gitlab/postgresql/slony/slon_tools.conf | /opt/gitlab/embedded/bin/slonik ``` This should produce the following output: -``` +```plaintext :6: Subscribed nodes to set 1 ``` @@ -324,7 +324,7 @@ not days. Unfortunately Slony itself doesn't really provide a way of knowing when the two databases are in sync. To get an estimate of the progress you can use the following shell script: -``` +```shell #!/usr/bin/env bash set -e @@ -365,7 +365,7 @@ GitLab so it can use the new database, etc. First, let's stop all of GitLab. Omnibus users can do so by running the following on their GitLab server(s): -``` +```shell sudo gitlab-ctl stop unicorn sudo gitlab-ctl stop sidekiq sudo gitlab-ctl stop mailroom @@ -382,7 +382,7 @@ as this data will be lost. To stop replication, run the following on both database servers: -```bash +```shell sudo -u gitlab-psql /opt/gitlab/embedded/bin/slon_kill --conf /var/opt/gitlab/postgresql/slony/slon_tools.conf ``` @@ -394,7 +394,7 @@ The above setup does not replicate database sequences, as such these must be reset manually in the target database. You can use the following script for this: -```bash +```shell #!/usr/bin/env bash set -e @@ -459,7 +459,7 @@ main Upload this script to the _target_ server and execute it as follows: -```bash +```shell bash path/to/the/script/above.sh ``` @@ -471,7 +471,7 @@ This will correct the ownership of sequences and reset the next value for the Next we need to remove all Slony related data. To do so, run the following command on the _target_ server: -```bash +```shell sudo gitlab-psql gitlabhq_production -c "DROP SCHEMA _slony_replication CASCADE;" ``` diff --git a/doc/user/admin_area/settings/account_and_limit_settings.md b/doc/user/admin_area/settings/account_and_limit_settings.md index 131ff949cd1..ff427b1a579 100644 --- a/doc/user/admin_area/settings/account_and_limit_settings.md +++ b/doc/user/admin_area/settings/account_and_limit_settings.md @@ -81,7 +81,7 @@ If you wanted to increase the max attachment size to 200m in a GitLab [Omnibus](https://docs.gitlab.com/omnibus/) install, for example, you might need to add the line below to `/etc/gitlab/gitlab.rb` before increasing the max attachment size: -``` +```ruby nginx['client_max_body_size'] = "200m" ``` diff --git a/doc/user/admin_area/settings/protected_paths.md b/doc/user/admin_area/settings/protected_paths.md index 5d2548890e3..0df7dd7d128 100644 --- a/doc/user/admin_area/settings/protected_paths.md +++ b/doc/user/admin_area/settings/protected_paths.md @@ -6,7 +6,7 @@ type: reference GitLab protects the following paths with Rack Attack by default: -``` +```plaintext '/users/password', '/users/sign_in', '/api/#{API::API.version}/session.json', @@ -23,7 +23,7 @@ that exceed 10 requests per minute per IP address. This header is included in responses to blocked requests: -``` +```plaintext Retry-After: 60 ``` diff --git a/doc/user/application_security/index.md b/doc/user/application_security/index.md index 35fdaa6fc9b..0567c84a66c 100644 --- a/doc/user/application_security/index.md +++ b/doc/user/application_security/index.md @@ -213,7 +213,7 @@ An approval will be optional when a license report: When including a security job template like [`SAST`](sast/index.md#configuration), the following error can be raised, depending on your GitLab CI/CD configuration: -``` +```plaintext Found errors in your .gitlab-ci.yml: * sast job: stage parameter should be unit-tests diff --git a/doc/user/clusters/crossplane.md b/doc/user/clusters/crossplane.md index 247a373301f..1e8a3129fed 100644 --- a/doc/user/clusters/crossplane.md +++ b/doc/user/clusters/crossplane.md @@ -27,7 +27,7 @@ that the IP address of the pods are routable within the GCP network. First, we need to declare some environment variables with configuration that will be used throughout this guide: -```sh +```shell export PROJECT_ID=crossplane-playground # the GCP project where all resources reside. export NETWORK_NAME=default # the GCP network where your GKE is provisioned. export REGION=us-central1 # the GCP region where the GKE cluster is provisioned. @@ -43,7 +43,7 @@ NOTE: **Note:** For a non-GitLab managed cluster, ensure that the service account for the token provided can manage resources in the `database.crossplane.io` API group. ​1. Save the following YAML as `crossplane-database-role.yaml`: -```sh +```shell cat > crossplane-database-role.yaml < network.yaml < gcp-postgres-standard.yaml < diff --git a/doc/user/discussions/index.md b/doc/user/discussions/index.md index 1855c6666e6..4ac850880c7 100644 --- a/doc/user/discussions/index.md +++ b/doc/user/discussions/index.md @@ -89,7 +89,7 @@ When a merge request has a large number of comments it can be difficult to track what remains unresolved. You can jump between unresolved threads with the Jump button next to the Reply field on a thread. -You can also jump to the first unresolved thread from the button next to the +You can also jump to the next unresolved thread from the button next to the resolved threads tracker. You can also use keyboard shortcuts to navigate among threads: diff --git a/doc/user/gitlab_com/index.md b/doc/user/gitlab_com/index.md index dd6ee4175bc..38113231186 100644 --- a/doc/user/gitlab_com/index.md +++ b/doc/user/gitlab_com/index.md @@ -19,7 +19,7 @@ Below are the fingerprints for GitLab.com's SSH host keys. Add the following to `.ssh/known_hosts` to skip manual fingerprint confirmation in SSH: -``` +```plaintext gitlab.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAfuCHKVTjquxvt6CM6tdG4SLp1Btn/nOeHHE5UOzRdf gitlab.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsj2bNKTBSpIYDEGk9KxsGh3mySTRgMtXL583qmBpzeQ+jqCMRgBqB98u3z++J1sKlXHWfM9dyhSevkMwSbhoR8XIq/U0tCNyokEi/ueaBMCvbcTHhO7FcwzY92WK4Yt0aGROY5qX2UKSeOvuP4D6TPqKF1onrSzH9bx9XUf2lEdWT/ia1NEKjunUqu1xOB/StKDHMoX4/OKyIzuS0q/T1zOATthvasJFoPrAjkohTyaDUz2LN5JoH839hViyEG82yB+MjcFV5MU3N1l1QL3cVUCh93xSaua1N85qivl+siMkPGbO5xR/En4iEY6K2XPASUEMaieWVNTRCtJ4S8H+9 gitlab.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY= @@ -41,7 +41,7 @@ GitLab.com can be reached via a [different SSH port][altssh] for `git+ssh`. An example `~/.ssh/config` is the following: -``` +```plaintext Host gitlab.com Hostname altssh.gitlab.com User git @@ -455,7 +455,7 @@ per second per IP address. The following example headers are included for all API requests: -``` +```plaintext RateLimit-Limit: 600 RateLimit-Observed: 6 RateLimit-Remaining: 594 @@ -481,7 +481,7 @@ user confirmation, user sign in, and password reset. This header is included in responses to blocked requests: -``` +```plaintext Retry-After: 60 ``` diff --git a/doc/user/project/pages/introduction.md b/doc/user/project/pages/introduction.md index 37b5e77c062..359a9b4489a 100644 --- a/doc/user/project/pages/introduction.md +++ b/doc/user/project/pages/introduction.md @@ -102,7 +102,7 @@ Learn how to set up GitLab CI/CD for specific use cases. Supposed your repository contained the following files: -``` +```plaintext ├── index.html ├── css │ └── main.css @@ -144,7 +144,7 @@ orphan branch (let's name it `pages`) that will host your static generator site. You can create a new empty branch like this: -```bash +```shell git checkout --orphan pages ``` @@ -155,7 +155,7 @@ commits. Push the source files of your static generator in the `pages` branch. Below is a copy of `.gitlab-ci.yml` where the most significant line is the last one, specifying to execute everything in the `pages` branch: -``` +```yaml image: ruby:2.6 pages: @@ -188,7 +188,7 @@ compressed files, it will serve that version instead of the uncompressed one. To take advantage of this feature, the artifact you upload to the Pages should have this structure: -``` +```plaintext public/ ├─┬ index.html │ └ index.html.gz @@ -226,7 +226,7 @@ request for a URL that does not include an extension. Consider a Pages site deployed with the following files: -``` +```plaintext public/ ├─┬ index.html │ ├ data.html diff --git a/doc/user/project/pipelines/job_artifacts.md b/doc/user/project/pipelines/job_artifacts.md index 4ea46399635..0f1507b73c5 100644 --- a/doc/user/project/pipelines/job_artifacts.md +++ b/doc/user/project/pipelines/job_artifacts.md @@ -113,13 +113,13 @@ Artifacts for other pipelines can be accessed with direct access to them. The structure of the URL to download the whole artifacts archive is the following: -``` +```plaintext https://example.com///-/jobs/artifacts//download?job= ``` To download a single file from the artifacts use the following URL: -``` +```plaintext https://example.com///-/jobs/artifacts//raw/?job= ``` @@ -127,40 +127,40 @@ For example, to download the latest artifacts of the job named `coverage` of the `master` branch of the `gitlab` project that belongs to the `gitlab-org` namespace, the URL would be: -``` +```plaintext https://gitlab.com/gitlab-org/gitlab/-/jobs/artifacts/master/download?job=coverage ``` To download the file `coverage/index.html` from the same artifacts use the following URL: -``` +```plaintext https://gitlab.com/gitlab-org/gitlab/-/jobs/artifacts/master/raw/coverage/index.html?job=coverage ``` There is also a URL to browse the latest job artifacts: -``` +```plaintext https://example.com///-/jobs/artifacts//browse?job= ``` For example: -``` +```plaintext https://gitlab.com/gitlab-org/gitlab/-/jobs/artifacts/master/browse?job=coverage ``` There is also a URL to specific files, including html files that are shown in [GitLab Pages](../../../administration/pages/index.md): -``` +```plaintext https://example.com///-/jobs/artifacts//file/?job= ``` For example, when a job `coverage` creates the artifact `htmlcov/index.html`, you can access it at: -``` +```plaintext https://gitlab.com/gitlab-org/gitlab/-/jobs/artifacts/master/file/htmlcov/index.html?job=coverage ``` diff --git a/doc/user/project/repository/gpg_signed_commits/index.md b/doc/user/project/repository/gpg_signed_commits/index.md index 0cbede4a372..d65e9e17d4f 100644 --- a/doc/user/project/repository/gpg_signed_commits/index.md +++ b/doc/user/project/repository/gpg_signed_commits/index.md @@ -46,7 +46,7 @@ started: 1. Generate the private/public key pair with the following command, which will spawn a series of questions: - ```sh + ```shell gpg --full-gen-key ``` @@ -57,7 +57,7 @@ started: 1. The first question is which algorithm can be used. Select the kind you want or press Enter to choose the default (RSA and RSA): - ``` + ```plaintext Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal @@ -68,7 +68,7 @@ started: 1. The next question is key length. We recommend you choose `4096`: - ``` + ```plaintext RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) 4096 Requested keysize is 4096 bits @@ -77,7 +77,7 @@ started: 1. Specify the validity period of your key. This is something subjective, and you can use the default value, which is to never expire: - ``` + ```plaintext Please specify how long the key should be valid. 0 = key does not expire = key expires in n days @@ -90,7 +90,7 @@ started: 1. Confirm that the answers you gave were correct by typing `y`: - ``` + ```plaintext Is this correct? (y/N) y ``` @@ -98,7 +98,7 @@ started: (should match a verified email address you use in GitLab) and an optional comment (press Enter to skip): - ``` + ```plaintext GnuPG needs to construct a user ID to identify your key. Real name: Mr. Robot @@ -113,7 +113,7 @@ started: 1. Pick a strong password when asked and type it twice to confirm. 1. Use the following command to list the private GPG key you just created: - ``` + ```shell gpg --list-secret-keys --keyid-format LONG ``` @@ -122,7 +122,7 @@ started: 1. Copy the GPG key ID that starts with `sec`. In the following example, that's `30F2B65B9246B6CA`: - ``` + ```plaintext sec rsa4096/30F2B65B9246B6CA 2017-08-18 [SC] D5E4F29F3275DC0CDA8FFC8730F2B65B9246B6CA uid [ultimate] Mr. Robot @@ -131,7 +131,7 @@ started: 1. Export the public key of that ID (replace your key ID from the previous step): - ``` + ```shell gpg --armor --export 30F2B65B9246B6CA ``` @@ -167,7 +167,7 @@ key to use. 1. Use the following command to list the private GPG key you just created: - ```sh + ```shell gpg --list-secret-keys --keyid-format LONG ``` @@ -176,7 +176,7 @@ key to use. 1. Copy the GPG key ID that starts with `sec`. In the following example, that's `30F2B65B9246B6CA`: - ``` + ```plaintext sec rsa4096/30F2B65B9246B6CA 2017-08-18 [SC] D5E4F29F3275DC0CDA8FFC8730F2B65B9246B6CA uid [ultimate] Mr. Robot @@ -185,7 +185,7 @@ key to use. 1. Tell Git to use that key to sign the commits: - ```sh + ```shell git config --global user.signingkey 30F2B65B9246B6CA ``` @@ -195,7 +195,7 @@ key to use. or `gpg: signing failed: secret key not available`, run the following command to change to `gpg2`: - ```sh + ```shell git config --global gpg.program gpg2 ``` @@ -207,7 +207,7 @@ commits: 1. Commit like you used to, the only difference is the addition of the `-S` flag: - ``` + ```shell git commit -S -m "My commit msg" ``` @@ -217,7 +217,7 @@ commits: If you don't want to type the `-S` flag every time you commit, you can tell Git to sign your commits automatically: -``` +```shell git config --global commit.gpgsign true ``` diff --git a/doc/user/project/repository/reducing_the_repo_size_using_git.md b/doc/user/project/repository/reducing_the_repo_size_using_git.md index 1187a44fda8..a024f8eff97 100644 --- a/doc/user/project/repository/reducing_the_repo_size_using_git.md +++ b/doc/user/project/repository/reducing_the_repo_size_using_git.md @@ -60,26 +60,26 @@ removed from the repository. 1. Navigate to your repository: - ``` + ```shell cd my_repository/ ``` 1. Change to the branch you want to remove the big file from: - ``` + ```shell git checkout master ``` 1. Create a commit removing the large file from the branch, if it still exists: - ``` + ```shell git rm path/to/big_file.mpg git commit -m 'Remove unneeded large file' ``` 1. Rewrite history: - ``` + ```shell bfg --delete-files path/to/big_file.mpg ``` @@ -88,7 +88,7 @@ removed from the repository. 1. Force-push the changes to GitLab: - ``` + ```shell git push --force-with-lease origin master ``` @@ -116,31 +116,31 @@ purposes! 1. Navigate to your repository: - ``` + ```shell cd my_repository/ ``` 1. Change to the branch you want to remove the big file from: - ``` + ```shell git checkout master ``` 1. Use `filter-branch` to remove the big file: - ``` + ```shell git filter-branch --force --tree-filter 'rm -f path/to/big_file.mpg' HEAD ``` 1. Instruct Git to purge the unwanted data: - ``` + ```shell git reflog expire --expire=now --all && git gc --prune=now --aggressive ``` 1. Lastly, force push to the repository: - ``` + ```shell git push --force origin master ``` -- cgit v1.2.3