Archive

Archive for the ‘Redmine’ Category

Redmine 2.1 & Block activity show(show only for admin)

October 23, 2012 admin No comments

vi app/controllers/activities_controller.rb

 def index
    @days = Setting.activity_days_default.to_i

    if !User.current.admin?
      render_404
      return
    end

 

rake tmp:cache:clear
rake tmp:sessions:clear
touch tmp/restart.txt

Categories: Redmine Tags:

How to upgrade Redmine 1.4 to Redmine 2.1 (CentOS 5.8)

October 23, 2012 admin No comments

Upgrade Ruby 1.9.3 with libyaml

Installing libyaml

#  cd /usr/src/
# wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
# tar xzvf yaml-0.1.4.tar.gz
# cd yaml-0.1.4
# ./configure --prefix=/usr/local
# make && make install

Installing Ruby 1.9.3-p194

#  cd /usr/src/
# wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
# tar zxvf ruby-1.9.3-p194.tar.gz
# cd ruby-1.9.3-p194
# ./configure --prefix=/usr/local --disable-install-doc --with-opt-dir=/usr/local/lib
# make && make install
# gem install bundler

Optional Update passenger

# gem install passenger
# passenger-install-apache2-module

vi /etc/httpd/conf.d/passenger.conf

LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.17
PassengerRuby /usr/local/bin/ruby

Install Redmine 2.1

# cd /opt
# svn co http://redmine.rubyforge.org/svn/branches/2.1-stable redmine-2.1
# cd /opt/redmine-2.1
# bundle install --without development test postgresql sqlite rmagick

# cd /opt/redmine-2.1
# chown -R root:root .
# mkdir public/plugin_assets
# chown -R apache:apache files log tmp public/plugin_assets
# chmod -R 755 files log tmp public/plugin_assets
# chown -R apache:apache config/environment.rb

# rake generate_secret_token
# rake db:migrate RAILS_ENV=production
# rake redmine:plugins:migrate RAILS_ENV=production
# rake tmp:cache:clear
# rake tmp:sessions:clear
# touch tmp/restart.txt

vi config/database.yml
change:
adapter: mysql
to:
adapter: mysql2

vi /etc/httpd/conf/httpd.conf

DocumentRoot "/opt/redmine-2.1/public"

Optional Install plugin

# cd /opt/redmine-2.1/plugins
# git clone https://github.com/undx/redmine_redirect_to_after_login.git redirect_to_after_login
# git clone https://github.com/f0y/redmine-wiking.git wiking
# cd /opt/redmine-2.1
# rake redmine:plugins:assets RAILS_ENV=production

Patch

Can’t edit update of an issue http://www.redmine.org/issues/12076
vi /usr/local/lib/ruby/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/http/mime_negotiation.rb
change
Array(Mime[parameters[:format]])
to
Array.wrap(Mime[parameters[:format]])

Categories: Redmine Tags:

Redmine 1.4 & Block user show(show only for admin)

January 27, 2012 admin No comments

vi app/controllers/users_controller.rb

    @events_by_day = events.group_by(&:event_date)

    if !User.current.admin?
        render_404
        return
    end

 

rake tmp:cache:clear
rake tmp:sessions:clear
touch tmp/restart.txt

Categories: Redmine Tags:

Redmine 1.4 & Hide list of members(author, assignee) in reports (show only for admin)

January 26, 2012 admin No comments

vi app/views/reports/issue_report.html.erb

<%= render :partial => 'simple', :locals => { :data => @issues_by_priority, :field_name => "priority_id", :rows => @priorities } %>
<br />
<% if User.current.admin? %>
<h3><%=l(:field_assigned_to)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :action => 'issue_report_details', :detail => 'assigned_to' %></h3>
<%= render :partial => 'simple', :locals => { :data => @issues_by_assigned_to, :field_name => "assigned_to_id", :rows => @assignees } %>
<h3><%=l(:field_author)%>&nbsp;&nbsp;<%= link_to image_tag('zoom_in.png'), :action => 'issue_report_details', :detail => 'author' %></h3>
<%= render :partial => 'simple', :locals => { :data => @issues_by_author, :field_name => "author_id", :rows => @authors } %>
<% end %>

 

vi app/controllers/reports_controller.rb

    when "assigned_to"
      if User.current.admin?
        @field = "assigned_to_id"
        @rows = (Setting.issue_group_assignment? ? @project.principals : @project.users).sort
        @data = Issue.by_assigned_to(@project)
        @report_title = l(:field_assigned_to)
      end
    when "author"
      if User.current.admin?
        @field = "author_id"
        @rows = @project.users.sort
        @data = Issue.by_author(@project)
        @report_title = l(:field_author)
      endif
...

 

vi app/models/query.rb

    users = principals.select {|p| p.is_a?(User)}

    if User.current.admin?
      assigned_to_values = []
      assigned_to_values << ["<< #{l(:label_me)} >>", "me"] if User.current.logged?
      assigned_to_values += (Setting.issue_group_assignment? ? principals : users).collect{|s| [s.name, s.id.to_s] }
      @available_filters["assigned_to_id"] = { :type => :list_optional, :o rder => 4, :values => assigned_to_values } unless assigned_to_values.empty?

      author_values = []
      author_values << ["<< #{l(:label_me)} >>", "me"] if User.current.logged?
      author_values += users.collect{|s| [s.name, s.id.to_s] }
      @available_filters["author_id"] = { :type => :list, :o rder => 5, :values => author_values } unless author_values.empty?

      group_values = Group.all.collect {|g| [g.name, g.id.to_s] }
      @available_filters["member_of_group"] = { :type => :list_optional, :o rder => 6, :values => group_values } unless group_values.empty?

      role_values = Role.givable.collect {|r| [r.name, r.id.to_s] }
      @available_filters["assigned_to_role"] = { :type => :list_optional, :o rder => 7, :values => role_values } unless role_values.empty?

      if User.current.logged?
        @available_filters["watcher_id"] = { :type => :list, :o rder => 15, :values => [["<< #{l(:label_me)} >>", "me"]] }
      end
    end
...

 

rake tmp:cache:clear
rake tmp:sessions:clear
touch tmp/restart.txt

Categories: Redmine Tags:

Redmine 1.4 & Fields permissions (Hide Assigned to & due date & estimated time) in issue

January 24, 2012 admin 2 comments
rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm
yum install --enablerepo=webtatic git-core

 

cd vendor/plugins/
git clone git://github.com/resilva/Redmine-Fields-permissions.git
cd ..
cd ..
rake db:migrate_plugins RAILS_ENV=production
rake tmp:cache:clear
rake tmp:sessions:clear
touch tmp/restart.txt

 

ActionView::TemplateError (uninitialized constant ActionView::Base::CompiledTemplates::TabularFormBuilder) on line #1 of vendor/plugins/Redmine-Fields-permissions/app/views/issues/_attributes.rhtml:

cd lib
wget http://svn.ohwr.org/ohr-support/trunk/lib/tabular_form_builder.rb
rake tmp:cache:clear
rake tmp:sessions:clear
touch tmp/restart.txt

 

Categories: Redmine Tags:

Redmine 1.4 & Hide list of members in project overview (show only for admin)

January 24, 2012 admin No comments

vi app/views/projects/_members_box.html.erb

<% if @users_by_role.any? %>

 
to

<% if User.current.admin? %>

 

rake tmp:cache:clear
rake tmp:sessions:clear
touch tmp/restart.txt

Categories: Redmine Tags:

How to install graphviz & Redmine 1.2 (CentOS 5.6)

November 2, 2011 admin No comments

Imtall graphviz

# wget -O /etc/yum.repos.d/graphviz-rhel.repo http://www.graphviz.org/graphviz-rhel.repo
# yum install graphviz.x86_64
# yum install graphviz-gd
# yum install graphviz-ruby

 

Imtall wiki_graphviz_plugin

/opt/redmine/vendor/plugins/wiki_graphviz_plugin/

# mkdir /opt/redmine/tmp/wiki_graphviz_plugin
# chown -R apache:apache /opt/redmine/tmp/
# cd /opt/redmine
# /etc/init.d/httpd restart

 

Categories: CentOS, Redmine Tags:

RIS & Redmine

January 25, 2011 admin No comments

Redmine configuration

Administration - Custom fields
Administration - Settings - Autentification
My account - API access key

RIS risRedminePlugin configuration

  1. Open the plugin configuration file: C:\htdocs\ris\plugins\risRedminePlugin\config\app.yml
  2. Make sure to change url and key to match your Redmine url and API access key.
    all:
      pagination:
        redmineprojects:              10
        redminetasks:                 10
      redmine:
        url:                          http://localhost:8000
        key:                          77b08c3b1c17ff101a25c3fc2113dc8c8fa5c28a
        custom_field_uuid_id:         1
        priority_id:                  4
        tracker_id:                   2
    
  3. Open the plugin configuration file: C:\htdocs\ris\config\ProjectConfiguration.class.php
  4. Add risRedminePlugin to the enablePlugins array in your project Configuration
    <?php
    
    //date_default_timezone_set('UTC');
    date_default_timezone_set('Europe/Berlin');
    
    require_once dirname(__FILE__).'/../lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php';
    sfCoreAutoload::register();
    
    class ProjectConfiguration extends sfProjectConfiguration
    {
    	public function setup()
    	{
    		$this->enablePlugins('sfPropel15Plugin', 'sfProtoculousPlugin', 'sfDateTime2Plugin', 'sfFormExtraPlugin', 'sfPropelUuidBehaviorPlugin', 'sfFormButtonsPlugin', 'sfAmfPlugin', 'risRedminePlugin', 'sfPhpExcelPlugin');
    		$this->setIncludePath();
    	}
    
    	public function setIncludePath()
    	{
    		sfToolkit::addIncludePath(dirname(__FILE__).'/../lib/vendor/PEAR/', 'front');
    	}
    }
    

Projekt in Redmine importieren(ohne Vorgänge)


Folgende Daten werden mittels REST-API von RIS zu Redmine automatisch übergeben:

  • Name
  • Beschreibung
  • Kennung – UUID des Projekts


Ticket in Redmine importieren / aktualisieren


Folgende Daten werden mittels REST-API von RIS zu Redmine automatisch übergeben:

  • Thema – Vorgangsname
  • Beschreibung
  • Status – konfigurierbar für alle importierten Tickets
  • Priorität – konfigurierbar für alle importierten Tickets
  • Zugewiesen am Vorgangs – Mitarbeiter, bei dem das Kontrollkästchen “Besitzer” angekreuzt ist, oder der erste zugewiesene Mitarbeiter
  • Beginn
  • Abgabedatum
  • Geschätzter Aufwand
  • Beobachter – Alle Vorgangs-Mitarbeiter
  • Benutzerdefinierte Felder “uuid” – UUID des Vorgangs

Zuordnung Mitarbeiter vom Rillsoft Ressourcenpool zu Redmine-Mitglied wird über E-Mail-Adresse gemacht

Übername von aufgewendeter Zeit aus Redmine

  1. Aufgewendete Zeit wird von allen untergeordneten Tickets gesammelt und an Vorgangs-Mitarbeiter übernommen.
  2. Aufgewendete Zeit von Redmine-Mitglied, der nicht dem Vorgangs-Mitarbeiter zugeordnet ist, wird nicht übernommen.
  3. Wenn Ticket auf 100% erledigt ist, werden wie tatsächlich erbrachter Aufwand so auch Anfang und Ende aus aufgewendeter Zeit übernommen und der Vorgang wird als abgeschlossen markiert.






Categories: Redmine, Rillsoft Tags:

How to install Redmine 1.4 (CentOS 5.8)

January 17, 2011 admin 2 comments

Install the Apache

Install the MySQL 5.1

# yum install mysql mysql-devel mysql-server
# chkconfig --levels 235 mysqld on
# /etc/init.d/mysqld start

Create database for Redmine:

# mysql -u root -p
CREATE DATABASE redmine CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'redmine';
GRANT ALL ON redmine.* TO 'redmine'@'localhost';

 

Installing Ruby

# yum install gcc-c++ openssl openssl-devel zlib zlib-devel mysql-devel postgresql-devel subversion wget
# wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
# tar zxvf ruby-1.8.7.tar.gz
# cd ruby-1.8.7
# ./configure
# make && make install

math.c:37:13: error: missing binary operator before token "("
make: *** [math.o] Error 1
Just open math.c [Don’t locate any where just use vi math.c from the same same location where you are executing the command ‘make’]
And look at the line
“#elif define(ERANGE)” it should be “#elif defined(ERANGE)”
Note: not “define”, it is “defined” => d is missing in this phrase

 

Installing RubyGems

# wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.7.tgz
# tar zxvf rubygems-1.8.7.tgz
# cd rubygems-1.8.7
# ruby setup.rb

 

Installing Redmine

# cd /opt
# svn co http://redmine.rubyforge.org/svn/branches/1.4-stable redmine-1.4

Installing Bundler

# gem install bundler

Installing Rails

# cd /opt/redmine-1.4
# bundle install --without development test postgresql sqlite rmagick

 

Created lets configure our database settings for Redmine:

# cd /opt/redmine-1.4
# cp  config/database.yml.example config/database.yml

Edit config/database.yml and set your settings:

# vi config/database.yml
 production:
    adapter: mysql
    database: redmine
    host: localhost
    username: redmine
    password: redmine

Generate a session store secret:

# cd /opt/redmine-1.4
# rake config/initializers/session_store.rb

Create the database structure:

# RAILS_ENV=production rake db:migrate
# RAILS_ENV=production rake redmine:load_default_data

Configure email settings:

cd /opt/redmine-1.4
cp config/email.yml.example config/email.yml

 

Option 1. Running under Apache

# yum install httpd-devel curl-devel apr-devel gcc gcc-c++
# gem install passenger
# passenger-install-apache2-module
# cd /opt/redmine-1.4
# chown -R root:root .
# chown -R apache:apache files log tmp public/plugin_assets
# chmod -R 755 files log tmp public/plugin_assets
# chown -R apache:apache config/environment.rb
# vi /etc/httpd/conf.d/passenger.conf
LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.12/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.12
PassengerRuby /usr/local/bin/ruby

# delete HTTP header which would be added by Passenger
Header always unset "X-Powered-By"
Header always unset "X-Rack-Cache"
Header always unset "X-Content-Digest"
Header always unset "X-Runtime"

# for passenger tuning
PassengerLogLevel 0
RailsAutoDetect On
PassengerMaxPoolSize 20
PassengerMaxInstancesPerApp 4
PassengerPoolIdleTime 3600
PassengerUseGlobalQueue on
#PassengerHighPerformance on !!! conflict with DAV svn
PassengerStatThrottleRate 10
RailsSpawnMethod smart
RailsAppSpawnerIdleTime 86400
RailsFrameworkSpawnerIdleTime 0
PassengerUserSwitching On
PassengerDefaultUser apache
PassengerMaxRequests 3000
PassengerMinInstances 3
# vi /etc/httpd/conf/httpd.conf
DocumentRoot "/opt/redmine-1.4/public"
# ln -sf /opt/redmine-1.4/public /var/www/html/redmine

Redmine under a subdirectory

# vi /etc/httpd/conf/httpd.conf
RailsAutoDetect off
PassengerAppRoot /opt/redmine-1.4
RailsBaseURI  /redmine
Alias "/redmine" /opt/redmine-1.4/public

Check disable SElinux !!!
[error] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger watchdog (/usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.11/agents/PassengerWatchdog): Permission denied (13)
How to disable SElinux

Option 2. Running under Apache

# yum install yum-priorities
# rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# yum update
# yum install curl-devel apr-devel
# yum install openssl openssl-devel
# yum install zlib zlib-devel
# yum install gcc gcc-c++
# yum install subversion mod_dav_svn
# yum install perl-HTML-Parser perl-SVN-Notify

Installing Thin

# gem install thin
# thin install
# chkconfig --levels 235 thin on

Configure Thin

# thin config -C /etc/thin/redmine.yml -c /opt/redmine --servers 3 -e production
# service thin start

 

Configure Apache and add a Redmine config file

# vi /etc/httpd/conf/httpd.conf

Uncomment

NameVirtualHost *:80
# vi /etc/httpd/conf.d/redmine.conf
<VirtualHost *:80>
        DocumentRoot /opt/redmine-1.4
        ServerName redmine.how2centos.com
        <Proxy balancer://redminecluster>
                 BalancerMember http://127.0.0.1:3000
                 BalancerMember http://127.0.0.1:3001
                 BalancerMember http://127.0.0.1:3002
        </Proxy>
        ProxyPass / balancer://redminecluster/
        ProxyPassReverse / balancer://redminecluster/
        ErrorLog /var/log/httpd/redmine_error.log
        CustomLog /var/log/httpd/redmine_access.log combined
</VirtualHost>

(13)Permission denied: proxy: HTTP: attempt to connect
# setsebool -P httpd_can_network_connect=1

Option 3. Starting Redmine on built-in WEBrick web server

# cd /opt/redmine-1.4
# ruby script/server webrick -p 8000 -e production

Change IPTables

# vi /etc/sysconfig/iptables

Includes the following before the REJECT line:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8000 -j ACCEPT
# service iptables restart

 
After its started you can access Redmine on the following URL:

http://your.ser.ver.ip:8000/

Use default administrator account to log in:

    * login: admin
    * password: admin

 

Optional Intall ImageMagick

# yum install ImageMagick ImageMagick-devel libpng libpng-devel freetype freetype-devel giflib giflib-devel
# yum erase ImageMagick ImageMagick-devel
# wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
# tar -xzvf ImageMagick.tar.gz
# cd ImageMagick-6.6.7-6
# ./configure --without-perl
# make
# make install
gem install rmagick

 
Can’t install RMagick 2.13.1. Can’t find MagickWand.h.

C_INCLUDE_PATH=/usr/src/ImageMagick-6.7.4-8 gem install rmagick

 

Optional Imtall SVN

# yum install mod_dav_svn subversion
# mkdir /opt/svn
# chown root:apache /opt/svn
# chmod 0750 /opt/svn
# ln -s /opt/redmine/extra/svn/Redmine.pm /usr/lib/perl5/5.8.8/Redmine.pm

 

# vi /etc/httpd/conf.d/svn.conf
PerlLoadModule Redmine
<Location /svn>
    DAV svn
    SVNParentPath "/opt/svn"
    AuthType Basic
    AuthName "Redmine SVN Repository"
    Require valid-user

    PerlAccessHandler Apache::Authn::Redmine::access_handler
    PerlAuthenHandler Apache::Authn::Redmine::authen_handler

    RedmineDSN "DBI:mysql:database=redmine;host=localhost"

    RedmineDbUser "redmine"
    RedmineDbPass "redmine"
</Location>

 

Optional Autocreate Subversion Repositories

Go to Administration -> Settings -> Repositoryand check Enable WS for repository management.

# vi /etc/cron.d/redmine
*/10 * * * * root ruby /opt/redmine/extra/svn/reposman.rb --redmine localhost --svn-dir /opt/svn/ --owner apache --url file:///opt/svn/ --verbose >> /var/log/reposman.log

 

Trac to Redmine migration

# yum install ruby-devel sqlite sqlite-devel ruby-rdoc
# gem install sqlite3-ruby --version=1.2.5
# rake redmine:migrate_from_trac RAILS_ENV=production --trace

Upgrade 1.3 to 1.4

A key is required to write a cookie containing the session data. Use config.action_controller.session = { :key => “_myapp_session”, :secret => “some secret phrase” } in config/environment.rb

#rake config/initializers/session_store.rb
Categories: CentOS, Redmine Tags: