Compare commits
21 Commits
master
...
4-1-stable
Author | SHA1 | Date |
---|---|---|
Dmitriy Zaporozhets | c643fb78e2 | |
Dmitriy Zaporozhets | c78ebc3ebb | |
Dmitriy Zaporozhets | db958e5997 | |
Dmitriy Zaporozhets | 2e8db0dfc5 | |
Alexander frenzel | 09d977322e | |
Erwan Arzur | 385a515d2b | |
Dmitriy Zaporozhets | 0ac9dd3243 | |
Jaakko Kantojärvi | 7c87eed6b9 | |
Jaakko Kantojärvi | fcffb4c381 | |
Jaakko Kantojärvi | de7012c4fb | |
Riyad Preukschas | 72e2a49819 | |
Donny Kurnia | 506309e17a | |
Donny Kurnia | 59d91729c8 | |
Dmitriy Zaporozhets | d14069e333 | |
Dmitriy Zaporozhets | c78ede3165 | |
Valeriy Sizov | feb036bbf7 | |
McJoppy | 26b3050f37 | |
Zachary Kjellberg | 4f1035988d | |
Riyad Preukschas | ed17a01181 | |
Dmitriy Zaporozhets | 7014c8782b | |
Dmitriy Zaporozhets | e33aa23299 |
|
@ -2,7 +2,7 @@
|
||||||
.rbx/
|
.rbx/
|
||||||
db/*.sqlite3
|
db/*.sqlite3
|
||||||
db/*.sqlite3-journal
|
db/*.sqlite3-journal
|
||||||
log/*.log
|
log/*.log*
|
||||||
tmp/
|
tmp/
|
||||||
.sass-cache/
|
.sass-cache/
|
||||||
coverage/*
|
coverage/*
|
||||||
|
|
|
@ -51,7 +51,9 @@ class ProfilesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_username
|
def update_username
|
||||||
@user.update_attributes(username: params[:user][:username])
|
if @user.can_change_username?
|
||||||
|
@user.update_attributes(username: params[:user][:username])
|
||||||
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
|
|
|
@ -63,12 +63,12 @@ class Notify < ActionMailer::Base
|
||||||
# Note
|
# Note
|
||||||
#
|
#
|
||||||
|
|
||||||
def note_commit_email(commit_autor_email, note_id)
|
def note_commit_email(recipient_id, note_id)
|
||||||
@note = Note.find(note_id)
|
@note = Note.find(note_id)
|
||||||
@commit = @note.noteable
|
@commit = @note.noteable
|
||||||
@commit = CommitDecorator.decorate(@commit)
|
@commit = CommitDecorator.decorate(@commit)
|
||||||
@project = @note.project
|
@project = @note.project
|
||||||
mail(to: commit_autor_email, subject: subject("note for commit #{@commit.short_id}", @commit.title))
|
mail(to: recipient(recipient_id), subject: subject("note for commit #{@commit.short_id}", @commit.title))
|
||||||
end
|
end
|
||||||
|
|
||||||
def note_issue_email(recipient_id, note_id)
|
def note_issue_email(recipient_id, note_id)
|
||||||
|
|
|
@ -151,7 +151,7 @@ class Repository
|
||||||
return nil unless commit
|
return nil unless commit
|
||||||
|
|
||||||
# Build file path
|
# Build file path
|
||||||
file_name = self.path_with_namespace + "-" + commit.id.to_s + ".tar.gz"
|
file_name = self.path_with_namespace.gsub("/","_") + "-" + commit.id.to_s + ".tar.gz"
|
||||||
storage_path = Rails.root.join("tmp", "repositories")
|
storage_path = Rails.root.join("tmp", "repositories")
|
||||||
file_path = File.join(storage_path, file_name)
|
file_path = File.join(storage_path, file_name)
|
||||||
|
|
||||||
|
|
|
@ -215,6 +215,10 @@ class User < ActiveRecord::Base
|
||||||
keys.count == 0
|
keys.count == 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def can_change_username?
|
||||||
|
Gitlab.config.gitlab.username_changing_enabled
|
||||||
|
end
|
||||||
|
|
||||||
def can_create_project?
|
def can_create_project?
|
||||||
projects_limit > personal_projects.count
|
projects_limit > personal_projects.count
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,7 +11,7 @@ class NoteObserver < ActiveRecord::Observer
|
||||||
notify_team(note)
|
notify_team(note)
|
||||||
elsif note.notify_author
|
elsif note.notify_author
|
||||||
# Notify only author of resource
|
# Notify only author of resource
|
||||||
Notify.delay.note_commit_email(note.noteable.author_email, note.id)
|
Notify.delay.note_commit_email(note.commit_author.id, note.id)
|
||||||
else
|
else
|
||||||
# Otherwise ignore it
|
# Otherwise ignore it
|
||||||
nil
|
nil
|
||||||
|
|
|
@ -53,28 +53,29 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%fieldset.update-username
|
- if current_user.can_change_username?
|
||||||
%legend
|
%fieldset.update-username
|
||||||
Username
|
%legend
|
||||||
%small.cred.right
|
Username
|
||||||
Changing your username can have unintended side effects!
|
%small.cred.right
|
||||||
= form_for @user, url: update_username_profile_path, method: :put, remote: true do |f|
|
Changing your username can have unintended side effects!
|
||||||
.padded
|
= form_for @user, url: update_username_profile_path, method: :put, remote: true do |f|
|
||||||
= f.label :username
|
.padded
|
||||||
.input
|
= f.label :username
|
||||||
= f.text_field :username, required: true
|
.input
|
||||||
|
= f.text_field :username, required: true
|
||||||
%span.loading-gif.hide= image_tag "ajax_loader.gif"
|
|
||||||
%span.update-success.cgreen.hide
|
%span.loading-gif.hide= image_tag "ajax_loader.gif"
|
||||||
%i.icon-ok
|
%span.update-success.cgreen.hide
|
||||||
Saved
|
%i.icon-ok
|
||||||
%span.update-failed.cred.hide
|
Saved
|
||||||
%i.icon-remove
|
%span.update-failed.cred.hide
|
||||||
Failed
|
%i.icon-remove
|
||||||
%ul.cred
|
Failed
|
||||||
%li It will change web url for personal projects.
|
%ul.cred
|
||||||
%li It will change the git path to repositories for personal projects.
|
%li It will change web url for personal projects.
|
||||||
.input
|
%li It will change the git path to repositories for personal projects.
|
||||||
= f.submit 'Save username', class: "btn save-btn"
|
.input
|
||||||
|
= f.submit 'Save username', class: "btn save-btn"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ gitlab:
|
||||||
## Project settings
|
## Project settings
|
||||||
default_projects_limit: 10
|
default_projects_limit: 10
|
||||||
# signup_enabled: true # default: false - Account passwords are not sent via the email if signup is enabled.
|
# signup_enabled: true # default: false - Account passwords are not sent via the email if signup is enabled.
|
||||||
|
# username_changing_enabled: false # default: true - User can change her username/namespace
|
||||||
|
|
||||||
## Gravatar
|
## Gravatar
|
||||||
gravatar:
|
gravatar:
|
||||||
|
|
|
@ -53,6 +53,7 @@ Settings.gitlab['support_email'] ||= Settings.gitlab.email_from
|
||||||
Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
|
Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
|
||||||
Settings.gitlab['user'] ||= 'gitlab'
|
Settings.gitlab['user'] ||= 'gitlab'
|
||||||
Settings.gitlab['signup_enabled'] ||= false
|
Settings.gitlab['signup_enabled'] ||= false
|
||||||
|
Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil?
|
||||||
|
|
||||||
Settings['gravatar'] ||= Settingslogic.new({})
|
Settings['gravatar'] ||= Settingslogic.new({})
|
||||||
Settings.gravatar['enabled'] = true if Settings.gravatar['enabled'].nil?
|
Settings.gravatar['enabled'] = true if Settings.gravatar['enabled'].nil?
|
||||||
|
|
|
@ -190,10 +190,10 @@ See `doc/install/databases.md`
|
||||||
cd /home/gitlab/gitlab
|
cd /home/gitlab/gitlab
|
||||||
|
|
||||||
# Checkout to stable release
|
# Checkout to stable release
|
||||||
sudo -u gitlab -H git checkout 4-0-stable
|
sudo -u gitlab -H git checkout 4-1-stable
|
||||||
|
|
||||||
**Note:**
|
**Note:**
|
||||||
You can change `4-0-stable` to `master` if you want the *bleeding edge* version, but
|
You can change `4-1-stable` to `master` if you want the *bleeding edge* version, but
|
||||||
do so with caution!
|
do so with caution!
|
||||||
|
|
||||||
## Configure it
|
## Configure it
|
||||||
|
@ -267,7 +267,7 @@ used for the `email.from` setting in `config/gitlab.yml`)
|
||||||
|
|
||||||
Download the init script (will be /etc/init.d/gitlab):
|
Download the init script (will be /etc/init.d/gitlab):
|
||||||
|
|
||||||
sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/master/init.d/gitlab
|
sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/4-1-stable/init.d/gitlab
|
||||||
sudo chmod +x /etc/init.d/gitlab
|
sudo chmod +x /etc/init.d/gitlab
|
||||||
|
|
||||||
Make GitLab start on boot:
|
Make GitLab start on boot:
|
||||||
|
@ -292,7 +292,7 @@ However there are still a few steps left.
|
||||||
|
|
||||||
sudo service gitlab start
|
sudo service gitlab start
|
||||||
# or
|
# or
|
||||||
sudo /etc/init.d/gitlab restart
|
sudo /etc/init.d/gitlab start
|
||||||
|
|
||||||
|
|
||||||
# 7. Nginx
|
# 7. Nginx
|
||||||
|
@ -302,13 +302,13 @@ If you can't or don't want to use Nginx as your web server, have a look at the
|
||||||
"Advanced Setup Tips" section.
|
"Advanced Setup Tips" section.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
sudo apt-get install nginx
|
sudo apt-get -y install nginx
|
||||||
|
|
||||||
## Site Configuration
|
## Site Configuration
|
||||||
|
|
||||||
Download an example site config:
|
Download an example site config:
|
||||||
|
|
||||||
sudo curl --output /etc/nginx/sites-available/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/master/nginx/gitlab
|
sudo curl --output /etc/nginx/sites-available/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/4-1-stable/nginx/gitlab
|
||||||
sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab
|
sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab
|
||||||
|
|
||||||
Make sure to edit the config file to match your setup:
|
Make sure to edit the config file to match your setup:
|
||||||
|
|
|
@ -87,7 +87,9 @@ module Gitlab
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy_project(project)
|
def destroy_project(project)
|
||||||
FileUtils.rm_rf(project.repository.path_to_repo)
|
if project.repository
|
||||||
|
FileUtils.rm_rf(project.repository.path_to_repo)
|
||||||
|
end
|
||||||
conf.rm_repo(project.path_with_namespace)
|
conf.rm_repo(project.path_with_namespace)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ namespace :gitlab do
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
recipe_content = `curl https://raw.github.com/gitlabhq/gitlab-recipes/master/init.d/gitlab 2>/dev/null`
|
recipe_content = `curl https://raw.github.com/gitlabhq/gitlab-recipes/4-1-stable/init.d/gitlab 2>/dev/null`
|
||||||
script_content = File.read(script_path)
|
script_content = File.read(script_path)
|
||||||
|
|
||||||
if recipe_content == script_content
|
if recipe_content == script_content
|
||||||
|
@ -780,21 +780,25 @@ namespace :gitlab do
|
||||||
Project.find_each(batch_size: 100) do |project|
|
Project.find_each(batch_size: 100) do |project|
|
||||||
print "#{project.name_with_namespace.yellow} ... "
|
print "#{project.name_with_namespace.yellow} ... "
|
||||||
|
|
||||||
correct_options = options.map do |name, value|
|
if project.empty_repo?
|
||||||
run("git --git-dir=\"#{project.repository.path_to_repo}\" config --get #{name}").try(:chomp) == value
|
puts "repository is empty".magenta
|
||||||
end
|
|
||||||
|
|
||||||
if correct_options.all?
|
|
||||||
puts "ok".green
|
|
||||||
else
|
else
|
||||||
puts "wrong or missing".red
|
correct_options = options.map do |name, value|
|
||||||
try_fixing_it(
|
run("git --git-dir=\"#{project.repository.path_to_repo}\" config --get #{name}").try(:chomp) == value
|
||||||
sudo_gitlab("bundle exec rake gitlab:gitolite:update_repos")
|
end
|
||||||
)
|
|
||||||
for_more_information(
|
if correct_options.all?
|
||||||
"doc/raketasks/maintenance.md"
|
puts "ok".green
|
||||||
)
|
else
|
||||||
fix_and_rerun
|
puts "wrong or missing".red
|
||||||
|
try_fixing_it(
|
||||||
|
sudo_gitlab("bundle exec rake gitlab:gitolite:update_repos")
|
||||||
|
)
|
||||||
|
for_more_information(
|
||||||
|
"doc/raketasks/maintenance.md"
|
||||||
|
)
|
||||||
|
fix_and_rerun
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -820,32 +824,37 @@ namespace :gitlab do
|
||||||
|
|
||||||
Project.find_each(batch_size: 100) do |project|
|
Project.find_each(batch_size: 100) do |project|
|
||||||
print "#{project.name_with_namespace.yellow} ... "
|
print "#{project.name_with_namespace.yellow} ... "
|
||||||
project_hook_file = File.join(project.repository.path_to_repo, "hooks", hook_file)
|
|
||||||
|
|
||||||
unless File.exists?(project_hook_file)
|
if project.empty_repo?
|
||||||
puts "missing".red
|
puts "repository is empty".magenta
|
||||||
try_fixing_it(
|
|
||||||
"sudo -u #{gitolite_ssh_user} ln -sf #{gitolite_hook_file} #{project_hook_file}"
|
|
||||||
)
|
|
||||||
for_more_information(
|
|
||||||
"lib/support/rewrite-hooks.sh"
|
|
||||||
)
|
|
||||||
fix_and_rerun
|
|
||||||
next
|
|
||||||
end
|
|
||||||
|
|
||||||
if File.lstat(project_hook_file).symlink? &&
|
|
||||||
File.realpath(project_hook_file) == File.realpath(gitolite_hook_file)
|
|
||||||
puts "ok".green
|
|
||||||
else
|
else
|
||||||
puts "not a link to Gitolite's hook".red
|
project_hook_file = File.join(project.repository.path_to_repo, "hooks", hook_file)
|
||||||
try_fixing_it(
|
|
||||||
"sudo -u #{gitolite_ssh_user} ln -sf #{gitolite_hook_file} #{project_hook_file}"
|
unless File.exists?(project_hook_file)
|
||||||
)
|
puts "missing".red
|
||||||
for_more_information(
|
try_fixing_it(
|
||||||
"lib/support/rewrite-hooks.sh"
|
"sudo -u #{gitolite_ssh_user} ln -sf #{gitolite_hook_file} #{project_hook_file}"
|
||||||
)
|
)
|
||||||
fix_and_rerun
|
for_more_information(
|
||||||
|
"lib/support/rewrite-hooks.sh"
|
||||||
|
)
|
||||||
|
fix_and_rerun
|
||||||
|
next
|
||||||
|
end
|
||||||
|
|
||||||
|
if File.lstat(project_hook_file).symlink? &&
|
||||||
|
File.realpath(project_hook_file) == File.realpath(gitolite_hook_file)
|
||||||
|
puts "ok".green
|
||||||
|
else
|
||||||
|
puts "not a link to Gitolite's hook".red
|
||||||
|
try_fixing_it(
|
||||||
|
"sudo -u #{gitolite_ssh_user} ln -sf #{gitolite_hook_file} #{project_hook_file}"
|
||||||
|
)
|
||||||
|
for_more_information(
|
||||||
|
"lib/support/rewrite-hooks.sh"
|
||||||
|
)
|
||||||
|
fix_and_rerun
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -42,9 +42,10 @@ namespace :gitlab do
|
||||||
|
|
||||||
project_params = {
|
project_params = {
|
||||||
:name => path,
|
:name => path,
|
||||||
|
:namespace_id => Namespace.global_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
project = Project.create_by_user(project_params, user)
|
project = Projects::CreateContext.new(user, project_params).execute
|
||||||
|
|
||||||
if project.valid?
|
if project.valid?
|
||||||
puts " * Created #{project.name} (#{repo_name})".green
|
puts " * Created #{project.name} (#{repo_name})".green
|
||||||
|
|
Loading…
Reference in New Issue