gordonchan commited on
Commit
858b198
1 Parent(s): 422efd0

Upload 4 files

Browse files
config/config-tls.toml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ [system]
2
+ server_key = "a secret key"
3
+ data_dir = "./data"
4
+
5
+ [network]
6
+ bind = "0.0.0.0:3000"
7
+ tls = true
config/config.toml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # webclient_url = "https://github.com/Privoce/vocechat-web/releases/latest/download"
2
+
3
+ [webclient]
4
+ url = "https://s.voce.chat/web_client/v0.4.x"
5
+
6
+ [system]
7
+ data_dir = "./data"
8
+ token_expiry_seconds = 300
9
+ refresh_token_expiry_seconds = 604800
10
+
11
+ # magic_token_expiry_seconds = 600
12
+
13
+ [network]
14
+ bind = "0.0.0.0:3000"
15
+ # domain = "chat.privoce.com"
16
+ # frontend_url = "http://1.2.3.4:4000"
17
+
18
+ # [network.tls]
19
+ # type = "self_signed"
20
+
21
+ # [network.tls]
22
+ # type = "certificate"
23
+ # cert = "...."
24
+ # key = "...."
25
+ # path = "./cert/"
26
+
27
+ # [network.tls]
28
+ # type = "acme_http_01"
29
+ # directory_url = "https://acme-v02.api.letsencrypt.org/directory"
30
+ # http_bind = "0.0.0.0:80"
31
+ # cache_path = "./data/cert"
32
+
33
+ # [network.tls]
34
+ # type = "acme_tls_alpn_01"
35
+ # directory_url = "https://acme-v02.api.letsencrypt.org/directory"
36
+ # cache_path = "./data/cert"
37
+
38
+ [template.register_by_email]
39
+ subject = "Register code"
40
+ file = "templates/register_by_email.html"
41
+
42
+ [template.login_by_email]
43
+ subject = "Your sign-in link for Vocechat"
44
+ file = "templates/login_by_email.html"
45
+
46
+ #[[user]]
47
+ #name = "Guest"
48
+ #password = "123456"
49
+ #email = "guest@voce.chat"
config/templates/login_by_email.html ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>VoceChat Link</title>
8
+ <style type="text/css">
9
+ #outlook a {
10
+ padding: 0;
11
+ }
12
+
13
+ body {
14
+ width: 100% !important;
15
+ -webkit-text-size-adjust: 100%;
16
+ -ms-text-size-adjust: 100%;
17
+ margin: 0;
18
+ padding: 0;
19
+ }
20
+
21
+ .ExternalClass {
22
+ width: 100%;
23
+ }
24
+
25
+ .ExternalClass,
26
+ .ExternalClass p,
27
+ .ExternalClass span,
28
+ .ExternalClass font,
29
+ .ExternalClass td,
30
+ .ExternalClass div {
31
+ line-height: 100%;
32
+ }
33
+
34
+ #backgroundTable {
35
+ margin: 0;
36
+ padding: 0;
37
+ width: 100% !important;
38
+ line-height: 100% !important;
39
+ }
40
+
41
+ img {
42
+ outline: none;
43
+ text-decoration: none;
44
+ -ms-interpolation-mode: bicubic;
45
+ }
46
+
47
+ a img {
48
+ border: none;
49
+ }
50
+
51
+ .image_fix {
52
+ display: block;
53
+ }
54
+
55
+ p {
56
+ margin: 1em 0;
57
+ }
58
+
59
+ h1,
60
+ h2,
61
+ h3,
62
+ h4,
63
+ h5,
64
+ h6 {
65
+ color: black !important;
66
+ }
67
+
68
+ h1 a,
69
+ h2 a,
70
+ h3 a,
71
+ h4 a,
72
+ h5 a,
73
+ h6 a {
74
+ color: blue !important;
75
+ }
76
+
77
+ h1 a:active,
78
+ h2 a:active,
79
+ h3 a:active,
80
+ h4 a:active,
81
+ h5 a:active,
82
+ h6 a:active {
83
+ color: red !important;
84
+ }
85
+
86
+ h1 a:visited,
87
+ h2 a:visited,
88
+ h3 a:visited,
89
+ h4 a:visited,
90
+ h5 a:visited,
91
+ h6 a:visited {
92
+ color: purple !important;
93
+ }
94
+
95
+ table td {
96
+ border-collapse: collapse;
97
+ }
98
+
99
+ table {
100
+ border-collapse: collapse;
101
+ mso-table-lspace: 0pt;
102
+ mso-table-rspace: 0pt;
103
+ }
104
+
105
+ a {
106
+ color: orange;
107
+ }
108
+
109
+ @media only screen and (max-device-width: 480px) {
110
+
111
+ a[href^="tel"],
112
+ a[href^="sms"] {
113
+ text-decoration: none;
114
+ color: black;
115
+ /* or whatever your want */
116
+ pointer-events: none;
117
+ cursor: default;
118
+ }
119
+
120
+ .mobile_link a[href^="tel"],
121
+ .mobile_link a[href^="sms"] {
122
+ text-decoration: default;
123
+ color: orange !important;
124
+ /* or whatever your want */
125
+ pointer-events: auto;
126
+ cursor: default;
127
+ }
128
+ }
129
+
130
+ @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
131
+
132
+ a[href^="tel"],
133
+ a[href^="sms"] {
134
+ text-decoration: none;
135
+ color: blue;
136
+ pointer-events: none;
137
+ cursor: default;
138
+ }
139
+
140
+ .mobile_link a[href^="tel"],
141
+ .mobile_link a[href^="sms"] {
142
+ text-decoration: default;
143
+ color: orange !important;
144
+ pointer-events: auto;
145
+ cursor: default;
146
+ }
147
+ }
148
+
149
+ #email_body {
150
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
151
+ width: 500px;
152
+ }
153
+
154
+ img {
155
+ display: block;
156
+ }
157
+
158
+ a {
159
+ text-decoration: none;
160
+ }
161
+
162
+ #email_body .p {
163
+ font-style: normal;
164
+ font-weight: 400;
165
+ font-size: 12px;
166
+ line-height: 18px;
167
+ color: #1D2939;
168
+ }
169
+
170
+ #email_body .logo {
171
+ width: 64px;
172
+ height: 64px;
173
+ }
174
+
175
+ #email_body .btn {
176
+ display: inline-block;
177
+ width: auto;
178
+ margin: 32px 0;
179
+ padding: 12px 20px;
180
+ text-decoration: none;
181
+ font-style: normal;
182
+ font-weight: 500;
183
+ font-size: 16px;
184
+ line-height: 24px;
185
+ color: #FFFFFF;
186
+ background: #22CCEE;
187
+ border: 1px solid #22CCEE;
188
+ box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
189
+ border-radius: 8px;
190
+ }
191
+
192
+ #email_body .hl {
193
+ color: #22CCEE;
194
+ }
195
+ </style>
196
+ </head>
197
+
198
+ <body>
199
+ <div id="email_body">
200
+ <img src="https://s.voce.chat/logo.png" alt="Vocechat logo" width="64" height="64" class="logo" />
201
+ <div class="tip">
202
+ <div class="p">
203
+ Click the button below to log in to Vocechat.
204
+ </div>
205
+ <div class="p">
206
+ This button will expire in 3 minutes.
207
+ </div>
208
+ </div>
209
+ <a href="{{ url }}/?magic_token={{ magic_token }}&exists={{ exists }}#/login" class="btn">Login to
210
+ Vocechat</a>
211
+ <div class="tail">
212
+ <div class="p">Button not showing? <a
213
+ href="{{ url }}/?magic_token={{ magic_token }}&exists={{ exists }}#/login" class="hl link">Click
214
+ here</a>
215
+ </div>
216
+ <div class="p">Confirming this request will securely log you in using <span class="hl">
217
+ {{ email }}
218
+ </span>.</div>
219
+ </div>
220
+ </div>
221
+ </body>
222
+
223
+ </html>
config/templates/register_by_email.html ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>VoceChat Link</title>
8
+ <style type="text/css">
9
+ #outlook a {
10
+ padding: 0;
11
+ }
12
+
13
+ body {
14
+ width: 100% !important;
15
+ -webkit-text-size-adjust: 100%;
16
+ -ms-text-size-adjust: 100%;
17
+ margin: 0;
18
+ padding: 0;
19
+ }
20
+
21
+ .ExternalClass {
22
+ width: 100%;
23
+ }
24
+
25
+ .ExternalClass,
26
+ .ExternalClass p,
27
+ .ExternalClass span,
28
+ .ExternalClass font,
29
+ .ExternalClass td,
30
+ .ExternalClass div {
31
+ line-height: 100%;
32
+ }
33
+
34
+ #backgroundTable {
35
+ margin: 0;
36
+ padding: 0;
37
+ width: 100% !important;
38
+ line-height: 100% !important;
39
+ }
40
+
41
+ img {
42
+ outline: none;
43
+ text-decoration: none;
44
+ -ms-interpolation-mode: bicubic;
45
+ }
46
+
47
+ a img {
48
+ border: none;
49
+ }
50
+
51
+ .image_fix {
52
+ display: block;
53
+ }
54
+
55
+ p {
56
+ margin: 1em 0;
57
+ }
58
+
59
+ h1,
60
+ h2,
61
+ h3,
62
+ h4,
63
+ h5,
64
+ h6 {
65
+ color: black !important;
66
+ }
67
+
68
+ h1 a,
69
+ h2 a,
70
+ h3 a,
71
+ h4 a,
72
+ h5 a,
73
+ h6 a {
74
+ color: blue !important;
75
+ }
76
+
77
+ h1 a:active,
78
+ h2 a:active,
79
+ h3 a:active,
80
+ h4 a:active,
81
+ h5 a:active,
82
+ h6 a:active {
83
+ color: red !important;
84
+ }
85
+
86
+ h1 a:visited,
87
+ h2 a:visited,
88
+ h3 a:visited,
89
+ h4 a:visited,
90
+ h5 a:visited,
91
+ h6 a:visited {
92
+ color: purple !important;
93
+ }
94
+
95
+ table td {
96
+ border-collapse: collapse;
97
+ }
98
+
99
+ table {
100
+ border-collapse: collapse;
101
+ mso-table-lspace: 0pt;
102
+ mso-table-rspace: 0pt;
103
+ }
104
+
105
+ a {
106
+ color: orange;
107
+ }
108
+
109
+ @media only screen and (max-device-width: 480px) {
110
+
111
+ a[href^="tel"],
112
+ a[href^="sms"] {
113
+ text-decoration: none;
114
+ color: black;
115
+ /* or whatever your want */
116
+ pointer-events: none;
117
+ cursor: default;
118
+ }
119
+
120
+ .mobile_link a[href^="tel"],
121
+ .mobile_link a[href^="sms"] {
122
+ text-decoration: default;
123
+ color: orange !important;
124
+ /* or whatever your want */
125
+ pointer-events: auto;
126
+ cursor: default;
127
+ }
128
+ }
129
+
130
+ @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
131
+
132
+ a[href^="tel"],
133
+ a[href^="sms"] {
134
+ text-decoration: none;
135
+ color: blue;
136
+ pointer-events: none;
137
+ cursor: default;
138
+ }
139
+
140
+ .mobile_link a[href^="tel"],
141
+ .mobile_link a[href^="sms"] {
142
+ text-decoration: default;
143
+ color: orange !important;
144
+ pointer-events: auto;
145
+ cursor: default;
146
+ }
147
+ }
148
+
149
+ #email_body {
150
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
151
+ width: 500px;
152
+ }
153
+
154
+ img {
155
+ display: block;
156
+ }
157
+
158
+ a {
159
+ text-decoration: none;
160
+ }
161
+
162
+ #email_body .p {
163
+ font-style: normal;
164
+ font-weight: 400;
165
+ font-size: 12px;
166
+ line-height: 18px;
167
+ color: #1D2939;
168
+ }
169
+
170
+ #email_body .logo {
171
+ width: 64px;
172
+ height: 64px;
173
+ }
174
+
175
+ #email_body .btn {
176
+ display: inline-block;
177
+ width: auto;
178
+ margin: 32px 0;
179
+ padding: 12px 20px;
180
+ text-decoration: none;
181
+ font-style: normal;
182
+ font-weight: 500;
183
+ font-size: 16px;
184
+ line-height: 24px;
185
+ color: #FFFFFF;
186
+ background: #22CCEE;
187
+ border: 1px solid #22CCEE;
188
+ box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
189
+ border-radius: 8px;
190
+ }
191
+
192
+ #email_body .hl {
193
+ color: #22CCEE;
194
+ }
195
+ </style>
196
+ </head>
197
+
198
+ <body>
199
+ <div id="email_body">
200
+ <img src="https://s.voce.chat/logo.png" alt="Vocechat logo" width="64" height="64" class="logo" />
201
+ <div class="tip">
202
+ <div class="p">
203
+ Click the button below to log in to Vocechat.
204
+ </div>
205
+ <div class="p">
206
+ This button will expire in 3 minutes.
207
+ </div>
208
+ </div>
209
+ <a href="{{ url }}/?email={{ email }}&gid={{ gid }}&magic_token={{ magic_token }}#/register/set_name"
210
+ class="btn">Login to
211
+ Vocechat</a>
212
+ <div class="tail">
213
+ <div class="p">Button not showing? <a
214
+ href="{{ url }}/?email={{ email }}&gid={{ gid }}&magic_token={{ magic_token }}#/register/set_name"
215
+ class="hl link">Click here</a>
216
+ </div>
217
+ <div class="p">Confirming this request will securely log you in using <span class="hl">
218
+ {{ email }}
219
+ </span>.</div>
220
+ </div>
221
+ </div>
222
+ </body>
223
+
224
+ </html>