Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mtproto_proxy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mtproto_proxy
Commits
35c8f0da
Unverified
Commit
35c8f0da
authored
Jul 29, 2019
by
Sergey Prokhorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix start.sh handling of -a key
parent
40b1d8da
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
start.sh
start.sh
+10
-8
No files found.
start.sh
View file @
35c8f0da
...
...
@@ -12,14 +12,16 @@ usage() {
echo
"To start in single-port mode configured from command-line:"
echo
"
${
THIS
}
-p <port> -s <secret> -t <ad tag>"
echo
"To only allow connections with randomized protocol (dd-secrets):"
echo
"
${
THIS
}
-d"
echo
"
${
THIS
}
-
a d
d"
echo
"Parameters:"
echo
"-p <port>: port to listen on. 1-65535"
echo
"-s <secret>: proxy secret. 32 hex characters 0-9 a-f"
echo
"-t <ad tag>: promo tag that you get from @MTProxybot. 32 hex characters"
echo
"-d: only allow 'secure' connections (with dd-secret)"
echo
"port, secret, tag and secure mode can also be configured via environment variables:"
echo
"MTP_PORT, MTP_SECRET, MTP_TAG, MTP_DD_ONLY"
echo
"-a dd: only allow 'secure' connections (with dd-secret) / fake-tls connections (base64 secrets)"
echo
"-a tls: only allow 'fake-tls' connections (base64 secrets)"
echo
"It's ok to provide both '-a dd -a tls'."
echo
"port, secret, tag and allowed protocols can also be configured via environment variables:"
echo
"MTP_PORT, MTP_SECRET, MTP_TAG, MTP_DD_ONLY, MTP_TLS_ONLY"
echo
"If both command line and environment are set, command line have higher priority."
}
...
...
@@ -37,7 +39,7 @@ DD_ONLY=${MTP_DD_ONLY:-""}
TLS_ONLY
=
${
MTP_TLS_ONLY
:-
""
}
# check command line options
while
getopts
"p:s:t:dh"
o
;
do
while
getopts
"p:s:t:
a:
dh"
o
;
do
case
"
${
o
}
"
in
p
)
PORT
=
${
OPTARG
}
...
...
@@ -49,9 +51,9 @@ while getopts "p:s:t:dh" o; do
TAG
=
${
OPTARG
}
;;
a
)
if
[
"
${
OPTARG
}
"
-e
"dd"
]
;
then
if
[
"
${
OPTARG
}
"
=
"dd"
]
;
then
DD_ONLY
=
"y"
elif
[
"
${
OPTARG
}
"
-eq
"tls"
]
;
then
elif
[
"
${
OPTARG
}
"
=
"tls"
]
;
then
TLS_ONLY
=
"y"
else
error
"Invalid -a value: '
${
OPTARG
}
'"
...
...
@@ -70,7 +72,7 @@ done
PROTO_ARG
=
""
if
[
-n
"
${
DD_ONLY
}
"
-a
-n
"
${
TLS_ONLY
}
"
]
;
then
PROTO_ARG
=
"-mtproto_proxy allowed_protocols [mtp_fake_tls, mtp_secure]"
PROTO_ARG
=
'-mtproto_proxy allowed_protocols [mtp_fake_tls,mtp_secure]'
elif
[
-n
"
${
DD_ONLY
}
"
]
;
then
PROTO_ARG
=
'-mtproto_proxy allowed_protocols [mtp_secure]'
elif
[
-n
"
${
TLS_ONLY
}
"
]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment