Commit b74347e3 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Replace NGINX with gitlab-workhorse

parent 30918257
......@@ -21,11 +21,3 @@ gitlab-openldap/sbin/
gitlab-openldap/share/
.vagrant/
gitlab-workhorse/
nginx/logs
nginx/conf/nginx.conf
nginx/tmp
nginx/client_body_temp
nginx/fastcgi_temp
nginx/proxy_temp
nginx/scgi_temp
nginx/uwsgi_temp
......@@ -5,7 +5,7 @@ gitlab_workhorse_repo = https://gitlab.com/gitlab-org/gitlab-workhorse.git
gitlab_development_root = $(shell pwd)
postgres_bin_dir = $(shell pg_config --bindir)
all: gitlab-setup gitlab-shell-setup gitlab-runner-setup gitlab-workhorse-setup nginx-setup support-setup
all: gitlab-setup gitlab-shell-setup gitlab-runner-setup gitlab-workhorse-setup support-setup
# Set up the GitLab Rails app
......@@ -138,17 +138,6 @@ gitlab-workhorse/.git/pull:
cd ${gitlab_development_root}/gitlab-workhorse && \
git pull --ff-only
nginx-setup: nginx/conf/nginx.conf nginx/logs nginx/tmp
nginx/conf/nginx.conf:
sed -e "s|/home/git|${gitlab_development_root}|" nginx/conf/nginx.conf.example > $@
nginx/logs:
mkdir -p $@
nginx/tmp:
mkdir -p $@
clean-config:
rm -f \
gitlab/config/gitlab.yml \
......@@ -157,5 +146,4 @@ clean-config:
gitlab/config/resque.yml \
gitlab-shell/config.yml \
redis/redis.conf \
Procfile \
nginx/conf/nginx.conf
Procfile
redis: redis-server /home/git/redis/redis.conf
postgresql: postgres -D /home/git/postgresql/data -k /home/git/postgresql -h ''
#openldap: cd gitlab-openldap && libexec/slapd -F slapd.d -d2 -h "ldap://127.0.0.1:3890"
nginx: nginx -p /home/git/nginx -c conf/nginx.conf
gitlab-workhorse: /home/git/gitlab-workhorse/gitlab-workhorse -listenNetwork unix -listenAddr /home/git/gitlab-workhorse.socket /home/git/repositories
gitlab-workhorse: /home/git/gitlab-workhorse/gitlab-workhorse -listenAddr localhost:3000 -documentRoot /home/git/gitlab/public -developmentMode
......@@ -37,7 +37,7 @@ sockets to avoid port conflicts.
## Differences with production
- NGINX does not serve static files
- gitlab-workhorse does not serve static files
- C compiler needed to run `bundle install` (not needed with Omnibus)
- GitLab can rewrite its program code and configuration data (read-only with
Omnibus)
......@@ -89,7 +89,7 @@ Please read [the prerequisites for all platforms](#prerequisites-for-all-platfor
```
brew tap homebrew/dupes
brew tap homebrew/versions
brew install git redis postgresql phantomjs198 libiconv icu4c pkg-config cmake nodejs go nginx openssl
brew install git redis postgresql phantomjs198 libiconv icu4c pkg-config cmake nodejs go openssl
brew link phantomjs198
bundle config build.nokogiri --with-iconv-dir=/usr/local/opt/libiconv
```
......@@ -100,7 +100,7 @@ Please read [the prerequisites for all platforms](#prerequisites-for-all-platfor
```
sudo apt-add-repository -y ppa:ubuntu-lxc/lxd-stable && sudo apt-get update
sudo apt-get install git postgresql libpq-dev phantomjs redis-server libicu-dev cmake g++ nodejs libkrb5-dev golang nginx ed pkg-config
sudo apt-get install git postgresql libpq-dev phantomjs redis-server libicu-dev cmake g++ nodejs libkrb5-dev golang ed pkg-config
```
##### Arch Linux
......@@ -108,7 +108,7 @@ sudo apt-get install git postgresql libpq-dev phantomjs redis-server libicu-dev
Please read [the prerequisites for all platforms](#prerequisites-for-all-platforms).
```
sudo pacman -S postgresql phantomjs redis postgresql-libs icu nodejs ed cmake openssh git go nginx
sudo pacman -S postgresql phantomjs redis postgresql-libs icu nodejs ed cmake openssh git go
```
##### Debian
......@@ -116,7 +116,7 @@ sudo pacman -S postgresql phantomjs redis postgresql-libs icu nodejs ed cmake op
Please read [the prerequisites for all platforms](#prerequisites-for-all-platforms).
```
sudo apt-get install postgresql libpq-dev redis-server libicu-dev cmake g++ nodejs libkrb5-dev ed nginx pkg-config
sudo apt-get install postgresql libpq-dev redis-server libicu-dev cmake g++ nodejs libkrb5-dev ed pkg-config
```
You need to install phantomjs manually
......@@ -151,7 +151,7 @@ This is tested on CentOS 6.5
```
sudo yum install http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm
sudo yum install http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo yum install postgresql93-server libicu-devel cmake gcc-c++ redis nginx ed fontconfig freetype libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6 golang nodejs
sudo yum install postgresql93-server libicu-devel cmake gcc-c++ redis ed fontconfig freetype libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6 golang nodejs
sudo gpg2 --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
sudo curl -sSL https://get.rvm.io | bash -s stable
......@@ -256,7 +256,7 @@ make gitlab_repo=git@gitlab.com:example/gitlab-ce.git gitlab_shell_repo=git@gitl
## Post-installation
First install the requirements for development kit, then start Redis,
PostgreSQL, NGINX, and GitLab-Workhorse by running the command below in the
PostgreSQL and GitLab-Workhorse by running the command below in the
root of the gitlab-development-kit project:
bundle install
......@@ -270,7 +270,7 @@ Finally, start the main GitLab rails application in the gitlab subdirectory of t
bundle exec foreman start -p4000
This will run Foreman on port 4000. NGINX is already running on port 3000, hence to login to GitLab you may now
This will run Foreman on port 4000. Gitlab-workhorse is already running on port 3000, hence to login to GitLab you may now
go to http://localhost:3000 in your browser. The development login credentials are `root` and `5iveL!fe`.
If you want to work on GitLab CI - setup the GitLab Runner:
......
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/png png;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
image/svg+xml svg svgz;
image/webp webp;
application/font-woff woff;
application/java-archive jar war ear;
application/json json;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.apple.mpegurl m3u8;
application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt;
application/vnd.wap.wmlc wmlc;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/xspf+xml xspf;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream iso img;
application/octet-stream msi msp msm;
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp2t ts;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}
worker_processes 1;
daemon off;
pid tmp/nginx.pid;
error_log stderr;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
access_log logs/access.log;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
proxy_temp_path proxy_temp;
client_body_temp_path client_body_temp;
uwsgi_temp_path uwsgi_temp;
fastcgi_temp_path fastcgi_temp;
scgi_temp_path scgi_temp;
client_max_body_size 0;
upstream gitlab {
server unix:/home/git/gitlab.socket fail_timeout=0;
}
upstream gitlab-workhorse {
server unix:/home/git/gitlab-workhorse.socket fail_timeout=0;
}
server {
listen 3000;
server_name localhost;
location / {
try_files $uri $uri/index.html @uri.html @gitlab;
}
location ~ ^/[\w\.-]+/[\w\.-]+/(info/refs|git-upload-pack|git-receive-pack)$ {
error_page 418 = @gitlab-workhorse;
return 418;
}
location ~ ^/[\w\.-]+/[\w\.-]+/repository/archive {
error_page 418 = @gitlab-workhorse;
return 418;
}
location ~ ^/api/v3/projects/.*/repository/archive {
error_page 418 = @gitlab-workhorse;
return 418;
}
location @gitlab-workhorse {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://gitlab-workhorse;
}
location @gitlab {
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_pass http://gitlab;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment