Compare commits
15 Commits
dde29c4a6c
...
bugfix/sub
| Author | SHA1 | Date | |
|---|---|---|---|
|
fd9636441b
|
|||
|
aade479e5b
|
|||
| a3bb927f95 | |||
|
|
5b53635f1a | ||
|
ea087b1e3e
|
|||
| 9817589a92 | |||
|
d632cafd9c
|
|||
| 87b03d3936 | |||
|
ae3df992e4
|
|||
|
2ea5b30224
|
|||
| 4ef06cb4b7 | |||
|
73e8a2c413
|
|||
|
ea4713c654
|
|||
|
|
78e5f810b7 | ||
|
|
443910c7a2 |
4
clients/garage-12.json
Normal file
4
clients/garage-12.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"name": "garage-12",
|
||||||
|
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9GtHHi298BjiIqpZ3WkT\nkYAPfWD60hFe/8icYcq/F/6cHLYKZQ4chek9X/hDCMq4tHEN6Oh58T5x/nuNdPrK\nIAMGyVAGk6ekWlmD4jwdEf6TGb/J3ffJTRDvwX/I8xD/DW3wtXsN+X24T59ByGTm\nrnwRmmmwHF3otRx9wnCsIgDQ0AjiUujsfNNv1FcLXD/WJLys9lEeU5aJ4XtHTwDv\ntJM8YyVEFhEnuvgdKmzn5+F5k9VGdUwForlFOBfvzbCnTZMDMmDVeiUtAUv/7xWQ\nQl2mLUGCtgWuYJYXsQacAJ6pa3h+7cQyshC6w3dwUG+1fS9lNO0Yp1GGX1AGYKpp\nPQIDAQAB\n-----END PUBLIC KEY-----\n"
|
||||||
|
}
|
||||||
4
clients/garage-13.json
Normal file
4
clients/garage-13.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"name": "garage-13",
|
||||||
|
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvbqWc6OwRxgHfsQuTNL4\naxeVvNen5d9srYpZSHjuBB/k9NHB+9P6vU5qF37XHkw1lVUGeYbPHzhYsx3O0/kZ\nH5f4+4SMy/P9jc6SE7AJF4qtYKgJ88koZdqCww07c6K9g+BnEGFFZui/h3hUBxWj\nTfhBHEWPyQ2bl/lr9sIJwsEz+EN0isGn/eIXkmw9J6LdLJ5Q0LLks33K28FNOU7q\nfeAN4MiBVMUtgCGyT2Voe6WrOXwQLSDXQONOp3sfSfFExsIJ1s24xdd7AMD7/9a7\n4sFDZ4swhqAWgWmW2giR7Kb8wTvGQLO/O/uUbmKz3DZXgkOKXHdHCEB/PZx1mRNM\nEwIDAQAB\n-----END PUBLIC KEY-----\n"
|
||||||
|
}
|
||||||
@@ -37,6 +37,7 @@
|
|||||||
"timezone_iii::debian",
|
"timezone_iii::debian",
|
||||||
"ntp::default",
|
"ntp::default",
|
||||||
"ntp::apparmor",
|
"ntp::apparmor",
|
||||||
|
"kosmos-base::journald_conf",
|
||||||
"kosmos-base::systemd_emails",
|
"kosmos-base::systemd_emails",
|
||||||
"apt::unattended-upgrades",
|
"apt::unattended-upgrades",
|
||||||
"kosmos-base::firewall",
|
"kosmos-base::firewall",
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
"timezone_iii::debian",
|
"timezone_iii::debian",
|
||||||
"ntp::default",
|
"ntp::default",
|
||||||
"ntp::apparmor",
|
"ntp::apparmor",
|
||||||
|
"kosmos-base::journald_conf",
|
||||||
"kosmos-base::systemd_emails",
|
"kosmos-base::systemd_emails",
|
||||||
"apt::unattended-upgrades",
|
"apt::unattended-upgrades",
|
||||||
"kosmos-base::firewall",
|
"kosmos-base::firewall",
|
||||||
|
|||||||
65
nodes/garage-12.json
Normal file
65
nodes/garage-12.json
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
{
|
||||||
|
"name": "garage-12",
|
||||||
|
"chef_environment": "production",
|
||||||
|
"normal": {
|
||||||
|
"knife_zero": {
|
||||||
|
"host": "10.1.1.224"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"automatic": {
|
||||||
|
"fqdn": "garage-12",
|
||||||
|
"os": "linux",
|
||||||
|
"os_version": "5.15.0-1059-kvm",
|
||||||
|
"hostname": "garage-12",
|
||||||
|
"ipaddress": "192.168.122.173",
|
||||||
|
"roles": [
|
||||||
|
"base",
|
||||||
|
"kvm_guest",
|
||||||
|
"garage_node"
|
||||||
|
],
|
||||||
|
"recipes": [
|
||||||
|
"kosmos-base",
|
||||||
|
"kosmos-base::default",
|
||||||
|
"kosmos_kvm::guest",
|
||||||
|
"kosmos_garage",
|
||||||
|
"kosmos_garage::default",
|
||||||
|
"kosmos_garage::firewall_rpc",
|
||||||
|
"kosmos_garage::firewall_apis",
|
||||||
|
"apt::default",
|
||||||
|
"timezone_iii::default",
|
||||||
|
"timezone_iii::debian",
|
||||||
|
"ntp::default",
|
||||||
|
"ntp::apparmor",
|
||||||
|
"kosmos-base::journald_conf",
|
||||||
|
"kosmos-base::systemd_emails",
|
||||||
|
"apt::unattended-upgrades",
|
||||||
|
"kosmos-base::firewall",
|
||||||
|
"kosmos-postfix::default",
|
||||||
|
"postfix::default",
|
||||||
|
"postfix::_common",
|
||||||
|
"postfix::_attributes",
|
||||||
|
"postfix::sasl_auth",
|
||||||
|
"hostname::default",
|
||||||
|
"firewall::default"
|
||||||
|
],
|
||||||
|
"platform": "ubuntu",
|
||||||
|
"platform_version": "22.04",
|
||||||
|
"cloud": null,
|
||||||
|
"chef_packages": {
|
||||||
|
"chef": {
|
||||||
|
"version": "18.7.10",
|
||||||
|
"chef_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.7.10/lib",
|
||||||
|
"chef_effortless": null
|
||||||
|
},
|
||||||
|
"ohai": {
|
||||||
|
"version": "18.2.5",
|
||||||
|
"ohai_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.2.5/lib/ohai"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"run_list": [
|
||||||
|
"role[base]",
|
||||||
|
"role[kvm_guest]",
|
||||||
|
"role[garage_node]"
|
||||||
|
]
|
||||||
|
}
|
||||||
65
nodes/garage-13.json
Normal file
65
nodes/garage-13.json
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
{
|
||||||
|
"name": "garage-13",
|
||||||
|
"chef_environment": "production",
|
||||||
|
"normal": {
|
||||||
|
"knife_zero": {
|
||||||
|
"host": "10.1.1.179"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"automatic": {
|
||||||
|
"fqdn": "garage-13",
|
||||||
|
"os": "linux",
|
||||||
|
"os_version": "5.15.0-1059-kvm",
|
||||||
|
"hostname": "garage-13",
|
||||||
|
"ipaddress": "192.168.122.27",
|
||||||
|
"roles": [
|
||||||
|
"base",
|
||||||
|
"kvm_guest",
|
||||||
|
"garage_node"
|
||||||
|
],
|
||||||
|
"recipes": [
|
||||||
|
"kosmos-base",
|
||||||
|
"kosmos-base::default",
|
||||||
|
"kosmos_kvm::guest",
|
||||||
|
"kosmos_garage",
|
||||||
|
"kosmos_garage::default",
|
||||||
|
"kosmos_garage::firewall_rpc",
|
||||||
|
"kosmos_garage::firewall_apis",
|
||||||
|
"apt::default",
|
||||||
|
"timezone_iii::default",
|
||||||
|
"timezone_iii::debian",
|
||||||
|
"ntp::default",
|
||||||
|
"ntp::apparmor",
|
||||||
|
"kosmos-base::journald_conf",
|
||||||
|
"kosmos-base::systemd_emails",
|
||||||
|
"apt::unattended-upgrades",
|
||||||
|
"kosmos-base::firewall",
|
||||||
|
"kosmos-postfix::default",
|
||||||
|
"postfix::default",
|
||||||
|
"postfix::_common",
|
||||||
|
"postfix::_attributes",
|
||||||
|
"postfix::sasl_auth",
|
||||||
|
"hostname::default",
|
||||||
|
"firewall::default"
|
||||||
|
],
|
||||||
|
"platform": "ubuntu",
|
||||||
|
"platform_version": "22.04",
|
||||||
|
"cloud": null,
|
||||||
|
"chef_packages": {
|
||||||
|
"chef": {
|
||||||
|
"version": "18.7.10",
|
||||||
|
"chef_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.7.10/lib",
|
||||||
|
"chef_effortless": null
|
||||||
|
},
|
||||||
|
"ohai": {
|
||||||
|
"version": "18.2.5",
|
||||||
|
"ohai_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.2.5/lib/ohai"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"run_list": [
|
||||||
|
"role[base]",
|
||||||
|
"role[kvm_guest]",
|
||||||
|
"role[garage_node]"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
"timezone_iii::debian",
|
"timezone_iii::debian",
|
||||||
"ntp::default",
|
"ntp::default",
|
||||||
"ntp::apparmor",
|
"ntp::apparmor",
|
||||||
|
"kosmos-base::journald_conf",
|
||||||
"kosmos-base::systemd_emails",
|
"kosmos-base::systemd_emails",
|
||||||
"apt::unattended-upgrades",
|
"apt::unattended-upgrades",
|
||||||
"kosmos-base::firewall",
|
"kosmos-base::firewall",
|
||||||
@@ -66,12 +67,13 @@
|
|||||||
"cloud": null,
|
"cloud": null,
|
||||||
"chef_packages": {
|
"chef_packages": {
|
||||||
"chef": {
|
"chef": {
|
||||||
"version": "15.13.8",
|
"version": "18.7.10",
|
||||||
"chef_root": "/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/chef-15.13.8/lib"
|
"chef_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.7.10/lib",
|
||||||
|
"chef_effortless": null
|
||||||
},
|
},
|
||||||
"ohai": {
|
"ohai": {
|
||||||
"version": "15.12.0",
|
"version": "18.2.5",
|
||||||
"ohai_root": "/opt/chef/embedded/lib/ruby/gems/2.6.0/gems/ohai-15.12.0/lib/ohai"
|
"ohai_root": "/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.2.5/lib/ohai"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,52 +0,0 @@
|
|||||||
#
|
|
||||||
# Cookbook Name:: kosmos-base
|
|
||||||
# Recipe:: andromeda_firewall
|
|
||||||
#
|
|
||||||
# The MIT License (MIT)
|
|
||||||
#
|
|
||||||
# Copyright:: 2019, 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.
|
|
||||||
|
|
||||||
# Temporary extra rules for Andromeda
|
|
||||||
|
|
||||||
firewall_rule 'bitcoind' do
|
|
||||||
port [8333, 8334, 8335]
|
|
||||||
protocol :tcp
|
|
||||||
command :allow
|
|
||||||
end
|
|
||||||
|
|
||||||
firewall_rule 'lnd' do
|
|
||||||
port [9736]
|
|
||||||
# port [9736, 8002]
|
|
||||||
protocol :tcp
|
|
||||||
command :allow
|
|
||||||
end
|
|
||||||
|
|
||||||
firewall_rule 'lightningd' do
|
|
||||||
port [9735]
|
|
||||||
protocol :tcp
|
|
||||||
command :allow
|
|
||||||
end
|
|
||||||
|
|
||||||
firewall_rule 'spark_wallet' do
|
|
||||||
port 8008
|
|
||||||
protocol :tcp
|
|
||||||
command :allow
|
|
||||||
end
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
node.default['bitcoin']['version'] = '29.0'
|
node.default['bitcoin']['version'] = '30.0'
|
||||||
node.default['bitcoin']['checksum'] = '882c782c34a3bf2eacd1fae5cdc58b35b869883512f197f7d6dc8f195decfdaa'
|
node.default['bitcoin']['checksum'] = '9b472a4d51dfed9aa9d0ded2cb8c7bcb9267f8439a23a98f36eb509c1a5e6974'
|
||||||
node.default['bitcoin']['username'] = 'satoshi'
|
node.default['bitcoin']['username'] = 'satoshi'
|
||||||
node.default['bitcoin']['usergroup'] = 'bitcoin'
|
node.default['bitcoin']['usergroup'] = 'bitcoin'
|
||||||
node.default['bitcoin']['network'] = 'mainnet'
|
node.default['bitcoin']['network'] = 'mainnet'
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ bash "compile_bitcoin-core" do
|
|||||||
cwd "/usr/local/bitcoind"
|
cwd "/usr/local/bitcoind"
|
||||||
environment ({'CC' => 'gcc-13', 'CXX' => 'g++-13', 'NO_QT' => '1'})
|
environment ({'CC' => 'gcc-13', 'CXX' => 'g++-13', 'NO_QT' => '1'})
|
||||||
code <<-EOH
|
code <<-EOH
|
||||||
cmake -B build --toolchain depends/x86_64-pc-linux-gnu/toolchain.cmake
|
cmake -B build --toolchain depends/x86_64-pc-linux-gnu/toolchain.cmake -DBUILD_TESTS=OFF
|
||||||
cmake --build build -j $(($(nproc)/2))
|
cmake --build build -j $(($(nproc)/2))
|
||||||
cmake --install build
|
cmake --install build
|
||||||
EOH
|
EOH
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
node.default["ejabberd"]["version"] = "24.02"
|
node.default["ejabberd"]["version"] = "25.08"
|
||||||
node.default["ejabberd"]["package_version"] = "1"
|
node.default["ejabberd"]["package_version"] = "1"
|
||||||
node.default["ejabberd"]["checksum"] = "476c187b42074b88472fd1c8042418072e47962facd47dab4e5883f6f61b2173"
|
node.default["ejabberd"]["checksum"] = "e4703bc41b5843fc4b76e8b54a9380d5895f9b3dcd4795e05ad0c260ed9b9a23"
|
||||||
node.default["ejabberd"]["turn_domain"] = "turn.kosmos.org"
|
node.default["ejabberd"]["turn_domain"] = "turn.kosmos.org"
|
||||||
node.default["ejabberd"]["stun_auth_realm"] = "kosmos.org"
|
node.default["ejabberd"]["stun_auth_realm"] = "kosmos.org"
|
||||||
node.default["ejabberd"]["stun_turn_port"] = 3478
|
node.default["ejabberd"]["stun_turn_port"] = 3478
|
||||||
|
|||||||
@@ -65,15 +65,13 @@ file "/opt/ejabberd/.hosts.erlang" do
|
|||||||
content ejabberd_hostnames.map{|h| "#{h}."}.join("\n")
|
content ejabberd_hostnames.map{|h| "#{h}."}.join("\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
ruby_block "configure ERLANG_NODE" do
|
template "/opt/ejabberd/conf/ejabberdctl.cfg" do
|
||||||
block do
|
source "ejabberdctl.cfg.erb"
|
||||||
file = Chef::Util::FileEdit.new("/opt/ejabberd/conf/ejabberdctl.cfg")
|
mode 0644
|
||||||
file.search_file_replace_line(
|
owner 'ejabberd'
|
||||||
%r{#ERLANG_NODE=ejabberd@localhost},
|
group 'ejabberd'
|
||||||
"ERLANG_NODE=ejabberd@#{node['name']}"
|
variables epmd_node_name: "ejabberd@#{node['name']}"
|
||||||
)
|
notifies :reload, "service[ejabberd]", :delayed
|
||||||
file.write_file
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
postgresql_data_bag_item = data_bag_item('credentials', 'postgresql')
|
postgresql_data_bag_item = data_bag_item('credentials', 'postgresql')
|
||||||
@@ -225,10 +223,3 @@ end
|
|||||||
unless node.chef_environment == "development"
|
unless node.chef_environment == "development"
|
||||||
include_recipe "kosmos-ejabberd::firewall"
|
include_recipe "kosmos-ejabberd::firewall"
|
||||||
end
|
end
|
||||||
|
|
||||||
firewall_rule 'ejabberd_http' do
|
|
||||||
port [80]
|
|
||||||
source "10.1.1.0/24"
|
|
||||||
protocol :tcp
|
|
||||||
command :allow
|
|
||||||
end
|
|
||||||
|
|||||||
@@ -35,3 +35,10 @@ firewall_rule 'ejabberd_turn' do
|
|||||||
protocol :udp
|
protocol :udp
|
||||||
command :allow
|
command :allow
|
||||||
end
|
end
|
||||||
|
|
||||||
|
firewall_rule 'ejabberd_http' do
|
||||||
|
port [80]
|
||||||
|
source "10.1.1.0/24"
|
||||||
|
protocol :tcp
|
||||||
|
command :allow
|
||||||
|
end
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ log_rotate_count: 1
|
|||||||
loglevel: info
|
loglevel: info
|
||||||
hide_sensitive_log_data: true
|
hide_sensitive_log_data: true
|
||||||
|
|
||||||
|
log_modules_fully:
|
||||||
|
- mod_s3_upload
|
||||||
|
|
||||||
hosts:
|
hosts:
|
||||||
<% @hosts.each do |host| -%>
|
<% @hosts.each do |host| -%>
|
||||||
- "<%= host[:name] %>"
|
- "<%= host[:name] %>"
|
||||||
@@ -119,6 +122,15 @@ acl:
|
|||||||
- "::1/128"
|
- "::1/128"
|
||||||
- "::FFFF:127.0.0.1/128"
|
- "::FFFF:127.0.0.1/128"
|
||||||
|
|
||||||
|
api_permissions:
|
||||||
|
"webadmin commands":
|
||||||
|
who:
|
||||||
|
- admin
|
||||||
|
from:
|
||||||
|
- ejabberd_web_admin
|
||||||
|
what:
|
||||||
|
- "*"
|
||||||
|
|
||||||
shaper_rules:
|
shaper_rules:
|
||||||
max_user_sessions: 10
|
max_user_sessions: 10
|
||||||
max_user_offline_messages:
|
max_user_offline_messages:
|
||||||
|
|||||||
175
site-cookbooks/kosmos-ejabberd/templates/ejabberdctl.cfg.erb
Normal file
175
site-cookbooks/kosmos-ejabberd/templates/ejabberdctl.cfg.erb
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
#
|
||||||
|
# In this file you can configure options that are passed by ejabberdctl
|
||||||
|
# to the erlang runtime system when starting ejabberd
|
||||||
|
#
|
||||||
|
|
||||||
|
#' POLL: Kernel polling ([true|false])
|
||||||
|
#
|
||||||
|
# The kernel polling option requires support in the kernel.
|
||||||
|
# Additionally, you need to enable this feature while compiling Erlang.
|
||||||
|
#
|
||||||
|
# Default: true
|
||||||
|
#
|
||||||
|
#POLL=true
|
||||||
|
|
||||||
|
#.
|
||||||
|
#' SMP: SMP support ([enable|auto|disable])
|
||||||
|
#
|
||||||
|
# Explanation in Erlang/OTP documentation:
|
||||||
|
# enable: starts the Erlang runtime system with SMP support enabled.
|
||||||
|
# This may fail if no runtime system with SMP support is available.
|
||||||
|
# auto: starts the Erlang runtime system with SMP support enabled if it
|
||||||
|
# is available and more than one logical processor are detected.
|
||||||
|
# disable: starts a runtime system without SMP support.
|
||||||
|
#
|
||||||
|
# Default: enable
|
||||||
|
#
|
||||||
|
#SMP=enable
|
||||||
|
|
||||||
|
#.
|
||||||
|
#' ERL_MAX_PORTS: Maximum number of simultaneously open Erlang ports
|
||||||
|
#
|
||||||
|
# ejabberd consumes two or three ports for every connection, either
|
||||||
|
# from a client or from another Jabber server. So take this into
|
||||||
|
# account when setting this limit.
|
||||||
|
#
|
||||||
|
# Default: 32000
|
||||||
|
# Maximum: 268435456
|
||||||
|
#
|
||||||
|
#ERL_MAX_PORTS=32000
|
||||||
|
|
||||||
|
#.
|
||||||
|
#' FIREWALL_WINDOW: Range of allowed ports to pass through a firewall
|
||||||
|
#
|
||||||
|
# If Ejabberd is configured to run in cluster, and a firewall is blocking ports,
|
||||||
|
# it's possible to make Erlang use a defined range of port (instead of dynamic
|
||||||
|
# ports) for node communication.
|
||||||
|
#
|
||||||
|
# Default: not defined
|
||||||
|
# Example: 4200-4210
|
||||||
|
#
|
||||||
|
FIREWALL_WINDOW=4200-4210
|
||||||
|
|
||||||
|
#.
|
||||||
|
#' INET_DIST_INTERFACE: IP address where this Erlang node listens other nodes
|
||||||
|
#
|
||||||
|
# This communication is used by ejabberdctl command line tool,
|
||||||
|
# and in a cluster of several ejabberd nodes.
|
||||||
|
#
|
||||||
|
# Default: 0.0.0.0
|
||||||
|
#
|
||||||
|
#INET_DIST_INTERFACE=127.0.0.1
|
||||||
|
|
||||||
|
#.
|
||||||
|
#' ERL_EPMD_ADDRESS: IP addresses where epmd listens for connections
|
||||||
|
#
|
||||||
|
# IMPORTANT: This option works only in Erlang/OTP R14B03 and newer.
|
||||||
|
#
|
||||||
|
# This environment variable may be set to a comma-separated
|
||||||
|
# list of IP addresses, in which case the epmd daemon
|
||||||
|
# will listen only on the specified address(es) and on the
|
||||||
|
# loopback address (which is implicitly added to the list if it
|
||||||
|
# has not been specified). The default behaviour is to listen on
|
||||||
|
# all available IP addresses.
|
||||||
|
#
|
||||||
|
# Default: 0.0.0.0
|
||||||
|
#
|
||||||
|
#ERL_EPMD_ADDRESS=127.0.0.1
|
||||||
|
|
||||||
|
#.
|
||||||
|
#' ERL_PROCESSES: Maximum number of Erlang processes
|
||||||
|
#
|
||||||
|
# Erlang consumes a lot of lightweight processes. If there is a lot of activity
|
||||||
|
# on ejabberd so that the maximum number of processes is reached, people will
|
||||||
|
# experience greater latency times. As these processes are implemented in
|
||||||
|
# Erlang, and therefore not related to the operating system processes, you do
|
||||||
|
# not have to worry about allowing a huge number of them.
|
||||||
|
#
|
||||||
|
# Default: 250000
|
||||||
|
# Maximum: 268435456
|
||||||
|
#
|
||||||
|
#ERL_PROCESSES=250000
|
||||||
|
|
||||||
|
#.
|
||||||
|
#' ERL_MAX_ETS_TABLES: Maximum number of ETS and Mnesia tables
|
||||||
|
#
|
||||||
|
# The number of concurrent ETS and Mnesia tables is limited. When the limit is
|
||||||
|
# reached, errors will appear in the logs:
|
||||||
|
# ** Too many db tables **
|
||||||
|
# You can safely increase this limit when starting ejabberd. It impacts memory
|
||||||
|
# consumption but the difference will be quite small.
|
||||||
|
#
|
||||||
|
# Default: 1400
|
||||||
|
#
|
||||||
|
#ERL_MAX_ETS_TABLES=1400
|
||||||
|
|
||||||
|
#.
|
||||||
|
#' ERL_OPTIONS: Additional Erlang options
|
||||||
|
#
|
||||||
|
# The next variable allows to specify additional options passed to erlang while
|
||||||
|
# starting ejabberd. Some useful options are -noshell, -detached, -heart. When
|
||||||
|
# ejabberd is started from an init.d script options -noshell and -detached are
|
||||||
|
# added implicitly. See erl(1) for more info.
|
||||||
|
#
|
||||||
|
# It might be useful to add "-pa /usr/local/lib/ejabberd/ebin" if you
|
||||||
|
# want to add local modules in this path.
|
||||||
|
#
|
||||||
|
# Default: ""
|
||||||
|
#
|
||||||
|
#ERL_OPTIONS=""
|
||||||
|
|
||||||
|
#.
|
||||||
|
#' ERLANG_NODE: Erlang node name
|
||||||
|
#
|
||||||
|
# The next variable allows to explicitly specify erlang node for ejabberd
|
||||||
|
# It can be given in different formats:
|
||||||
|
# ERLANG_NODE=ejabberd
|
||||||
|
# Lets erlang add hostname to the node (ejabberd uses short name in this case)
|
||||||
|
# ERLANG_NODE=ejabberd@hostname
|
||||||
|
# Erlang uses node name as is (so make sure that hostname is a real
|
||||||
|
# machine hostname or you'll not be able to control ejabberd)
|
||||||
|
# ERLANG_NODE=ejabberd@hostname.domainname
|
||||||
|
# The same as previous, but erlang will use long hostname
|
||||||
|
# (see erl (1) manual for details)
|
||||||
|
#
|
||||||
|
# Default: ejabberd@localhost
|
||||||
|
#
|
||||||
|
ERLANG_NODE=<%= @epmd_node_name %>
|
||||||
|
|
||||||
|
#.
|
||||||
|
#' EJABBERD_PID_PATH: ejabberd PID file
|
||||||
|
#
|
||||||
|
# Indicate the full path to the ejabberd Process identifier (PID) file.
|
||||||
|
# If this variable is defined, ejabberd writes the PID file when starts,
|
||||||
|
# and deletes it when stops.
|
||||||
|
# Remember to create the directory and grant write permission to ejabberd.
|
||||||
|
#
|
||||||
|
# Default: don't write PID file
|
||||||
|
#
|
||||||
|
#EJABBERD_PID_PATH=/var/run/ejabberd/ejabberd.pid
|
||||||
|
|
||||||
|
#.
|
||||||
|
#' CONTRIB_MODULES_PATH: contributed ejabberd modules path
|
||||||
|
#
|
||||||
|
# Specify the full path to the contributed ejabberd modules. If the path is not
|
||||||
|
# defined, ejabberd will use ~/.ejabberd-modules in home of user running ejabberd.
|
||||||
|
#
|
||||||
|
# Default: $HOME/.ejabberd-modules
|
||||||
|
#
|
||||||
|
#CONTRIB_MODULES_PATH=/opt/ejabberd-modules
|
||||||
|
|
||||||
|
#.
|
||||||
|
#' CONTRIB_MODULES_CONF_DIR: configuration directory for contributed modules
|
||||||
|
#
|
||||||
|
# Specify the full path to the configuration directory for contributed ejabberd
|
||||||
|
# modules. In order to configure a module named mod_foo, a mod_foo.yml file can
|
||||||
|
# be created in this directory. This file will then be used instead of the
|
||||||
|
# default configuration file provided with the module.
|
||||||
|
#
|
||||||
|
# Default: $CONTRIB_MODULES_PATH/conf
|
||||||
|
#
|
||||||
|
#CONTRIB_MODULES_CONF_DIR=/etc/ejabberd/modules
|
||||||
|
|
||||||
|
#.
|
||||||
|
#'
|
||||||
|
# vim: foldmarker=#',#. foldmethod=marker:
|
||||||
@@ -3,7 +3,6 @@ maintainer 'Kosmos'
|
|||||||
maintainer_email 'mail@kosmos.org'
|
maintainer_email 'mail@kosmos.org'
|
||||||
license 'MIT'
|
license 'MIT'
|
||||||
description 'Installs/Configures kosmos-mediawiki'
|
description 'Installs/Configures kosmos-mediawiki'
|
||||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
|
||||||
version '0.3.1'
|
version '0.3.1'
|
||||||
|
|
||||||
depends "mediawiki"
|
depends "mediawiki"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#
|
#
|
||||||
# Cookbook Name:: kosmos-mediawiki
|
# Cookbook:: kosmos-mediawiki
|
||||||
# Recipe:: default
|
# Recipe:: default.rb
|
||||||
#
|
#
|
||||||
|
|
||||||
include_recipe 'apt'
|
apt_update
|
||||||
include_recipe 'ark'
|
include_recipe 'ark'
|
||||||
include_recipe 'composer'
|
include_recipe 'composer'
|
||||||
|
|
||||||
@@ -11,15 +11,15 @@ apt_package 'imagemagick'
|
|||||||
|
|
||||||
server_name = 'wiki.kosmos.org'
|
server_name = 'wiki.kosmos.org'
|
||||||
|
|
||||||
node.override['mediawiki']['version'] = "1.34.2"
|
node.override['mediawiki']['version'] = "1.34.2"
|
||||||
node.override['mediawiki']['webdir'] = "#{node['mediawiki']['docroot_dir']}/mediawiki-#{node['mediawiki']['version']}"
|
node.override['mediawiki']['webdir'] = "#{node['mediawiki']['docroot_dir']}/mediawiki-#{node['mediawiki']['version']}"
|
||||||
node.override['mediawiki']['tarball']['name'] = "mediawiki-#{node['mediawiki']['version']}.tar.gz"
|
node.override['mediawiki']['tarball']['name'] = "mediawiki-#{node['mediawiki']['version']}.tar.gz"
|
||||||
node.override['mediawiki']['tarball']['url'] = "https://releases.wikimedia.org/mediawiki/1.34/#{node['mediawiki']['tarball']['name']}"
|
node.override['mediawiki']['tarball']['url'] = "https://releases.wikimedia.org/mediawiki/1.34/#{node['mediawiki']['tarball']['name']}"
|
||||||
node.override['mediawiki']['language_code'] = 'en'
|
node.override['mediawiki']['language_code'] = 'en'
|
||||||
node.override['mediawiki']['server_name'] = server_name
|
node.override['mediawiki']['server_name'] = server_name
|
||||||
node.override['mediawiki']['site_name'] = 'Kosmos Wiki'
|
node.override['mediawiki']['site_name'] = 'Kosmos Wiki'
|
||||||
protocol = node.chef_environment == "development" ? "http" : "https"
|
protocol = node.chef_environment == "development" ? "http" : "https"
|
||||||
node.override['mediawiki']['server'] = "#{protocol}://#{server_name}"
|
node.override['mediawiki']['server'] = "#{protocol}://#{server_name}"
|
||||||
mysql_credentials = data_bag_item('credentials', 'mysql')
|
mysql_credentials = data_bag_item('credentials', 'mysql')
|
||||||
mediawiki_credentials = data_bag_item('credentials', 'mediawiki')
|
mediawiki_credentials = data_bag_item('credentials', 'mediawiki')
|
||||||
|
|
||||||
@@ -30,14 +30,14 @@ directory "#{node['mediawiki']['webdir']}/skins/common/images" do
|
|||||||
owner node['nginx']['user']
|
owner node['nginx']['user']
|
||||||
group node['nginx']['group']
|
group node['nginx']['group']
|
||||||
recursive true
|
recursive true
|
||||||
mode 0750
|
mode "750"
|
||||||
end
|
end
|
||||||
|
|
||||||
cookbook_file "#{node['mediawiki']['webdir']}/skins/common/images/kosmos.png" do
|
cookbook_file "#{node['mediawiki']['webdir']}/skins/common/images/kosmos.png" do
|
||||||
source 'kosmos.png'
|
source 'kosmos.png'
|
||||||
owner node['nginx']['user']
|
owner node['nginx']['user']
|
||||||
group node['nginx']['group']
|
group node['nginx']['group']
|
||||||
mode 0640
|
mode "640"
|
||||||
end
|
end
|
||||||
|
|
||||||
directory "#{node['mediawiki']['webdir']}/.well-known/acme-challenge" do
|
directory "#{node['mediawiki']['webdir']}/.well-known/acme-challenge" do
|
||||||
@@ -80,14 +80,14 @@ nginx_certbot_site server_name
|
|||||||
# Extensions
|
# Extensions
|
||||||
#
|
#
|
||||||
|
|
||||||
mediawiki_credentials = Chef::EncryptedDataBagItem.load('credentials', 'mediawiki')
|
mediawiki_credentials = data_bag_item('credentials', 'mediawiki')
|
||||||
|
|
||||||
#
|
#
|
||||||
# MediawikiHubot extension
|
# MediawikiHubot extension
|
||||||
#
|
#
|
||||||
|
|
||||||
# requires curl extension
|
# requires curl extension
|
||||||
if platform?('ubuntu') && node[:platform_version].to_f < 16.04
|
if platform?('ubuntu') && node["platform_version"].to_f < 16.04
|
||||||
package "php5-curl"
|
package "php5-curl"
|
||||||
else
|
else
|
||||||
package "php-curl"
|
package "php-curl"
|
||||||
@@ -100,7 +100,7 @@ ark "MediawikiHubot" do
|
|||||||
action :cherry_pick
|
action :cherry_pick
|
||||||
end
|
end
|
||||||
|
|
||||||
hubot_credentials = Chef::EncryptedDataBagItem.load('credentials', 'hal8000_xmpp')
|
hubot_credentials = data_bag_item('credentials', 'hal8000_xmpp')
|
||||||
webhook_token = hubot_credentials['webhook_token']
|
webhook_token = hubot_credentials['webhook_token']
|
||||||
|
|
||||||
template "#{node['mediawiki']['webdir']}/extensions/MediawikiHubot/DefaultConfig.php" do
|
template "#{node['mediawiki']['webdir']}/extensions/MediawikiHubot/DefaultConfig.php" do
|
||||||
@@ -145,7 +145,7 @@ end
|
|||||||
|
|
||||||
ruby_block "configuration" do
|
ruby_block "configuration" do
|
||||||
block do
|
block do
|
||||||
# FIXME This is internal Chef API and should not be used from recipes, as
|
# FIXME: This is internal Chef API and should not be used from recipes, as
|
||||||
# it is unsupported for that
|
# it is unsupported for that
|
||||||
file = Chef::Util::FileEdit.new("#{node['mediawiki']['webdir']}/LocalSettings.php")
|
file = Chef::Util::FileEdit.new("#{node['mediawiki']['webdir']}/LocalSettings.php")
|
||||||
file.search_file_replace_line(%r{\$wgLogo\ =\ \"\$wgResourceBasePath\/resources\/assets\/wiki.png\";},
|
file.search_file_replace_line(%r{\$wgLogo\ =\ \"\$wgResourceBasePath\/resources\/assets\/wiki.png\";},
|
||||||
@@ -235,7 +235,7 @@ wfLoadExtension( 'LDAPAuthentication2' );
|
|||||||
$wgGroupPermissions['*']['createaccount'] = false;
|
$wgGroupPermissions['*']['createaccount'] = false;
|
||||||
$wgGroupPermissions['*']['autocreateaccount'] = true;
|
$wgGroupPermissions['*']['autocreateaccount'] = true;
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
file.write_file
|
file.write_file
|
||||||
end
|
end
|
||||||
@@ -247,9 +247,7 @@ end
|
|||||||
#
|
#
|
||||||
|
|
||||||
file "#{node['mediawiki']['webdir']}/composer.local.json" do
|
file "#{node['mediawiki']['webdir']}/composer.local.json" do
|
||||||
requires = { "require": {
|
requires = { "require": { "mediawiki/mermaid": "~1.0" } }.to_json
|
||||||
"mediawiki/mermaid": "~1.0"
|
|
||||||
}}.to_json
|
|
||||||
content requires
|
content requires
|
||||||
owner node['nginx']['user']
|
owner node['nginx']['user']
|
||||||
group node['nginx']['group']
|
group node['nginx']['group']
|
||||||
|
|||||||
@@ -1,4 +1,14 @@
|
|||||||
# kosmos_kvm
|
# kosmos_kvm
|
||||||
|
|
||||||
TODO: Enter the cookbook description here.
|
## Create a new VM
|
||||||
|
|
||||||
|
A script is deployed by the `host` recipe to `/usr/local/sbin/create_vm`
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
```
|
||||||
|
create_vm VMNAME RAM CPUS DISKSIZE
|
||||||
|
```
|
||||||
|
|
||||||
|
* `RAM` in megabytes
|
||||||
|
* `DISKSIZE` in gigabytes, defaults to 10
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ server {
|
|||||||
alias /var/www/assets.kosmos.org/site/img/favicon.ico;
|
alias /var/www/assets.kosmos.org/site/img/favicon.ico;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~* ^/[@~n]|^/assets {
|
location ~ ^/(?:@|~|npub|naddr|nprofile|assets/) {
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_pass http://_substr;
|
proxy_pass http://_substr;
|
||||||
|
|||||||
Reference in New Issue
Block a user