From f95e84391d393be6086bc1933fa4ffca52456402 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Tue, 17 Oct 2023 17:42:38 +0800 Subject: [PATCH] portainer password --- docker/deployment/Dockerfile | 4 ++-- docker/deployment/init_portainer.go | 2 +- systemd/script/crontab.sh | 14 ++++++-------- version.json | 2 +- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/docker/deployment/Dockerfile b/docker/deployment/Dockerfile index d8480a3c..122fbd86 100644 --- a/docker/deployment/Dockerfile +++ b/docker/deployment/Dockerfile @@ -1,11 +1,11 @@ -# step1: build entrypoint execute program init_portainer by golang +# step1: Build entrypoint execute program init_portainer by golang FROM golang:latest AS builder WORKDIR / COPY init_portainer.go / RUN go build -o init_portainer /init_portainer.go RUN chmod +x /init_portainer -# step2: copy build go program to portainer +# step2: Copy build go program to portainer # Dockerfile refer to: https://github.com/portainer/portainer/blob/develop/build/linux/Dockerfile FROM portainer/portainer-ce:2.19.0 LABEL maintainer="websoft9" diff --git a/docker/deployment/init_portainer.go b/docker/deployment/init_portainer.go index e2d57d12..d8ae36ea 100644 --- a/docker/deployment/init_portainer.go +++ b/docker/deployment/init_portainer.go @@ -44,7 +44,7 @@ func main() { func generatePassword(length int) string { rand.Seed(time.Now().UnixNano()) - charset := "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+{}[]:;?.,<>" + charset := "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@$()_" password := make([]byte, length) for i := range password { diff --git a/systemd/script/crontab.sh b/systemd/script/crontab.sh index c662ba23..a4d643f7 100644 --- a/systemd/script/crontab.sh +++ b/systemd/script/crontab.sh @@ -25,12 +25,10 @@ set_Firewalld(){ firewall-cmd --reload 2>/dev/nul } -# 循环,持续监控 -while true; do - # monitor /lib/systemd/system/cockpit.socket and config.ini, make sure config.ini port is the same with cockpit.socket - inotifywait -e modify -m $FILES | while read PATH EVENT FILE; do - echo "Set cockpit port by config.ini..." - export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH - on_change - done +# monitor /lib/systemd/system/cockpit.socket and config.ini, make sure config.ini port is the same with cockpit.socket +inotifywait -e modify -m $FILES | while read PATH EVENT FILE; do + echo "Set cockpit port by config.ini..." + export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH + on_change done + diff --git a/version.json b/version.json index de7ec1b0..d22d8306 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "0.8.26-rc58", + "version": "0.8.26-rc59", "plugins": { "portainer": "0.0.7", "nginx": "0.0.5",