Commit 9a1e910d authored by Stephane VAROQUI's avatar Stephane VAROQUI

Adding password and merge notes

parent 1cb88cb0
...@@ -2,18 +2,15 @@ ...@@ -2,18 +2,15 @@
extends = extends =
../../component/golang/buildout.cfg ../../component/golang/buildout.cfg
parts = parts =
repman repman
[gowork] [gowork]
golang = ${golang1.12:location} golang = ${golang1.12:location}
install = install =
buildflags = -v --tags server --ldflags "-extldflags 'static' -w -s -X main.GoOS=linux -X main.GoArch=amd64 -X main.Version=2.1 -X main.FullVersion=$FULLVERSION -X main.Build=$(date +%FT%T%z) -X main.WithProvisioning=ON -X main.WithOpenSVC=OFF -X main.WithHaproxy=ON -X main.WithMaxscale=ON -X main.WithMariadbshardproxy=ON -X main.WithProxysql=ON -X main.WithSphinx=ON -X main.WithArbitration=OFF -X main.WithArbitrationClient=ON -X main.WithMonitoring=ON -X main.WithHttp=ON -X main.WithBackup=ON -X main.WithMail=ON -X main.WithEnforce=ON -X main.WithDeprecate=ON" buildflags = -v --tags server --ldflags "-extldflags 'static' -w -s -X main.GoOS=linux -X main.GoArch=amd64 -X main.Version=2.1 -X main.FullVersion=$FULLVERSION -X main.Build=$(date +%FT%T%z) -X main.WithProvisioning=ON -X main.WithOpenSVC=OFF -X main.WithHaproxy=ON -X main.WithMaxscale=ON -X main.WithMariadbshardproxy=ON -X main.WithProxysql=ON -X main.WithSphinx=ON -X main.WithArbitration=OFF -X main.WithArbitrationClient=ON -X main.WithMonitoring=ON -X main.WithHttp=ON -X main.WithBackup=ON -X main.WithMail=ON -X main.WithEnforce=ON -X main.WithDeprecate=ON"
[gowork.goinstall] [gowork.goinstall]
depends_gitfetch = depends_gitfetch =
${git.signal18.io_signal18_repman:recipe} ${git.signal18.io_signal18_repman:recipe}
...@@ -26,9 +23,6 @@ command = . ${gowork:env.sh} && ...@@ -26,9 +23,6 @@ command = . ${gowork:env.sh} &&
# export VERSION=$(git describe --abbrev=0 --tags) && # export VERSION=$(git describe --abbrev=0 --tags) &&
[git.signal18.io_signal18_repman] [git.signal18.io_signal18_repman]
<= go-git-package <= go-git-package
go.importpath = github.com/signal18/replication-manager go.importpath = github.com/signal18/replication-manager
...@@ -38,11 +32,12 @@ branch = 2.1 ...@@ -38,11 +32,12 @@ branch = 2.1
[repman] [repman]
# revision and repository can be used to control which repman version is used # revision and repository can be used to control which repman version is used
depend = ${gowork:recipe} depend = ${gowork:recipe}
output = ${gowork:bin}/replication-manager
revision = 2.1
recipe = collective.recipe.template recipe = collective.recipe.template
# Do something useless to pass # Do something useless to pass
output = ${buildout:bin-directory}/${:_buildout_section_name_} output = ${buildout:bin-directory}/${:_buildout_section_name_}
mode = 0755 mode = 0755
input = inline: input = inline:
#!/bin/sh #!/bin/sh
${gowork:bin}/replication-manager
--monitoring-basedir=system --monitoring-sharedir=software_release/src/share --http-root=software_release/src/dashboard monitor
# --monitoring-datadir=$${directory:var}/lib --config=$${directory:etc}/config.toml --log-file=$${:logfile}
...@@ -30,20 +30,22 @@ offline = true ...@@ -30,20 +30,22 @@ offline = true
# Always the same. Just copy/paste. # Always the same. Just copy/paste.
# See docstring of slapos.cookbook:slapconfiguration for more information. # See docstring of slapos.cookbook:slapconfiguration for more information.
recipe = slapos.cookbook:slapconfiguration recipe = slapos.cookbook:slapconfiguration
computer = $${slap_connection:computer_id} computer = $${slap-connection:computer-id}
partition = $${slap_connection:partition_id} partition = $${slap-connection:partition-id}
url = $${slap_connection:server_url} url = $${slap-connection:server-url}
key = $${slap_connection:key_file} key = $${slap-connection:key-file}
cert = $${slap_connection:cert_file} cert = $${slap-connection:cert-file}
# Define default parameter(s) that will be used later, in case user didn't
# specify it. [slap-configuration]
# All possible parameters should have a default. # apache-frontend reads from a part named [slap-configuration]
# In our use case, we are expecting from the user to specify one (optional) parameter: "name". We put the default value here if he doesn't specify it, so that it doesn't crash. recipe = slapos.cookbook:slapconfiguration.serialised
configuration.name = John Doe computer = $${slap-connection:computer-id}
# If our use case requires that the user can specify a mail address so that his instance can mail to him (for example), we can do: partition = $${slap-connection:partition-id}
# configuration.mail-address = url = $${slap-connection:server-url}
# If the user doesn't specify it, it won't break and the recipe can handle it (i.e don't send any mail for example). key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
# Create all needed directories, depending on your needs # Create all needed directories, depending on your needs
...@@ -63,6 +65,11 @@ promise = $${:etc}/promise/ ...@@ -63,6 +65,11 @@ promise = $${:etc}/promise/
log = $${:var}/log log = $${:var}/log
data = $${:var}/lib data = $${:var}/lib
[replication-manager-credential]
recipe = slapos.cookbook:generate.password
username = admin
bytes = 12
[replication-manager] [replication-manager]
# repman service is listening on: # repman service is listening on:
# - global IPv6 address, and # - global IPv6 address, and
...@@ -83,7 +90,7 @@ logfile = $${directory:log}/repman.log ...@@ -83,7 +90,7 @@ logfile = $${directory:log}/repman.log
# This recipe will try to "exec" the command-line after separating parameters. # This recipe will try to "exec" the command-line after separating parameters.
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
command-line = command-line =
software_release/go.work/bin/replication-manager --monitoring-save-config=true --monitoring-basedir=system --monitoring-sharedir=software_release/src/share --http-root=software_release/src/dashboard --monitoring-datadir=$${directory:var}/lib --config=$${directory:etc}/config.toml --log-file=$${:logfile} monitor ${gowork:bin}/replication-manager --monitoring-basedir=system --monitoring-sharedir=software_release/src/share --http-root=software_release/src/dashboard --monitoring-datadir=$${directory:var}/lib --config=$${directory:etc}/config.toml --log-file=$${:logfile} monitor
# Put this shell script in the "etc/service" directory. Each executable of this # Put this shell script in the "etc/service" directory. Each executable of this
# repository will be started and monitored by supervisord. If a service # repository will be started and monitored by supervisord. If a service
...@@ -99,7 +106,10 @@ recipe = slapos.recipe.template:jinja2 ...@@ -99,7 +106,10 @@ recipe = slapos.recipe.template:jinja2
template = ${download-config-toml:destination} template = ${download-config-toml:destination}
rendered =$${directory:etc}/config.toml rendered =$${directory:etc}/config.toml
extra-context = extra-context =
context = key service_ipv6 replication-manager:ipv6 context =
key service_ipv6 replication-manager:ipv6
key service_user replication-manager-credential:username
key service_pwd replication-manager-credential:passwd
# promise, that checks that helloweb service is alive # promise, that checks that helloweb service is alive
[repman-promise] [repman-promise]
recipe = slapos.cookbook:check_port_listening recipe = slapos.cookbook:check_port_listening
...@@ -113,5 +123,6 @@ port = 10005 ...@@ -113,5 +123,6 @@ port = 10005
# Here we'll just echo back the entered name as instance parameter # Here we'll just echo back the entered name as instance parameter
[publish-connection-parameter] [publish-connection-parameter]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
name = Hello $${instance-parameter:configuration.name}!
url = $${replication-manager:url} url = $${replication-manager:url}
username = $${replication-manager-credential:username}
password = $${replication-manager-credential:passwd}
...@@ -3,10 +3,11 @@ api-bind = "[{{service_ipv6}}]" ...@@ -3,10 +3,11 @@ api-bind = "[{{service_ipv6}}]"
http-bind-address = "[{{service_ipv6}}]" http-bind-address = "[{{service_ipv6}}]"
monitoring-save-config = true monitoring-save-config = true
api-https-bind = true api-https-bind = true
api-credentials = "{{service_user}}:{{service_pwd}}"
[cluster1] [cluster1]
title = "cluster1" title = "cluster1"
#db-servers-hosts = "[2408:5180:0:43::d2a5]:3306,[2409:5180:0:43::d2a5]:3306"
db-servers-hosts = "[2408:5180:0:43::d2a5]:3306,[2409:5180:0:43::d2a5]:3306" #db-servers-prefered-master = "[2408:5180:0:43::d2a5]:3306"
db-servers-prefered-master = "127.0.0.1:3310" db-servers-hosts = ""
db-servers-credential = "root:test" db-servers-credential = "root:test"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment