Commit a243424c authored by nepalole's avatar nepalole
Browse files

Dockerizing Redmine

parents
Pipeline #119 failed with stages

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
FROM mysql:5.7
ADD ./redmine.sql /docker-entrypoint-initdb.d
EXPOSE 3306
This diff is collapsed.
version: '3.1'
services:
db:
build:
context: ./database
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: redmine
volumes:
- mysqldata:/var/lib/mysql
redmine:
image: redmine
restart: always
ports:
- 8080:3000
environment:
REDMINE_DB_MYSQL: db
REDMINE_DB_PASSWORD: example
volumes:
- ./redmine/files:/usr/src/redmine/files
volumes:
mysqldata:
version: '3.1'
services:
redmine:
image: redmine
restart: always
ports:
- 8080:3000
environment:
REDMINE_DB_MYSQL: db
REDMINE_DB_PASSWORD: example
volumes:
- ./redmine/files:/usr/src/redmine/files
db:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: redmine
volumes:
- ./mysql/redmine:/var/lib/mysql/redmine
version: '3.1'
services:
db:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: redmine
MYSQL_USER: redmine_user
MYSQL_PASSWORD: redmine
redmine:
depends_on:
- db
image: redmine
restart: always
ports:
- 8080:3000
environment:
REDMINE_DB_MYSQL: db
REDMINE_DB_USERNAME: redmine
REDMINE_DB_PASSWORD: example
/.project
/.loadpath
/.powrc
/.rvmrc
/config/additional_environment.rb
/config/configuration.yml
/config/database.yml
/config/email.yml
/config/secrets.yml
/config/initializers/session_store.rb
/config/initializers/secret_token.rb
/coverage
/db/*.db
/db/*.sqlite3
/db/schema.rb
/files/*
/lib/redmine/scm/adapters/mercurial/redminehelper.pyc
/lib/redmine/scm/adapters/mercurial/redminehelper.pyo
/log/*.log*
/log/mongrel_debug
/plugins/*
!/plugins/README
/public/dispatch.*
/public/plugin_assets/*
/public/themes/*
!/public/themes/alternate
!/public/themes/classic
!/public/themes/README
/tmp/*
/tmp/cache/*
/tmp/pdf/*
/tmp/sessions/*
/tmp/sockets/*
/tmp/test/*
/tmp/thumbnails/*
/vendor/cache
*.rbc
/.bundle
/Gemfile.lock
/Gemfile.local
syntax: glob
.project
.loadpath
.powrc
.rvmrc
config/additional_environment.rb
config/configuration.yml
config/database.yml
config/email.yml
config/secrets.yml
config/initializers/session_store.rb
config/initializers/secret_token.rb
coverage
db/*.db
db/*.sqlite3
db/schema.rb
files/*
lib/redmine/scm/adapters/mercurial/redminehelper.pyc
lib/redmine/scm/adapters/mercurial/redminehelper.pyo
log/*.log*
log/mongrel_debug
public/dispatch.*
public/plugin_assets/*
tmp/*
tmp/cache/*
tmp/pdf/*
tmp/sessions/*
tmp/sockets/*
tmp/test/*
tmp/thumbnails/*
vendor/cache
*.rbc
.svn/
.git/
.bundle
Gemfile.lock
Gemfile.local
class <%= class_name %> < ActiveRecord::Migration
def self.up
create_table :open_id_authentication_associations, :force => true do |t|
t.integer :issued, :lifetime
t.string :handle, :assoc_type
t.binary :server_url, :secret
end
create_table :open_id_authentication_nonces, :force => true do |t|
t.integer :timestamp, :null => false
t.string :server_url, :null => true
t.string :salt, :null => false
end
end
def self.down
drop_table :open_id_authentication_associations
drop_table :open_id_authentication_nonces
end
end
# Redmine - project management software
# Copyright (C) 2006-2016 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../../../test_helper', __FILE__)
class Redmine::CodesetUtilTest < ActiveSupport::TestCase
def test_to_utf8_by_setting_from_latin1
with_settings :repositories_encodings => 'UTF-8,ISO-8859-1' do
s1 = "Texte encod\xc3\xa9".force_encoding("UTF-8")
s2 = "Texte encod\xe9".force_encoding("ASCII-8BIT")
s3 = s2.dup.force_encoding("UTF-8")
assert_equal s1, Redmine::CodesetUtil.to_utf8_by_setting(s2)
assert_equal s1, Redmine::CodesetUtil.to_utf8_by_setting(s3)
end
end
def test_to_utf8_by_setting_from_euc_jp
with_settings :repositories_encodings => 'UTF-8,EUC-JP' do
s1 = "\xe3\x83\xac\xe3\x83\x83\xe3\x83\x89\xe3\x83\x9e\xe3\x82\xa4\xe3\x83\xb3".force_encoding("UTF-8")
s2 = "\xa5\xec\xa5\xc3\xa5\xc9\xa5\xde\xa5\xa4\xa5\xf3".force_encoding("ASCII-8BIT")
s3 = s2.dup.force_encoding("UTF-8")
assert_equal s1, Redmine::CodesetUtil.to_utf8_by_setting(s2)
assert_equal s1, Redmine::CodesetUtil.to_utf8_by_setting(s3)
end
end
def test_to_utf8_by_setting_should_be_converted_all_latin1
with_settings :repositories_encodings => 'ISO-8859-1' do
s1 = "\xc3\x82\xc2\x80".force_encoding("UTF-8")
s2 = "\xC2\x80".force_encoding("ASCII-8BIT")
s3 = s2.dup.force_encoding("UTF-8")
assert_equal s1, Redmine::CodesetUtil.to_utf8_by_setting(s2)
assert_equal s1, Redmine::CodesetUtil.to_utf8_by_setting(s3)
end
end
def test_to_utf8_by_setting_blank_string
assert_equal "", Redmine::CodesetUtil.to_utf8_by_setting("")
assert_nil Redmine::CodesetUtil.to_utf8_by_setting(nil)
end
def test_to_utf8_by_setting_returns_ascii_as_utf8
s1 = "ASCII".force_encoding("UTF-8")
s2 = s1.dup.force_encoding("ISO-8859-1")
str1 = Redmine::CodesetUtil.to_utf8_by_setting(s1)
str2 = Redmine::CodesetUtil.to_utf8_by_setting(s2)
assert_equal s1, str1
assert_equal s1, str2
assert_equal "UTF-8", str1.encoding.to_s
assert_equal "UTF-8", str2.encoding.to_s
end
def test_to_utf8_by_setting_invalid_utf8_sequences_should_be_stripped
with_settings :repositories_encodings => '' do
# s1 = File.read("#{RAILS_ROOT}/test/fixtures/encoding/iso-8859-1.txt")
s1 = "Texte encod\xe9 en ISO-8859-1.".force_encoding("ASCII-8BIT")
str = Redmine::CodesetUtil.to_utf8_by_setting(s1)
assert str.valid_encoding?
assert_equal "UTF-8", str.encoding.to_s
assert_equal "Texte encod? en ISO-8859-1.", str
end
end
def test_to_utf8_by_setting_invalid_utf8_sequences_should_be_stripped_ja_jis
with_settings :repositories_encodings => 'ISO-2022-JP' do
s1 = "test\xb5\xfetest\xb5\xfe".force_encoding("ASCII-8BIT")
str = Redmine::CodesetUtil.to_utf8_by_setting(s1)
assert str.valid_encoding?
assert_equal "UTF-8", str.encoding.to_s
assert_equal "test??test??", str
end
end
end
namespace :test do
desc 'Measures test coverage'
task :coverage do
rm_f "coverage"
ENV["COVERAGE"] = "1"
Rake::Task["test"].invoke
end
desc 'Run unit and functional scm tests'
task :scm do
errors = %w(test:scm:units test:scm:functionals).collect do |task|
begin
Rake::Task[task].invoke
nil
rescue => e
task
end
end.compact
abort "Errors running #{errors.to_sentence(:locale => :en)}!" if errors.any?
end
namespace :scm do
namespace :setup do
desc "Creates directory for test repositories"
task :create_dir => :environment do
FileUtils.mkdir_p Rails.root + '/tmp/test'
end
supported_scms = [:subversion, :cvs, :bazaar, :mercurial, :git, :darcs, :filesystem]
desc "Creates a test subversion repository"
task :subversion => :create_dir do
repo_path = "tmp/test/subversion_repository"
unless File.exists?(repo_path)
system "svnadmin create #{repo_path}"
system "gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load #{repo_path}"
end
end
desc "Creates a test mercurial repository"
task :mercurial => :create_dir do
repo_path = "tmp/test/mercurial_repository"
unless File.exists?(repo_path)
bundle_path = "test/fixtures/repositories/mercurial_repository.hg"
system "hg init #{repo_path}"
system "hg -R #{repo_path} pull #{bundle_path}"
end
end
def extract_tar_gz(prefix)
unless File.exists?("tmp/test/#{prefix}_repository")
# system "gunzip < test/fixtures/repositories/#{prefix}_repository.tar.gz | tar -xv -C tmp/test"
system "tar -xvz -C tmp/test -f test/fixtures/repositories/#{prefix}_repository.tar.gz"
end
end
(supported_scms - [:subversion, :mercurial]).each do |scm|
desc "Creates a test #{scm} repository"
task scm => :create_dir do
extract_tar_gz(scm)
end
end
desc "Creates all test repositories"
task :all => supported_scms
end
desc "Updates installed test repositories"
task :update => :environment do
require 'fileutils'
Dir.glob("tmp/test/*_repository").each do |dir|
next unless File.basename(dir) =~ %r{^(.+)_repository$} && File.directory?(dir)
scm = $1
next unless fixture = Dir.glob("test/fixtures/repositories/#{scm}_repository.*").first
next if File.stat(dir).ctime > File.stat(fixture).mtime
FileUtils.rm_rf dir
Rake::Task["test:scm:setup:#{scm}"].execute
end
end
Rake::TestTask.new(:units => "db:test:prepare") do |t|
t.libs << "test"
t.verbose = true
t.test_files = FileList['test/unit/repository*_test.rb'] + FileList['test/unit/lib/redmine/scm/**/*_test.rb']
end
Rake::Task['test:scm:units'].comment = "Run the scm unit tests"
Rake::TestTask.new(:functionals => "db:test:prepare") do |t|
t.libs << "test"
t.verbose = true
t.test_files = FileList['test/functional/repositories*_test.rb']
end
Rake::Task['test:scm:functionals'].comment = "Run the scm functional tests"
end
Rake::TestTask.new(:routing) do |t|
t.libs << "test"
t.verbose = true
t.test_files = FileList['test/integration/routing/*_test.rb'] + FileList['test/integration/api_test/*_routing_test.rb']
end
Rake::Task['test:routing'].comment = "Run the routing tests"
Rake::TestTask.new(:ui => "db:test:prepare") do |t|
t.libs << "test"
t.verbose = true
t.test_files = FileList['test/ui/**/*_test_ui.rb']
end
Rake::Task['test:ui'].comment = "Run the UI tests with Capybara (PhantomJS listening on port 4444 is required)"
end
/* Turkish initialisation for the jQuery UI date picker plugin. */
/* Written by Izzet Emre Erkan (kara@karalamalar.net). */
(function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
define([ "../datepicker" ], factory );
} else {
// Browser globals
factory( jQuery.datepicker );
}
}(function( datepicker ) {
datepicker.regional['tr'] = {
closeText: 'kapat',
prevText: '&#x3C;geri',
nextText: 'ileri&#x3e',
currentText: 'bugün',
monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran',
'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'],
monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz',
'Tem','Ağu','Eyl','Eki','Kas','Ara'],
dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'],
dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
weekHeader: 'Hf',
dateFormat: 'dd.mm.yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
datepicker.setDefaults(datepicker.regional['tr']);
return datepicker.regional['tr'];
}));
jsToolBar.strings = {};
jsToolBar.strings['Strong'] = 'Tučné';
jsToolBar.strings['Italic'] = 'Kurzíva';
jsToolBar.strings['Underline'] = 'Podčiarknuté';
jsToolBar.strings['Deleted'] = 'Preškrtnuté';
jsToolBar.strings['Code'] = 'Zobrazenie kódu';
jsToolBar.strings['Heading 1'] = 'Nadpis 1';
jsToolBar.strings['Heading 2'] = 'Nadpis 2';
jsToolBar.strings['Heading 3'] = 'Nadpis 3';
jsToolBar.strings['Unordered list'] = 'Odrážkový zoznam';
jsToolBar.strings['Ordered list'] = 'Číslovaný zoznam';
jsToolBar.strings['Quote'] = 'Odsadenie';
jsToolBar.strings['Unquote'] = 'Zrušiť odsadenie';
jsToolBar.strings['Preformatted text'] = 'Predformátovaný text';
jsToolBar.strings['Wiki link'] = 'Odkaz na wikistránku';
jsToolBar.strings['Image'] = 'Obrázok';
class AddCustomFieldsSearchable < ActiveRecord::Migration
def self.up
add_column :custom_fields, :searchable, :boolean, :default => false
end
def self.down
remove_column :custom_fields, :searchable
end
end
/* ***** BEGIN LICENSE BLOCK *****
* This file is part of DotClear.
* Copyright (c) 2005 Nicolas Martin & Olivier Meunier and contributors. All
* rights reserved.
*
* DotClear is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DotClear is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DotClear; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ***** END LICENSE BLOCK *****
*/
/* Modified by JP LANG for textile formatting */
// strong
jsToolBar.prototype.elements.strong = {
type: 'button',
title: 'Strong',
fn: {
wiki: function() { this.singleTag('*') }
}
}
// em
jsToolBar.prototype.elements.em = {
type: 'button',
title: 'Italic',
fn: {
wiki: function() { this.singleTag("_") }
}
}
// ins
jsToolBar.prototype.elements.ins = {
type: 'button',
title: 'Underline',
fn: {
wiki: function() { this.singleTag('+') }
}
}
// del
jsToolBar.prototype.elements.del = {
type: 'button',
title: 'Deleted',
fn: {
wiki: function() { this.singleTag('-') }
}
}
// code
jsToolBar.prototype.elements.code = {
type: 'button',
title: 'Code',
fn: {
wiki: function() { this.singleTag('@') }
}
}
// spacer
jsToolBar.prototype.elements.space1 = {type: 'space'}
// headings
jsToolBar.prototype.elements.h1 = {
type: 'button',
title: 'Heading 1',
fn: {
wiki: function() {
this.encloseLineSelection('h1. ', '',function(str) {
str = str.replace(/^h\d+\.\s+/, '')
return str;
});
}
}
}
jsToolBar.prototype.elements.h2 = {
type: 'button',
title: 'Heading 2',
fn: {
wiki: function() {
this.encloseLineSelection('h2. ', '',function(str) {
str = str.replace(/^h\d+\.\s+/, '')
return str;
});
}
}
}
jsToolBar.prototype.elements.h3 = {
type: 'button',
title: 'Heading 3',
fn: {
wiki: function() {
this.encloseLineSelection('h3. ', '',function(str) {
str = str.replace(/^h\d+\.\s+/, '')
return str;
});
}
}
}
// spacer
jsToolBar.prototype.elements.space2 = {type: 'space'}
// ul
jsToolBar.prototype.elements.ul = {