ocean-rails 7.3.0 → 7.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/ocean_setup/ocean_setup_generator.rb +12 -3
- data/lib/generators/ocean_setup/templates/Dockerfile +3 -1
- data/lib/generators/ocean_setup/templates/config.yml +0 -4
- data/lib/generators/ocean_setup/templates/env +3 -5
- data/lib/generators/ocean_setup/templates/puma.rb +1 -1
- data/lib/ocean/api.rb +4 -4
- data/lib/ocean/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ee546b0b0c2b9c6a04425b1ac672389b82fd08fcf55a667b677864513ed514f
|
4
|
+
data.tar.gz: ae8d95eaccc0f63a052b1805e84563677f22bf47614e595a48b3f03b6f68351b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6a34a0c53ae708c5c383d8c8467fc018f822f2076fea6d2f2740533ed7e9b5c6b5aa60cfb149b6ac829ff1131279e69b3bf1555ad2036c3f28b31db24ca00ca
|
7
|
+
data.tar.gz: 37ea558d5140a78c66e9adabda5a52537874ee43289765e606afe76eb7a62fb96190c4090cce35630f7dc4746208352efa2d6ff2b669167823dfd0a99daa0ecd
|
@@ -9,7 +9,6 @@ class OceanSetupGenerator < Rails::Generators::NamedBase #:nodoc: all
|
|
9
9
|
remove_file "#{Rails.root}/config/locales"
|
10
10
|
remove_file "#{Rails.root}/public"
|
11
11
|
remove_file "#{Rails.root}/config/initializers/session_store.rb"
|
12
|
-
#remove_file "#{Rails.root}/config/initializers/secret_token.rb"
|
13
12
|
remove_file "#{Rails.root}/test"
|
14
13
|
remove_file "#{Rails.root}/vendor/assets"
|
15
14
|
remove_file "#{Rails.root}/vendor/plugins"
|
@@ -75,6 +74,16 @@ class OceanSetupGenerator < Rails::Generators::NamedBase #:nodoc: all
|
|
75
74
|
"
|
76
75
|
end
|
77
76
|
|
77
|
+
def setup_console_logging
|
78
|
+
application "# We want to set up a custom logger which logs to STDOUT.
|
79
|
+
# Docker expects your application to log to STDOUT/STDERR and to be run
|
80
|
+
# in the foreground.
|
81
|
+
config.log_level = ENV.fetch('LOG_LEVEL', :debug)
|
82
|
+
config.log_tags = [:uuid]
|
83
|
+
config.logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
|
84
|
+
"
|
85
|
+
end
|
86
|
+
|
78
87
|
def install_config_yml_files
|
79
88
|
copy_file "config.yml", "#{Rails.root}/config/config.yml"
|
80
89
|
end
|
@@ -102,12 +111,12 @@ class OceanSetupGenerator < Rails::Generators::NamedBase #:nodoc: all
|
|
102
111
|
end
|
103
112
|
|
104
113
|
def setup_docker
|
105
|
-
|
114
|
+
template "Dockerfile", "#{Rails.root}/Dockerfile"
|
106
115
|
copy_file "dockerignore", "#{Rails.root}/.dockerignore"
|
107
116
|
end
|
108
117
|
|
109
118
|
def setup_dotenv_file
|
110
|
-
|
119
|
+
template "env", "#{Rails.root}.env"
|
111
120
|
end
|
112
121
|
|
113
122
|
end
|
@@ -23,7 +23,3 @@ API_VERSIONS: <%= ENV['API_VERSIONS'] %>
|
|
23
23
|
|
24
24
|
# This is the list of IP numbers for the Varnish instances. (For PURGE and BAN.)
|
25
25
|
VARNISH_CACHES: <%= ENV['VARNISH_CACHES'] %>
|
26
|
-
|
27
|
-
# The password regex and error message
|
28
|
-
PASSWORD_REGEXP: <%= ENV['PASSWORD_REGEXP'] %>
|
29
|
-
PASSWORD_MSG: <%= ENV['PASSWORD_MSG'] %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# config.yml
|
2
2
|
OCEAN_ENV=dev
|
3
|
-
APP_NAME
|
4
|
-
API_USER
|
3
|
+
APP_NAME=<%= class_name.underscore %>
|
4
|
+
API_USER=<%= class_name.underscore %>
|
5
5
|
API_PASSWORD=xxxxxxxxxx
|
6
6
|
BASE_DOMAIN=example.com
|
7
7
|
OCEAN_API_HOST=dev-api.example.com
|
@@ -9,8 +9,6 @@ OCEAN_API_URL=http://dev-api.example.com
|
|
9
9
|
INTERNAL_OCEAN_API_URL=http://dev-api.example.com
|
10
10
|
API_VERSIONS={"_default":"v1"}
|
11
11
|
VARNISH_CACHES=[]
|
12
|
-
PASSWORD_REGEXP="\A[A-zA-z0-9_!\?*%&/-]{6,}\z"
|
13
|
-
PASSWORD_MSG="should be at least 6 characters long and contain only the characters A-Z, a-z, 0-9, and _!?/*%&-"
|
14
12
|
|
15
13
|
# DB and AWS services
|
16
14
|
RAILS_MAX_THREADS=5
|
@@ -19,7 +17,7 @@ SQL_DB_ADAPTER=mysql2
|
|
19
17
|
SQL_CONNECTION_POOL_SIZE=20
|
20
18
|
SQL_HOST=docker.for.mac.localhost
|
21
19
|
SQL_PORT=3306
|
22
|
-
SQL_DATABASE
|
20
|
+
SQL_DATABASE=<%= class_name.underscore %>
|
23
21
|
SQL_USERNAME=root
|
24
22
|
SQL_PASSWORD=thepassword
|
25
23
|
AWS_REGION=eu-west-1
|
data/lib/ocean/api.rb
CHANGED
@@ -43,10 +43,10 @@ class Api
|
|
43
43
|
def self.adorn_basename(basename, ocean_env: "dev", rails_env: "development",
|
44
44
|
suffix_only: false)
|
45
45
|
fullname = suffix_only ? "_#{ocean_env}" : "#{basename}_#{ocean_env}"
|
46
|
-
if rails_env != 'production' || ocean_env == 'dev' || ocean_env == 'ci'
|
47
|
-
|
48
|
-
|
49
|
-
end
|
46
|
+
# if rails_env != 'production' || ocean_env == 'dev' || ocean_env == 'ci'
|
47
|
+
# local_ip = UDPSocket.open {|s| s.connect("64.233.187.99", 1); s.addr.last}.gsub('.', '-')
|
48
|
+
# fullname += "_#{local_ip}_#{rails_env}"
|
49
|
+
# end
|
50
50
|
fullname
|
51
51
|
end
|
52
52
|
|
data/lib/ocean/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ocean-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Bengtson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|