diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 36f9fadc32d9ce27ef1ba33bec043be9aa8271a4_LmdpdGxhYi1jaS55bWw=..d3ddfc57dfa2a2b301ea38256f76566547bdc437_LmdpdGxhYi1jaS55bWw= 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,7 +23,7 @@ variables: BUILDER_IMAGE_REGISTRY: "dev.gitlab.org:5005/cookbooks/gitlab-omnibus-builder" - BUILDER_IMAGE_REVISION: "0.0.25" + BUILDER_IMAGE_REVISION: "0.0.26" ASSET_SYNC_EXISTING_REMOTE_FILES: "keep" ASSET_SYNC_GZIP_COMPRESSION: "true" @@ -118,6 +118,7 @@ only: - branches@gitlab/omnibus-gitlab artifacts: + when: always expire_in: 1 day paths: - pkg/ diff --git a/Gemfile.lock b/Gemfile.lock index 36f9fadc32d9ce27ef1ba33bec043be9aa8271a4_R2VtZmlsZS5sb2Nr..d3ddfc57dfa2a2b301ea38256f76566547bdc437_R2VtZmlsZS5sb2Nr 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://dev.gitlab.org/gitlab/omnibus.git - revision: b6d67e8db5c594d4e2b3970d8536141e8afee51d + revision: 2ed670aa5187a2fc200c7853304a964de11c3927 branch: gitlab-omnibus-v5.6.12 specs: omnibus (5.6.12) diff --git a/config/software/alertmanager.rb b/config/software/alertmanager.rb index 36f9fadc32d9ce27ef1ba33bec043be9aa8271a4_Y29uZmlnL3NvZnR3YXJlL2FsZXJ0bWFuYWdlci5yYg==..d3ddfc57dfa2a2b301ea38256f76566547bdc437_Y29uZmlnL3NvZnR3YXJlL2FsZXJ0bWFuYWdlci5yYg== 100644 --- a/config/software/alertmanager.rb +++ b/config/software/alertmanager.rb @@ -42,4 +42,7 @@ command "go build -ldflags '#{prom_version.print_ldflags}' ./cmd/alertmanager", env: env, cwd: cwd copy 'alertmanager', "#{install_dir}/embedded/bin/" + + command "license_finder report --decisions-file=#{Omnibus::Config.project_root}/support/dependency_decisions.yml --format=csv --save=license.csv" + copy "license.csv", "#{install_dir}/licenses/alertmanager.csv" end diff --git a/config/software/consul.rb b/config/software/consul.rb index 36f9fadc32d9ce27ef1ba33bec043be9aa8271a4_Y29uZmlnL3NvZnR3YXJlL2NvbnN1bC5yYg==..d3ddfc57dfa2a2b301ea38256f76566547bdc437_Y29uZmlnL3NvZnR3YXJlL2NvbnN1bC5yYg== 100644 --- a/config/software/consul.rb +++ b/config/software/consul.rb @@ -34,4 +34,7 @@ env['PATH'] = "#{ENV['PATH']}:#{env['GOPATH']}/bin" command 'make dev', env: env copy 'bin/consul', "#{install_dir}/embedded/bin/" + + command "license_finder report --decisions-file=#{Omnibus::Config.project_root}/support/dependency_decisions.yml --format=csv --save=license.csv" + copy "license.csv", "#{install_dir}/licenses/consul.csv" end diff --git a/config/software/gitaly.rb b/config/software/gitaly.rb index 36f9fadc32d9ce27ef1ba33bec043be9aa8271a4_Y29uZmlnL3NvZnR3YXJlL2dpdGFseS5yYg==..d3ddfc57dfa2a2b301ea38256f76566547bdc437_Y29uZmlnL3NvZnR3YXJlL2dpdGFseS5yYg== 100644 --- a/config/software/gitaly.rb +++ b/config/software/gitaly.rb @@ -54,4 +54,7 @@ ).each { |f| copy(f, ruby_install_dir) } make "install PREFIX=#{install_dir}/embedded", env: env + + command "license_finder report --decisions-file=#{Omnibus::Config.project_root}/support/dependency_decisions.yml --format=csv --save=license.csv" + copy "license.csv", "#{install_dir}/licenses/gitaly.csv" end diff --git a/config/software/gitlab-elasticsearch-indexer.rb b/config/software/gitlab-elasticsearch-indexer.rb index 36f9fadc32d9ce27ef1ba33bec043be9aa8271a4_Y29uZmlnL3NvZnR3YXJlL2dpdGxhYi1lbGFzdGljc2VhcmNoLWluZGV4ZXIucmI=..d3ddfc57dfa2a2b301ea38256f76566547bdc437_Y29uZmlnL3NvZnR3YXJlL2dpdGxhYi1lbGFzdGljc2VhcmNoLWluZGV4ZXIucmI= 100644 --- a/config/software/gitlab-elasticsearch-indexer.rb +++ b/config/software/gitlab-elasticsearch-indexer.rb @@ -32,4 +32,6 @@ env['GOPATH'] = "#{Omnibus::Config.source_dir}/gitlab-elasticsearch-indexer" make "install PREFIX=#{install_dir}/embedded", env: env + command "license_finder report --decisions-file=#{Omnibus::Config.project_root}/support/dependency_decisions.yml --format=csv --save=license.csv" + copy "license.csv", "#{install_dir}/licenses/gitlab-elasticsearch-indexer.csv" end diff --git a/config/software/gitlab-pages.rb b/config/software/gitlab-pages.rb index 36f9fadc32d9ce27ef1ba33bec043be9aa8271a4_Y29uZmlnL3NvZnR3YXJlL2dpdGxhYi1wYWdlcy5yYg==..d3ddfc57dfa2a2b301ea38256f76566547bdc437_Y29uZmlnL3NvZnR3YXJlL2dpdGxhYi1wYWdlcy5yYg== 100644 --- a/config/software/gitlab-pages.rb +++ b/config/software/gitlab-pages.rb @@ -32,4 +32,7 @@ make 'gitlab-pages', env: env move 'gitlab-pages', "#{install_dir}/embedded/bin/gitlab-pages" + + command "license_finder report --decisions-file=#{Omnibus::Config.project_root}/support/dependency_decisions.yml --format=csv --save=license.csv" + copy "license.csv", "#{install_dir}/licenses/gitlab-pages.csv" end diff --git a/config/software/gitlab-rails.rb b/config/software/gitlab-rails.rb index 36f9fadc32d9ce27ef1ba33bec043be9aa8271a4_Y29uZmlnL3NvZnR3YXJlL2dpdGxhYi1yYWlscy5yYg==..d3ddfc57dfa2a2b301ea38256f76566547bdc437_Y29uZmlnL3NvZnR3YXJlL2dpdGxhYi1yYWlscy5yYg== 100644 --- a/config/software/gitlab-rails.rb +++ b/config/software/gitlab-rails.rb @@ -189,7 +189,7 @@ # This directory will be deleted after all the licenses copied to it are # handled by the DependencyInformation task of omnibus. It won't be part # of the final package, thus causing a redundancy. - command "mkdir -p #{install_dir}/licenses" + # TODO: Instead of relying on upstream provided file, run license_finder here copy 'vendor/licenses.csv', "#{install_dir}/licenses/gitlab-rails.csv" # Create a wrapper for the rake tasks of the Rails app diff --git a/config/software/node-exporter.rb b/config/software/node-exporter.rb index 36f9fadc32d9ce27ef1ba33bec043be9aa8271a4_Y29uZmlnL3NvZnR3YXJlL25vZGUtZXhwb3J0ZXIucmI=..d3ddfc57dfa2a2b301ea38256f76566547bdc437_Y29uZmlnL3NvZnR3YXJlL25vZGUtZXhwb3J0ZXIucmI= 100644 --- a/config/software/node-exporter.rb +++ b/config/software/node-exporter.rb @@ -39,4 +39,7 @@ command "go build -ldflags '#{prom_version.print_ldflags}'", env: env copy 'node_exporter', "#{install_dir}/embedded/bin/" + + command "license_finder report --decisions-file=#{Omnibus::Config.project_root}/support/dependency_decisions.yml --format=csv --save=license.csv" + copy "license.csv", "#{install_dir}/licenses/node-exporter.csv" end diff --git a/config/software/pgbouncer-exporter.rb b/config/software/pgbouncer-exporter.rb index 36f9fadc32d9ce27ef1ba33bec043be9aa8271a4_Y29uZmlnL3NvZnR3YXJlL3BnYm91bmNlci1leHBvcnRlci5yYg==..d3ddfc57dfa2a2b301ea38256f76566547bdc437_Y29uZmlnL3NvZnR3YXJlL3BnYm91bmNlci1leHBvcnRlci5yYg== 100644 --- a/config/software/pgbouncer-exporter.rb +++ b/config/software/pgbouncer-exporter.rb @@ -39,4 +39,7 @@ command "go build -ldflags '#{prom_version.print_ldflags}'", env: env copy 'pgbouncer_exporter', "#{install_dir}/embedded/bin/" + + command "license_finder report --decisions-file=#{Omnibus::Config.project_root}/support/dependency_decisions.yml --format=csv --save=license.csv" + copy "license.csv", "#{install_dir}/licenses/pgbouncer-exporter.csv" end diff --git a/config/software/postgres-exporter.rb b/config/software/postgres-exporter.rb index 36f9fadc32d9ce27ef1ba33bec043be9aa8271a4_Y29uZmlnL3NvZnR3YXJlL3Bvc3RncmVzLWV4cG9ydGVyLnJi..d3ddfc57dfa2a2b301ea38256f76566547bdc437_Y29uZmlnL3NvZnR3YXJlL3Bvc3RncmVzLWV4cG9ydGVyLnJi 100644 --- a/config/software/postgres-exporter.rb +++ b/config/software/postgres-exporter.rb @@ -40,4 +40,7 @@ command "go build -ldflags '#{ldflags}' ./cmd/postgres_exporter", env: env copy 'postgres_exporter', "#{install_dir}/embedded/bin/" + + command "license_finder report --decisions-file=#{Omnibus::Config.project_root}/support/dependency_decisions.yml --format=csv --save=license.csv" + copy "license.csv", "#{install_dir}/licenses/postgres-exporter.csv" end diff --git a/config/software/prometheus.rb b/config/software/prometheus.rb index 36f9fadc32d9ce27ef1ba33bec043be9aa8271a4_Y29uZmlnL3NvZnR3YXJlL3Byb21ldGhldXMucmI=..d3ddfc57dfa2a2b301ea38256f76566547bdc437_Y29uZmlnL3NvZnR3YXJlL3Byb21ldGhldXMucmI= 100644 --- a/config/software/prometheus.rb +++ b/config/software/prometheus.rb @@ -42,4 +42,7 @@ command "go build -ldflags '#{prom_version.print_ldflags}' ./cmd/prometheus", env: env, cwd: cwd copy 'prometheus', "#{install_dir}/embedded/bin/" + + command "license_finder report --decisions-file=#{Omnibus::Config.project_root}/support/dependency_decisions.yml --format=csv --save=license.csv" + copy "license.csv", "#{install_dir}/licenses/prometheus.csv" end diff --git a/config/software/redis-exporter.rb b/config/software/redis-exporter.rb index 36f9fadc32d9ce27ef1ba33bec043be9aa8271a4_Y29uZmlnL3NvZnR3YXJlL3JlZGlzLWV4cG9ydGVyLnJi..d3ddfc57dfa2a2b301ea38256f76566547bdc437_Y29uZmlnL3NvZnR3YXJlL3JlZGlzLWV4cG9ydGVyLnJi 100644 --- a/config/software/redis-exporter.rb +++ b/config/software/redis-exporter.rb @@ -48,4 +48,7 @@ command '../../../../bin/glide install ', env: env command "go build -ldflags '#{ldflags}'", env: env copy 'redis_exporter', "#{install_dir}/embedded/bin/" + + command "license_finder report --decisions-file=#{Omnibus::Config.project_root}/support/dependency_decisions.yml --format=csv --save=license.csv" + copy "license.csv", "#{install_dir}/licenses/redis-exporter.csv" end diff --git a/config/software/registry.rb b/config/software/registry.rb index 36f9fadc32d9ce27ef1ba33bec043be9aa8271a4_Y29uZmlnL3NvZnR3YXJlL3JlZ2lzdHJ5LnJi..d3ddfc57dfa2a2b301ea38256f76566547bdc437_Y29uZmlnL3NvZnR3YXJlL3JlZ2lzdHJ5LnJi 100644 --- a/config/software/registry.rb +++ b/config/software/registry.rb @@ -41,4 +41,7 @@ make "build", env: env, cwd: cwd make "binaries", env: env, cwd: cwd + + command "license_finder report --decisions-file=#{Omnibus::Config.project_root}/support/dependency_decisions.yml --format=csv --save=license.csv" + copy "license.csv", "#{install_dir}/licenses/registry.csv" end diff --git a/lib/gitlab/license/analyzer.rb b/lib/gitlab/license/analyzer.rb index 36f9fadc32d9ce27ef1ba33bec043be9aa8271a4_bGliL2dpdGxhYi9saWNlbnNlL2FuYWx5emVyLnJi..d3ddfc57dfa2a2b301ea38256f76566547bdc437_bGliL2dpdGxhYi9saWNlbnNlL2FuYWx5emVyLnJi 100644 --- a/lib/gitlab/license/analyzer.rb +++ b/lib/gitlab/license/analyzer.rb @@ -5,7 +5,7 @@ /Unlicense/i, /Artistic/i, /MPL/i, /AFL/i, /CC-BY-[0-9]*/, /^project_license$/, /OpenSSL/i, /ZLib/i, /jemalloc/i, /Python/i, /PostgreSQL/i, - /Info-Zip/i, /Libpng/i]) + /Info-Zip/i, /Libpng/i, /Mozilla Public/i, /WTFPL/, /CC0/]) # TODO: Re-confirm that licenses Python, Info-Zip, OpenSSL and CC-BY are # OK to be shipped. https://gitlab.com/gitlab-org/omnibus-gitlab/issues/2448 @@ -119,7 +119,8 @@ message = status_string(name, version, license, status, reason, level) puts message output_file.write(message) + violations << "#{name} - #{version} - #{license} - #{reason}" if status == 'unacceptable' end end output_file.close @@ -122,8 +123,8 @@ end end output_file.close - violations + violations.uniq end end end diff --git a/spec/gitlab/tasks/license_spec.rb b/spec/gitlab/tasks/license_spec.rb index 36f9fadc32d9ce27ef1ba33bec043be9aa8271a4_c3BlYy9naXRsYWIvdGFza3MvbGljZW5zZV9zcGVjLnJi..d3ddfc57dfa2a2b301ea38256f76566547bdc437_c3BlYy9naXRsYWIvdGFza3MvbGljZW5zZV9zcGVjLnJi 100644 --- a/spec/gitlab/tasks/license_spec.rb +++ b/spec/gitlab/tasks/license_spec.rb @@ -86,7 +86,7 @@ { "name": "sample", "version": "1.0.0", - "license": "GPL-3.0" + "license": "LGPL" } ] } diff --git a/support/dependency_decisions.yml b/support/dependency_decisions.yml new file mode 100644 index 0000000000000000000000000000000000000000..d3ddfc57dfa2a2b301ea38256f76566547bdc437_c3VwcG9ydC9kZXBlbmRlbmN5X2RlY2lzaW9ucy55bWw= --- /dev/null +++ b/support/dependency_decisions.yml @@ -0,0 +1,187 @@ +--- +- - :license + - github.com/beevik/ntp + - BSD-2-Clause + - :who: Balasankar C + :why: https://github.com/beevik/ntp/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - github.com/coreos/go-systemd + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/coreos/go-systemd/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - github.com/garyburd/redigo + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/garyburd/redigo/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - github.com/godbus/dbus + - BSD-2-Clause + - :who: Balasankar C + :why: https://github.com/godbus/dbus/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - github.com/gomodule/redigo + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/gomodule/redigo/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - github.com/gorilla/handlers + - BSD-2-Clause + - :who: Balasankar C + :why: https://github.com/gorilla/handlers/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - github.com/hashicorp/consul + - MPL + - :who: Balasankar C + :why: https://github.com/hashicorp/consul/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - github.com/influxdata/influxdb + - MIT + - :who: Balasankar C + :why: https://github.com/influxdata/influxdb/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - github.com/karrick/godirwalk + - BSD-2-Clause + - :who: Balasankar C + :why: https://github.com/karrick/godirwalk/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - github.com/spf13/cobra + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/spf13/cobra/blob/master/LICENSE.txt + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - github.com/syndtr/goleveldb + - BSD-2-Clause + - :who: Balasankar C + :why: https://github.com/syndtr/goleveldb/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - github.com/yvasiyarov/gorelic + - BSD-2-Clause + - :who: Balasankar C + :why: https://github.com/yvasiyarov/gorelic/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - google.golang.org/api/compute + - BSD-3-Clause + - :who: Balasankar C + :why: https://github.com/google/google-api-go-client/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - google.golang.org/grpc/codes + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/grpc/grpc-go/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - google.golang.org/grpc/credentials + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/grpc/grpc-go/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - google.golang.org/grpc/credentials + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/grpc/grpc-go/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - google.golang.org/grpc/health + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/grpc/grpc-go/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - google.golang.org/grpc/health + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/grpc/grpc-go/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - google.golang.org/grpc/metadata + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/grpc/grpc-go/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - google.golang.org/grpc/reflection + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/grpc/grpc-go/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - google.golang.org/grpc/resolver + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/grpc/grpc-go/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - google.golang.org/grpc/status + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/grpc/grpc-go/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - gopkg.in/check.v1 + - BSD-2-Clause + - :who: Balasankar C + :why: https://github.com/go-check/check/blob/v1/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - k8s.io/client-go/kubernetes + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/kubernetes/client-go/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - k8s.io/client-go/pkg + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/kubernetes/client-go/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - k8s.io/client-go/rest + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/kubernetes/client-go/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - k8s.io/client-go/tools + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/kubernetes/client-go/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - github.com/docker/go-connections + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/docker/go-connections/blob/master/LICENSE + :when: 2018-09-05 14:20:10.089350919 Z +- - :license + - github.com/elazarl/go-bindata-assetfs + - BSD-2-Clause + - :who: Balasankar C + :why: https://github.com/elazarl/go-bindata-assetfs/blob/master/LICENSE + :when: 2018-09-05 14:20:39.642552381 Z +- - :license + - github.com/shirou/gopsutil + - BSD-3-Clause + - :who: Balasankar C + :why: https://github.com/shirou/gopsutil/blob/master/LICENSE + :when: 2018-09-05 14:21:19.937703316 Z +- - :license + - github.com/matttproud/golang_protobuf_extensions + - Apache-2.0 + - :who: Balasankar C + :why: https://github.com/matttproud/golang_protobuf_extensions/blob/master/LICENSE + :when: 2018-09-05 17:48:47.084496785 Z