├── .gitignore
├── .sandstorm
├── .gitattributes
├── .gitignore
├── Vagrantfile
├── app-graphics
│ ├── gitlab-128.svg
│ ├── gitlab-150.svg
│ └── gitlab-24.svg
├── build.sh
├── changeLog.md
├── description.md
├── global-setup.sh
├── pgp-keyring
├── pgp-signature
├── sandstorm-files.list
├── sandstorm-pkgdef.capnp
├── screenshot.png
├── screenshot_gitlab_home.png
├── setup.sh
├── stack
└── unprivileged-setup.sh
├── Makefile
├── README.md
├── continue.sh
├── etc
├── hosts
├── passwd
└── redis.conf
├── home
└── git
│ └── .gitconfig
├── schema.rb
├── start.sh
└── usr
└── bin
├── awk
├── basename
├── cat
├── cp
├── head
├── mkdir
├── readlink
├── rm
├── sh
├── sort
└── which
/.gitignore:
--------------------------------------------------------------------------------
1 | gitlab-shell/
2 | .ssh/
3 | gitlab-satellites/
4 | repositories/
5 | gitlab/
6 | Procfile
7 | postgresql/data
8 | postgresql/.s.*
9 | redis/*.conf
10 | .bundle/
11 | gitlab-openldap/bin/
12 | gitlab-openldap/etc/
13 | gitlab-openldap/include/
14 | gitlab-openldap/lib/
15 | gitlab-openldap/libexec/
16 | gitlab-openldap/openldap-2.4.40.tgz
17 | gitlab-openldap/openldap-2.4.40/
18 | gitlab-openldap/sbin/
19 | gitlab-openldap/share/
20 | .vagrant/
21 |
--------------------------------------------------------------------------------
/.sandstorm/.gitattributes:
--------------------------------------------------------------------------------
1 |
2 |
3 | # vagrant-spk creates shell scripts, which must end in \n, even on a \r\n system.
4 | *.sh text eol=lf
5 |
6 |
--------------------------------------------------------------------------------
/.sandstorm/.gitignore:
--------------------------------------------------------------------------------
1 |
2 |
3 | # This file stores a list of sub-paths of .sandstorm/ that should be ignored by git.
4 | .vagrant
5 |
6 |
--------------------------------------------------------------------------------
/.sandstorm/Vagrantfile:
--------------------------------------------------------------------------------
1 | # -*- mode: ruby -*-
2 | # vi: set ft=ruby :
3 |
4 | # Guess at a reasonable name for the VM based on the folder vagrant-spk is
5 | # run from. The timestamp is there to avoid conflicts if you have multiple
6 | # folders with the same name.
7 | VM_NAME = File.basename(File.dirname(File.dirname(__FILE__))) + "_sandstorm_#{Time.now.utc.to_i}"
8 |
9 | # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
10 | VAGRANTFILE_API_VERSION = "2"
11 |
12 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
13 | # Base on the Sandstorm snapshots of the official Debian 8 (jessie) box.
14 | config.vm.box = "sandstorm/debian-jessie64"
15 |
16 | if Vagrant.has_plugin?("vagrant-vbguest") then
17 | # vagrant-vbguest is a Vagrant plugin that upgrades
18 | # the version of VirtualBox Guest Additions within each
19 | # guest. If you have the vagrant-vbguest plugin, then it
20 | # needs to know how to compile kernel modules, etc., and so
21 | # we give it this hint about operating system type.
22 | config.vm.guest = "debian"
23 | end
24 |
25 | # We forward port 6080, the Sandstorm web port, so that developers can
26 | # visit their sandstorm app from their browser as local.sandstorm.io:6080
27 | # (aka 127.0.0.1:6080).
28 | config.vm.network :forwarded_port, guest: 6080, host: 6080
29 |
30 | # Use a shell script to "provision" the box. This installs Sandstorm using
31 | # the bundled installer.
32 | config.vm.provision "shell", inline: "sudo bash /opt/app/.sandstorm/global-setup.sh", keep_color: true
33 | # Then, do stack-specific and app-specific setup.
34 | config.vm.provision "shell", inline: "sudo bash /opt/app/.sandstorm/setup.sh", keep_color: true
35 |
36 | # Shared folders are configured per-provider since vboxsf can't handle >4096 open files,
37 | # NFS requires privilege escalation every time you bring a VM up,
38 | # and 9p is only available on libvirt.
39 |
40 | # Calculate the number of CPUs and the amount of RAM the system has,
41 | # in a platform-dependent way; further logic below.
42 | cpus = nil
43 | total_kB_ram = nil
44 |
45 | host = RbConfig::CONFIG['host_os']
46 | if host =~ /darwin/
47 | cpus = `sysctl -n hw.ncpu`.to_i
48 | total_kB_ram = `sysctl -n hw.memsize`.to_i / 1024
49 | elsif host =~ /linux/
50 | cpus = `nproc`.to_i
51 | total_kB_ram = `grep MemTotal /proc/meminfo | awk '{print $2}'`.to_i
52 | elsif host =~ /mingw/
53 | # powershell may not be available on Windows XP and Vista, so wrap this in a rescue block
54 | begin
55 | cpus = `powershell -Command "(Get-WmiObject Win32_Processor -Property NumberOfLogicalProcessors | Select-Object -Property NumberOfLogicalProcessors | Measure-Object NumberOfLogicalProcessors -Sum).Sum"`.to_i
56 | total_kB_ram = `powershell -Command "Get-CimInstance -class cim_physicalmemory | % $_.Capacity}"`.to_i / 1024
57 | rescue
58 | end
59 | end
60 | # Use the same number of CPUs within Vagrant as the system, with 1
61 | # as a default.
62 | #
63 | # Use at least 512MB of RAM, and if the system has more than 2GB of
64 | # RAM, use 1/4 of the system RAM. This seems a reasonable compromise
65 | # between having the Vagrant guest operating system not run out of
66 | # RAM entirely (which it basically would if we went much lower than
67 | # 512MB) and also allowing it to use up a healthily large amount of
68 | # RAM so it can run faster on systems that can afford it.
69 | if cpus.nil? or cpus.zero?
70 | cpus = 1
71 | end
72 | if total_kB_ram.nil? or total_kB_ram < 2048000
73 | assign_ram_mb = 512
74 | else
75 | assign_ram_mb = (total_kB_ram / 1024 / 4)
76 | end
77 | # Actually apply these CPU/memory values to the providers.
78 | config.vm.provider :virtualbox do |vb, override|
79 | vb.cpus = cpus
80 | vb.memory = assign_ram_mb
81 | vb.name = VM_NAME
82 | vb.customize ["modifyvm", :id, "--nictype1", "Am79C973"]
83 |
84 | override.vm.synced_folder "..", "/opt/app"
85 | override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm"
86 | override.vm.synced_folder "..", "/vagrant", disabled: true
87 | end
88 | config.vm.provider :libvirt do |libvirt, override|
89 | libvirt.cpus = cpus
90 | libvirt.memory = assign_ram_mb
91 | libvirt.default_prefix = VM_NAME
92 |
93 | override.vm.synced_folder "..", "/opt/app", type: "9p", accessmode: "passthrough"
94 | override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm", type: "9p", accessmode: "passthrough"
95 | override.vm.synced_folder "..", "/vagrant", type: "9p", accessmode: "passthrough", disabled: true
96 | end
97 | end
98 |
--------------------------------------------------------------------------------
/.sandstorm/app-graphics/gitlab-128.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
37 |
--------------------------------------------------------------------------------
/.sandstorm/app-graphics/gitlab-150.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
33 |
--------------------------------------------------------------------------------
/.sandstorm/app-graphics/gitlab-24.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
34 |
--------------------------------------------------------------------------------
/.sandstorm/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -euo pipefail
3 | # This script is run in the VM each time you run `vagrant-spk dev`. This is
4 | # the ideal place to invoke anything which is normally part of your app's build
5 | # process - transforming the code in your repository into the collection of files
6 | # which can actually run the service in production
7 | #
8 | # Some examples:
9 | #
10 | # * For a C/C++ application, calling
11 | # ./configure && make && make install
12 | # * For a Python application, creating a virtualenv and installing
13 | # app-specific package dependencies:
14 | # virtualenv /opt/app/env
15 | # /opt/app/env/bin/pip install -r /opt/app/requirements.txt
16 | # * Building static assets from .less or .sass, or bundle and minify JS
17 | # * Collecting various build artifacts or assets into a deployment-ready
18 | # directory structure
19 |
20 | # By default, this script does nothing. You'll have to modify it as
21 | # appropriate for your application.
22 | cd /opt/app
23 | exit 0
24 |
--------------------------------------------------------------------------------
/.sandstorm/changeLog.md:
--------------------------------------------------------------------------------
1 | ### v.2016.07.18 (8.7.9)
2 | - Fix bug where relative links in the wiki could cause the page to fail to load.
3 | - Add target=_blank to external links.
4 |
5 | ### v.2016.06.29 (8.7.1)
6 | - Fix bug where only the grian owner could see the list of issues.
7 |
8 | ### v.2016.05.12 (8.7.1)
9 | - Fix bug where "blame" feature caused a 500 error.
10 |
11 | ### v.2016.05.05 (8.7.1)
12 | - Fix appMarketingVersion. The year is not 2017.
13 |
14 | ### v.2017.05.05 (8.7.1)
15 | - Use a saner migration strategy for the Users.ldap_email column.
16 |
17 | ### v.2017.05.04 (8.7.1)
18 | - Update to upstream version 8.7.1
19 | - Disable repo renaming, because we don't actually support it.
20 | - Synchronize the path from the iframe to the browser's location bar.
21 |
22 | ### v2015.09.03 (7.14)
23 | - Update jquery-atwho-rails gem to fix commenting in Chrome.
24 | - Hide the clone panel for guests, who don't have pull access and would get a 404 if they tried.
25 |
26 | ### v2015.09.02 (7.14)
27 | - Update to upstream version 7.14
28 | - Define Master, Developer, Reporter, and Guest roles.
29 | - Use Sandstorm avatars and preferred handles.
30 | - Get emoji to work.
31 | - Fix the graphs view.
32 |
33 | ### v2015.8.23 (7.8)
34 | - Add metadata.
35 | - Use Offer Templates to display copy/pastable git configuration instructions.
36 |
--------------------------------------------------------------------------------
/.sandstorm/description.md:
--------------------------------------------------------------------------------
1 | GitLab is a sophisticated Ruby on Rails app for hosting Git repositories.
2 | Its features include an issue tracker, a wiki,
3 | and an editor that allows you to compose and push commits entirely from a web interface.
4 |
5 | This version of GitLab has been slimmed down to work better as a Sandstorm app.
6 | Some upstream features, such as multiproject management, web hooks,
7 | and LDAP authentication, are omitted,
8 | either because they are better handled by Sandstorm itself
9 | or because they are dependent on as-yet-unimplemented features of Sandstorm.
10 |
11 |
--------------------------------------------------------------------------------
/.sandstorm/global-setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -euo pipefail
3 |
4 | CURL_OPTS="--silent --show-error"
5 | echo localhost > /etc/hostname
6 | hostname localhost
7 | curl $CURL_OPTS https://install.sandstorm.io/ > /host-dot-sandstorm/caches/install.sh
8 | SANDSTORM_CURRENT_VERSION=$(curl $CURL_OPTS -f "https://install.sandstorm.io/dev?from=0&type=install")
9 | SANDSTORM_PACKAGE="sandstorm-$SANDSTORM_CURRENT_VERSION.tar.xz"
10 | if [[ ! -f /host-dot-sandstorm/caches/$SANDSTORM_PACKAGE ]] ; then
11 | echo -n "Downloading Sandstorm version ${SANDSTORM_CURRENT_VERSION}..."
12 | curl $CURL_OPTS --output "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE.partial" "https://dl.sandstorm.io/$SANDSTORM_PACKAGE"
13 | mv "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE.partial" "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE"
14 | echo "...done."
15 | fi
16 | if [ ! -e /opt/sandstorm/latest/sandstorm ] ; then
17 | echo -n "Installing Sandstorm version ${SANDSTORM_CURRENT_VERSION}..."
18 | bash /host-dot-sandstorm/caches/install.sh -d -e "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE" >/dev/null
19 | echo "...done."
20 | fi
21 | modprobe ip_tables
22 | # Make the vagrant user part of the sandstorm group so that commands like
23 | # `spk dev` work.
24 | usermod -a -G 'sandstorm' 'vagrant'
25 | # Bind to all addresses, so the vagrant port-forward works.
26 | sudo sed --in-place='' \
27 | --expression='s/^BIND_IP=.*/BIND_IP=0.0.0.0/' \
28 | /opt/sandstorm/sandstorm.conf
29 | sudo service sandstorm restart
30 | # Enable apt-cacher-ng proxy to make things faster if one appears to be running on the gateway IP
31 | GATEWAY_IP=$(ip route | grep ^default | cut -d ' ' -f 3)
32 | if nc -z "$GATEWAY_IP" 3142 ; then
33 | echo "Acquire::http::Proxy \"http://$GATEWAY_IP:3142\";" > /etc/apt/apt.conf.d/80httpproxy
34 | fi
35 | # Configure apt to retry fetching things that fail to download.
36 | echo "APT::Acquire::Retries \"10\";" > /etc/apt/apt.conf.d/80sandstorm-retry
37 |
--------------------------------------------------------------------------------
/.sandstorm/pgp-keyring:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwrensha/gitlab-sandstorm/edae12398098390390b08ef2d230502040615e99/.sandstorm/pgp-keyring
--------------------------------------------------------------------------------
/.sandstorm/pgp-signature:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwrensha/gitlab-sandstorm/edae12398098390390b08ef2d230502040615e99/.sandstorm/pgp-signature
--------------------------------------------------------------------------------
/.sandstorm/sandstorm-pkgdef.capnp:
--------------------------------------------------------------------------------
1 | @0x9ec493829e8965ce;
2 |
3 | using Spk = import "/sandstorm/package.capnp";
4 | using Util = import "/sandstorm/util.capnp";
5 |
6 | const pkgdef :Spk.PackageDefinition = (
7 | id = "zx9d3pt0fjh4uqrprjftgpqfwgzp6y2ena6098ug3ctv37uv6kfh",
8 |
9 | manifest = (
10 |
11 | appVersion = 10, # Increment this for every release.
12 | appTitle = (defaultText = "GitLab"),
13 | appMarketingVersion = (defaultText = "2016.07.18 (8.7.9)"),
14 |
15 | metadata = (
16 | icons = (
17 | appGrid = (svg = embed "app-graphics/gitlab-128.svg"),
18 | grain = (svg = embed "app-graphics/gitlab-24.svg"),
19 | market = (svg = embed "app-graphics/gitlab-150.svg"),
20 | ),
21 | website = "https://about.gitlab.com/",
22 | codeUrl = "https://github.com/dwrensha/gitlab-sandstorm",
23 | license = (openSource = mit),
24 | categories = [developerTools,],
25 | author = (
26 | upstreamAuthor = "GitLab Inc.",
27 | contactEmail = "david@sandstorm.io",
28 | pgpSignature = embed "pgp-signature",
29 | ),
30 | pgpKeyring = embed "pgp-keyring",
31 | description = (defaultText = embed "description.md"),
32 | shortDescription = (defaultText = "Git hosting"),
33 | screenshots = [(width = 448, height = 281, png = embed "screenshot.png"),
34 | (width = 1280, height = 720, png = embed "screenshot_gitlab_home.png")],
35 | changeLog = (defaultText = embed "changeLog.md"),
36 | ),
37 |
38 | actions = [
39 | ( title = (defaultText = "New GitLab Repository"),
40 | nounPhrase = (defaultText = "repository"),
41 | command = .startCommand
42 | )
43 | ],
44 |
45 | continueCommand = .continueCommand
46 | ),
47 |
48 | sourceMap = (
49 | # Here we defined where to look for files to copy into your package. The
50 | # `spk dev` command actually figures out what files your app needs
51 | # automatically by running it on a FUSE filesystem. So, the mappings
52 | # here are only to tell it where to find files that the app wants.
53 | searchPath = [
54 | ( packagePath = "gitlab/db/schema.rb", sourcePath = "/opt/app/schema.rb" ),
55 | ( sourcePath = "/opt/app",
56 | hidePaths = ["gitlab/.git", ".git",
57 | "gitlab/app/controllers/oauth",
58 | ]
59 | ),
60 | ( sourcePath = "/", # Then search the system root directory.
61 | hidePaths = ["home", "proc", "sys", "etc/nsswitch.conf", "etc/localtime",
62 | "etc/host.conf", "etc/resolv.conf",
63 | "usr/bin/ruby",
64 | "/opt/ruby/gitlab-bundle/ruby/2.1.0/cache",
65 | ]
66 | )
67 | ]
68 | ),
69 |
70 | fileList = "sandstorm-files.list",
71 |
72 | alwaysInclude = ["gitlab/vendor", "opt/ruby/gitlab-bundle", "gitlab/app", "gitlab/lib",
73 | "gitlab/config", "gitlab/public",
74 | "gitlab/read-only-cache",
75 | "gitlab-shell/hooks", "gitlab-shell/lib",
76 | "usr/bin/node"],
77 |
78 | bridgeConfig = (
79 | viewInfo = (
80 | permissions = [(name = "owner", title = (defaultText = "owner"),
81 | description =
82 | (defaultText = "A vestigal permission only useful outside of Sandstorm.")),
83 | (name = "master", title = (defaultText = "master"),
84 | description = (defaultText = "A master can push to any branch.")),
85 | (name = "developer", title = (defaultText = "developer"),
86 | description = (defaultText = "A developer can create merge requests.")),
87 | (name = "reporter", title = (defaultText = "reporter"),
88 | description =
89 | (defaultText = "A reporter can view the code and manage the issue tracker.")),
90 | (name = "guest", title = (defaultText = "guest"),
91 | description = (defaultText = "A guest can create new issues and leave comments."))
92 | ],
93 | roles = [
94 | (title = (defaultText = "master"),
95 | verbPhrase = (defaultText = "can push to any branch"),
96 | permissions = .masterPermissions,
97 | default = true),
98 | (title = (defaultText = "developer"),
99 | verbPhrase = (defaultText = "can create merge requests"),
100 | permissions = .developerPermissions),
101 | (title = (defaultText = "reporter"),
102 | verbPhrase = (defaultText = "can view and pull code"),
103 | permissions = .reporterPermissions),
104 | (title = (defaultText = "guest"),
105 | verbPhrase = (defaultText = "can create new issues"),
106 | permissions = .guestPermissions)
107 | ]
108 | )
109 | )
110 |
111 | );
112 |
113 | # admin, master, dev, report, guest
114 | const ownerPermissions :List(Bool) = [true, true, true, true, true];
115 | const masterPermissions :List(Bool) = [false, true, true, true, true];
116 | const developerPermissions :List(Bool) = [false, false, true, true, true];
117 | const reporterPermissions :List(Bool) = [false, false, false, true, true];
118 | const guestPermissions :List(Bool) = [false, false, false, false, true];
119 |
120 | const commandEnvironment : List(Util.KeyValue) =
121 | [
122 | (key = "PATH", value = "/opt/ruby/rbenv/versions/2.1.8/bin:/usr/local/bin:/usr/bin:/bin"),
123 | (key = "HOME", value = "/home/git")
124 | ];
125 |
126 | const startCommand :Spk.Manifest.Command = (
127 | argv = ["/sandstorm-http-bridge", "10000", "--", "/bin/bash", "start.sh"],
128 | environ = .commandEnvironment
129 | );
130 |
131 | const continueCommand :Spk.Manifest.Command = (
132 | argv = ["/sandstorm-http-bridge", "10000", "--", "/bin/bash", "continue.sh"],
133 | environ = .commandEnvironment
134 | );
135 |
--------------------------------------------------------------------------------
/.sandstorm/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwrensha/gitlab-sandstorm/edae12398098390390b08ef2d230502040615e99/.sandstorm/screenshot.png
--------------------------------------------------------------------------------
/.sandstorm/screenshot_gitlab_home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dwrensha/gitlab-sandstorm/edae12398098390390b08ef2d230502040615e99/.sandstorm/screenshot_gitlab_home.png
--------------------------------------------------------------------------------
/.sandstorm/setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -euo pipefail
4 |
5 | export DEBIAN_FRONTEND=noninteractive
6 | apt-get update
7 | apt-get install -y nodejs-dev nodejs-legacy git libsqlite3-dev cmake pkg-config libicu-dev g++ redis-server golang-go
8 |
9 | mkdir /opt/ruby
10 | chown vagrant:vagrant /opt/ruby
11 |
12 | # TODO(cleanup): the logic this unpriviliged-setup script probably belongs in build.sh.
13 | su -c "bash /opt/app/.sandstorm/unprivileged-setup.sh" vagrant
14 |
15 | exit 0
16 |
--------------------------------------------------------------------------------
/.sandstorm/stack:
--------------------------------------------------------------------------------
1 | diy
2 |
--------------------------------------------------------------------------------
/.sandstorm/unprivileged-setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -euo pipefail
4 |
5 |
6 | cd /opt/ruby
7 |
8 | git clone https://github.com/rbenv/rbenv.git /opt/ruby/rbenv
9 | git clone https://github.com/rbenv/ruby-build.git /opt/ruby/rbenv/plugins/ruby-build
10 |
11 | export PATH=/opt/ruby/rbenv/bin:$PATH
12 | export RBENV_ROOT=/opt/ruby/rbenv
13 | eval "$(rbenv init -)"
14 |
15 | rbenv install 2.1.8
16 | rbenv shell 2.1.8
17 |
18 | gem install bundler
19 |
20 | cd /opt/app
21 | make
22 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | gitlab_repo = https://github.com/dwrensha/gitlabhq.git
2 | gitlab_repo_branch = sandstorm-app
3 | gitlab_shell_repo = https://github.com/dwrensha/gitlab-shell.git
4 | gitlab_shell_repo_branch = sandstorm-app
5 |
6 | gitlab_workhorse_repo = https://gitlab.com/gitlab-org/gitlab-workhorse.git
7 |
8 | all: gitlab-setup gitlab-shell-setup gitlab-workhorse/gitlab-workhorse
9 |
10 | # Set up the GitLab Rails app
11 |
12 | gitlab-setup: gitlab/.git /opt/ruby/gitlab-bundle initdb.sqlite3
13 |
14 | gitlab/.git:
15 | git clone ${gitlab_repo} gitlab && cd gitlab && git checkout ${gitlab_repo_branch}
16 |
17 | /opt/ruby/gitlab-bundle:
18 | cd gitlab && bundle install --path /opt/ruby/gitlab-bundle --without test development --jobs 1 --standalone
19 |
20 | initdb.sqlite3: /opt/ruby/gitlab-bundle
21 | rm -rf db
22 | mkdir db
23 | find /opt/ruby/gitlab-bundle -type f -name "jquery.atwho.js" -exec sed -i 's/@ sourceMappingURL=jquery.caret.map//g' {} \;
24 | cd gitlab && SECRET_KEY_BASE='not so secret' RAILS_ENV=production ./bin/rake db:create db:setup && SECRET_KEY_BASE='not so secret' RAILS_ENV=production ./bin/rake assets:precompile
25 | mv db/db.sqlite3 initdb.sqlite3
26 | rm -rf db
27 | ln -s /var/sqlite3 db
28 |
29 | # Set up gitlab-shell
30 |
31 | gitlab-shell-setup: gitlab-shell/.git
32 |
33 | gitlab-shell/.git:
34 | git clone ${gitlab_shell_repo} gitlab-shell && cd gitlab-shell && git checkout ${gitlab_shell_repo_branch}
35 |
36 | gitlab-workhorse/.git:
37 | git clone ${gitlab_workhorse_repo} gitlab-workhorse
38 |
39 | gitlab-workhorse/gitlab-workhorse: gitlab-workhorse/.git
40 | cd gitlab-workhorse && git checkout f184885d77ba7 && make
41 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | This is a fork of https://gitlab.com/gitlab-org/gitlab-development-kit.git,
2 | adapted for development of a GitLab Sandstorm app.
3 |
4 | You should be able type "vagrant-spk vm up" and then "vagrant-spk dev" and be good to go.
5 | It may take some time to install all of the gems.
6 |
--------------------------------------------------------------------------------
/continue.sh:
--------------------------------------------------------------------------------
1 | export SECRET_KEY_BASE=`base64 /dev/urandom | head -c 30`
2 |
3 | set -x -e
4 |
5 | base64 /dev/urandom | head -c 30 > /var/gitlab_shell_secret
6 |
7 | # The sandbox's /tmp is capped at 16MB. If we don't set TMPDIR, a `git push` bigger than that will fail.
8 | export TMPDIR=/var/tmp
9 | rm -rf /var/tmp
10 | mkdir -p /var/tmp
11 |
12 | redis-server /etc/redis.conf &
13 | echo "started redis-server: " $?
14 |
15 | export SSH_CONNECTION=12345 # gitlab-shell wants this variable to be set. Any value will do.
16 |
17 | cd gitlab
18 |
19 | export GEM_HOME=/opt/ruby/gitlab-bundle/ruby/2.1.0
20 |
21 | if [ -f /var/migrations/20160421130527 ]
22 | then
23 | echo "no migration necessary"
24 | else
25 | RUBYOPT=-r/opt/ruby/gitlab-bundle/bundler/setup RAILS_ENV=production /opt/ruby/gitlab-bundle/ruby/2.1.0/bin/rake db:migrate
26 | mkdir -p /var/migrations/
27 | touch /var/migrations/20160421130527
28 | fi
29 |
30 | RUBYOPT=-r/opt/ruby/gitlab-bundle/bundler/setup RAILS_ENV=production /opt/ruby/gitlab-bundle/ruby/2.1.0/bin/sidekiq -q post_receive -q default -q archive_repo 2>&1 | awk '{print "sidekiq: " $0}' &
31 | RUBYOPT=-r/opt/ruby/gitlab-bundle/bundler/setup RAILS_ENV=production /opt/ruby/gitlab-bundle/ruby/2.1.0/bin/unicorn_rails -p 10001 -E production -c /gitlab/config/unicorn.sandstorm.rb &
32 |
33 | # Give Unicorn some time to start listening.
34 | sleep 3
35 |
36 | ../gitlab-workhorse/gitlab-workhorse -listenAddr 127.0.0.1:10000 -authBackend http://127.0.0.1:10001
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/etc/hosts:
--------------------------------------------------------------------------------
1 | 127.0.0.1 localhost.localdomain localhost
2 | ::1 localhost.localdomain localhost
3 |
--------------------------------------------------------------------------------
/etc/passwd:
--------------------------------------------------------------------------------
1 | git:x:1000:1000::/home/git:/bin/bash
2 |
--------------------------------------------------------------------------------
/etc/redis.conf:
--------------------------------------------------------------------------------
1 | dir /var/redis
2 |
3 |
--------------------------------------------------------------------------------
/home/git/.gitconfig:
--------------------------------------------------------------------------------
1 | [user]
2 | name = GitLab Shell
3 | email = fake@example.com
4 | [core]
5 | autocrlf = input
6 |
--------------------------------------------------------------------------------
/schema.rb:
--------------------------------------------------------------------------------
1 | /var/schema.rb
--------------------------------------------------------------------------------
/start.sh:
--------------------------------------------------------------------------------
1 | set -x -e
2 |
3 | mkdir -p /var/redis
4 | mkdir -p /var/log
5 |
6 | mkdir -p /var/repositories
7 | mkdir -p /var/gitlab-satellites
8 |
9 | mkdir -p /var/tmp/repositories
10 |
11 | mkdir -p /var/uploads
12 |
13 | mkdir -p /var/sqlite3
14 |
15 | mkdir -p /var/migrations/
16 | touch /var/migrations/20160421130527
17 |
18 | cp initdb.sqlite3 /var/sqlite3/db.sqlite3
19 |
20 | source continue.sh
21 |
--------------------------------------------------------------------------------
/usr/bin/awk:
--------------------------------------------------------------------------------
1 | /bin/busybox
--------------------------------------------------------------------------------
/usr/bin/basename:
--------------------------------------------------------------------------------
1 | /bin/busybox
--------------------------------------------------------------------------------
/usr/bin/cat:
--------------------------------------------------------------------------------
1 | /bin/busybox
--------------------------------------------------------------------------------
/usr/bin/cp:
--------------------------------------------------------------------------------
1 | /bin/busybox
--------------------------------------------------------------------------------
/usr/bin/head:
--------------------------------------------------------------------------------
1 | /bin/busybox
--------------------------------------------------------------------------------
/usr/bin/mkdir:
--------------------------------------------------------------------------------
1 | /bin/busybox
--------------------------------------------------------------------------------
/usr/bin/readlink:
--------------------------------------------------------------------------------
1 | /bin/busybox
--------------------------------------------------------------------------------
/usr/bin/rm:
--------------------------------------------------------------------------------
1 | /bin/busybox
--------------------------------------------------------------------------------
/usr/bin/sh:
--------------------------------------------------------------------------------
1 | /bin/busybox
--------------------------------------------------------------------------------
/usr/bin/sort:
--------------------------------------------------------------------------------
1 | /bin/busybox
--------------------------------------------------------------------------------
/usr/bin/which:
--------------------------------------------------------------------------------
1 | /bin/busybox
--------------------------------------------------------------------------------