Skip to content

Commit

Permalink
Removed sudo functionality, using umask instead.
Browse files Browse the repository at this point in the history
This commit removes the functionality and necessity for
sudo calls between the openproject and git users.

As gitolite suggests, we now access the repositories through
the git group and a umask of 0770.

For more information on the gitolite config, see:
http://gitolite.com/gitolite/g2/rc.html

This commit also adds a few changes to the configuration:

 * delayed_job can be disabled through the config and is disabled by
default
 * The relative git storage dir has been replaced with an absolute path
setting for "Gitolite repositories base path".
 * Repository::Git no longer store the url as a relative path from the
git home directory, but only the relative path below the base_path
 * Added an output of the repository names in the config test

This commit adds the following organizational changes:

 * Introducing a changelog, even though no gem is released yet.
 * Adding hound/rubocop integration and extensive linting refactoring

Closes #9
  • Loading branch information
oliverguenther committed Jan 16, 2015
1 parent e8657d5 commit 48456a1
Show file tree
Hide file tree
Showing 71 changed files with 1,066 additions and 2,081 deletions.
3 changes: 3 additions & 0 deletions .hound.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ruby:
enabled: true
config_file: .rubocop.yml
264 changes: 264 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
AccessorMethodName:
Enabled: false

ActionFilter:
Enabled: false

Alias:
Enabled: false

AndOr:
Enabled: false

ArrayJoin:
Enabled: false

AsciiComments:
Enabled: false

AsciiIdentifiers:
Enabled: false

Attr:
Enabled: false

BlockNesting:
Enabled: false

Blocks:
Enabled: false

CaseEquality:
Enabled: false

CharacterLiteral:
Enabled: false

ClassAndModuleChildren:
Enabled: false

ClassLength:
Enabled: false

ClassVars:
Enabled: false

CollectionMethods:
PreferredMethods:
find: detect
reduce: inject
collect: map
find_all: select

ColonMethodCall:
Enabled: false

CommentAnnotation:
Enabled: false

CyclomaticComplexity:
Enabled: false

Delegate:
Enabled: false

DeprecatedHashMethods:
Enabled: false

Documentation:
Enabled: false

DotPosition:
EnforcedStyle: leading

DoubleNegation:
Enabled: false

EachWithObject:
Enabled: false

EmptyLiteral:
Enabled: false

Encoding:
Enabled: false

EvenOdd:
Enabled: false

FileName:
Enabled: false

FlipFlop:
Enabled: false

FormatString:
Enabled: false

GlobalVars:
Enabled: false

GuardClause:
Enabled: false

IfUnlessModifier:
Enabled: false

IfWithSemicolon:
Enabled: false

InlineComment:
Enabled: false

Lambda:
Enabled: false

LambdaCall:
Enabled: false

LineEndConcatenation:
Enabled: false

LineLength:
Max: 120

Metrics/AbcSize:
Max: 26

MethodLength:
Enabled: false

ModuleFunction:
Enabled: false

NegatedIf:
Enabled: false

NegatedWhile:
Enabled: false

Next:
Enabled: false

NilComparison:
Enabled: false

Not:
Enabled: false

NumericLiterals:
Enabled: false

OneLineConditional:
Enabled: false

OpMethod:
Enabled: false

ParameterLists:
Enabled: false

PercentLiteralDelimiters:
Enabled: false

PerlBackrefs:
Enabled: false

PredicateName:
NamePrefixBlacklist:
- is_

Proc:
Enabled: false

RaiseArgs:
Enabled: false

RegexpLiteral:
Enabled: false

SelfAssignment:
Enabled: false

SingleLineBlockParams:
Enabled: false

SingleLineMethods:
Enabled: false

SignalException:
Enabled: false

SpecialGlobalVars:
Enabled: false

StringLiterals:
EnforcedStyle: single_quotes

VariableInterpolation:
Enabled: false

TrailingComma:
Enabled: false

TrivialAccessors:
Enabled: false

VariableInterpolation:
Enabled: false

WhenThen:
Enabled: false

WhileUntilModifier:
Enabled: false

WordArray:
Enabled: false

# Lint

AmbiguousOperator:
Enabled: false

AmbiguousRegexpLiteral:
Enabled: false

AssignmentInCondition:
Enabled: false

ConditionPosition:
Enabled: false

DeprecatedClassMethods:
Enabled: false

ElseLayout:
Enabled: false

HandleExceptions:
Enabled: false

InvalidCharacterLiteral:
Enabled: false

LiteralInCondition:
Enabled: false

LiteralInInterpolation:
Enabled: false

Loop:
Enabled: false

ParenthesesAsGroupedExpression:
Enabled: false

RequireParentheses:
Enabled: false

UnderscorePrefixedVariableName:
Enabled: false

Void:
Enabled: false
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## 0.1.0 (unreleased)

Features:


- Added a repositories listing on the config test page.
- Showing the git clone URL in the repository sidebar

Changes:

- **delayed_job can be disabled through the config and is disabled by default**
- ** The relative git storage dir has been replaced with an absolute path setting for "Gitolite repositories base path" **
- Repository::Git no longer store the url as a relative path from the
git home directory, but only the relative path below the base_path

Organizational Changes:

- Major refactoring for rubocop compliance

### Breaking Changes:

** sudo requirement removed **

The Requirement for sudo from `openproject` to `git` user has been replaced with direct read/write access through gitolite.rc's `$UMASK` directive. When upgrading, follow these steps:

1. The ``$UMASK`` directive within the `gitolite.rc` must be changed to `0770` for any subsequent updates to the repositories
2. The `<git home>/repositories` directory permissions must be extended to `770`.
3. The openproject user must be added to the git user group.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "http://www.rubygems.org"
source 'http://www.rubygems.org'

gemspec
Loading

0 comments on commit 48456a1

Please sign in to comment.