portainer password

This commit is contained in:
qiaofeng1227 2023-10-17 17:42:38 +08:00
parent e6d7da91aa
commit f95e84391d
4 changed files with 10 additions and 12 deletions

View file

@ -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<help@websoft9.com>"

View file

@ -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 {

View file

@ -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

View file

@ -1,5 +1,5 @@
{
"version": "0.8.26-rc58",
"version": "0.8.26-rc59",
"plugins": {
"portainer": "0.0.7",
"nginx": "0.0.5",