Browse Source

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 years ago
parent
commit
9b5c2b0229

+ 11
- 4
README.textile View File

147
 Same for the IRC password hash...
147
 Same for the IRC password hash...
148
 
148
 
149
 bc. # znc --makepass
149
 bc. # znc --makepass
150
+[ ** ] Type your new password.
150
 [ ?? ] Enter Password: foo
151
 [ ?? ] Enter Password: foo
151
 [ ?? ] Confirm Password: foo
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
 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@):
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
 For git hosting, copy your public key into place. @cp ~/.ssh/id_rsa.pub roles/git/files/gitolite.pub@ or similar.
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 View File

64
 	RealName = {{ irc_realname }}
64
 	RealName = {{ irc_realname }}
65
 	TimestampFormat = [%H:%M:%S]
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
 	<Network freenode>
73
 	<Network freenode>
68
 		BindHost = 0.0.0.0
74
 		BindHost = 0.0.0.0
69
 		FloodBurst = 4
75
 		FloodBurst = 4
74
 		LoadModule = savebuff
80
 		LoadModule = savebuff
75
 		Server = chat.freenode.net +6697
81
 		Server = chat.freenode.net +6697
76
 	</Network>
82
 	</Network>
77
-
78
-	Pass = {{ irc_password_hash }}
79
 </User>
83
 </User>

+ 1
- 0
vars/defaults.yml View File

47
 # irc_realname: (required)
47
 # irc_realname: (required)
48
 # irc_quitmsg: (required)
48
 # irc_quitmsg: (required)
49
 # irc_password_hash: (required)
49
 # irc_password_hash: (required)
50
+# irc_password_salt: (required)
50
 
51
 
51
 # mailserver
52
 # mailserver
52
 mail_server_hostname: "mail.{{ domain }}"
53
 mail_server_hostname: "mail.{{ domain }}"

+ 2
- 1
vars/testing.yml View File

19
 irc_ident: sovereign
19
 irc_ident: sovereign
20
 irc_realname: Mr. Sovereign
20
 irc_realname: Mr. Sovereign
21
 irc_quitmsg: Bye
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
 # mailserver
25
 # mailserver
25
 mail_db_password: testPassword
26
 mail_db_password: testPassword

+ 1
- 0
vars/user.yml View File

19
 irc_realname: TODO
19
 irc_realname: TODO
20
 irc_quitmsg: TODO
20
 irc_quitmsg: TODO
21
 irc_password_hash: TODO
21
 irc_password_hash: TODO
22
+irc_password_salt: TODO
22
 
23
 
23
 # mailserver
24
 # mailserver
24
 mail_db_password: TODO
25
 mail_db_password: TODO

Loading…
Cancel
Save