-

   rss_rss_hh_new

 - e-mail

 

 -

 LiveInternet.ru:
: 17.03.2011
:
:
: 51

:


[ ] Redmine + Mercurial Ubuntu 16.04

, 15 2017 . 19:18 +
- . Google-, , . , Redmine .

Redmine, , : , , , -, .. , . , Redmine .


Redmine


->

:

  • (bug, feature)
  • (, , )
  • , , , wiki,
  • (SVN, Git, Mercurial)

Mercurial


->

- .


Web- . Mysql Apache.


,
HowTo Install Redmine 1.2.x with Mercurial and Subversion on Ubuntu Server 10.04.


Redmine Installation Guide.

Ubuntu Server 16.04. .

, . LAMP server:

$ sudo tasksel install lamp-server

root- MySQL ( root ).

MySQL redmine . [password] .

$ mysql -u root -p
(  root   MySQL)
> create database redmine character set utf8;
> create user 'redmine'@'localhost' identified by '[password]';
> grant all privileges on redmine.* to 'redmine'@'localhost';
> exit

Redmine www.redmine.org/projects/redmine/wiki/Download

$ wget http://www.redmine.org/releases/redmine-3.3.3.tar.gz

Redmine /usr/share/redmine. config config/database.yml.example config/database.yml. , production :

$ sudo cp /usr/share/redmine/config/database.yml.example /usr/share/redmine/config/database.yml
$ sudo nano /usr/share/redmine/config/database.yml

(ctrl+x):

production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: redmine
  password: "[password]"
  encoding: utf8

:

$ sudo apt install ruby ruby-dev build-essential libmysqlclient-dev

Bundler:

$ gem install bundler

gems, Redmine:

$ cd /usr/share/redmine
$ bundle install --without development test rmagick

, Rails cookie:

$ cd /usr/share/redmine
$ bundle exec rake generate_secret_token

( /usr/share/redmine):

$ RAILS_ENV=production bundle exec rake db:migrate
$ RAILS_ENV=production bundle exec rake redmine:load_default_data

:

$ cd /usr/share/redmine
$ sudo chown -R www-data:www-data files log tmp public/plugin_assets
$ sudo chmod -R 755 files log tmp public/plugin_assets

Redmine - WEBrick:

$ sudo -u www-data bundle exec rails server webrick -e production

WEBrick Redmine http://localhost:3000/

Apache


Passenger:

$ sudo apt-get install libapache2-mod-passenger

public Redmine:

$ sudo ln -s /usr/share/redmine/public /var/www/redmine

Passenger , :

$ sudo nano /etc/apache2/mods-available/passenger.conf

(ctrl+x):

PassengerDefaultUser www-data

:


  PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
  PassengerDefaultRuby /usr/bin/ruby
  PassengerDefaultUser www-data

redmine.conf apache:

$ sudo nano /etc/apache2/sites-available/redmine.conf 

(ctrl+x):


        ServerAdmin webmaster@localhost
        DocumentRoot /var/www
        ServerName myservername

        RewriteEngine on
        RewriteRule   ^/$  /redmine  [R]

        var/www/redmine>
                RailsBaseURI /redmine
                PassengerResolveSymlinksInDocumentRoot on
        

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined

Passenger Rewite:

$ sudo a2enmod passenger
$ sudo a2enmod rewrite

default redmine:

$ sudo a2dissite 000-default
$ sudo a2ensite redmine

/tmp/cache Redmine:

sudo chmod 777 /usr/share/redmine/tmp/cache

Apache:

$ sudo service apache2 reload

http://[my site or ip]/redmine http://[my site or ip]. Redmine.

Mercurial


:

$ sudo apt-get install mercurial libapache2-mod-perl2 libapache-dbi-perl libdbd-mysql-perl

, :

$ sudo mkdir -p /var/hg/

http . cgi-:

$ sudo nano /var/hg/hgwebdir.cgi

:

#!/usr/bin/python
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb.hgwebdir_mod import hgwebdir
import mercurial.hgweb.wsgicgi as wsgicgi
application = hgwebdir('hgweb.config')
wsgicgi.launch(application)

hgweb.config:

$ sudo nano /var/hg/hgweb.config

:

[paths]
/=/var/hg/**
[web]
allow_push = *
push_ssl = false
allowbz2 = yes
allowgz = yes
allowzip = yes

:

$ sudo chown -R www-data:www-data /var/hg/*
$ sudo chmod gu+x /var/hg/hgwebdir.cgi

conf Apache:

$ sudo nano /etc/apache2/conf-available/hg.conf

:

PerlLoadModule Apache2::Redmine
 ScriptAliasMatch ^/hg/(.*)  /var/hg/hgwebdir.cgi/$1

    var/hg>
      Options +ExecCGI
    

    hg>
        AuthType Basic
        AuthName "Mercurial" 
        Require valid-user
        AuthUserFile /dev/null

        #Redmine auth
        PerlAccessHandler Apache::Authn::Redmine::access_handler
        PerlAuthenHandler Apache::Authn::Redmine::authen_handler
        RedmineDSN "DBI:mysql:database=redmine;host=127.0.0.1" 
        RedmineDbUser "redmine" 
        RedmineDbPass "[password]" 
    

:

$ sudo ln -s /etc/apache2/conf-available/hg.conf /etc/apache2/conf-enabled/
$ sudo ln -s /usr/share/redmine/extra/svn/Redmine.pm /usr/lib/x86_64-linux-gnu/perl5/5.22/Apache2/

CGI Apache:

$ sudo a2enmod cgi
$ sudo service apache2 reload

http://[my site or ip]/hg/*. , project http://[my site or ip]/hg/project. project subproject1, http://[my site or ip]/hg/project/subproject1.

:

$ hg clone http://[my site or ip]/hg/project

( - Redmine), .

, .. ( ).

, /var/hg/ Identifier , Redmine ( -). Redmine , /var/hg/project. /var/hg (hg init).

, :

$ sudo chown -R www-data:www-data /var/hg/[repository name]

, . HowTo Install Redmine 1.2.x with Mercurial and Subversion on Ubuntu Server 10.04

email


Redmine ( / ..). email-. /usr/share/redmine/config/configuration.yml . .

, :

  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: "10.11.12.13"
      port: 25
      authentification: :none
      enable_starttls_auto: false
      openssl_verify_mode: 'none'

, configuration.yml . .

. . github.com/lpirl/redmine_diff_email.

. /usr/share/redmine/plugins/redmine_diff_email. /usr/share/redmine/app/views/repositories/_form.html.erb:

--- OLD
 +++ NEW
 @@ -23,6 +23,7 @@
    
    
  
 +
  
  


redmine. redmine-3.3
/usr/share/redmine/plugins/redmine_diff_email/db/migrate/002_add_repositories_is_diff_email_attached.rb. :

class AddRepositoriesIsDiffEmailAttached < ActiveRecord::Migration
  def self.up
    add_column :repositories, :is_diff_email_attached, :boolean, :default => false, :null => false
    Repository.update_all(["is_diff_email_attached = ?", true])
    Repository.update_all(["is_diff_email = ?", true])
  end

  def self.down
    remove_column :repositories, :is_diff_email_attached
  end
end

/usr/share/redmine :

bundle exec rake redmine:plugins:migrate RAILS_ENV=production

Redmine:

$ sudo service apache2 reload

, Administration -> Plugins Redmine Diff Email Plugin, - Redmine SomeProject -> Settings Tab -> Repositories Tab -> Edit .

, Redmine, . WS API key. :

* web- Redmine Administration Settings
* Repositories
* 'Enable WS for repository management'
* 'Generate a key'
* 'Save'

:

$ sudo nano /var/hg/fetch_changes

: ( [your API key] API-)

#!/bin/sh
curl "http://localhost/redmine/sys/fetch_changesets?key=[your API key]"  > /dev/null 2>&1

:

$ sudo chown www-data:www-data /var/hg/fetch_changes
$ sudo chmod ug+x /var/hg/fetch_changes

/var/hg/hgweb.config [hooks], fetch_changes :

[hooks]
changegroup = /var/hg/fetch_changes

Redmine .
Original source: habrahabr.ru (comments, light).

https://habrahabr.ru/post/331006/

:  

: [1] []
 

:
: 

: ( )

:

  URL