Merge branch 'master' of github.com:internetee/registry

This commit is contained in:
Andres Keskküla 2014-09-22 11:02:24 +03:00
commit 9cc6fed5f2
15 changed files with 217 additions and 56 deletions

0
.dockerignore Normal file
View file

45
Dockerfile Normal file
View file

@ -0,0 +1,45 @@
# FROM gitlab/registry
FROM slimmed
MAINTAINER Gitlab <info@gitlab.eu>
# Initial build
# SSH authorized keys setup
# ADD ./doc/docker/ssh/authorized_keys /root/.ssh/authorized_keys
#
# Apache2 setup
# ADD ./doc/docker/apache2/ /etc/apache2/sites-enabled
# Use baseimage-docker's init process.
CMD ["/sbin/my_init"]
# Set correct environment variables.
ENV RAILS_ENV production
ENV HOME /home/app
# Registry
WORKDIR /home/app/registry
ADD . /home/app/registry
RUN chown -R app:www-data .; chmod -R 750 .; chmod g+s .; umask 027
RUN setuser app ls -la /home/app/registry/vendor/
# RUN setuser app ls -la /home/app/registry/vendor/bundle
RUN rm /home/app/registry/vendor/bundle -rf
RUN setuser app bundle install --deployment
RUN setuser app rake assets:precompile
# Registry test
WORKDIR /home/app/registry-test
ADD . /home/app/registry-test
RUN chown -R app:www-data .; chmod -R 750 .; chmod g+s .; umask 027
RUN setuser app bundle install
# Ports
# Registry admin:
EXPOSE 80
# EPP:
EXPOSE 700
# Test env what jenkins uses
# for debugging only:
# EXPOSE 81
# Clean up when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

View file

@ -80,6 +80,7 @@ group :development, :test do
gem 'capybara', '~> 2.4.1'
# For feature testing
# gem 'capybara-webkit', '1.2.0' # Webkit driver didn't work with turbolinks
gem 'phantomjs-binaries', '~> 1.9.2.4'
gem 'phantomjs', '~> 1.9.7.1', require: 'phantomjs/poltergeist'
gem 'poltergeist', '~> 1.5.1' # We are using PhantomJS instead
@ -108,3 +109,4 @@ group :development, :test do
# For unique IDs (used by the epp gem)
gem 'uuidtools', '~> 2.1.4'
end

View file

@ -29,7 +29,9 @@ GEM
tzinfo (~> 1.1)
arel (5.0.1.20140414130214)
ast (2.0.0)
bootstrap-sass (3.2.0.1)
astrolabe (1.3.0)
parser (>= 2.2.0.pre.3, < 3.0)
bootstrap-sass (3.2.0.2)
sass (~> 3.2)
builder (3.2.2)
byebug (2.7.0)
@ -41,17 +43,17 @@ GEM
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
celluloid (0.15.2)
timers (~> 1.1.0)
celluloid (0.16.0)
timers (~> 4.0.0)
cliver (0.3.2)
coderay (1.1.0)
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
coffee-script (2.2.0)
coffee-script (2.3.0)
coffee-script-source
execjs
coffee-script-source (1.7.0)
coffee-script-source (1.8.0)
columnize (0.8.9)
database_cleaner (1.3.0)
debugger-linecache (1.2.0)
@ -60,7 +62,7 @@ GEM
hpricot
libxml-ruby
erubis (2.7.0)
execjs (2.2.0)
execjs (2.2.1)
fabrication (2.11.3)
faker (1.3.0)
i18n (~> 0.5)
@ -86,13 +88,14 @@ GEM
haml (>= 3.1, < 5.0)
railties (>= 4.0.1)
hike (1.2.3)
hitimes (1.2.2)
hpricot (0.8.6)
i18n (0.6.11)
isikukood (0.1.2)
jbuilder (2.1.1)
jbuilder (2.1.3)
activesupport (>= 3.0.0, < 5)
multi_json (~> 1.2)
jquery-rails (3.1.0)
jquery-rails (3.1.2)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.1)
@ -100,7 +103,7 @@ GEM
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
kgio (2.9.2)
libv8 (3.16.14.3)
libv8 (3.16.14.5)
libxml-ruby (2.7.0)
listen (2.7.9)
celluloid (>= 0.15.2)
@ -113,7 +116,7 @@ GEM
method_source (0.8.2)
mime-types (1.25.1)
mini_portile (0.6.0)
minitest (5.4.0)
minitest (5.4.1)
multi_json (1.10.1)
nokogiri (1.6.2.1)
mini_portile (= 0.6.0)
@ -123,6 +126,8 @@ GEM
slop (~> 3.4, >= 3.4.5)
pg (0.17.1)
phantomjs (1.9.7.1)
phantomjs-binaries (1.9.2.4)
sys-uname (= 0.9.0)
poltergeist (1.5.1)
capybara (~> 2.1)
cliver (~> 0.3.1)
@ -169,7 +174,7 @@ GEM
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rdoc (4.1.1)
rdoc (4.1.2)
json (~> 1.4)
ref (1.0.5)
rspec (3.0.0)
@ -192,7 +197,8 @@ GEM
rspec-mocks (~> 3.0.0)
rspec-support (~> 3.0.0)
rspec-support (3.0.4)
rubocop (0.25.0)
rubocop (0.26.0)
astrolabe (~> 1.3)
parser (>= 2.2.0.pre.4, < 3.0)
powerpack (~> 0.0.6)
rainbow (>= 1.99.1, < 3.0)
@ -204,10 +210,10 @@ GEM
sass (~> 3.2.0)
sprockets (~> 2.8, <= 2.11.0)
sprockets-rails (~> 2.0)
sdoc (0.4.0)
json (~> 1.8)
rdoc (~> 4.0, < 5.0)
shoulda-matchers (2.6.1)
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
shoulda-matchers (2.6.2)
activesupport (>= 3.0.0)
simpleidn (0.0.5)
slop (3.6.0)
@ -217,32 +223,35 @@ GEM
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.1.3)
sprockets-rails (2.1.4)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
sys-uname (0.9.0)
ffi (>= 1.0.0)
therubyracer (0.12.1)
libv8 (~> 3.16.14.0)
ref
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
timers (1.1.0)
timers (4.0.1)
hitimes
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
turbolinks (2.2.2)
turbolinks (2.3.0)
coffee-rails
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.5.1)
uglifier (2.5.3)
execjs (>= 0.3.0)
json (>= 1.8.0)
unicorn (4.8.3)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
uuidtools (2.1.4)
uuidtools (2.1.5)
websocket-driver (0.3.4)
xpath (2.0.0)
nokogiri (~> 1.3)
@ -270,6 +279,7 @@ DEPENDENCIES
nprogress-rails (~> 0.1.3.1)
pg
phantomjs (~> 1.9.7.1)
phantomjs-binaries (~> 1.9.2.4)
poltergeist (~> 1.5.1)
pry (~> 0.10.1)
pry-byebug (~> 1.3.3)

View file

@ -13,7 +13,7 @@ require 'sprockets/railtie'
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Internetee
module Registry
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers

View file

@ -3,13 +3,17 @@ default: &default
adapter: postgresql
encoding: unicode
pool: 5
username: internetee
password: internetee_pwd
username: registry
password: registry_pwd
development:
<<: *default
database: internetee_development
database: registry_development
test:
<<: *default
database: internetee_test
database: registry_test
production:
<<: *default
database: registry_production

View file

@ -1 +1 @@
Internetee::Application.config.autoload_paths += %W(#{Internetee::Application.config.root}/app/validators/)
Registry::Application.config.autoload_paths += %W(#{Registry::Application.config.root}/app/validators/)

View file

@ -1,3 +1,3 @@
# Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_internetee_session'
Rails.application.config.session_store :cookie_store, key: '_registry_session'

View file

@ -5,4 +5,4 @@ test:
secret_key_base: generate-your-secret-key-by-rake-secret
production:
secret_key_base:
secret_key_base: please-change

View file

@ -0,0 +1,18 @@
Listen 8888
<VirtualHost *:8888>
ServerName registry.gitlab.eu
ServerAdmin info@gitlab.eu
PassengerEnabled on
RailsEnv production
DocumentRoot /home/app/epp-tester/public
ErrorLog /var/log/apache2/epp-tester.error.log
LogLevel info ssl:warn
CustomLog /var/log/apache2/epp-tester.access.log combined
<Directory /home/app/epp-tester/public>
Require all granted
Options -MultiViews
</Directory>
</VirtualHost>

View file

@ -0,0 +1,21 @@
<IfModule mod_epp.c>
Listen 700
<VirtualHost *:700>
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
SSLVerifyClient optional_no_ca
EPPEngine On
EPPCommandRoot /proxy/command
EPPSessionRoot /proxy/session
EPPErrorRoot /proxy/error
ProxyPass /proxy/ http://localhost:80/epp/
EPPAuthURI implicit
EPPReturncodeHeader X-EPP-Returncode
</VirtualHost>
</IfModule>

View file

@ -0,0 +1,39 @@
Listen 81
<VirtualHost *:81>
ServerAdmin info@gitlab.eu
PassengerEnabled on
RailsEnv test
DocumentRoot /home/app/registry-test/public
ErrorLog /var/log/apache2/registry-test.error.log
LogLevel info ssl:warn
CustomLog /var/log/apache2/registry-test.access.log combined
<Directory /home/app/registry-test/public>
Require all granted
Options -MultiViews
</Directory>
</VirtualHost>
<IfModule mod_epp.c>
Listen 701
<VirtualHost *:701>
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
SSLVerifyClient optional_no_ca
EPPEngine On
EPPCommandRoot /proxy/command
EPPSessionRoot /proxy/session
EPPErrorRoot /proxy/error
ProxyPass /proxy/ http://localhost:81/epp/
EPPAuthURI implicit
EPPReturncodeHeader X-EPP-Returncode
</VirtualHost>
</IfModule>

View file

@ -0,0 +1,17 @@
<VirtualHost *:80>
ServerName registry.gitlab.eu
ServerAdmin info@gitlab.eu
PassengerEnabled on
RailsEnv production
DocumentRoot /home/app/registry/public
ErrorLog /var/log/apache2/registry.error.log
LogLevel info ssl:warn
CustomLog /var/log/apache2/registry.access.log combined
<Directory /home/app/registry/public>
Require all granted
Options -MultiViews
</Directory>
</VirtualHost>

3
doc/docker/ssh/authorized_keys Executable file
View file

@ -0,0 +1,3 @@
ssh-rs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zFi1LDtq1aIrqWrczKaJGSryxSba6pnYiK69MTojF/SAXMsJ1u5q1P andres.kesk@gmail.com

View file

@ -1,3 +1,4 @@
if Rails.env.test?
require 'rspec/core/rake_task'
require 'open3'
@ -33,3 +34,4 @@ def test_against_server
`kill #{pid}`
end
end
end