Compare commits
21 commits
master
...
4-1-stable
Author | SHA1 | Date | |
---|---|---|---|
c643fb78e2 | |||
c78ebc3ebb | |||
db958e5997 | |||
2e8db0dfc5 | |||
09d977322e | |||
385a515d2b | |||
0ac9dd3243 | |||
7c87eed6b9 | |||
fcffb4c381 | |||
de7012c4fb | |||
72e2a49819 | |||
506309e17a | |||
59d91729c8 | |||
d14069e333 | |||
c78ede3165 | |||
feb036bbf7 | |||
26b3050f37 | |||
4f1035988d | |||
ed17a01181 | |||
7014c8782b | |||
e33aa23299 |
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -2,7 +2,7 @@
|
|||
.rbx/
|
||||
db/*.sqlite3
|
||||
db/*.sqlite3-journal
|
||||
log/*.log
|
||||
log/*.log*
|
||||
tmp/
|
||||
.sass-cache/
|
||||
coverage/*
|
||||
|
|
|
@ -51,7 +51,9 @@ class ProfilesController < ApplicationController
|
|||
end
|
||||
|
||||
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|
|
||||
format.js
|
||||
|
|
|
@ -63,12 +63,12 @@ class Notify < ActionMailer::Base
|
|||
# Note
|
||||
#
|
||||
|
||||
def note_commit_email(commit_autor_email, note_id)
|
||||
def note_commit_email(recipient_id, note_id)
|
||||
@note = Note.find(note_id)
|
||||
@commit = @note.noteable
|
||||
@commit = CommitDecorator.decorate(@commit)
|
||||
@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
|
||||
|
||||
def note_issue_email(recipient_id, note_id)
|
||||
|
|
|
@ -151,7 +151,7 @@ class Repository
|
|||
return nil unless commit
|
||||
|
||||
# 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")
|
||||
file_path = File.join(storage_path, file_name)
|
||||
|
||||
|
|
|
@ -215,6 +215,10 @@ class User < ActiveRecord::Base
|
|||
keys.count == 0
|
||||
end
|
||||
|
||||
def can_change_username?
|
||||
Gitlab.config.gitlab.username_changing_enabled
|
||||
end
|
||||
|
||||
def can_create_project?
|
||||
projects_limit > personal_projects.count
|
||||
end
|
||||
|
|
|
@ -11,7 +11,7 @@ class NoteObserver < ActiveRecord::Observer
|
|||
notify_team(note)
|
||||
elsif note.notify_author
|
||||
# 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
|
||||
# Otherwise ignore it
|
||||
nil
|
||||
|
|
|
@ -53,28 +53,29 @@
|
|||
|
||||
|
||||
|
||||
%fieldset.update-username
|
||||
%legend
|
||||
Username
|
||||
%small.cred.right
|
||||
Changing your username can have unintended side effects!
|
||||
= form_for @user, url: update_username_profile_path, method: :put, remote: true do |f|
|
||||
.padded
|
||||
= f.label :username
|
||||
.input
|
||||
= f.text_field :username, required: true
|
||||
|
||||
%span.loading-gif.hide= image_tag "ajax_loader.gif"
|
||||
%span.update-success.cgreen.hide
|
||||
%i.icon-ok
|
||||
Saved
|
||||
%span.update-failed.cred.hide
|
||||
%i.icon-remove
|
||||
Failed
|
||||
%ul.cred
|
||||
%li It will change web url for personal projects.
|
||||
%li It will change the git path to repositories for personal projects.
|
||||
.input
|
||||
= f.submit 'Save username', class: "btn save-btn"
|
||||
- if current_user.can_change_username?
|
||||
%fieldset.update-username
|
||||
%legend
|
||||
Username
|
||||
%small.cred.right
|
||||
Changing your username can have unintended side effects!
|
||||
= form_for @user, url: update_username_profile_path, method: :put, remote: true do |f|
|
||||
.padded
|
||||
= f.label :username
|
||||
.input
|
||||
= f.text_field :username, required: true
|
||||
|
||||
%span.loading-gif.hide= image_tag "ajax_loader.gif"
|
||||
%span.update-success.cgreen.hide
|
||||
%i.icon-ok
|
||||
Saved
|
||||
%span.update-failed.cred.hide
|
||||
%i.icon-remove
|
||||
Failed
|
||||
%ul.cred
|
||||
%li It will change web url for personal projects.
|
||||
%li It will change the git path to repositories for personal projects.
|
||||
.input
|
||||
= f.submit 'Save username', class: "btn save-btn"
|
||||
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ gitlab:
|
|||
## Project settings
|
||||
default_projects_limit: 10
|
||||
# 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:
|
||||
|
|
|
@ -53,6 +53,7 @@ Settings.gitlab['support_email'] ||= Settings.gitlab.email_from
|
|||
Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
|
||||
Settings.gitlab['user'] ||= 'gitlab'
|
||||
Settings.gitlab['signup_enabled'] ||= false
|
||||
Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil?
|
||||
|
||||
Settings['gravatar'] ||= Settingslogic.new({})
|
||||
Settings.gravatar['enabled'] = true if Settings.gravatar['enabled'].nil?
|
||||
|
|
|
@ -190,10 +190,10 @@ See `doc/install/databases.md`
|
|||
cd /home/gitlab/gitlab
|
||||
|
||||
# Checkout to stable release
|
||||
sudo -u gitlab -H git checkout 4-0-stable
|
||||
sudo -u gitlab -H git checkout 4-1-stable
|
||||
|
||||
**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!
|
||||
|
||||
## 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):
|
||||
|
||||
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
|
||||
|
||||
Make GitLab start on boot:
|
||||
|
@ -292,7 +292,7 @@ However there are still a few steps left.
|
|||
|
||||
sudo service gitlab start
|
||||
# or
|
||||
sudo /etc/init.d/gitlab restart
|
||||
sudo /etc/init.d/gitlab start
|
||||
|
||||
|
||||
# 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.
|
||||
|
||||
## Installation
|
||||
sudo apt-get install nginx
|
||||
sudo apt-get -y install nginx
|
||||
|
||||
## Site Configuration
|
||||
|
||||
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
|
||||
|
||||
Make sure to edit the config file to match your setup:
|
||||
|
|
|
@ -87,7 +87,9 @@ module Gitlab
|
|||
end
|
||||
|
||||
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)
|
||||
end
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ namespace :gitlab do
|
|||
return
|
||||
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)
|
||||
|
||||
if recipe_content == script_content
|
||||
|
@ -780,21 +780,25 @@ namespace :gitlab do
|
|||
Project.find_each(batch_size: 100) do |project|
|
||||
print "#{project.name_with_namespace.yellow} ... "
|
||||
|
||||
correct_options = options.map do |name, value|
|
||||
run("git --git-dir=\"#{project.repository.path_to_repo}\" config --get #{name}").try(:chomp) == value
|
||||
end
|
||||
|
||||
if correct_options.all?
|
||||
puts "ok".green
|
||||
if project.empty_repo?
|
||||
puts "repository is empty".magenta
|
||||
else
|
||||
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
|
||||
correct_options = options.map do |name, value|
|
||||
run("git --git-dir=\"#{project.repository.path_to_repo}\" config --get #{name}").try(:chomp) == value
|
||||
end
|
||||
|
||||
if correct_options.all?
|
||||
puts "ok".green
|
||||
else
|
||||
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
|
||||
|
@ -820,32 +824,37 @@ namespace :gitlab do
|
|||
|
||||
Project.find_each(batch_size: 100) do |project|
|
||||
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)
|
||||
puts "missing".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
|
||||
next
|
||||
end
|
||||
|
||||
if File.lstat(project_hook_file).symlink? &&
|
||||
File.realpath(project_hook_file) == File.realpath(gitolite_hook_file)
|
||||
puts "ok".green
|
||||
if project.empty_repo?
|
||||
puts "repository is empty".magenta
|
||||
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
|
||||
project_hook_file = File.join(project.repository.path_to_repo, "hooks", hook_file)
|
||||
|
||||
unless File.exists?(project_hook_file)
|
||||
puts "missing".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
|
||||
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
|
||||
|
|
|
@ -42,9 +42,10 @@ namespace :gitlab do
|
|||
|
||||
project_params = {
|
||||
: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?
|
||||
puts " * Created #{project.name} (#{repo_name})".green
|
||||
|
|
Loading…
Reference in a new issue