User Tools

Site Tools


инструмент_gitlab

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
инструмент_gitlab [2025/10/05 15:07]
val [Подключение через API]
инструмент_gitlab [2025/10/15 06:43] (current)
val [Управление пользователями]
Line 39: Line 39:
 # cat docker-compose.yml # cat docker-compose.yml
 </​code><​code>​ </​code><​code>​
-version: '​3.6'​+#version: '​3.6'​
 services: services:
   web:   web:
 +#  gitlab:
     image: '​gitlab/​gitlab-ce:​latest'​     image: '​gitlab/​gitlab-ce:​latest'​
 #    image: '​gitlab/​gitlab-ce:​16.7.4-ce.0'​ #    image: '​gitlab/​gitlab-ce:​16.7.4-ce.0'​
Line 90: Line 91:
 ==== Подключение через API ==== ==== Подключение через API ====
  
-=== К проекту ===+=== проект ===
  
   * Токен доступа:​ Settings -> Access Tokens ([[https://​docs.gitlab.com/​ee/​user/​project/​settings/​project_access_tokens.html|Project access tokens]]), в примере достаточно role: Reporter, Scopes: api   * Токен доступа:​ Settings -> Access Tokens ([[https://​docs.gitlab.com/​ee/​user/​project/​settings/​project_access_tokens.html|Project access tokens]]), в примере достаточно role: Reporter, Scopes: api
Line 113: Line 114:
 </​code>​ </​code>​
  
-=== К REST API интерфейсу ===+=== REST API интерфейс === 
 + 
 +  * Search or go to... -> Profile -> Access tokens -> Add new token -> api -> Create token 
 + 
 +== Добавление пользователя == 
 <​code>​ <​code>​
 GITLAB_URL="​https://​server.corp13.un:​4443" ​ GITLAB_URL="​https://​server.corp13.un:​4443" ​
Line 126: Line 132:
      ​--header "​Content-Type:​ application/​json"​ \      ​--header "​Content-Type:​ application/​json"​ \
      ​--request POST \      ​--request POST \
-     ​--data "{ \"​email\":​ \"​$USER_EMAIL\",​ \"​password\":​ \"​$USER_PASSWORD\",​ \"​username\":​ \"​$USER_USERNAME\",​ \"​name\":​ \"​$USER_NAME\"​ }" \+     ​--data "{ \"​email\":​ \"​$USER_EMAIL\",​ \"​password\":​ \"​$USER_PASSWORD\",​ \"​username\":​ \"​$USER_USERNAME\",​ \"​name\":​ \"​$USER_NAME\"​, \"​admin\":​ true }" \
      "​$GITLAB_URL/​api/​v4/​users"​ -k      "​$GITLAB_URL/​api/​v4/​users"​ -k
 </​code>​ </​code>​
Line 242: Line 248:
   * [[Установка и настройка OpenLDAP]]   * [[Установка и настройка OpenLDAP]]
   * [[Хранение учетных записей UNIX в LDAP]] !!! с атрибутом почты и паролем   * [[Хранение учетных записей UNIX в LDAP]] !!! с атрибутом почты и паролем
 +  * [[Решение FreeIPA]]
  
 <​code>​ <​code>​
Line 254: Line 261:
     host: '​server.corpX.un'​     host: '​server.corpX.un'​
 #    host: '​server2.corpX.un'​ #    host: '​server2.corpX.un'​
 +#    host: '​192.168.X.10'​
     port: 389     port: 389
 #    uid: '​uid'​ #    uid: '​uid'​
Line 259: Line 267:
 #    bind_dn: '​cn=admin,​dc=corpX,​dc=un'​ #    bind_dn: '​cn=admin,​dc=corpX,​dc=un'​
 #    password: '​secret'​ #    password: '​secret'​
 +#    bind_dn: '​uid=admin,​cn=users,​cn=accounts,​dc=corpX,​dc=un'​
 +#    password: '​strongpassword'​
     bind_dn: '​cn=Administrator,​cn=Users,​dc=corpX,​dc=un'​     bind_dn: '​cn=Administrator,​cn=Users,​dc=corpX,​dc=un'​
     password: '​Pa$$w0rd'​     password: '​Pa$$w0rd'​
инструмент_gitlab.1759666073.txt.gz · Last modified: 2025/10/05 15:07 by val