9seconds 7 лет назад
Родитель
Сommit
0b555c4deb
1 измененных файлов: 36 добавлений и 1 удалений
  1. 36
    1
      README.md

+ 36
- 1
README.md Просмотреть файл

91
 $ head -c 512 /dev/urandom | md5sum | cut -f 1 -d ' '
91
 $ head -c 512 /dev/urandom | md5sum | cut -f 1 -d ' '
92
 ```
92
 ```
93
 
93
 
94
+## Secure mode
95
+
96
+If you want to support new secure mode, please prepend `dd` to the
97
+secret. For example, secret `cf18fa8ea0267057e2c61a5f7322a8e7` should
98
+be `ddcf18fa8ea0267057e2c61a5f7322a8e7`. But pay attention that some
99
+old clients won't support this mode. If this is not your case, I would
100
+suggest to go with this mode.
101
+
102
+Oneliners to generate such secrets:
103
+
104
+```console
105
+$ echo dd$(openssl rand -hex 16)
106
+```
107
+
108
+or
109
+
110
+```console
111
+$ echo dd$(head -c 512 /dev/urandom | md5sum | cut -f 1 -d ' ')
112
+```
113
+
114
+
115
+# How to run the tool
116
+
94
 Now run the tool:
117
 Now run the tool:
95
 
118
 
96
 ```console
119
 ```console
97
 $ mtg <secret>
120
 $ mtg <secret>
98
 ```
121
 ```
99
 
122
 
123
+How to run the tool with ADTag:
124
+
125
+```console
126
+$ mtg <secret> <adtag>
127
+```
128
+
100
 This tool will listen on port 3128 by default with the given secret.
129
 This tool will listen on port 3128 by default with the given secret.
101
 
130
 
102
 # One-line runner
131
 # One-line runner
103
 
132
 
104
-```
133
+```console
105
 $ docker run --name mtg --restart=unless-stopped -p 3128:3128 -p 3129:3129 -d nineseconds/mtg $(openssl rand -hex 16)
134
 $ docker run --name mtg --restart=unless-stopped -p 3128:3128 -p 3129:3129 -d nineseconds/mtg $(openssl rand -hex 16)
106
 ```
135
 ```
107
 
136
 
137
+or in secret mode:
138
+
139
+```console
140
+$ docker run --name mtg --restart=unless-stopped -p 3128:3128 -p 3129:3129 -d nineseconds/mtg dd$(openssl rand -hex 16)
141
+```
142
+
108
 You will have this tool up and running on port 3128. Now curl
143
 You will have this tool up and running on port 3128. Now curl
109
 `localhost:3129` to get `tg://` links or do `docker logs mtg`. Also,
144
 `localhost:3129` to get `tg://` links or do `docker logs mtg`. Also,
110
 port 3129 will show you some statistics if you are interested in.
145
 port 3129 will show you some statistics if you are interested in.

Загрузка…
Отмена
Сохранить