This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
инструмент_gitlab [2026/03/19 09:06] val [Установка в виде контейнера] |
инструмент_gitlab [2026/06/15 09:11] (current) val [Настройка отправки почты] |
||
|---|---|---|---|
| Line 110: | Line 110: | ||
| sudo -i | sudo -i | ||
| - | export BR=main; bash <(curl -s http://gate.corp13.un/api/v4/projects/1/repository/files/start.sh/raw?ref=$BR) | + | export BR=main; bash <(curl -s http://gate.corpX.un/api/v4/projects/1/repository/files/start.sh/raw?ref=$BR) |
| </code> | </code> | ||
| Line 151: | Line 151: | ||
| <code> | <code> | ||
| ### docker exec -it root_web_1 bash | ### docker exec -it root_web_1 bash | ||
| - | ### kubectl -n my-gitlab-ns exec -ti pods/gitlab-<TAB> -- bash | + | ### kubectl -n my-gitlab-ns exec -ti deployment/gitlab -- bash |
| # ###gitlab-ctl status | # ###gitlab-ctl status | ||
| Line 163: | Line 163: | ||
| real 2m34.726s | real 2m34.726s | ||
| ... | ... | ||
| + | </code> | ||
| + | |||
| + | ==== 500: We're sorry, something went wrong on our end ==== | ||
| + | <code> | ||
| + | # gitlab-rails console | ||
| + | |||
| + | irb(main):001> ApplicationSetting.delete_all | ||
| + | |||
| + | irb(main):001> ActiveRecord::Base.connection.execute("UPDATE application_settings SET runners_registration_token_encrypted = NULL, error_tracking_access_token_encrypted = NULL, encrypted_ci_jwt_signing_key = NULL") | ||
| + | |||
| + | irb(main):002> Project.update_all(runners_token: nil, runners_token_encrypted: nil) | ||
| + | irb(main):003> Group.update_all(runners_token: nil, runners_token_encrypted: nil) | ||
| + | |||
| + | irb(main):004> Ci::RunnerProject.delete_all | ||
| + | irb(main):005> Ci::Runner.delete_all | ||
| + | irb(main):006> Rails.cache.clear | ||
| </code> | </code> | ||
| ==== Настройка отправки почты ==== | ==== Настройка отправки почты ==== | ||
| Line 169: | Line 185: | ||
| <code> | <code> | ||
| root@gitlab:/# gitlab-rails console | root@gitlab:/# gitlab-rails console | ||
| - | irb(main):001> Notify.test_email('student@corp15.un', 'Message Subject', 'Message Body').deliver_now | + | irb(main):001> Notify.test_email('student@corpX.un', 'Message Subject', 'Message Body').deliver_now |
| </code> | </code> | ||
| ==== GitLab Docker Registry ==== | ==== GitLab Docker Registry ==== | ||
| Line 298: | Line 314: | ||
| * [[https://docs.gitlab.com/runner/install/linux-manually.html|Install GitLab Runner manually on GNU/Linux]] | * [[https://docs.gitlab.com/runner/install/linux-manually.html|Install GitLab Runner manually on GNU/Linux]] | ||
| - | * [[https://val.bmstu.ru/unix/Git/gitlab-runner_amd64.deb]] (16.10.0) | + | * [[https://val.bmstu.ru/unix/Git/gitlab-runner_amd64.deb]] (17.3.1-1) |
| <code> | <code> | ||
| Line 678: | Line 694: | ||
| # - prebuildtest | # - prebuildtest | ||
| - build | - build | ||
| + | # - scan | ||
| # - test | # - test | ||
| - push | - push | ||
| Line 709: | Line 726: | ||
| --pull | --pull | ||
| --cache-from $CI_REGISTRY_IMAGE:latest | --cache-from $CI_REGISTRY_IMAGE:latest | ||
| - | --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA | + | --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA . |
| - | . | + | |
| - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA | - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA | ||
| Line 771: | Line 787: | ||
| # except: | # except: | ||
| # - tags | # - tags | ||
| + | # tags: | ||
| + | # - build | ||
| + | |||
| + | #semgrep: | ||
| + | # stage: lint | ||
| + | # image: semgrep/semgrep | ||
| + | # script: semgrep --config=auto --error | ||
| + | # variables: | ||
| + | # SEMGREP_SRC_DIRECTORY: $CI_PROJECT_DIR | ||
| + | # #https_proxy: http://gate.isp.un:3128/ | ||
| + | # #no_proxy: localhost,127.0.0.1,isp.un,corpX.un | ||
| + | # except: | ||
| + | # - tags | ||
| + | # tags: | ||
| + | # - build | ||
| + | |||
| + | #Unit test: | ||
| + | # stage: prebuildtest | ||
| + | # script: | ||
| + | # - export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring | ||
| + | # - poetry install | ||
| + | # - poetry run python3 -m unittest | ||
| + | # except: | ||
| + | # - tags | ||
| + | # tags: | ||
| + | # - build | ||
| #Smoke test: | #Smoke test: | ||
| Line 784: | Line 826: | ||
| # - build | # - build | ||
| - | #Unit test: | + | #trivy: |
| - | # stage: prebuildtest | + | # stage: scan |
| + | # image: | ||
| + | # name: ghcr.io/aquasecurity/trivy | ||
| + | # entrypoint: [""] | ||
| + | # variables: | ||
| + | # #TRIVY_USERNAME: "$CI_REGISTRY_USER" | ||
| + | # #TRIVY_PASSWORD: "$CI_REGISTRY_PASSWORD" | ||
| + | # TRIVY_REGISTRY: "$CI_REGISTRY" | ||
| + | # TRIVY_CACHE_DIR: ".trivycache/" | ||
| # script: | # script: | ||
| - | # - export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring | + | # - trivy image --exit-code 1 --severity HIGH --insecure $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA |
| - | # - poetry install | + | # cache: |
| - | # - poetry run python3 -m unittest | + | # paths: |
| + | # - ".trivycache/" | ||
| # except: | # except: | ||
| # - tags | # - tags | ||
| Line 812: | Line 863: | ||
| <code> | <code> | ||
| Name: test-cgi | Name: test-cgi | ||
| - | Redirect URI: http://gate.corp13.un/cgi-bin/test-cgi !!! Если URL каталога, то без финального "/" !!! | + | Redirect URI: http://gate.corpX.un/cgi-bin/test-cgi !!! Если URL каталога, то без финального "/" !!! |
| Trusted: Yes | Trusted: Yes | ||
| Confidential: Yes | Confidential: Yes | ||