https://wiki.archlinux.org/api.php?action=feedcontributions&user=Robvelor&feedformat=atomArchWiki - User contributions [en]2024-03-29T12:41:07ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=GitLab&diff=328025GitLab2014-08-01T23:45:41Z<p>Robvelor: Added link to virtual host example.</p>
<hr />
<div>[[Category:Version Control System]]<br />
{{Related articles start}}<br />
{{Related|Gitolite}}<br />
{{Related|Ruby on Rails}}<br />
{{Related articles end}}<br />
<br />
[http://gitlab.org/ Gitlab] is a free git repository management application based on [[Ruby on Rails]]. It is distributed under the MIT License and its source code can be found on [https://github.com/gitlabhq/gitlabhq Github]. It is a very active project with a monthly release cycle and ideal for businesses that want to keep their code private. Consider it as a self hosted Github but open source. You can try a demo [http://demo.gitlabhq.com/ here].<br />
<br />
== Installation ==<br />
{{Note|If you want to use rvm be sure to check out [[Gitlab#Running GitLab with rvm]] before starting with the installation}}<br />
<br />
{{note|This guide covers installing and configuring GitLab without HTTPS/SSL at first, just to get GitLab up and running. After getting GitLab up and running, see [[#Advanced Configuration]] to set up SSL.}}<br />
<br />
Installing {{AUR|gitlab}} from the [[AUR]] instead of manually has the added benefit that lots of steps have been taken care of for you (e.g. permissions and ownership for files, etc). <br />
<br />
Make sure you perform a system upgrade ({{ic|pacman -Syu}}) before installing gitlab from AUR and that you have installed the {{ic|base-devel}} group, or you may face problems installing gitlab because [https://wiki.archlinux.org/index.php/Makepkg#Usage base-devel packages are not required to be listed as dependencies in PKGBUILD files].<br />
<br />
Also before installing the {{AUR|gitlab}} package from the [[AUR]], you need to choose a database backend if you're planning to host GitLab it on the same machine as the database:<br />
<br />
* Use [[pacman|Pacman]] to install {{Pkg|mariadb}} and {{Pkg|libmariadbclient}} from the [[official repositories]] and start the [[daemon]]<br />
* or install {{Pkg|postgresql}} and {{Pkg|libpqxx}}. Read [[PostgreSQL#Installing_PostgreSQL]] to set it up and start the [[daemon]]. <br />
<br />
In order to receive mail notifications, make sure to install a mail server. By default, Archlinux does not ship with one. The recommended mail server is [[postfix]], but you can use others such as [[SSMTP]], [[msmtp]], [[sendmail]], [https://wiki.archlinux.org/index.php/Category:Mail_Server etc].<br />
<br />
== Configuration ==<br />
<br />
=== Notes Before Configuring ===<br />
The gitlab package from AUR organizes GitLab's files in a manner that more closely follows standard linux conventions rather than installing everything in {{ic|/home/git}} as you are told to do by [https://github.com/gitlabhq/gitlabhq/blob/6-5-stable/doc/install/installation.md GitLab's official install guide]. <br />
<br />
<br />
After you've installed gitlab from AUR, the config file {{ic|/etc/webapps/gitlab/shell.yml}} corresponds to the file {{ic|/home/git/gitlab-shell/config.yml}} that is mentioned in [https://github.com/gitlabhq/gitlabhq/blob/6-5-stable/doc/install/installation.md#4-gitlab-shell GitLab's official install guide when installing gitlab-shell]. The config file {{ic|/etc/webapps/gitlab/gitlab.yml}} corresponds to the file {{ic|/home/git/gitlab/config/gitlab.yml}} that is mentioned in [https://github.com/gitlabhq/gitlabhq/blob/6-5-stable/doc/install/installation.md#configure-it GitLab's official install guide when configuring GitLab].<br />
<br />
<br />
Another key difference between gitlab from AUR and the GitLab install guide is that GitLab from AUR uses the {{ic|gitlab}} user with {{ic|/var/lib/gitlab}} as the home folder instead of the {{ic|git}} user with {{ic|/home/git}} as the home folder. This keeps the {{ic|/home}} area clean so it contains only real user homes.<br />
<br />
{{tip|If you are familiar with the [[Arch Build System]] you can edit the PKGBUILD and relevant files to change gitlab's home directory to a place of your liking.}}<br />
<br />
===Basic configuration===<br />
Open up {{ic|/etc/webapps/gitlab/shell.yml}} and set {{ic|gitlab_url:}} to the url where you intend to host GitLab (note the 'http://' and trailing slash). For example, if you will host GitLab at 'yourdomain.com', then it'd look like this:<br />
<br />
{{hc|Snippet from /etc/webapps/gitlab/shell.yml|<br />
# GitLab user. git by default<br />
user: gitlab<br />
<br />
# Url to gitlab instance. Used for api calls. Should end with a slash.<br />
gitlab_url: "<nowiki>http://yourdomain.com/</nowiki>" # <<-- right here<br />
<br />
http_settings:<br />
# user: someone<br />
# password: somepass<br />
...<br />
}}<br />
<br />
<br />
Open up {{ic|/etc/webapps/gitlab/gitlab.yml}} and edit where needed. In the {{ic|gitlab:}} section set {{ic|host:}} (replacing {{ic|localhost}}) to 'yourdomain.com', your fully qualified domin name (no 'http://' or trailing slash). {{ic|port:}} can be confusing. This is not the port that the gitlab server (unicorn) runs on; it's the port that users will initially access through in their browser. Basically, if you intend for users to visit 'yourdomain.com' in their browser, without appending a port number to the domain name, leave {{ic|port:}} as {{ic|80}}. If you intend your users to type something like 'yourdomain.com:3425' into their browsers, then you'd set {{ic|port:}} to {{ic|3425}} (you'll also have to configure your server (apache, nginx, etc) to listen on that port). Those are the minimal changes needed for a working GitLab install. The adventurous may read on in the comment and customize as needed. For example:<br />
<br />
{{hc|Snippet from /etc/webapps/gitlab/gitlab.yml|<br />
...<br />
## GitLab settings<br />
gitlab:<br />
## Web server settings<br />
host: yourdomain.com<br />
port: 80<br />
https: false<br />
...<br />
}}<br />
<br />
=== Further configuration ===<br />
<br />
==== Database backend ====<br />
A Database backend will be required before Gitlab can be run. Currently GitLab supports [[MariaDB]] and [[PostgreSQL]]. By default, GitLab assumes you will use MySQL. Extra work is needed if you plan to use PostgreSQL.<br />
<br />
{{note|Don't forget to replace {{ic|your_username_here}} and {{ic|your_password_here}} with your chosen values in the following examples.}}<br />
<br />
==== MariaDB ====<br />
To set up MySQL (MariaDB) you need to create a database called {{ic|gitlabhq_production}} along with a user who has full priviledges to the database. You might do it via command line as in the following example.<br />
<br />
{{bc|mysql -u root -p}}<br />
<br />
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production`;<br />
mysql> CREATE USER 'your_username_here'@'localhost' IDENTIFIED BY 'your_password_here';<br />
mysql> GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'your_username_here'@'localhost';<br />
mysql> \q<br />
<br />
Now try connecting to the new database with the new user to verify you did it correctly:<br />
<br />
{{bc|mysql -u your_username_here -p -D gitlabhq_production}}<br />
<br />
Next you'll need to open up {{ic|/etc/webapps/gitlab/database.yml}} and set {{ic|username:}} and {{ic|password:}} for the {{ic|gitlabhq_production}} database to {{ic|your_username_here}} and {{ic|your_password_here}}, respectively. You need not worry about the info for the {{ic|gitlabhq_development}} and {{ic|gitlan_test}} databases, as those are not required for our purposes (unless you're feeling adventurous at your own risk). For example:<br />
<br />
{{hc|Snippet from /etc/webapps/gitlab/database.yml|<br />
#<br />
# PRODUCTION<br />
#<br />
production:<br />
adapter: mysql2<br />
encoding: utf8<br />
reconnect: false<br />
database: gitlabhq_production<br />
pool: 10<br />
username: your_username_here<br />
password: "your_password_here"<br />
# host: localhost<br />
# socket: /tmp/mysql.sock<br />
...<br />
}}<br />
<br />
That's all for MySQL configuration.<br />
<br />
For more info and other ways to create/manage MySQL databases, see the [https://mariadb.org/docs/ MariaDB documentation], the [https://github.com/gitlabhq/gitlabhq/blob/6-5-stable/doc/install/installation.md GitLab official (generic) install guide], and [[phpMyAdmin]].<br />
<br />
==== PostgreSQL ====<br />
Login to PostgreSQL and create the {{ic|gitlabhq_production}} database with along with it's user. Remember to change {{ic|your_username_here}} and {{ic|your_password_here}} to the real values:<br />
<br />
{{bc|psql -d template1}}<br />
<br />
template1=# CREATE USER your_username_here WITH PASSWORD 'your_password_here';<br />
template1=# CREATE DATABASE gitlabhq_production OWNER your_username_here;<br />
template1=# \q<br />
<br />
Try connecting to the new database with the new user to verify it works:<br />
<br />
{{bc|psql -d gitlabhq_production}}<br />
<br />
Copy the PostgreSQL template file before configuring it (overwriting the default MySQL configuration file):<br />
<br />
# cp /usr/share/doc/gitlab/database.yml.postgresql /etc/webapps/gitlab/database.yml<br />
<br />
Open up the new {{ic|/etc/webapps/gitlab/database.yml}} and set the values for {{ic|username:}} and {{ic|password:}}. For example:<br />
<br />
{{hc|Snippet from the new /etc/webapps/gitlab/database.yml|<br />
#<br />
# PRODUCTION<br />
#<br />
production:<br />
adapter: postgresql<br />
encoding: unicode<br />
database: gitlabhq_production<br />
pool: 10<br />
username: your_username_here<br />
password: "your_password_here"<br />
# host: localhost<br />
# port: 5432 <br />
# socket: /tmp/postgresql.sock<br />
...<br />
}}<br />
<br />
For our purposes (unless you know what you're doing), you don't need to worry about configuring the other databases listed in {{ic|/etc/webapps/gitlab/database.yml}}. We only need to set up the production database to get GitLab working.<br />
<br />
Finally, open up {{ic|/usr/lib/systemd/system/gitlab.target}} change all instances of {{ic|mysql.service}} to {{ic|postgresql.service}}. For example:<br />
<br />
{{Accuracy|See [[systemd#Editing provided unit files]] for the correct way.}}<br />
<br />
{{hc|Snippet from /usr/lib/systemd/system/gitlab.target|<br />
...<br />
[Unit]<nowiki><br />
Description=GitLab - Self Hosted Git Management<br />
Requires=redis.service postgresql.service<br />
After=redis.service postgresql.service syslog.target network.target<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki><br />
}}<br />
<br />
<br />
==== Firewall ====<br />
<br />
If you want to give direct access to your Gitlab isntallation through a [[iptables]] firewall you have to the following ACCEPT rule. Change "your_gitlab_port" to your chosen port from above (here we give access to all clients within 192.168.1.0/24 network):<br />
<br />
# iptables -A tcp_inbound -p TCP -s 192.168.1.0/24 --destination-port your_gitlab_port -j ACCEPT <br />
<br />
If you are behind a router, don't forget to forward this port to the running Gitlab server host, too.<br />
<br />
==== Satellites access ====<br />
<br />
Satellites access should be "drwxr-x---":<br />
<br />
# chmod 750 /var/lib/gitlab/satellites<br />
<br />
==== Initialize Gitlab database ====<br />
<br />
Start the Redis server before we create the database:<br />
<br />
# systemctl start redis<br />
# systemctl enable redis<br />
<br />
Then, initialize the database and activate advanced features: <br />
# cd /usr/share/webapps/gitlab<br />
# sudo -u gitlab bundle exec rake gitlab:setup RAILS_ENV=production<br />
<br />
Finally, Compile assets.(If you didn't do it,you won't receive data on user/sign_in pages)<br />
<br />
# cd /usr/share/webapps/gitlab<br />
# sudo -u gitlab -H bundle exec rake assets:precompile RAILS_ENV=production<br />
<br />
==== Configure Git User ====<br />
<br />
# cd /usr/share/webapps/gitlab<br />
# sudo -u gitlab -H git config --global user.name "GitLab"<br />
# sudo -u gitlab -H git config --global user.email "example@example.com"<br />
<br />
==== Adjust modifier bits ====<br />
(The gitlab check won't pass if the user and group ownership isn't configured properly)<br />
<br />
# chmod -R ug+rwX,o-rwx /path/to/repos/<br />
# chmod -R ug-s /path/to/repos<br />
# find /path/to/repos/ -type d -print0 | xargs -O chmod g+s<br />
<br />
== Start and test GitLab ==<br />
<br />
With the following commands we check if the steps we followed so far are configured properly. <br />
<br />
$ cd /usr/share/webapps/gitlab<br />
$ sudo -u gitlab bundle exec rake gitlab:env:info RAILS_ENV=production<br />
$ sudo -u gitlab bundle exec rake gitlab:check RAILS_ENV=production<br />
<br />
{{note|These gitlab:env:info and gitlab:check commands will show a fatal error related to git. This is OK.}}<br />
<br />
{{hc|Example output of sudo -u gitlab bundle exec rake gitlab:env:info <nowiki>RAILS_ENV=production</nowiki>|<br />
fatal: Not a git repository (or any of the parent directories): .git<br />
<br />
System information<br />
System: Arch Linux<br />
Current User: git<br />
Using RVM: yes<br />
RVM Version: 1.20.3<br />
Ruby Version: 2.0.0p0<br />
Gem Version: 2.0.0<br />
Bundler Version:1.3.5<br />
Rake Version: 10.0.4<br />
<br />
GitLab information<br />
Version: 5.2.0.pre<br />
Revision: <br />
Directory: /home/git/gitlab<br />
DB Adapter: mysql2<br />
URL: http://gitlab.arch<br />
HTTP Clone URL: http://gitlab.arch/some-project.git<br />
SSH Clone URL: git@gitlab.arch:some-project.git<br />
Using LDAP: no<br />
Using Omniauth: no<br />
<br />
GitLab Shell<br />
Version: 1.4.0<br />
Repositories: /home/git/repositories/<br />
Hooks: /home/git/gitlab-shell/hooks/<br />
Git: /usr/bin/git<br />
}}<br />
<br />
{{Note| {{ic|gitlab:check}} will complain about missing initscripts. Don't worry, we will use ArchLinux's [[systemd]] to manage server start during boot (which GitLab does not recognize).}}<br />
<br />
{{hc|Example output of sudo -u gitlab bundle exec rake gitlab:check <nowiki>RAILS_ENV=production</nowiki>|<br />
<nowiki>fatal: Not a git repository (or any of the parent directories): .git<br />
Checking Environment ...<br />
<br />
Git configured for gitlab user? ... yes<br />
Has python2? ... yes<br />
python2 is supported version? ... yes<br />
<br />
Checking Environment ... Finished<br />
<br />
Checking GitLab Shell ...<br />
<br />
GitLab Shell version >= 1.7.9 ? ... OK (1.8.0)<br />
Repo base directory exists? ... yes<br />
Repo base directory is a symlink? ... no<br />
Repo base owned by gitlab:gitlab? ... yes<br />
Repo base access is drwxrws---? ... yes<br />
update hook up-to-date? ... yes<br />
update hooks in repos are links: ... can't check, you have no projects<br />
Running /srv/gitlab/gitlab-shell/bin/check<br />
Check GitLab API access: OK<br />
Check directories and files:<br />
/srv/gitlab/repositories: OK<br />
/srv/gitlab/.ssh/authorized_keys: OK<br />
Test redis-cli executable: redis-cli 2.8.4<br />
Send ping to redis server: PONG<br />
gitlab-shell self-check successful<br />
<br />
Checking GitLab Shell ... Finished<br />
<br />
Checking Sidekiq ...<br />
<br />
Running? ... yes<br />
Number of Sidekiq processes ... 1<br />
<br />
Checking Sidekiq ... Finished<br />
<br />
Checking LDAP ...<br />
<br />
LDAP is disabled in config/gitlab.yml<br />
<br />
Checking LDAP ... Finished<br />
<br />
Checking GitLab ...<br />
<br />
Database config exists? ... yes<br />
Database is SQLite ... no<br />
All migrations up? ... fatal: Not a git repository (or any of the parent directories): .git<br />
yes<br />
GitLab config exists? ... yes<br />
GitLab config outdated? ... no<br />
Log directory writable? ... yes<br />
Tmp directory writable? ... yes<br />
Init script exists? ... no<br />
Try fixing it:<br />
Install the init script<br />
For more information see:<br />
doc/install/installation.md in section "Install Init Script"<br />
Please fix the error above and rerun the checks.<br />
Init script up-to-date? ... can't check because of previous errors<br />
projects have namespace: ... can't check, you have no projects<br />
Projects have satellites? ... can't check, you have no projects<br />
Redis version >= 2.0.0? ... yes<br />
Your git bin path is "/usr/bin/git"<br />
Git version >= 1.7.10 ? ... yes (1.8.5)<br />
<br />
Checking GitLab ... Finished<br />
</nowiki><br />
}}<br />
<br />
Make systemd see your new daemon unit files:<br />
<br />
$ systemctl daemon-reload<br />
<br />
After starting the database backend (in this case MySQL), we can start Gitlab with its webserver (Unicorn):<br />
<br />
$ systemctl start redis mysqld gitlab-sidekiq gitlab-unicorn<br />
<br />
Replace {{ic|mysqld}} with {{ic|postgresql}} in the above command if you're using PostgreSQL.<br />
<br />
To automatically launch GitLab at startup, run:<br />
<br />
$ systemctl enable gitlab.target gitlab-sidekiq gitlab-unicorn<br />
<br />
Now test your Gitlab instance by visiting http://localhost:8080 or http://yourdomain.com and login with the default credentials:<br />
username: {{ic|admin@local.host}}<br />
password: {{ic|5iveL!fe}}<br />
<br />
{{note|1=If your browser runs not on the machine where gitlab is running, modify your unocorn.rb in order to be able to test your setup without the use of a proxy. The corresponding line looks like this:<br />
<pre>listen "127.0.0.1:8080, :tcp_nopush => true</pre><br />
you should replace that with:<br />
<pre>listen "examle.yourhost.com:8080, :tcp_nopush => true</pre><br />
}}<br />
<br />
GitLab should now be up and running.<br />
<br />
== Advanced Configuration ==<br />
<br />
=== HTTPS/SSL ===<br />
<br />
==== Change GitLab configs ====<br />
Modify {{ic|/etc/webapps/gitlab/shell.yml}} so the url to your GitLab site starts with {{ic|https://}}.<br />
Modify {{ic|/etc/webapps/gitlab/gitlab.yml}} so that {{ic|https:}} setting is set to {{ic|true}}.<br />
<br />
==== Configure HTTPS server of choice====<br />
<br />
===== Apache =====<br />
{{stub|info needed}}<br />
<br />
===== Node.js =====<br />
You can easily set up an http proxy on port 443 to proxy traffic to the GitLab application on port 8080 using http-master for Node.js. After you've creates your domain's OpenSSL keys and have gotten you CA certificate (or self signed it), then go to https://github.com/CodeCharmLtd/http-master to learn how easy it is to proxy requests to GitLab using HTTPS. http-master is built on top of [https://github.com/nodejitsu/node-http-proxy node-http-proxy].<br />
<br />
===Web server configuration===<br />
If you want to integrate Gitlab into a running web server instead of using its build-in http server Unicorn, then follow these instructions.<br />
<br />
====Nginx and unicorn====<br />
<br />
[[pacman|Install]] {{Pkg|nginx}} from the [[official repositories]].<br />
<br />
Nginx gitlab configuration needs to be copied to nginx configuration directories.<br />
<br />
If you installed GitLab from AUR, do:<br />
<br />
# cp /usr/share/webapps/gitlab/lib/support/nginx/gitlab /etc/nginx/sites-available<br />
<br />
Then edit /usr/share/webapps/gitlab/lib/support/nginx/gitlab and change all path starting from /home/git/gitlab to /usr/share/webapps/gitlab (there are two occurences).<br />
<br />
If you did not use AUR, you need to copy {{ic|/lib/support/nginx/gitlab}} to {{ic|/etc/nginx/sites-available/}}.<br />
<br />
Run these commands to setup nginx:<br />
<br />
# ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab<br />
<br />
Edit {{ic|/etc/nginx/sites-enabled/gitlab}} and change YOUR_SERVER_IP and YOUR_SERVER_FQDN to the IP address and fully-qualified domain name of the host serving Gitlab.<br />
<br />
Restart gitlab.target, resque.service and nginx.<br />
<br />
====Apache and unicorn====<br />
<br />
[[pacman|Install]] {{Pkg|apache}} from the [[official repositories]]. <br />
<br />
=====Configure Unicorn=====<br />
<br />
{{Note|If the default path is not {{ic|/home/git}} for your installation, change the below path accordingly}}<br />
<br />
As the official installation guide instructs, copy the unicorn configuration file:<br />
# sudo -u git -H cp /home/git/gitlab/config/unicorn.rb.example /home/git/gitlab/config/unicorn.rb<br />
<br />
Now edit {{ic|config/unicorn.rb}} and add a listening port by uncommenting the following line:<br />
listen "127.0.0.1:8080"<br />
<br />
{{Tip| You can set a custom port if you want. Just remember to also include it in Apache's virtual host. See below.}}<br />
<br />
=====Create a virtual host for Gitlab=====<br />
<br />
Create a configuration file for Gitlab’s virtual host and insert the lines below adjusted accordingly. For the ssl section see [[LAMP#SSL]]. If you do not need it, remove it. Notice that the SSL virtual host needs a specific IP instead of generic. Also if you set a custom port for Unicorn, do not forget to set it at the BalanceMember line.<br />
<br />
You can use these [https://gitlab.com/gitlab-org/gitlab-recipes/blob/079f70dd2c091434a8dd04ed5b1a0d0e937cd361/web-server/apache/gitlab-ssl-apache2.4.conf examples] to get you started.<br />
<br />
=====Enable host and start unicorn=====<br />
<br />
Enable your Gitlab virtual host and reload [[Apache]]:<br />
{{hc|/etc/httpd/conf/httpd.conf| Include /etc/httpd/conf/extra/gitlab.conf}}<br />
<br />
Finally start unicorn:<br />
<br />
# systemctl start gitlab-unicorn<br />
<br />
=== Redis ===<br />
Using a Redis setup different from default (e.g. different address, port, unix socket) requires the environment variable ''REDIS_URL'' to be set accordingly for unicorn. This can be achieved by extending the systemd service file. Create a file ''/etc/systemd/system/gitlab-unicorn.service.d/redis.conf'' that injects the ''REDIS_URL'' environment variable:<br />
[Service]<br />
Environment=REDIS_URL=unix:///run/gitlab/redis.sock<br />
<br />
==Useful Tips==<br />
<br />
===Fix Rake Warning===<br />
When running rake tasks for the gitlab project, this error will occur: {{ic|fatal: Not a git repository (or any of the parent directories): .git}}. This is a bug in bundler, and it can be safely ignored. However, if you want to git rid of the error, the following method can be used:<br />
<br />
{{bc|1=<br />
# cd /usr/share/webapps/gitlab<br />
# sudo -u gitlab git init<br />
# sudo -u gitlab git commit -m "initial commit" --allow-empty<br />
}}<br />
<br />
===Hook into /var===<br />
{{bc|1=<br />
# mkdir -m700 /var/log/gitlab /var/tmp/gitlab<br />
# chown gitlab:gitlab /var/log/gitlab /var/tmp/gitlab<br />
# sudo -u gitlab -i<br />
# cd ~/gitlab<br />
# d=log; mv $d/* /var/$d/gitlab; rm -f $d/.gitkeep; rm -r $d && ln -s /var/$d/gitlab $d<br />
# d=tmp; mv $d/* /var/$d/gitlab; rm -f $d/.gitkeep; rm -r $d && ln -s /var/$d/gitlab $d<br />
}}<br />
<br />
===Hidden options===<br />
Go to Gitlab's home directory:<br />
# cd /usr/share/webapps/gitlab<br />
<br />
and run:<br />
{{hc|<nowiki># rake -T | grep gitlab</nowiki>|<nowiki><br />
rake gitlab:app:check # GITLAB | Check the configuration of the GitLab Rails app<br />
rake gitlab:backup:create # GITLAB | Create a backup of the GitLab system<br />
rake gitlab:backup:restore # GITLAB | Restore a previously created backup<br />
rake gitlab:check # GITLAB | Check the configuration of GitLab and its environment<br />
rake gitlab:cleanup:block_removed_ldap_users # GITLAB | Cleanup | Block users that have been removed in LDAP<br />
rake gitlab:cleanup:dirs # GITLAB | Cleanup | Clean namespaces<br />
rake gitlab:cleanup:repos # GITLAB | Cleanup | Clean repositories<br />
rake gitlab:env:check # GITLAB | Check the configuration of the environment<br />
rake gitlab:env:info # GITLAB | Show information about GitLab and its environment<br />
rake gitlab:generate_docs # GITLAB | Generate sdocs for project<br />
rake gitlab:gitlab_shell:check # GITLAB | Check the configuration of GitLab Shell<br />
rake gitlab:import:all_users_to_all_groups # GITLAB | Add all users to all groups (admin users are added as owners)<br />
rake gitlab:import:all_users_to_all_projects # GITLAB | Add all users to all projects (admin users are added as masters)<br />
rake gitlab:import:repos # GITLAB | Import bare repositories from gitlab_shell -> repos_path into GitLab project instance<br />
rake gitlab:import:user_to_groups[email] # GITLAB | Add a specific user to all groups (as a developer)<br />
rake gitlab:import:user_to_projects[email] # GITLAB | Add a specific user to all projects (as a developer)<br />
rake gitlab:satellites:create # GITLAB | Create satellite repos<br />
rake gitlab:setup # GITLAB | Setup production application<br />
rake gitlab:shell:build_missing_projects # GITLAB | Build missing projects<br />
rake gitlab:shell:install[tag,repo] # GITLAB | Install or upgrade gitlab-shell<br />
rake gitlab:shell:setup # GITLAB | Setup gitlab-shell<br />
rake gitlab:sidekiq:check # GITLAB | Check the configuration of Sidekiq<br />
rake gitlab:test # GITLAB | Run all tests<br />
rake gitlab:web_hook:add # GITLAB | Adds a web hook to the projects<br />
rake gitlab:web_hook:list # GITLAB | List web hooks<br />
rake gitlab:web_hook:rm # GITLAB | Remove a web hook from the projects<br />
rake setup # GITLAB | Setup gitlab db<br />
</nowiki>}}<br />
<br />
===Backup and restore===<br />
<br />
Create a backup of the gitlab system:<br />
# sudo -u gitlab -H rake RAILS_ENV=production gitlab:backup:create<br />
<br />
Restore the previously created backup file {{ic|/home/gitlab/gitlab/tmp/backups/20130125_11h35_1359131740_gitlab_backup.tar}}:<br />
# sudo -u gitlab -H rake RAILS_ENV=production gitlab:backup:restore BACKUP=/home/gitlab/gitlab/tmp/backups/20130125_11h35_1359131740<br />
<br />
{{Note| Backup folder is set in {{ic|config/gitlab.yml}}. GitLab backup and restore is documented [https://github.com/gitlabhq/gitlabhq/blob/master/doc/raketasks/backup_restore.md here].}}<br />
<br />
===Migrate from sqlite to mysql===<br />
<br />
Get latest code as described in [[#Update_Gitlab]].<br />
Save data.<br />
# cd /home/gitlab/gitlab<br />
# sudo -u gitlab bundle exec rake db:data:dump RAILS_ENV=production<br />
<br />
Follow [[#Mysql]] instructions and then setup the database.<br />
# sudo -u gitlab bundle exec rake db:setup RAILS_ENV=production<br />
<br />
Finally restore old data.<br />
# sudo -u gitlab bundle exec rake db:data:load RAILS_ENV=production<br />
<br />
===Running GitLab with rvm===<br />
<br />
To run gitlab with rvm first you have to set up an rvm:<br />
<br />
curl -L https://get.rvm.io | bash -s stable --ruby=1.9.3<br />
<br />
{{Note|Version 1.9.3 is currently recommended to avoid some compatibility issues.}}<br />
<br />
For the complete installation you will want to be the final user (e.g. {{ic|git}}) so make sure to switch to this user and activate your rvm:<br />
<br />
su - git<br />
source "$HOME/.rvm/scripts/rvm"<br />
<br />
Then continue with the installation instructions from above. However, the systemd scripts will not work this way, because the environment for the rvm is not activated. The recommendation here is to create to separate shell scripts for {{ic|puma}} and {{ic|sidekiq}} to activate the environment and then start the service:<br />
<br />
{{hc|gitlab.sh|<nowiki><br />
#!/bin/sh<br />
source `/home/git/.rvm/bin/rvm 1.9.3 do rvm env --path`<br />
RAILS_ENV=production bundle exec puma -C "/home/git/gitlab/config/puma.rb"</nowiki><br />
}}<br />
<br />
{{hc|sidekiq.sh|<nowiki><br />
#!/bin/sh<br />
source `/home/git/.rvm/bin/rvm 1.9.3 do rvm env --path`<br />
case $1 in<br />
start)<br />
bundle exec rake sidekiq:start RAILS_ENV=production<br />
;;<br />
stop)<br />
bundle exec rake sidekiq:stop RAILS_ENV=production<br />
;;<br />
*)<br />
echo "Usage $0 {start|stop}"<br />
esac<br />
</nowiki>}}<br />
<br />
Then modify the above systemd files so they use these scripts. Modify the given lines:<br />
<br />
{{hc|gitlab.service|<nowiki><br />
ExecStart=/home/git/bin/gitlab.sh<br />
</nowiki>}}<br />
{{hc|sidekiq.service|<nowiki><br />
ExecStart=/home/git/bin/sidekiq.sh start<br />
ExecStop=/home/git/bin/sidekiq.sh stop<br />
</nowiki>}}<br />
<br />
==Troubleshooting==<br />
<br />
Sometimes things may not work as expected. Be sure to visit the [https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide Trouble Shooting Guide].<br />
<br />
=== HTTPS is not green (gravatar not using https) ===<br />
Redis caches gravatar images, so if you've visited your GitLab with http, then enabled https, gravatar will load up the non-secure images. You can clear the cache by doing<br />
<br />
cd /usr/share/webapps/gitlab; bundle exec rake cache:clear<br />
<br />
as the gitlab user.<br />
<br />
==See also==<br />
*[https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md Official Documentation]<br />
*[https://gitlab.com/gitlab-org/gitlab-recipes Gitlab recipes with further documentation on running it with several webservers]</div>Robvelorhttps://wiki.archlinux.org/index.php?title=Fbsplash&diff=171894Fbsplash2011-12-01T20:27:09Z<p>Robvelor: Added vga framebuffer size to grub params, fbsplash fails if this is not set.</p>
<hr />
<div>[[Category:Bootsplash (English)]]<br />
{{i18n|Fbsplash}}<br />
[http://fbsplash.berlios.de Fbsplash] (formerly gensplash) is a userspace implementation of a splash screen for Linux systems. It provides a graphical environment during system boot using the Linux framebuffer layer.<br />
<br />
==Installation==<br />
===Fbsplash===<br />
The {{AUR|fbsplash}} package is available in the [[AUR]]. For console backgrounds (discussed later in this article) you should install a kernel patched with fbcondecor such as {{AUR|linux-fbcondecor}}.<br />
<br />
===Scripts===<br />
The fbsplash package provides the scripts for basic functionality. If you want more bells and whistles, like smooth progress, filesystem-check progress messages, support for boot-services/'daemons'-icons and theme hook scripts, you may also install the {{AUR|fbsplash-extras}} package.<br />
<br />
===Themes===<br />
Themes can be found by searching the AUR for [https://aur.archlinux.org/packages.php?O=0&K=fbsplash-theme&do_Search=Go fbsplash-theme], in [http://gnome-look.org GNOME-Look.org] or in [http://kde-look.org KDE-Look.org].<br />
{{Note|The package fbsplash does not contain a default theme.}}<br />
<br />
===Suspend to Disk===<br />
If you want suspend to disk with [[Uswsusp]] using Fbsplash, install the {{AUR|uswsusp-fbsplash}} package from the AUR. For more info have a look at [[Pm-utils#Using_another_sleep_backend_.28like_uswsusp.29]] or [[Suspend_to_Disk#Uswsusp_method (hibernate-script)]]. Additionally there is limited support for using Fbsplash in the {{Package AUR|tuxonice-userui}} package for those using a kernel with the TuxOnIce patch.<br />
<br />
==Configuration==<br />
<br />
===Kernel Command Line===<br />
Your bootloader now needs some configuring to work with Fbsplash. The following is an example for [[Grub2]] and {{Filename|/boot/grub/grub.cfg}} (the legacy [[Grub]] and [[Lilo]] follow the same pattern):<br />
linux /boot/vmlinuz-linux root=/dev/... quiet loglevel=3 logo.nologo vga=790 console=tty1 splash=silent,fadein,fadeout,theme:arch-banner-icons<br />
<br />
You may also edit the file {{Filename|/etc/default/grub}} and append your kernel options to the line GRUB_CMDLINE_LINUX_DEFAULT="":<br />
{{File|name=/etc/default/grub|content=GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 logo.nologo vga=790 console=tty1 splash=silent,fadein,fadeout,theme:arch-banner-icons"}}<br />
<br />
To re-generate {{Filename|grub.cfg}} run:<br />
{{Cli|# grub-mkconfig -o /boot/grub/grub.cfg}}<br />
<br />
The parameter {{Codeline|1=loglevel=3}} prevents kernel messages from garbling the splash even with funny hardware (as recent initscripts do not set this by default any more). {{Codeline|quiet}} is needed additionally for silencing initcpio messages. {{Codeline|logo.nologo}} removes the boot logo (not needed with [https://aur.archlinux.org/packages.php?ID=50924 linux-fbcondecor] since it does not have one anyway). {{Codeline|1=console=tty1}} redirects system messages to tty1 and {{Codeline|1=splash=silent,fadein,fadeout,theme:arch-banner-icons}} creates a silent, splash-only boot with fading in/out 'arch-banner-icons' theme.<br />
<br />
===Configuration Files===<br />
Put one or more of the themes you installed into {{Filename|/etc/conf.d/splash}}. You can also specify screen resolutions to save some initcpio space:<br />
{{File|name=/etc/conf.d/splash|content=SPLASH_THEMES="<br />
arch-black<br />
arch-banner-icons/1280x1024.cfg<br />
arch-banner-noicons/1280x1024.cfg"}}<br />
{{Note|The theme '''arch-banner-icons''' contains mainly symlinks to '''arch-banner-noicons'''. So if one of them is included in total, not much space will be saved by limiting the resolutions.}}<br />
<br />
If you start Xorg using DAEMONS (kdm, gdm, etc.), also set the appropriate rc.d-script name to avoid VT/keyboard struggle between Xorg and the splash daemon:<br />
SPLASH_XSERVICE="gdm"<br />
{{note|Fbsplash will be stopped ''without'' changing to the tty1 console before the named script is started. If not set (or not enabled in DAEMONS), Fbsplash is stopped at the very end of [[Rc.multi]]. In the latter case it will change to the tty1 console if ''not'' booting into runlevel 5.}}<br />
<br />
==Starting Fbsplash early in the initcpio==<br />
Add '''fbsplash''' to HOOKS in {{Filename|/etc/[[mkinitcpio.conf]]}}:<br />
{{File|name=/etc/mkinitcpio.conf|content=HOOKS="base fbsplash ..."}}<br />
or:<br />
{{File|name=/etc/mkinitcpio.conf|content=HOOKS="base udev ... uresume fbsplash ..."}}<br />
or in case of system encryption:<br />
{{File|name=/etc/mkinitcpio.conf|content=HOOKS="base ... keymap encrypt fbsplash ..." }}<br />
Rebuild your initcpio via mkinitcpio. See the [[Mkinitcpio#Creating_the_image|Mkinitcpio article]] for more info.<br />
<br />
{{Note|With old kernels not supporting devtmpfs, '''udev''' is needed before '''fbsplash''' to get the device nodes necessary for starting the splash (/dev/fb0 for framebuffer, etc.) and/or to avoid visible screen repaint with the Fbcondecor kernel patch. To avoid interference, the '''uresume''' hook provided by ''uswsusp-fbsplash'' will first wait for any Fbcondecor helper '''fadein''' to finish. To get a quick resume, it is recommended to put '''uswsusp''' before '''fbsplash''' or even drop fadein if using a Fbcondecor kernel.}}<br />
<br />
If you have trouble getting fbsplash to work and your machine uses KMS (Kernel Mode Setting), try [[Intel#KMS_.28Kernel_Mode_Setting.29|adding the appropriate driver to mkinitcpio.conf]].<br />
<br />
==Console backgrounds==<br />
If you have a kernel that supports Fbcondecor (eg. {{AUR|linux-fbcondecor}}), you can get nice graphical console backgrounds beside the splash screen. Just search the AUR for [https://aur.archlinux.org/packages.php?O=0&K=fbsplash-theme&do_Search=Go fbsplash-theme].<br />
<br />
After installing your patched kernel and fbsplash, add {{Codeline|fbcondecor}} to your {{Codeline|DAEMONS}} array in {{Filename|/etc/[[rc.conf]]}}:<br />
{{File|name=/etc/rc.conf|content=DAEMONS=(... fbcondecor ...)}}<br />
There is also a configuration file {{Filename|/etc/conf.d/fbcondecor}} to set up the virtual terminals to be used.<br />
<br />
You may even boot up with a nice console background and the plain Arch Linux boot messages instead of a splash screen. Just change your kernel command line to use the verbose mode:<br />
quiet console=tty1 splash=verbose,theme:arch-banner-icons<br />
<br />
==Links==<br />
* http://fbsplash.berlios.de<br />
* http://dev.gentoo.org/~spock/projects/fbcondecor/</div>Robvelor