www-apps/gitlab-ce:

Purge versions <9.0.0.

Package-Manager: Portage-2.3.5, Repoman-2.3.1
This commit is contained in:
Manuel Friedli 2017-07-09 03:30:23 +02:00
parent 6380ef1d0b
commit 631b5afd9c
9 changed files with 9 additions and 1472 deletions

View file

@ -1,13 +0,0 @@
diff --git a/config/mail_room.yml b/config/mail_room.yml
index c639f82..860e78d 100644
--- a/config/mail_room.yml
+++ b/config/mail_room.yml
@@ -3,7 +3,7 @@
#
:mailboxes:
<%
- require_relative "lib/gitlab/mail_room" unless defined?(Gitlab::MailRoom)
+ require_relative "/opt/gitlab/lib/gitlab/mail_room" unless defined?(Gitlab::MailRoom)
config = Gitlab::MailRoom.config
if Gitlab::MailRoom.enabled?

View file

@ -1,92 +0,0 @@
diff --git a/config/database.yml.mysql b/config/database.yml.mysql
index d970287..a3b5ecc 100644
--- a/config/database.yml.mysql
+++ b/config/database.yml.mysql
@@ -6,37 +6,9 @@ production:
encoding: utf8mb4
collation: utf8mb4_general_ci
reconnect: false
- database: gitlabhq_production
+ database: gitlab
pool: 10
username: git
password: "secure password"
# host: localhost
- # socket: /tmp/mysql.sock
-
-#
-# Development specific
-#
-development:
- adapter: mysql2
- encoding: utf8mb4
- collation: utf8mb4_general_ci
- reconnect: false
- database: gitlabhq_development
- pool: 5
- username: root
- password: "secure password"
- # socket: /tmp/mysql.sock
-
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
-test: &test
- adapter: mysql2
- encoding: utf8mb4
- collation: utf8mb4_general_ci
- reconnect: false
- database: gitlabhq_test
- pool: 5
- username: root
- password:
- # socket: /tmp/mysql.sock
+ # socket: /run/mysqld/mysqld.sock
diff --git a/config/database.yml.postgresql b/config/database.yml.postgresql
index 7067e0f..74af7df 100644
--- a/config/database.yml.postgresql
+++ b/config/database.yml.postgresql
@@ -4,42 +4,9 @@
production:
adapter: postgresql
encoding: unicode
- database: gitlabhq_production
+ database: gitlab
pool: 10
# username: git
# password:
# host: localhost
# port: 5432
-
-#
-# Development specific
-#
-development:
- adapter: postgresql
- encoding: unicode
- database: gitlabhq_development
- pool: 5
- username: postgres
- password:
-
-#
-# Staging specific
-#
-staging:
- adapter: postgresql
- encoding: unicode
- database: gitlabhq_staging
- pool: 5
- username: postgres
- password:
-
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
-test: &test
- adapter: postgresql
- encoding: unicode
- database: gitlabhq_test
- pool: 5
- username: postgres
- password:

View file

@ -1,77 +0,0 @@
diff --git a/Gemfile b/Gemfile
index 4a517b2..ed6fc2e 100644
--- a/Gemfile
+++ b/Gemfile
@@ -352,4 +352,4 @@ gem 'health_check', '~> 2.1.0'
# System information
gem 'vmstat', '~> 2.2'
-gem 'sys-filesystem', '~> 1.1.6'
+gem 'sys-filesystem', '~> 1.1.6', group: :exclude
diff --git a/app/controllers/admin/system_info_controller.rb b/app/controllers/admin/system_info_controller.rb
index ca04a17..0e36b12 100644
--- a/app/controllers/admin/system_info_controller.rb
+++ b/app/controllers/admin/system_info_controller.rb
@@ -1,3 +1,5 @@
+require 'open3'
+
class Admin::SystemInfoController < Admin::ApplicationController
EXCLUDED_MOUNT_OPTIONS = [
'nobrowse',
@@ -28,10 +30,14 @@ class Admin::SystemInfoController < Admin::ApplicationController
'vfat'
]
+ MOUNT_REGEX = /(\S+) on (\S+) type (\S+) \(([^)]+)\)/
+
+ Mount = Struct.new('Mount', :name, :mount_point, :mount_type, :options)
+ FsStat = Struct.new('FsStats', :path, :bytes_total, :bytes_used)
+
def show
@cpus = Vmstat.cpu rescue nil
@memory = Vmstat.memory rescue nil
- mounts = Sys::Filesystem.mounts
@disks = []
mounts.each do |mount|
@@ -41,15 +47,38 @@ class Admin::SystemInfoController < Admin::ApplicationController
next if (EXCLUDED_MOUNT_TYPES & [mount.mount_type]).any?
begin
- disk = Sys::Filesystem.stat(mount.mount_point)
+ disk = fs_stat(mount.mount_point)
@disks.push({
bytes_total: disk.bytes_total,
bytes_used: disk.bytes_used,
disk_name: mount.name,
mount_path: disk.path
})
- rescue Sys::Filesystem::Error
+ rescue IOError
end
end
end
+
+ def mounts
+ stdout, stderr, status = Open3.capture3('mount')
+ fail IOError, stderr unless status.success?
+
+ stdout.lines
+ .map { |line| MOUNT_REGEX.match(line) }
+ .compact
+ .map { |match| Mount.new(*match.captures) }
+ end
+
+ def fs_stat(mount_point)
+ stdout, status = Open3.capture2('stat', '-c', '%s %b %a', '-f', mount_point)
+ fail IOError unless status.success?
+
+ block_size, blocks_total, blocks_free = stdout.split(' ').map(&:to_i)
+
+ bytes_total = blocks_total * block_size
+ bytes_free = blocks_free * block_size
+ bytes_used = bytes_total - bytes_free
+
+ FsStat.new(mount_point, bytes_total, bytes_used)
+ end
end

View file

@ -1,77 +0,0 @@
diff --git a/Gemfile b/Gemfile
index 07ff500..1352dd4 100644
--- a/Gemfile
+++ b/Gemfile
@@ -350,4 +350,4 @@ gem 'health_check', '~> 2.2.0'
# System information
gem 'vmstat', '~> 2.3.0'
-gem 'sys-filesystem', '~> 1.1.6'
+gem 'sys-filesystem', '~> 1.1.6', group: :exclude
diff --git a/app/controllers/admin/system_info_controller.rb b/app/controllers/admin/system_info_controller.rb
index ca04a17..1efb29e 100644
--- a/app/controllers/admin/system_info_controller.rb
+++ b/app/controllers/admin/system_info_controller.rb
@@ -1,3 +1,5 @@
+require 'open3'
+
class Admin::SystemInfoController < Admin::ApplicationController
EXCLUDED_MOUNT_OPTIONS = [
'nobrowse',
@@ -28,10 +30,14 @@ class Admin::SystemInfoController < Admin::ApplicationController
'vfat'
]
+ MOUNT_REGEX = /(\S+) on (\S+) type (\S+) \(([^)]+)\)/
+
+ Mount = Struct.new('Mount', :name, :mount_point, :mount_type, :options)
+ FsStat = Struct.new('FsStats', :path, :bytes_total, :bytes_used)
+
def show
@cpus = Vmstat.cpu rescue nil
@memory = Vmstat.memory rescue nil
- mounts = Sys::Filesystem.mounts
@disks = []
mounts.each do |mount|
@@ -41,15 +47,38 @@ class Admin::SystemInfoController < Admin::ApplicationController
next if (EXCLUDED_MOUNT_TYPES & [mount.mount_type]).any?
begin
- disk = Sys::Filesystem.stat(mount.mount_point)
+ disk = fs_stat(mount.mount_point)
@disks.push({
bytes_total: disk.bytes_total,
bytes_used: disk.bytes_used,
disk_name: mount.name,
mount_path: disk.path
})
- rescue Sys::Filesystem::Error
+ rescue IOError
end
end
end
+
+ def mounts
+ stdout, stderr, status = Open3.capture3('mount')
+ fail IOError, stderr unless status.success?
+
+ stdout.lines
+ .map { |line| MOUNT_REGEX.match(line) }
+ .compact
+ .map { |match| Mount.new(*match.captures) }
+ end
+
+ def fs_stat(mount_point)
+ stdout, status = Open3.capture2('stat', '-c', '%s %b %a', '-f', mount_point)
+ fail IOError unless status.success?
+
+ block_size, blocks_total, blocks_free = stdout.split(' ').map(&:to_i)
+
+ bytes_total = blocks_total * block_size
+ bytes_free = blocks_free * block_size
+ bytes_used = bytes_total - bytes_free
+
+ FsStat.new(mount_point, bytes_total, bytes_used)
+ end
end