Compare commits

...

21 commits

Author SHA1 Message Date
Dmitriy Zaporozhets c643fb78e2 Merge pull request #3058 from lyda/4-1-stable
Fix sending commit note email to id instead email
2013-02-25 10:11:38 -08:00
Dmitriy Zaporozhets c78ebc3ebb Fix sending commit note email to id instead email 2013-02-20 16:48:14 +00:00
Dmitriy Zaporozhets db958e5997 Merge pull request #2888 from raphendyr/username_changing_disabled
Add option to disable username changing
2013-02-13 05:04:50 -08:00
Dmitriy Zaporozhets 2e8db0dfc5 Merge pull request #2932 from escaped/repo-import-4.1-fix
Repo import 4.1 fix (empty repositories)
2013-02-07 07:58:52 -08:00
Alexander frenzel 09d977322e import repositories to global namespace 2013-02-07 14:52:54 +01:00
Erwan Arzur 385a515d2b [import] - fix project import after refactoring 2013-02-07 14:51:50 +01:00
Dmitriy Zaporozhets 0ac9dd3243 Merge pull request #2905 from raphendyr/gitignore_and_logrotate
Change .gitignore to ignore logrotated log files.
2013-02-05 04:11:22 -08:00
Jaakko Kantojärvi 7c87eed6b9 Change .gitignore to ignore logrotated log files. 2013-02-04 13:12:10 +02:00
Jaakko Kantojärvi fcffb4c381 Move username change decision into user model 2013-02-02 21:25:03 +02:00
Jaakko Kantojärvi de7012c4fb Add option to disable username changing 2013-02-01 22:53:41 +02:00
Riyad Preukschas 72e2a49819 Merge pull request #2803 from donnykurnia/fix-2776
Improve gitlab:check. Fix 2776
2013-02-01 11:38:59 -08:00
Donny Kurnia 506309e17a Using empty_repo? instead
Display message if repository is empty
2013-01-28 22:07:46 +07:00
Donny Kurnia 59d91729c8 Check if project.repository before check
Fix for #2776
2013-01-28 21:53:41 +07:00
Dmitriy Zaporozhets d14069e333 fix deleting non-existing repo 2013-01-25 14:36:31 +02:00
Dmitriy Zaporozhets c78ede3165 Merge pull request #2726 from McJoppy/download-archive-bug
Update app/models/repository.rb
2013-01-24 12:53:16 -08:00
Valeriy Sizov feb036bbf7 Merge pull request #2723 from ZKjellberg/patch-1
Update doc/install/installation.md
2013-01-24 03:46:15 -08:00
McJoppy 26b3050f37 Update app/models/repository.rb
Issue #2699 - Download button not functioning. Replaces slashes with underscore in downloads filename
2013-01-24 09:22:14 +13:00
Zachary Kjellberg 4f1035988d Update doc/install/installation.md
Line 295: sudo /etc/init.d/gitlab restart
Results in: "Error, unicorn not running!"
This is because unicorn is not yet running for first boot. I suggest changing this to 'start'.

Line 305: sudo apt-get install nginx
Change command to: sudo apt-get -y install nginx
Allowing automated install to simplify and follow pattern of earlier installs.
2013-01-23 15:04:09 -05:00
Riyad Preukschas ed17a01181 Fix init script recipe url for 4.1 in check.rake 2013-01-21 17:18:00 +01:00
Dmitriy Zaporozhets 7014c8782b Up to 4.1.0 2013-01-21 15:53:00 +02:00
Dmitriy Zaporozhets e33aa23299 Update docs to use 4-1-stable 2013-01-21 15:51:46 +02:00
14 changed files with 98 additions and 77 deletions

2
.gitignore vendored
View file

@ -2,7 +2,7 @@
.rbx/
db/*.sqlite3
db/*.sqlite3-journal
log/*.log
log/*.log*
tmp/
.sass-cache/
coverage/*

View file

@ -1 +1 @@
4.1.0rc1
4.1.0

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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
&nbsp;
%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
&nbsp;
%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"

View file

@ -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:

View file

@ -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?

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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