Skip to content

Commit

Permalink
add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
rgl committed Sep 2, 2018
1 parent 13594f7 commit abcf8db
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/gitlab-source-link-proxy
/gitlab-source-link-proxy*
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
dist: gitlab-source-link-proxy.tgz

build: gitlab-source-link-proxy

gitlab-source-link-proxy: *.go go.*
GOOS=linux GOARCH=amd64 go build -v -o $@ -ldflags="-s -w"

gitlab-source-link-proxy.tgz: gitlab-source-link-proxy
rm -f $@
tar czf $@ $^
sha256sum $@

clean:
rm -rf gitlab-source-link-proxy*

.PHONY: dist build clean
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Basic Authorization support for GitLab Source Link requests.

You can see this used at [rgl/gitlab-vagrant](https://github.com/rgl/gitlab-vagrant).

# GitLab configuration

Configure GitLab nginx to proxy the Visual Studio requests through our proxy:
Expand All @@ -18,12 +22,10 @@ vim /var/opt/gitlab/nginx/conf/gitlab-http.conf
gitlab-ctl restart nginx
```

Build this binary:
Build the binary:

```bash
go get -u -v github.com/jamiealquiza/bicache
go get -u -v golang.org/x/crypto/blake2b
go build -v
make
```

Manually run it:
Expand Down Expand Up @@ -58,7 +60,22 @@ install -d -o root -g gitlab-source-link-proxy -m 750 /opt/gitlab-source-link-pr
install -o root -g root -m 555 gitlab-source-link-proxy /opt/gitlab-source-link-proxy/bin

# install the systemd service.
install -o root -g root -m 644 gitlab-source-link-proxy.service /etc/systemd/system/
cat >/etc/systemd/system/gitlab-source-link-proxy.service <<EOF
[Unit]
Description=gitlab-source-link-proxy
After=network.target
[Service]
Type=simple
User=gitlab-source-link-proxy
Group=gitlab-source-link-proxy
ExecStart=/opt/gitlab-source-link-proxy/bin/gitlab-source-link-proxy --gitlab-base-url https://gitlab.example.com
WorkingDirectory=/opt/gitlab-source-link-proxy
Restart=on-abort
[Install]
WantedBy=multi-user.target
EOF
systemctl enable gitlab-source-link-proxy
systemctl start gitlab-source-link-proxy
```
Expand Down
14 changes: 0 additions & 14 deletions gitlab-source-link-proxy.service

This file was deleted.

9 changes: 9 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/rgl/gitlab-source-link-proxy

require (
github.com/jamiealquiza/bicache v2.0.0+incompatible
github.com/jamiealquiza/fnv v1.0.0 // indirect
github.com/jamiealquiza/tachymeter v1.1.2 // indirect
golang.org/x/crypto v0.0.0-20180830192347-182538f80094
golang.org/x/sys v0.0.0-20180831094639-fa5fdf94c789 // indirect
)
10 changes: 10 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
github.com/jamiealquiza/bicache v2.0.0+incompatible h1:0V+RlPLr4g9PkC2CZdZg/6NlN6bgdhlqdEsP1Fm6Q8U=
github.com/jamiealquiza/bicache v2.0.0+incompatible/go.mod h1:xSPiksbz+HyGfZ+2f5KngWsTJex9wUilkK4sIdXDgUM=
github.com/jamiealquiza/fnv v1.0.0 h1:4NwlkaoZiLhqk008EY5+MTGVPRQZgRG/6B7+jN7ueT8=
github.com/jamiealquiza/fnv v1.0.0/go.mod h1:iJRnFlvFvZpWKZd+KljYXcyQLasMIKAVuQhx63P4DUk=
github.com/jamiealquiza/tachymeter v1.1.2 h1:cOgpMYFejxGSAe5f5JOb7uNPZ53kmEYwwpCrw1vDh2Q=
github.com/jamiealquiza/tachymeter v1.1.2/go.mod h1:Ayf6zPZKEnLsc3winWEXJRkTBhdHo58HODAu1oFJkYU=
golang.org/x/crypto v0.0.0-20180830192347-182538f80094 h1:rVTAlhYa4+lCfNxmAIEOGQRoD23UqP72M3+rSWVGDTg=
golang.org/x/crypto v0.0.0-20180830192347-182538f80094/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/sys v0.0.0-20180831094639-fa5fdf94c789 h1:T8D7l6WB3tLu+VpKvw06ieD/OhBi1XpJmG1U/FtttZg=
golang.org/x/sys v0.0.0-20180831094639-fa5fdf94c789/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=

0 comments on commit abcf8db

Please sign in to comment.