User Tools

Site Tools


gitlab_notes

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
gitlab_notes [2022/03/25 15:29] – [Gitlab Notes] lenocilgitlab_notes [2022/08/09 12:02] (current) – [Gitlab Notes] lenocil
Line 1: Line 1:
 ====== Gitlab Notes ====== ====== Gitlab Notes ======
 +Lorentz Institute runs a private instance of Gitlab accessible to all institute members available at https://gitlab.lorentz.leidenuniv.nl regardless of their role within the Institute. You are strongly encouraged to use it to collaborate with your colleagues and fellow scientists anywhere in the world. 
  
-|IMPORTANT\\ :!:|Gitlab logins via the Lorentz Institute IdP might assign you a gitlab username different than expected.\\ Please check https://gitlab.lorentz.leidenuniv.nl/-/profile/account and do **not** change it|+Accounts for external users can be requested via <support@lorentz.leidenuniv.nl>.
  
-Lorentz Institute runs a private instance of Gitlab accessible to all institute members at https://gitlab.lorentz.leidenuniv.nl regardless of their role within the Institute. +Lorentz Institute members login using the button  //Sign in with Lorentz Institute IdP// via the institute Identity Provider Server, where as external users, after their access has been approved and account created,  will login via //Standard// tab in the authentication form. See figures below
- +
-You are strongly encouraged to use it to collaborate with your colleagues and fellow scientists anywhere in the world. Accounts for external users can be requested via <support@lorentz.institute.nl>+
- +
-Lorentz Institute members **must use** the button  //Sign in with Lorentz Institute IdP// to login via the institute Identity Provider Server, where as external users must use the //Standard// tab in the authentication form.+
  
 {{::gitlab1.png?nolink&300|}}  {{:gitlab2.png?nolink&200|}} {{::gitlab1.png?nolink&300|}}  {{:gitlab2.png?nolink&200|}}
Line 13: Line 10:
 ===== SSH Keys and Personal Access Tokens ===== ===== SSH Keys and Personal Access Tokens =====
  
-Because access to the Institute Gitlab instance occurs via Single-Sign On((In other words it uses access and refresh tokens rather than usernames and passwords)) for all IL members, git //push// and //pull// operations must be performed either using __SSH key-pairs__ (SSH protocol) or using __Personal Access Tokens__ (HTTPS protocol). Failing to set up SSH key-pairs or Access Tokens will prevent IL members to interact via git with our Gitlab server.+Because access to the Institute Gitlab instance occurs via Single-Sign On((In other words it uses access and refresh tokens rather than usernames and passwords.)) for all IL members, git //push// and //pull// operations must be performed either using __SSH key-pairs__ (SSH protocol) or using __Personal Access Tokens__ (HTTPS protocol). Failing to set up SSH key-pairs or Access Tokens will prevent IL members to interact via git with our Gitlab server.
  
-In this case, the server will warn you with a message like the one in the figure below+IL users that do not set up SSH key-pairs or Access Tokens will likely receive upon login warning message like the one in the figure below 
  
 {{ :gitlab4.png?nolink&800 |}} {{ :gitlab4.png?nolink&800 |}}
  
 ==== Generate an SSH key-pair and add it to Gitlab ==== ==== Generate an SSH key-pair and add it to Gitlab ====
 +On the workstation/laptop from which you would like to interact with the IL giltab server generate a private/public key pair  ''$HOME/.ssh/id_ed25519''((This is your private key which must remain secret otherwise your account is compromised.)) and ''$HOME/.ssh/id_ed25519.pub'' using the command
 <code bash> <code bash>
-ssh-keygen -t ed25519 -C "bongo@gitlab.lorentz.leidenuniv.nl"+ssh-keygen -t ed25519 -C "bongo@gitlab"
 </code> </code>
-The cmd above will generate the private/public keys  ''$HOME/.ssh/id_ed25519''((This is your private key which must remain secret otherwise your account is compromised.)) and ''$HOME/.ssh/id_ed25519.pub'' respectively.  
  
-Visit https://gitlab.lorentz.leidenuniv.nl/-/profile/keys, copy the contents of the newly created ''$HOME/.ssh/id_ed25519.pub'' and paste it as in the figure below and push //Add key//.+Visit https://gitlab.lorentz.leidenuniv.nl/-/profile/keys, copy the contents of the newly created ''$HOME/.ssh/id_ed25519.pub'' and paste it in the //Key// area like in the figure below. Click on //Add key//.
  
 {{ :gitlab5.png?nolink&600 |}} {{ :gitlab5.png?nolink&600 |}}
  
-Git over SSH is now enabled for your IL account.+You can non perform git operations over the //SSH// protocol. Test that your set up is correct   
 +<code bash> 
 +ssh  -T git@gitlab.lorentz.leidenuniv.nl 
 +Welcome to GitLab, @bongo1! 
 +</code> 
 + 
 +|:!: NOTE| In some exceptional cases((Think of users with the same private email address or same username but different domain.)) your gitlab username might differ from your Institute username. This is normal and no action is required on your side. Nonetheless, you are encouraged to take note of it because you will need it for all git operations.|
  
 ==== Generate a Gitlab Personal Access Token ==== ==== Generate a Gitlab Personal Access Token ====
  
-Visit https://gitlab.lorentz.leidenuniv.nl/-/profile/personal_access_tokens, choose a token name, assign the necessary scopes((Read also as permissions)), and click on //Create Personal Access Token//.+Visit https://gitlab.lorentz.leidenuniv.nl/-/profile/personal_access_tokens, choose a token name, assign the necessary scopes((That is permissions.)), and click on //Create Personal Access Token//.
    
 {{ :gitlab6.png?nolink&600 |}} {{ :gitlab6.png?nolink&600 |}}
  
-Your personal access token will look something like ''xyzop-ybVxByblaUBLA7RUAGAs'' (this is a fake one). Please take note of it and store it in a very safe place. Disclosing this token is equivalent to disclosing your credentials! Should a token be compromised at any time, just visit  https://gitlab.lorentz.leidenuniv.nl/-/profile/personal_access_tokens to revoke any compromised tokens.+Your personal access token will look something like ''xyzop-ybVxByblaUBLA7RUAGAs''((This is a fake one.)). Please take note of it and store it in a very safe place. Disclosing this token is equivalent to disclosing your credentials! Should a token be compromised at any time, just visit  https://gitlab.lorentz.leidenuniv.nl/-/profile/personal_access_tokens to revoke any compromised tokens.
  
-Your IL account is now enabled to perform git operations over HTTPS.+Your IL account is now enabled to perform git operations over //HTTPS//.
 ===== Examples ===== ===== Examples =====
  
Line 86: Line 89:
  
 <code bash> <code bash>
-git clone https://gitlab.strw.leidenuniv.nl/bongo1/test.git+git clone https://gitlab.lorentz.leidenuniv.nl/bongo1/test.git
 Cloning into 'test'... Cloning into 'test'...
-Username for 'https://gitlab.strw.leidenuniv.nl': bongo1 +Username for 'https://gitlab.lorentz.leidenuniv.nl': bongo1 
-Password for 'https://bongo1@gitlab.strw.leidenuniv.nl': <Personal Access Token>+Password for 'https://bongo1@gitlab.lorentz.leidenuniv.nl': <Personal Access Token>
 remote: Enumerating objects: 3, done. remote: Enumerating objects: 3, done.
 remote: Counting objects: 100% (3/3), done. remote: Counting objects: 100% (3/3), done.
gitlab_notes.1648222179.txt.gz · Last modified: 2022/03/25 15:29 by lenocil