|
|
|
|
@@ -2,27 +2,6 @@
|
|
|
|
|
# Cookbook:: kosmos-akkounts
|
|
|
|
|
# Recipe:: default
|
|
|
|
|
#
|
|
|
|
|
# The MIT License (MIT)
|
|
|
|
|
# Copyright:: 2020, Kosmos Developers
|
|
|
|
|
#
|
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
# of this software and associated documentation files (the "Software"), to deal
|
|
|
|
|
# in the Software without restriction, including without limitation the rights
|
|
|
|
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
# copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
# furnished to do so, subject to the following conditions:
|
|
|
|
|
#
|
|
|
|
|
# The above copyright notice and this permission notice shall be included in
|
|
|
|
|
# all copies or substantial portions of the Software.
|
|
|
|
|
#
|
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
|
# THE SOFTWARE.
|
|
|
|
|
#
|
|
|
|
|
require 'ipaddr'
|
|
|
|
|
|
|
|
|
|
app_name = "akkounts"
|
|
|
|
|
@@ -42,6 +21,7 @@ end
|
|
|
|
|
package "libpq-dev"
|
|
|
|
|
|
|
|
|
|
include_recipe 'kosmos-nodejs'
|
|
|
|
|
include_recipe "kosmos-redis"
|
|
|
|
|
|
|
|
|
|
npm_package "yarn" do
|
|
|
|
|
version "1.22.4"
|
|
|
|
|
@@ -54,7 +34,7 @@ rails_env = node.chef_environment == "development" ? "development" : "production
|
|
|
|
|
systemd_unit "akkounts.service" do
|
|
|
|
|
content({
|
|
|
|
|
Unit: {
|
|
|
|
|
Description: "Kosmos account management",
|
|
|
|
|
Description: "Kosmos Accounts",
|
|
|
|
|
Documentation: ["https://gitea.kosmos.org/kosmos/akkounts"],
|
|
|
|
|
After: "network.target"
|
|
|
|
|
},
|
|
|
|
|
@@ -79,6 +59,36 @@ systemd_unit "akkounts.service" do
|
|
|
|
|
action [:create, :enable]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
systemd_unit "akkounts-sidekiq.service" do
|
|
|
|
|
content({
|
|
|
|
|
Unit: {
|
|
|
|
|
Description: "Kosmos Accounts async/background jobs",
|
|
|
|
|
Documentation: ["https://gitea.kosmos.org/kosmos/akkounts"],
|
|
|
|
|
Requires: "redis-server.service",
|
|
|
|
|
After: "syslog.target network.target redis-server.service"
|
|
|
|
|
},
|
|
|
|
|
Service: {
|
|
|
|
|
Type: "notify",
|
|
|
|
|
User: deploy_user,
|
|
|
|
|
WorkingDirectory: deploy_path,
|
|
|
|
|
Environment: "MALLOC_ARENA_MAX=2",
|
|
|
|
|
ExecStart: "#{bundle_path} exec sidekiq -C #{deploy_path}/config/sidekiq.yml -e production",
|
|
|
|
|
WatchdogSec: "10",
|
|
|
|
|
Restart: "on-failure",
|
|
|
|
|
RestartSec: "1",
|
|
|
|
|
StandardOutput: "syslog",
|
|
|
|
|
StandardError: "syslog",
|
|
|
|
|
SyslogIdentifier: "sidekiq"
|
|
|
|
|
},
|
|
|
|
|
Install: {
|
|
|
|
|
WantedBy: "multi-user.target"
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
verify false
|
|
|
|
|
triggers_reload true
|
|
|
|
|
action [:create, :enable]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
application deploy_path do
|
|
|
|
|
owner deploy_user
|
|
|
|
|
group deploy_group
|
|
|
|
|
@@ -143,6 +153,10 @@ application deploy_path do
|
|
|
|
|
service "akkounts" do
|
|
|
|
|
action [:enable, :start]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
service "akkounts-sidekiq" do
|
|
|
|
|
action [:enable, :start]
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
ejabberd_private_ip_addresses = []
|
|
|
|
|
|