NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
PHP 49% JavaScript 35% HTML 9% CSS 4% Shell 2% Python 1% Lua 0% Perl 0% Ruby 0% SCSS 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git

Trace

helper-scripts/mailcow-reset-admin.sh

Trace helps you understand code history line by line. See who changed each line, when it changed, and which commit introduced it.

mailcow-reset-admin.sh on main
Author Date Commit Line Code
Harald Glatt about 7 years ago 7dc0a05

Update all helper scripts to '/usr/bin/env bash' shebang

Full commit hash
7dc0a05a71d958918644339649ac6874c821eacb
Author
Harald Glatt <[email protected]>
Date
about 7 years ago
Selected line
1
#!/usr/bin/env bash
Open commit View diff
1 #!/usr/bin/env bash
andryyy almost 9 years ago bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
2
[[ -f mailcow.conf ]] && source mailcow.conf
Open commit View diff
2 [[ -f mailcow.conf ]] && source mailcow.conf
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
3
[[ -f ../mailcow.conf ]] && source ../mailcow.conf
Open commit View diff
3 [[ -f ../mailcow.conf ]] && source ../mailcow.conf
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
4
Open commit View diff
4
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
5
if [[ -z ${DBUSER} ]] || [[ -z ${DBPASS} ]] || [[ -z ${DBNAME} ]]; then
Open commit View diff
5 if [[ -z ${DBUSER} ]] || [[ -z ${DBPASS} ]] || [[ -z ${DBNAME} ]]; then
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
6
	echo "Cannot find mailcow.conf, make sure this script is run from within the mailcow folder."
Open commit View diff
6 echo "Cannot find mailcow.conf, make sure this script is run from within the mailcow folder."
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
7
	exit 1
Open commit View diff
7 exit 1
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
8
fi
Open commit View diff
8 fi
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
9
Open commit View diff
9
Hichem Ammar Khodja 5 months ago 4732f56

Add skip feature to mailcow admin password reset script

Full commit hash
4732f568faebc3984b87896af44f9411aa79d6f6
Author
Hichem Ammar Khodja <[email protected]>
Date
5 months ago
Selected line
10
SKIP_CONFIRM=false
Open commit View diff
10 SKIP_CONFIRM=false
same change 4732f56

Add skip feature to mailcow admin password reset script

Full commit hash
4732f568faebc3984b87896af44f9411aa79d6f6
Author
Hichem Ammar Khodja <[email protected]>
Date
5 months ago
Selected line
11
if [[ "${1:-}" == "-y" || "${1:-}" == "--yes" ]]; then
Open commit View diff
11 if [[ "${1:-}" == "-y" || "${1:-}" == "--yes" ]]; then
same change 4732f56

Add skip feature to mailcow admin password reset script

Full commit hash
4732f568faebc3984b87896af44f9411aa79d6f6
Author
Hichem Ammar Khodja <[email protected]>
Date
5 months ago
Selected line
12
    SKIP_CONFIRM=true
Open commit View diff
12 SKIP_CONFIRM=true
same change 4732f56

Add skip feature to mailcow admin password reset script

Full commit hash
4732f568faebc3984b87896af44f9411aa79d6f6
Author
Hichem Ammar Khodja <[email protected]>
Date
5 months ago
Selected line
13
    shift # prevent $1 from bleeding into head -c${1:-16} below
Open commit View diff
13 shift # prevent $1 from bleeding into head -c${1:-16} below
same change 4732f56

Add skip feature to mailcow admin password reset script

Full commit hash
4732f568faebc3984b87896af44f9411aa79d6f6
Author
Hichem Ammar Khodja <[email protected]>
Date
5 months ago
Selected line
14
fi
Open commit View diff
14 fi
same change 4732f56

Add skip feature to mailcow admin password reset script

Full commit hash
4732f568faebc3984b87896af44f9411aa79d6f6
Author
Hichem Ammar Khodja <[email protected]>
Date
5 months ago
Selected line
15
Open commit View diff
15
andryyy almost 9 years ago bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
16
echo -n "Checking MySQL service... "
Open commit View diff
16 echo -n "Checking MySQL service... "
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
17
if [[ -z $(docker ps -qf name=mysql-mailcow) ]]; then
Open commit View diff
17 if [[ -z $(docker ps -qf name=mysql-mailcow) ]]; then
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
18
	echo "failed"
Open commit View diff
18 echo "failed"
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
19
	echo "MySQL (mysql-mailcow) is not up and running, exiting..."
Open commit View diff
19 echo "MySQL (mysql-mailcow) is not up and running, exiting..."
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
20
	exit 1
Open commit View diff
20 exit 1
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
21
fi
Open commit View diff
21 fi
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
22
Open commit View diff
22
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
23
echo "OK"
Open commit View diff
23 echo "OK"
Hichem Ammar Khodja 5 months ago 4732f56

Add skip feature to mailcow admin password reset script

Full commit hash
4732f568faebc3984b87896af44f9411aa79d6f6
Author
Hichem Ammar Khodja <[email protected]>
Date
5 months ago
Selected line
24
if [[ "$SKIP_CONFIRM" == "true" ]]; then
Open commit View diff
24 if [[ "$SKIP_CONFIRM" == "true" ]]; then
same change 4732f56

Add skip feature to mailcow admin password reset script

Full commit hash
4732f568faebc3984b87896af44f9411aa79d6f6
Author
Hichem Ammar Khodja <[email protected]>
Date
5 months ago
Selected line
25
    response="yes"
Open commit View diff
25 response="yes"
same change 4732f56

Add skip feature to mailcow admin password reset script

Full commit hash
4732f568faebc3984b87896af44f9411aa79d6f6
Author
Hichem Ammar Khodja <[email protected]>
Date
5 months ago
Selected line
26
else
Open commit View diff
26 else
same change 4732f56

Add skip feature to mailcow admin password reset script

Full commit hash
4732f568faebc3984b87896af44f9411aa79d6f6
Author
Hichem Ammar Khodja <[email protected]>
Date
5 months ago
Selected line
27
    read -r -p "Are you sure you want to reset the mailcow administrator account? [y/N] " response
Open commit View diff
27 read -r -p "Are you sure you want to reset the mailcow administrator account? [y/N] " response
same change 4732f56

Add skip feature to mailcow admin password reset script

Full commit hash
4732f568faebc3984b87896af44f9411aa79d6f6
Author
Hichem Ammar Khodja <[email protected]>
Date
5 months ago
Selected line
28
    response=${response,,}
Open commit View diff
28 response=${response,,}
same change 4732f56

Add skip feature to mailcow admin password reset script

Full commit hash
4732f568faebc3984b87896af44f9411aa79d6f6
Author
Hichem Ammar Khodja <[email protected]>
Date
5 months ago
Selected line
29
fi
Open commit View diff
29 fi
andryyy almost 9 years ago bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
30
if [[ "$response" =~ ^(yes|y)$ ]]; then
Open commit View diff
30 if [[ "$response" =~ ^(yes|y)$ ]]; then
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
31
	echo -e "\nWorking, please wait..."
Open commit View diff
31 echo -e "\nWorking, please wait..."
DerLinkman over 3 years ago 6795577

Fix broken pipe error in reset-admin.sh

Full commit hash
67955779b03ee807a9cd3463159c774e7c89c4db
Author
DerLinkman <[email protected]>
Date
over 3 years ago
Selected line
32
  random=$(</dev/urandom tr -dc _A-Z-a-z-0-9 2> /dev/null | head -c${1:-16})
Open commit View diff
32 random=$(</dev/urandom tr -dc _A-Z-a-z-0-9 2> /dev/null | head -c${1:-16})
prey87 about 5 years ago 171f394

[Helper] Use random password for mailcow-reset-admin.sh (#4162)

Full commit hash
171f394fd133149e1f8b04c231f341d79cdecd9e
Author
prey87 <[email protected]>
Date
about 5 years ago
Selected line
33
  password=$(docker exec -it $(docker ps -qf name=dovecot-mailcow) doveadm pw -s SSHA256 -p ${random} | tr -d '\r')
Open commit View diff
33 password=$(docker exec -it $(docker ps -qf name=dovecot-mailcow) doveadm pw -s SSHA256 -p ${random} | tr -d '\r')
André almost 8 years ago 53832d8

[Helper] Fix mailcow reset admin to work in multi-admin environment

Full commit hash
53832d890c35b722f44ae74b96e8fdad6359be30
Author
André <[email protected]>
Date
almost 8 years ago
Selected line
34
	docker exec -it $(docker ps -qf name=mysql-mailcow) mysql -u${DBUSER} -p${DBPASS} ${DBNAME} -e "DELETE FROM admin WHERE username='admin';"
Open commit View diff
34 docker exec -it $(docker ps -qf name=mysql-mailcow) mysql -u${DBUSER} -p${DBPASS} ${DBNAME} -e "DELETE FROM admin WHERE username='admin';"
same change 53832d8

[Helper] Fix mailcow reset admin to work in multi-admin environment

Full commit hash
53832d890c35b722f44ae74b96e8fdad6359be30
Author
André <[email protected]>
Date
almost 8 years ago
Selected line
35
  docker exec -it $(docker ps -qf name=mysql-mailcow) mysql -u${DBUSER} -p${DBPASS} ${DBNAME} -e "DELETE FROM domain_admins WHERE username='admin';"
Open commit View diff
35 docker exec -it $(docker ps -qf name=mysql-mailcow) mysql -u${DBUSER} -p${DBPASS} ${DBNAME} -e "DELETE FROM domain_admins WHERE username='admin';"
prey87 about 5 years ago 171f394

[Helper] Use random password for mailcow-reset-admin.sh (#4162)

Full commit hash
171f394fd133149e1f8b04c231f341d79cdecd9e
Author
prey87 <[email protected]>
Date
about 5 years ago
Selected line
36
	docker exec -it $(docker ps -qf name=mysql-mailcow) mysql -u${DBUSER} -p${DBPASS} ${DBNAME} -e "INSERT INTO admin (username, password, superadmin, active) VALUES ('admin', '${password}', 1, 1);"
Open commit View diff
36 docker exec -it $(docker ps -qf name=mysql-mailcow) mysql -u${DBUSER} -p${DBPASS} ${DBNAME} -e "INSERT INTO admin (username, password, superadmin, active) VALUES ('admin', '${password}', 1, 1);"
andryyy almost 9 years ago bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
37
	docker exec -it $(docker ps -qf name=mysql-mailcow) mysql -u${DBUSER} -p${DBPASS} ${DBNAME} -e "DELETE FROM tfa WHERE username='admin';"
Open commit View diff
37 docker exec -it $(docker ps -qf name=mysql-mailcow) mysql -u${DBUSER} -p${DBPASS} ${DBNAME} -e "DELETE FROM tfa WHERE username='admin';"
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
38
	echo "
Open commit View diff
38 echo "
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
39
Reset credentials:
Open commit View diff
39 Reset credentials:
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
40
---
Open commit View diff
40 ---
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
41
Username: admin
Open commit View diff
41 Username: admin
prey87 about 5 years ago 171f394

[Helper] Use random password for mailcow-reset-admin.sh (#4162)

Full commit hash
171f394fd133149e1f8b04c231f341d79cdecd9e
Author
prey87 <[email protected]>
Date
about 5 years ago
Selected line
42
Password: ${random}
Open commit View diff
42 Password: ${random}
andryyy almost 9 years ago bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
43
TFA: none
Open commit View diff
43 TFA: none
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
44
"
Open commit View diff
44 "
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
45
else
Open commit View diff
45 else
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
46
	echo "Operation canceled."
Open commit View diff
46 echo "Operation canceled."
same change bf2be84

Create helper-scripts directory for future scripts

Full commit hash
bf2be8410d24dc8865c4bf96f30e76e9b140c6d5
Author
andryyy <[email protected]>
Date
almost 9 years ago
Selected line
47
fi
Open commit View diff
47 fi