Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

master startup:455 change path for minion_master.pub #456

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ continues then there might be a problem with the public key of the salt main ser
following steps:

* `doil login <instance_name>`
* `rm /var/lib/salt/pki/minion/minion_master.pub`
* `rm /etc/salt/pki/minion/minion_master.pub`
* `exit`
* `doil down <instance_name>`
* `doil up <instance_name>`
Expand Down
2 changes: 1 addition & 1 deletion app/src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class App extends Application
{
const NAME = "Doil Version 20240806 - build 2024-08-06";
const NAME = "Doil Version 20240807 - build 2024-08-07";

public function __construct(Command ...$commands)
{
Expand Down
4 changes: 2 additions & 2 deletions setup/stack/states/base/startup/salt-startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ service cron start
# we need to remove the master pub key because the
# startup of this machine invokes new not accepted
# crypto stuff
if [ -f "/var/lib/salt/pki/minion/minion_master.pub" ]
if [ -f "/etc/salt/pki/minion/minion_master.pub" ]
then
rm /var/lib/salt/pki/minion/minion_master.pub
rm /etc/salt/pki/minion/minion_master.pub
fi


Expand Down
8 changes: 8 additions & 0 deletions setup/templates/mail/conf/salt-startup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/bin/bash

# we need to remove the master pub key because the
# startup of this machine invokes new not accepted
# crypto stuff
if [ -f "/etc/salt/pki/minion/minion_master.pub" ]
then
rm /etc/salt/pki/minion/minion_master.pub
fi

chown -R mysql:mysql /run/mysqld
chown -R mysql:mysql /var/lib/mysql
9 changes: 9 additions & 0 deletions setup/templates/proxy/conf/salt-startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# we need to remove the master pub key because the
# startup of this machine invokes new not accepted
# crypto stuff
if [ -f "/etc/salt/pki/minion/minion_master.pub" ]
then
rm /etc/salt/pki/minion/minion_master.pub
fi
6 changes: 6 additions & 0 deletions setup/templates/proxy/conf/startup.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[program:startup]
command=./root/salt-startup.sh
autostart=true
autorestart=false
user=root
startsecs=0
6 changes: 6 additions & 0 deletions setup/templates/proxy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ services:
- "80:80"
- "443:443"
volumes:
- type: bind
source: ./conf/salt-startup.sh
target: /root/salt-startup.sh
- type: bind
source: ./conf/startup.conf
target: /etc/supervisor/conf.d/startup.conf
- type: bind
source: ./conf/localcerts/
target: /etc/ssl/localcerts/
Expand Down
30 changes: 30 additions & 0 deletions setup/updates/update-20240807.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

doil_update_20240807() {
cp ${SCRIPT_DIR}/../app/src/App.php /usr/local/lib/doil/app/src/
cp -r ${SCRIPT_DIR}/../setup/stack/states/ /usr/local/share/doil/stack/states

cp ${SCRIPT_DIR}/../setup/templates/mail/conf/salt-startup.sh /usr/local/lib/doil/server/mail/conf/

cp ${SCRIPT_DIR}/../setup/templates/proxy/conf/salt-startup.sh /usr/local/lib/doil/server/proxy/conf/
cp ${SCRIPT_DIR}/../setup/templates/proxy/conf/startup.conf /usr/local/lib/doil/server/proxy/conf/
cp ${SCRIPT_DIR}/../setup/templates/proxy/docker-compose.yml /usr/local/lib/doil/server/proxy/

chmod +x /usr/local/lib/doil/server/proxy/conf/salt-startup.sh

if [ $(docker ps -a --filter "name=_local" --filter "name=_global" --format "{{.Names}}" | wc -l) -gt 0 ]
doil_status_send_message "Prepare existing instances to work with new doil"
then
for INSTANCE in $(docker ps -a --filter "name=_local" --filter "name=_global" --format "{{.Names}}")
do
docker start ${INSTANCE} &> /dev/null
sleep 5
docker exec -it ${INSTANCE} /bin/bash -c "sed -i 's%/var/lib/salt/pki/minion/minion_master.pub%/etc/salt/pki/minion/minion_master.pub%g' /root/salt-startup.sh" &> /dev/null
docker commit ${INSTANCE} doil/${INSTANCE}:stable &> /dev/null
docker stop ${INSTANCE} &> /dev/null
done
doil_status_okay
fi

return $?
}
Loading