Skip to content

Commit

Permalink
Merge remote-tracking branch 'ecoportal/master' into ecoportal-ontopo…
Browse files Browse the repository at this point in the history
…rtal-reset
  • Loading branch information
syphax-bouazzouni committed May 27, 2024
2 parents b291578 + 289b1de commit b952877
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 92 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ gem 'json-ld'


# Rack middleware
gem 'ffi'
gem 'ffi', '~> 1.15.5'
gem 'rack-accept', '~> 0.4'
gem 'rack-attack', '~> 6.6.1', require: 'rack/attack'
gem 'rack-cache', '~> 1.13.0'
Expand Down Expand Up @@ -52,6 +52,7 @@ gem 'goo', github: 'ontoportal-lirmm/goo', branch: 'development'
gem 'sparql-client', github: 'ontoportal-lirmm/sparql-client', branch: 'development'
gem 'ontologies_linked_data', git: 'https://github.com/lifewatch-eric/ontologies_linked_data.git', branch: 'master'
gem 'ncbo_cron', git: 'https://github.com/lifewatch-eric/ncbo_cron.git', branch: 'master'
gem 'request_store'

group :development do
# bcrypt_pbkdf and ed35519 is required for capistrano deployments when using ed25519 keys; see https://github.com/miloserdow/capistrano-deploy/issues/42
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ DEPENDENCIES
cube-ruby
ed25519 (>= 1.2, < 2.0)
faraday (~> 1.9)
ffi
ffi (~> 1.15.5)
goo!
haml (~> 5.2.2)
json-ld
Expand Down
49 changes: 0 additions & 49 deletions config/deploy/appliance.rb

This file was deleted.

48 changes: 11 additions & 37 deletions config/deploy/production.rb
Original file line number Diff line number Diff line change
@@ -1,39 +1,13 @@
# Simple Role Syntax
# ==================
# Supports bulk-adding hosts to roles, the primary
# server in each group is considered to be the first
# unless any hosts have the primary property set.
# Don't declare `role :all`, it's a meta role
role :app, %w{[email protected]}
role :web, %w{[email protected]}
role :db, %w{[email protected]}
set :branch, 'master'
set :server, 'ecoportal.lifewatch.eu'

# Extended Server Syntax
# ======================
# This can be used to drop a more detailed server
# definition into the server list. The second argument
# something that quacks like a hash can be used to set
# extended properties on the server.
server 'example.com', user: 'deploy', roles: %w{web app}, my_property: :my_value
server fetch(:server), user: fetch(:user), roles: %w{web app}

# you can set custom ssh options
# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options
# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start)
# set it globally
# set :ssh_options, {
# keys: %w(/home/rlisowski/.ssh/id_rsa),
# forward_agent: false,
# auth_methods: %w(password)
# }
# and/or per server
# server 'example.com',
# user: 'user_name',
# roles: %w{web app},
# ssh_options: {
# user: 'user_name', # overrides user setting above
# keys: %w(/home/user_name/.ssh/id_rsa),
# forward_agent: false,
# auth_methods: %w(publickey password)
# # password: 'please use keys'
# }
# setting per server overrides global ssh_options
set :ssh_options, {
user: 'ontoportal',
forward_agent: 'true',
#keys: %w(config/deploy_id_rsa),
#auth_methods: %w(publickey),
# use ssh proxy if UI servers are on a private network
#proxy: Net::SSH::Proxy::Command.new('ssh [email protected] -W %h:%p')
}
6 changes: 3 additions & 3 deletions controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def sso_auth
}

user = instance_from_params(User, user_creation_params)
save_user(user)
save_user(user, send_notifications: true)
end
user
end
Expand All @@ -153,11 +153,11 @@ def create_user(send_notifications: true)
error 409, "User with username `#{params["username"]}` already exists" unless user.nil?
params.delete("role") unless current_user.admin?
user = instance_from_params(User, params)
save_user(user)
save_user(user, send_notifications: send_notifications)
reply 201, user
end

def save_user(user)
def save_user(user, send_notifications: true)
if user.valid?
user.save(send_notifications: send_notifications)
else
Expand Down
2 changes: 1 addition & 1 deletion test/controllers/test_identifier_request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def setup
hasOntologyLanguage: LinkedData::Models::OntologyFormat.find('OWL').first,
contact: [LinkedData::Models::Contact.new(email: '[email protected]', name: 'test').save],
released: DateTime.now, uploadFilePath: '',
URI: 'https://test.com/test',
URI: RDF::URI.new('https://test.com/test'),
status: 'production',
description: 'ontology description' ).save
end
Expand Down
1 change: 1 addition & 0 deletions test/controllers/test_users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def test_authentication
end

def test_oauth_authentication
skip
fake_responses = {
github: {
id: 123456789,
Expand Down

0 comments on commit b952877

Please sign in to comment.