Pārlūkot izejas kodu

ZNC: Update configuration template for znc 1.4

ZNC 1.4 uses a new section within the configuration file to specify
password hash and salt. This requires adding a new Ansible variable
'irc_password_salt'.

Also update the README file to reflect above changes.
Lorenzo Villani 10 gadus atpakaļ
vecāks
revīzija
9b5c2b0229

+ 11
- 4
README.textile Parādīt failu

@@ -147,16 +147,23 @@ bc. python3 -c 'import crypt; print(crypt.crypt("password", salt=crypt.METHOD_SH
147 147
 Same for the IRC password hash...
148 148
 
149 149
 bc. # znc --makepass
150
+[ ** ] Type your new password.
150 151
 [ ?? ] Enter Password: foo
151 152
 [ ?? ] Confirm Password: foo
152
-[ ** ] Use this in the <User> section of your config:
153
-[ ** ] Pass = sha256#4bfc209c5e19874337fd89c80675ad194836efea5efd4189b7f73cd9e0a6094f#,i*Msa0B;w9yR23nm1ZB#
153
+[ ** ] Kill ZNC process, if it's running.
154
+[ ** ] Then replace password in the <User> section of your config with this:
155
+<Pass password>
156
+        Method = sha256
157
+        Hash = 310c5f99825e80d5b1d663a0a993b8701255f16b2f6056f335ba6e3e720e57ed
158
+        Salt = YdlPM5yjBmc/;JO6cfL5
159
+</Pass>
160
+[ ** ] After that start ZNC again, and you should be able to login with the new password.
154 161
 
155
-Take the string beginning with @sha256#@ and insert it as the value for @irc_password_hash@.
162
+Take the strings after @Hash =@ and @Salt =@ and insert them as the value for @irc_password_hash@ and @irc_password_salt@ respectively.
156 163
 
157 164
 Alternatively, if you don't already have @znc@ installed, Python 3.3 or higher will generate the appropriate string for you on Unix-based platforms (assuming your password is @password@):
158 165
 
159
-bc. python3 -c 'import crypt; print("sha256#{}#{}".format(*crypt.crypt("password", salt=crypt.METHOD_SHA256).split("$")[2:]))'
166
+bc. python3 -c 'import crypt; print("irc_password_salt: \"{}\"\nirc_password_hash: \"{}\"".format(*crypt.crypt("password", salt=crypt.METHOD_SHA256).split("$")[2:]))'
160 167
 
161 168
 For git hosting, copy your public key into place. @cp ~/.ssh/id_rsa.pub roles/git/files/gitolite.pub@ or similar.
162 169
 

+ 6
- 2
roles/ircbouncer/templates/var_lib_znc_configs_znc.conf.j2 Parādīt failu

@@ -64,6 +64,12 @@ Version = 1.0
64 64
 	RealName = {{ irc_realname }}
65 65
 	TimestampFormat = [%H:%M:%S]
66 66
 
67
+	<Pass password>
68
+	        Method = sha256
69
+	        Hash = {{ irc_password_hash }}
70
+	        Salt = {{ irc_password_salt }}
71
+	</Pass>
72
+
67 73
 	<Network freenode>
68 74
 		BindHost = 0.0.0.0
69 75
 		FloodBurst = 4
@@ -74,6 +80,4 @@ Version = 1.0
74 80
 		LoadModule = savebuff
75 81
 		Server = chat.freenode.net +6697
76 82
 	</Network>
77
-
78
-	Pass = {{ irc_password_hash }}
79 83
 </User>

+ 1
- 0
vars/defaults.yml Parādīt failu

@@ -47,6 +47,7 @@ znc_version: 1.4
47 47
 # irc_realname: (required)
48 48
 # irc_quitmsg: (required)
49 49
 # irc_password_hash: (required)
50
+# irc_password_salt: (required)
50 51
 
51 52
 # mailserver
52 53
 mail_server_hostname: "mail.{{ domain }}"

+ 2
- 1
vars/testing.yml Parādīt failu

@@ -19,7 +19,8 @@ irc_nick: sovereign
19 19
 irc_ident: sovereign
20 20
 irc_realname: Mr. Sovereign
21 21
 irc_quitmsg: Bye
22
-irc_password_hash: "sha256#4bfc209c5e19874337fd89c80675ad194836efea5efd4189b7f73cd9e0a6094f#,i*Msa0B;w9yR23nm1ZB#" #foo
22
+irc_password_hash: "310c5f99825e80d5b1d663a0a993b8701255f16b2f6056f335ba6e3e720e57ed" #foo
23
+irc_password_salt: "YdlPM5yjBmc/;JO6cfL5"
23 24
 
24 25
 # mailserver
25 26
 mail_db_password: testPassword

+ 1
- 0
vars/user.yml Parādīt failu

@@ -19,6 +19,7 @@ irc_ident: TODO
19 19
 irc_realname: TODO
20 20
 irc_quitmsg: TODO
21 21
 irc_password_hash: TODO
22
+irc_password_salt: TODO
22 23
 
23 24
 # mailserver
24 25
 mail_db_password: TODO

Notiek ielāde…
Atcelt
Saglabāt