소스 검색

change oper password on launching the server for the first time

pull/7/head
Daniel Oaks 5 년 전
부모
커밋
6d29a97621
1개의 변경된 파일16개의 추가작업 그리고 2개의 파일을 삭제
  1. 16
    2
      run.sh

+ 16
- 2
run.sh 파일 보기

6
 # make config file
6
 # make config file
7
 if [ ! -f "/ircd/ircd.yaml" ]; then
7
 if [ ! -f "/ircd/ircd.yaml" ]; then
8
     awk '{gsub(/path: languages/,"path: /ircd-bin/languages")}1' /ircd-bin/oragono.yaml > /tmp/ircd.yaml
8
     awk '{gsub(/path: languages/,"path: /ircd-bin/languages")}1' /ircd-bin/oragono.yaml > /tmp/ircd.yaml
9
-    mv /tmp/ircd.yaml /ircd/ircd.yaml
9
+
10
+    # change default oper passwd
11
+    OPERPASS=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c20)
12
+    echo "Oper username:password is dan:$OPERPASS"
13
+    ENCRYPTEDPASS=$(echo "$OPERPASS" | /ircd-bin/oragono genpasswd)
14
+    ORIGINALPASS='\$2a\$04\$LiytCxaY0lI.guDj2pBN4eLRD5cdM2OLDwqmGAgB6M2OPirbF5Jcu'
15
+
16
+    awk "{gsub(/password: \\\"$ORIGINALPASS\\\"/,\"password: \\\"$ENCRYPTEDPASS\\\"\")}1" /tmp/ircd.yaml > /tmp/ircd2.yaml
17
+
18
+    unset OPERPASS
19
+    unset ENCRYPTEDPASS
20
+    unset ORIGINALPASS
21
+
22
+    mv /tmp/ircd2.yaml /ircd/ircd.yaml
10
 fi
23
 fi
11
 
24
 
12
-# make db and certs
25
+# make db
13
 if [ ! -f "/ircd/ircd.db" ]; then
26
 if [ ! -f "/ircd/ircd.db" ]; then
14
     /ircd-bin/oragono initdb
27
     /ircd-bin/oragono initdb
15
 fi
28
 fi
16
 
29
 
30
+# make self-signed certs
17
 if [ ! -f "/ircd/tls.key" ]; then
31
 if [ ! -f "/ircd/tls.key" ]; then
18
     /ircd-bin/oragono mkcerts
32
     /ircd-bin/oragono mkcerts
19
 fi
33
 fi

Loading…
취소
저장