mirror of
https://github.com/internetee/registry.git
synced 2025-07-05 18:53:26 +02:00
Merge branch 'master' of github.com:internetee/registry
This commit is contained in:
commit
58f54c17e4
4 changed files with 12 additions and 2 deletions
|
@ -10,7 +10,7 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_sign_in_path_for(resource)
|
def after_sign_in_path_for(resource)
|
||||||
if resource.admin?
|
if REGISTRY_ENV == :admin && resource.admin?
|
||||||
(session[:user_return_to].nil?) ? admin_root_path : session[:user_return_to].to_s
|
(session[:user_return_to].nil?) ? admin_root_path : session[:user_return_to].to_s
|
||||||
else
|
else
|
||||||
(session[:user_return_to].nil?) ? client_root_path : session[:user_return_to].to_s
|
(session[:user_return_to].nil?) ? client_root_path : session[:user_return_to].to_s
|
||||||
|
|
|
@ -6,7 +6,7 @@ class Ability
|
||||||
alias_action :create, :read, :update, :destroy, :to => :crud
|
alias_action :create, :read, :update, :destroy, :to => :crud
|
||||||
|
|
||||||
user ||= User.new
|
user ||= User.new
|
||||||
if user.admin?
|
if REGISTRY_ENV == :admin && user.admin?
|
||||||
can :manage, Domain
|
can :manage, Domain
|
||||||
can :switch, :registrar
|
can :switch, :registrar
|
||||||
can :crud, DomainTransfer
|
can :crud, DomainTransfer
|
||||||
|
|
|
@ -15,9 +15,14 @@ set :deploy_to, '/home/app/registry'
|
||||||
set :repository, 'https://github.com/internetee/registry'
|
set :repository, 'https://github.com/internetee/registry'
|
||||||
set :branch, 'master'
|
set :branch, 'master'
|
||||||
|
|
||||||
|
task :admin do
|
||||||
|
set :deploy_to, '/home/app/admin-registry'
|
||||||
|
end
|
||||||
|
|
||||||
# Manually create these paths in shared/ (eg: shared/config/database.yml) in your server.
|
# Manually create these paths in shared/ (eg: shared/config/database.yml) in your server.
|
||||||
# They will be linked in the 'deploy:link_shared_paths' step.
|
# They will be linked in the 'deploy:link_shared_paths' step.
|
||||||
set :shared_paths, [
|
set :shared_paths, [
|
||||||
|
'config/initializers/env.rb',
|
||||||
'config/database.yml',
|
'config/database.yml',
|
||||||
'config/secrets.yml',
|
'config/secrets.yml',
|
||||||
'log',
|
'log',
|
||||||
|
@ -49,6 +54,9 @@ task setup: :environment do
|
||||||
queue! %(mkdir -p "#{deploy_to}/shared/config")
|
queue! %(mkdir -p "#{deploy_to}/shared/config")
|
||||||
queue! %(chmod g+rx,u+rwx "#{deploy_to}/shared/config")
|
queue! %(chmod g+rx,u+rwx "#{deploy_to}/shared/config")
|
||||||
|
|
||||||
|
queue! %(mkdir -p "#{deploy_to}/shared/config/initializers")
|
||||||
|
queue! %(chmod g+rx,u+rwx "#{deploy_to}/shared/config/initializers")
|
||||||
|
|
||||||
queue! %(mkdir -p "#{deploy_to}/shared/public")
|
queue! %(mkdir -p "#{deploy_to}/shared/public")
|
||||||
queue! %(chmod g+rx,u+rwx "#{deploy_to}/shared/public")
|
queue! %(chmod g+rx,u+rwx "#{deploy_to}/shared/public")
|
||||||
|
|
||||||
|
|
2
config/initializers/env.rb
Normal file
2
config/initializers/env.rb
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# options: :admin, :client
|
||||||
|
REGISTRY_ENV = :client
|
Loading…
Add table
Add a link
Reference in a new issue