mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-26 23:59:41 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f271a57238 | ||
|
|
dded867ede | ||
|
|
fad5acea9a | ||
|
|
a0ea1b3e7d | ||
|
|
5e71f7daff | ||
|
|
36ae10ad16 | ||
|
|
f52dc0f0b9 | ||
|
|
ffa1a05009 | ||
|
|
6f02ec2747 | ||
|
|
ca4667c035 | ||
|
|
41a08c11be | ||
|
|
6c4663a045 | ||
|
|
83139bc2e8 | ||
|
|
2dc4a422c5 | ||
|
|
d0ec7687db | ||
|
|
b8e5853b6b | ||
|
|
ad6e151b7c | ||
|
|
16ac797008 | ||
|
|
48d72538e1 | ||
|
|
2b8845f65a | ||
|
|
f265ea0b52 | ||
|
|
5400d53cef | ||
|
|
da2b8b3c1a | ||
|
|
ee0de3613a | ||
|
|
8971fcf991 | ||
|
|
9529a1dfcf | ||
|
|
ea4b2cc3a2 | ||
|
|
6915ea126f | ||
|
|
efa6f6560c | ||
|
|
3ff0f8b7ab | ||
|
|
382e7915f0 | ||
|
|
da66016c7f | ||
|
|
69c6ddc8c4 | ||
|
|
c0c51357d9 | ||
|
|
8582b33f8e | ||
|
|
daa0e36e41 | ||
|
|
cfc3c2bd7d | ||
|
|
fdd303ee32 | ||
|
|
cdbd47dc5b | ||
|
|
fc544c4dff | ||
|
|
e8d6aa555a | ||
|
|
488317da1d | ||
|
|
527f0704a4 | ||
|
|
facc35e287 | ||
|
|
7011e78ece | ||
|
|
137ff3beea | ||
|
|
e78c1d2c07 | ||
|
|
cb9effab9b | ||
|
|
a0ae86957f | ||
|
|
73fbf9d262 | ||
|
|
7f430ccc79 | ||
|
|
307e6d2c49 | ||
|
|
3526759e59 | ||
|
|
a3b40e6176 | ||
|
|
6ca4a2686d | ||
|
|
1565c67c13 | ||
|
|
9921ccbe47 | ||
|
|
40d3bf636e | ||
|
|
2cbdc6e845 | ||
|
|
f6963ea302 | ||
|
|
cf7749b320 | ||
|
|
f599c3239c | ||
|
|
984366ce3e | ||
|
|
22c7dfe0e1 | ||
|
|
4b48311d82 | ||
|
|
3dcd83e6d6 | ||
|
|
7a80a6ceb8 | ||
|
|
33b2a31180 | ||
|
|
fb2d1c0442 | ||
|
|
7e1ddf2e84 | ||
|
|
5908695b0f | ||
|
|
7807faa71b | ||
|
|
d2fa99fbd4 | ||
|
|
1e019bad0e | ||
|
|
86ad7263a6 | ||
|
|
55761128b3 | ||
|
|
b68887b6f9 | ||
|
|
e9b8f37053 | ||
|
|
21346cb2ce | ||
|
|
fa43cafd58 | ||
|
|
8f62e42e7d | ||
|
|
f4ad34c35a | ||
|
|
ff3398c6a9 | ||
|
|
4fb5c95704 | ||
|
|
13a57812e5 | ||
|
|
a43c95023d | ||
|
|
75021a2003 | ||
|
|
bebc3894e2 | ||
|
|
ddb74a111c | ||
|
|
1e47e74c49 | ||
|
|
eca362af81 | ||
|
|
c31fe8367f | ||
|
|
f480c9dfe8 | ||
|
|
8de2be3b3b | ||
|
|
aea9ff8c94 | ||
|
|
e7bc76da73 | ||
|
|
207ddb7f02 | ||
|
|
f5ff81d0bc | ||
|
|
8c2ad56665 | ||
|
|
a986ed7a07 | ||
|
|
eceb5a22df | ||
|
|
7eba73fc8f | ||
|
|
122ca26249 | ||
|
|
6369fe966e | ||
|
|
cb27ca5223 | ||
|
|
932c4e3fd9 | ||
|
|
6818872f63 | ||
|
|
81a4e5bae3 | ||
|
|
0ae2754c1e | ||
|
|
05f83896bf | ||
|
|
f668a34910 | ||
|
|
763e21e053 | ||
|
|
7b85f6a684 | ||
|
|
92d3b08dd2 | ||
|
|
4877b39f2c | ||
|
|
44c47ee7d9 | ||
|
|
5f1ed7363b | ||
|
|
c370635fc4 | ||
|
|
3bfabb29f8 | ||
|
|
e4a5a7252c | ||
|
|
5f542a505a | ||
|
|
5b7446ba8f | ||
|
|
4af02c9268 | ||
|
|
ed5103d176 | ||
|
|
75dedeff28 | ||
|
|
c60af54c98 | ||
|
|
01f85cf755 | ||
|
|
305f9932ac | ||
|
|
c94766dff7 | ||
|
|
87fc8ae4ee | ||
|
|
9ab2e820b5 | ||
|
|
7798f78137 | ||
|
|
d60ac723a5 | ||
|
|
afb2ec0696 | ||
|
|
f18a751f89 | ||
|
|
8de071aa87 | ||
|
|
f173f8860d | ||
|
|
3a66c0a4c0 | ||
|
|
66ee250e5c | ||
|
|
c893e866bd | ||
|
|
fbc0953d5c | ||
|
|
37b1ab8169 | ||
|
|
b7769d05af | ||
|
|
fdda69c1f4 | ||
|
|
a757fae617 | ||
|
|
1c9577b9a9 | ||
|
|
b59c044663 | ||
|
|
de5acb2abd | ||
|
|
d6dea13a6f | ||
|
|
a04cd67eaa | ||
|
|
19cacf0bd9 | ||
|
|
27d5d8d102 | ||
|
|
6b944f3fa9 | ||
|
|
4f99443750 | ||
|
|
c462963d8e | ||
|
|
e41ab58b2c | ||
|
|
8f13582329 | ||
|
|
af9f23ece7 | ||
|
|
d77dc00fd1 | ||
|
|
101125de36 | ||
|
|
1dfe9e718b | ||
|
|
84879cc0ba | ||
|
|
757ad916ec | ||
|
|
fbc3ed5a18 | ||
|
|
69862b67cb | ||
|
|
fd7b25bf06 | ||
|
|
ab11e6c4a3 | ||
|
|
74d5b67ef4 | ||
|
|
6d8643b70e | ||
|
|
9e7246e864 | ||
|
|
c5affd2db4 | ||
|
|
794f667eea | ||
|
|
0259b58b95 | ||
|
|
9734b54f56 | ||
|
|
fe2b2fd544 | ||
|
|
086d4cbd6a | ||
|
|
2695d83847 | ||
|
|
dd5fe3994e | ||
|
|
5ab63a0b68 | ||
|
|
254112cfde | ||
|
|
5cae5dc866 | ||
|
|
56fdbd6e8a | ||
|
|
997671ee16 | ||
|
|
34e9c453fa | ||
|
|
3dde2de498 | ||
|
|
bdf9946fe5 | ||
|
|
eab5758b51 | ||
|
|
1772295a36 | ||
|
|
f0a672b16a | ||
|
|
01dad546b7 | ||
|
|
30aaccc155 | ||
|
|
2cb6297968 | ||
|
|
d66311a045 | ||
|
|
905e3d3152 | ||
|
|
7c08432a70 | ||
|
|
d4554cfabd | ||
|
|
1aecfa7995 | ||
|
|
289d2f5211 | ||
|
|
94efc7f7a6 | ||
|
|
d34c036eb7 | ||
|
|
4bf1f3990b | ||
|
|
a639bcb017 | ||
|
|
bed3977575 | ||
|
|
16af910f3a | ||
|
|
7c1bc48c85 | ||
|
|
05c4832c6c | ||
|
|
381ef993a7 | ||
|
|
1de06c5059 | ||
|
|
aaa04116a8 | ||
|
|
5fdd4a4d6f | ||
|
|
7871279fae | ||
|
|
ff15a8d480 | ||
|
|
95029e9e41 | ||
|
|
6286bfcd6e | ||
|
|
b1d21cbdca | ||
|
|
978f351560 | ||
|
|
41d1fa8b00 | ||
|
|
8c638fcaff | ||
|
|
6963af7614 | ||
|
|
f8c22d5f91 | ||
|
|
c104203765 | ||
|
|
45c3b89484 | ||
|
|
0d7f05b05b | ||
|
|
750bb38907 | ||
|
|
46cff56cf4 | ||
|
|
d0d3b90226 | ||
|
|
7a139e59a5 | ||
|
|
ff7f4b8ea6 | ||
|
|
ec48b7f30e | ||
|
|
88a09bc3ff | ||
|
|
0e13f57139 | ||
|
|
cbab76fe41 | ||
|
|
fb9337c030 | ||
|
|
ef9386e29d | ||
|
|
334de0658c | ||
|
|
ec469fa2a6 | ||
|
|
fbd1788f4c | ||
|
|
830b2d39d1 | ||
|
|
a338a0c689 | ||
|
|
af8a6e0b91 | ||
|
|
2997533287 | ||
|
|
5f06879843 | ||
|
|
da8a8615f4 | ||
|
|
51a82613a6 | ||
|
|
b87e998e4d | ||
|
|
4068a6955f | ||
|
|
07c1dc1462 | ||
|
|
acce67a512 | ||
|
|
e986f8a747 | ||
|
|
314503d8df | ||
|
|
8107f03062 | ||
|
|
a3fb7aff07 | ||
|
|
b1ac46da79 | ||
|
|
d125261e8c | ||
|
|
a4527783d6 | ||
|
|
fb70d06d3e | ||
|
|
57d687fcb8 | ||
|
|
ada24a98ec | ||
|
|
ba2584cebf | ||
|
|
05096c222a | ||
|
|
6c3c5f31a2 | ||
|
|
319a74de06 | ||
|
|
e088a5d7f9 | ||
|
|
f01c8bfee9 | ||
|
|
a7cdfa578d | ||
|
|
d52701518d | ||
|
|
7ddea44ffd | ||
|
|
760a521df8 | ||
|
|
62ceb36157 | ||
|
|
62be3c7b5b | ||
|
|
85c431b96e | ||
|
|
90c312f4cd | ||
|
|
451b3d180c | ||
|
|
f63a83f554 | ||
|
|
6b61cfde4c | ||
|
|
e6c3427cab | ||
|
|
4f0f3c81e1 | ||
|
|
bfbbf1f446 | ||
|
|
b79906da02 | ||
|
|
68ef9dcc59 | ||
|
|
3957210609 | ||
|
|
ee00956b74 | ||
|
|
083a70393f | ||
|
|
d9b1493260 | ||
|
|
7102afe856 | ||
|
|
a3729354b8 | ||
|
|
45796f66c7 | ||
|
|
260cbf7a3d | ||
|
|
bba9871ed8 | ||
|
|
f1af44f3a9 | ||
|
|
4ee7f71fb9 | ||
|
|
98604b5421 | ||
|
|
a0d580b36d | ||
|
|
4c0e3a1bac | ||
|
|
454f5e1d54 | ||
|
|
c4ac696919 | ||
|
|
afbdad0ac7 | ||
|
|
a1a65c3fd5 | ||
|
|
2fd536781f | ||
|
|
878a432481 | ||
|
|
3f92dc7355 | ||
|
|
bae96b0823 | ||
|
|
f77f65ac4e | ||
|
|
2d6eeff5f3 | ||
|
|
c206349ee2 | ||
|
|
77b0dc3397 | ||
|
|
a2641cb103 | ||
|
|
98f8ec1464 | ||
|
|
238ed094dd | ||
|
|
c853ea5b9e | ||
|
|
825563ad85 | ||
|
|
0c8be907e9 | ||
|
|
840dd5dbdf | ||
|
|
71d676eb58 | ||
|
|
8cb8be1be8 | ||
|
|
0381461495 | ||
|
|
483542b914 | ||
|
|
855c04d8f6 | ||
|
|
ab852c6860 | ||
|
|
a54b773fac | ||
|
|
4d7d2cab6e | ||
|
|
05e5fbe274 | ||
|
|
de40d1839d | ||
|
|
d8161e94b5 | ||
|
|
30c3764c90 | ||
|
|
ceb4912172 | ||
|
|
ce104a5b3c | ||
|
|
d8d3d8cc1b | ||
|
|
44c86236cd | ||
|
|
3ee78a3195 | ||
|
|
9b06edb4f6 | ||
|
|
9d314a5fba | ||
|
|
be40871276 | ||
|
|
35993dfaaf | ||
|
|
3d9d76fcf5 | ||
|
|
c6eddc69a1 | ||
|
|
758c290092 | ||
|
|
1a753da70d | ||
|
|
2e534c7794 | ||
|
|
237fa15e36 | ||
|
|
6f1bb65841 | ||
|
|
238b314c90 | ||
|
|
e12b061148 | ||
|
|
5e92822900 | ||
|
|
0252f4978c | ||
|
|
7299bcc0e2 | ||
|
|
416e30ed0d | ||
|
|
7c25c23325 | ||
|
|
c34d29b7dd | ||
|
|
1d515af787 | ||
|
|
499c4240ad | ||
|
|
23b9e698e0 | ||
|
|
a5fce1a2f6 | ||
|
|
c05023ab6d | ||
|
|
1e8130cae8 | ||
|
|
28724187fb | ||
|
|
35db214b78 | ||
|
|
1ba0008055 | ||
|
|
92f170fca2 | ||
|
|
71c58e0c77 | ||
|
|
00d2ecbc31 | ||
|
|
662603f9d8 | ||
|
|
8292ec21a7 | ||
|
|
ef318bff67 | ||
|
|
128386723a | ||
|
|
acc6db59a3 | ||
|
|
251660940e | ||
|
|
7e4504997e | ||
|
|
8d8ee23385 | ||
|
|
7e47d5bd92 | ||
|
|
7fce892391 | ||
|
|
23551e53bf | ||
|
|
35406e6b61 | ||
|
|
26534e9cbd | ||
|
|
2cd0a34fd5 | ||
|
|
d67a052aa8 | ||
|
|
7d04915d3d | ||
|
|
280c7c8976 | ||
|
|
bc7e9b2ac6 | ||
|
|
5355af3112 | ||
|
|
2cfad638a7 | ||
|
|
cfc9c30bd2 | ||
|
|
7b4e8b6d6b | ||
|
|
e945890613 | ||
|
|
5c7cc3c9b2 | ||
|
|
6e55af7f48 | ||
|
|
4ec2226d3e | ||
|
|
8d744e16fb | ||
|
|
af25cb460f | ||
|
|
2508b89d96 | ||
|
|
09a3ddeeac | ||
|
|
66bdd86c6b | ||
|
|
b624da443a | ||
|
|
3c51af3737 | ||
|
|
7e7a0d4336 | ||
|
|
e373d84717 | ||
|
|
68ff2373b4 | ||
|
|
8d58e2618e | ||
|
|
1bfa64303a | ||
|
|
81224b6708 | ||
|
|
6944a012d9 | ||
|
|
7652a9bba1 | ||
|
|
cb368e0792 | ||
|
|
e20584cb2e | ||
|
|
f23fc4fc44 | ||
|
|
3668634781 | ||
|
|
46a230ebd3 | ||
|
|
e8e1bdfbf1 | ||
|
|
a5f1f08b60 | ||
|
|
926ef71ba0 | ||
|
|
bc92819572 | ||
|
|
a76dd93e86 | ||
|
|
2900b80d88 | ||
|
|
d7b0061626 | ||
|
|
74134db09e | ||
|
|
878025598b | ||
|
|
6387bed4f2 | ||
|
|
cb6a4166b7 | ||
|
|
cf6946cc8b | ||
|
|
ab8db00b1f | ||
|
|
94dfa195db | ||
|
|
fb4ab5d07f | ||
|
|
57f11d8a0f | ||
|
|
013d4bc333 | ||
|
|
29ef226b3c | ||
|
|
d347f0a058 | ||
|
|
a316622a85 | ||
|
|
d87241c487 | ||
|
|
144af547fb | ||
|
|
35d1de6f5e | ||
|
|
a592f07783 | ||
|
|
161cbbd452 | ||
|
|
067fdd7f95 | ||
|
|
d77e528847 | ||
|
|
2b4d8e67e4 | ||
|
|
375e3a74d0 | ||
|
|
6dc145b16b | ||
|
|
d162ad5c38 | ||
|
|
8198db8617 | ||
|
|
d83c1f47f8 | ||
|
|
20a929ca53 | ||
|
|
a80bef9ecf | ||
|
|
687ebafb1b | ||
|
|
5e2b2a399e | ||
|
|
5f341806b7 | ||
|
|
00513a7d28 | ||
|
|
dc7e098e6b | ||
|
|
8b57982a09 | ||
|
|
cebb45c095 | ||
|
|
13979b5df4 | ||
|
|
782878b5b4 | ||
|
|
6532163f01 | ||
|
|
862405bdfd | ||
|
|
c716c67da2 | ||
|
|
b94e1fc01f | ||
|
|
cc0fd518bd | ||
|
|
9a6908e623 | ||
|
|
65e57a251d | ||
|
|
25c375a78a | ||
|
|
a22e2be77b | ||
|
|
8a160dd188 | ||
|
|
fb56b7d307 | ||
|
|
5165a4d5bd | ||
|
|
bac19c9ae6 | ||
|
|
c98621aeef | ||
|
|
3dc698eccd | ||
|
|
c1beceb24b | ||
|
|
4ad05d1565 | ||
|
|
55d1bbe155 | ||
|
|
8a8622b30f | ||
|
|
1cf169b7ae | ||
|
|
d20e76bbc9 | ||
|
|
468124f55c | ||
|
|
17f07f2053 | ||
|
|
6d77141ecc | ||
|
|
7e681bbacd | ||
|
|
266e62644c | ||
|
|
f53b0eb985 | ||
|
|
bd1dcacf73 | ||
|
|
e1448b9eb1 | ||
|
|
70b14394b0 | ||
|
|
6c1b711fc9 | ||
|
|
34c4162cea | ||
|
|
461fae12e7 | ||
|
|
e8203ac3a5 | ||
|
|
beaa8777bb | ||
|
|
9254688d07 | ||
|
|
daa2b74354 | ||
|
|
bec6e589fb | ||
|
|
f9347c2f8b | ||
|
|
0d47a1eee3 | ||
|
|
58cf0d8def | ||
|
|
5fa261e91e | ||
|
|
b15d5bf681 | ||
|
|
e1b4e50242 | ||
|
|
346880eb2e | ||
|
|
e607c8b5d0 | ||
|
|
1fca6ada82 | ||
|
|
d7eb9fb82f | ||
|
|
1bd6eff0e6 | ||
|
|
e642100271 | ||
|
|
aac5c9fff9 | ||
|
|
e235ada0de | ||
|
|
7335bc2fb6 | ||
|
|
3f4c267a25 | ||
|
|
6279e86086 | ||
|
|
cc2979ee5b | ||
|
|
bad85a3d51 | ||
|
|
36f16fb899 | ||
|
|
5f550c9107 | ||
|
|
47c1640223 | ||
|
|
681182b1e5 | ||
|
|
9fae0082a3 | ||
|
|
c30065256f | ||
|
|
cbe0c2f511 | ||
|
|
1f2bdd7b80 | ||
|
|
0c902525e5 | ||
|
|
129d26475e | ||
|
|
29f8867a9e | ||
|
|
252c4cb36b | ||
|
|
07603ceea7 | ||
|
|
8ec14c131d | ||
|
|
1225dbced7 | ||
|
|
3cd9bdffcb | ||
|
|
336a4acd46 | ||
|
|
c5abe51e26 | ||
|
|
31062bdc3c | ||
|
|
8943099dfb | ||
|
|
09f007e741 | ||
|
|
4487fd4a73 | ||
|
|
5498a79115 | ||
|
|
9c7fc9fddc | ||
|
|
4d63f957c2 | ||
|
|
828e00e668 | ||
|
|
3ba16310c5 | ||
|
|
7aaa9c18dd | ||
|
|
72923879a3 | ||
|
|
b1cc2c7c70 | ||
|
|
d88c927ba9 | ||
|
|
cf58e62baa | ||
|
|
daf4a56665 | ||
|
|
05bc297ea7 | ||
|
|
7ea9ec89be | ||
|
|
f23b6b0d96 | ||
|
|
d2dcf4bb69 | ||
|
|
1ff0fabf15 | ||
|
|
e013cc2ab8 | ||
|
|
99a744abda | ||
|
|
062d60e9d6 | ||
|
|
b777ffec66 | ||
|
|
8a2050e7fa | ||
|
|
9fbb88238e | ||
|
|
36f8cde2fb | ||
|
|
f64cd475af | ||
|
|
a29d2ab66b | ||
|
|
fd1b7ce2a2 | ||
|
|
e0ccb34c10 | ||
|
|
ba29f38959 | ||
|
|
a6dfc81e98 | ||
|
|
fe05526472 | ||
|
|
a6445334e2 | ||
|
|
e5db29d1cb | ||
|
|
7bf7de53b2 | ||
|
|
312c40359c | ||
|
|
021314d6f5 | ||
|
|
ff67464aa1 | ||
|
|
c113f236e4 | ||
|
|
596dee0c5b | ||
|
|
32d5dc05c3 | ||
|
|
3a31da9b3d | ||
|
|
9356db8de6 | ||
|
|
dbbbe59ef2 | ||
|
|
c1c5875356 | ||
|
|
b81089f22e | ||
|
|
ee0eac51d6 | ||
|
|
6ecb4993fd | ||
|
|
285a7e6765 | ||
|
|
b2f82ed04f | ||
|
|
01ec2f12d5 | ||
|
|
624c3e6ae1 | ||
|
|
0d713dacc1 | ||
|
|
582f9d7be4 | ||
|
|
3f2659cb0f | ||
|
|
aeb0f4caa5 | ||
|
|
22555b58ec | ||
|
|
5448329c8a | ||
|
|
a8b000b7f1 | ||
|
|
edaee895e6 | ||
|
|
47f1bbc8d7 | ||
|
|
c9097154c6 | ||
|
|
9f6a8460ac | ||
|
|
637cb2e76d | ||
|
|
47affa0add | ||
|
|
eb829b062b | ||
|
|
3dd1969657 | ||
|
|
b6629850e5 | ||
|
|
e3840d2258 | ||
|
|
8c92470124 | ||
|
|
024c0fb749 | ||
|
|
ebd7b34159 | ||
|
|
d0725163d1 | ||
|
|
cc6ec2445c | ||
|
|
1075370594 | ||
|
|
1fd759d327 | ||
|
|
dd75eaa35e | ||
|
|
c30b4637a5 | ||
|
|
8c511a19e9 | ||
|
|
35153001ed | ||
|
|
3b5fa46e27 | ||
|
|
19eef46d7e | ||
|
|
c532958b9f | ||
|
|
936724f4f7 | ||
|
|
1e7e94d7ac | ||
|
|
859713d10f | ||
|
|
9eac5c13a8 | ||
|
|
041134007d | ||
|
|
37c380f4f7 | ||
|
|
9996856698 | ||
|
|
22cf9254c5 | ||
|
|
e7e7d2fddf | ||
|
|
336b411ea2 | ||
|
|
cb217d79c1 | ||
|
|
8ad8a9ccd2 | ||
|
|
70ed1233fb | ||
|
|
5471e0faf4 | ||
|
|
e85b064b52 | ||
|
|
9f6c0b5b8d | ||
|
|
3b67dc8447 | ||
|
|
bf4ef2284b | ||
|
|
19203381db | ||
|
|
4e2d4d56ac | ||
|
|
a905d00008 | ||
|
|
38a1ab80bc | ||
|
|
43b4c893ad | ||
|
|
96c28c6cba | ||
|
|
189b227853 | ||
|
|
d89134be33 | ||
|
|
3a1f8c2328 | ||
|
|
158bacc087 | ||
|
|
b88d07a1a7 | ||
|
|
e07054e8d0 | ||
|
|
536c8327ff | ||
|
|
0565cf050b | ||
|
|
ac429c8d52 | ||
|
|
09507a2fe9 | ||
|
|
5ee553e9a9 | ||
|
|
eed6e2962e | ||
|
|
76b040bfb8 | ||
|
|
941baaa311 | ||
|
|
92fbb0d2f5 | ||
|
|
1c7ce8744c | ||
|
|
02d52e89e9 | ||
|
|
d7373be071 | ||
|
|
ede4aee619 | ||
|
|
8af9ea8de8 | ||
|
|
603ab8187f | ||
|
|
953959efab | ||
|
|
480f999d21 | ||
|
|
03efdc451b | ||
|
|
54e9f9cedd | ||
|
|
930d9823ea | ||
|
|
6fe36b01d1 | ||
|
|
dec10d4edd | ||
|
|
37cebe08af | ||
|
|
3f2e621902 | ||
|
|
b7e3a85e88 | ||
|
|
79ea433caf | ||
|
|
a0591c9786 | ||
|
|
cc503ba925 | ||
|
|
68823c2921 | ||
|
|
46be58ab1d | ||
|
|
3d9ac1e1fb | ||
|
|
68fed46ea0 | ||
|
|
92b3dd8638 | ||
|
|
d8b5900be6 | ||
|
|
20fa72bd42 | ||
|
|
eb09ae7c58 | ||
|
|
b8127257f9 | ||
|
|
a5f7222a19 | ||
|
|
b56c294c01 | ||
|
|
b583e423c8 | ||
|
|
951304e18e | ||
|
|
0376e54196 | ||
|
|
572a5b3c34 | ||
|
|
9bd81a18b9 | ||
|
|
f35f0a0608 | ||
|
|
12b5ad143f | ||
|
|
73438cc378 | ||
|
|
f860ea9e54 | ||
|
|
836fffddbe | ||
|
|
4a9b924064 | ||
|
|
4fce1f41b5 | ||
|
|
46630a9b1b | ||
|
|
52ec3738d8 | ||
|
|
775530e28e | ||
|
|
1af6e65fba | ||
|
|
acc64b03fd | ||
|
|
0f9a9d6e37 | ||
|
|
8d36bb6453 | ||
|
|
b7c667a682 | ||
|
|
97b97a5664 | ||
|
|
531e0707cf | ||
|
|
b3abf80a50 | ||
|
|
fd588949c9 | ||
|
|
0b0de0d2ee | ||
|
|
d971601316 | ||
|
|
24127196ce | ||
|
|
0425cbbdb5 | ||
|
|
d2705df891 | ||
|
|
a4bc89dc8f | ||
|
|
a42bb38d76 | ||
|
|
db485dd4c4 | ||
|
|
93e410cd7a | ||
|
|
819d63caad | ||
|
|
78e180a054 | ||
|
|
de21bd0f6a | ||
|
|
39be30ba5d | ||
|
|
e2906f1219 | ||
|
|
b76b3b49fa | ||
|
|
83441eebc7 | ||
|
|
e469e9e369 | ||
|
|
d1b527b523 | ||
|
|
098b6194df | ||
|
|
50277692f4 | ||
|
|
819d61f5b6 | ||
|
|
63fdeb4bff | ||
|
|
6c3a5db52f | ||
|
|
d07500687c | ||
|
|
439373abd3 | ||
|
|
8afad700f8 | ||
|
|
a8b79d5df5 | ||
|
|
10a8febb0d | ||
|
|
747828d3ab | ||
|
|
9b8e6b33c7 | ||
|
|
05b23a840e | ||
|
|
5c9bb58a81 | ||
|
|
f8557187cd | ||
|
|
23623a22ff | ||
|
|
5149996b20 | ||
|
|
68e05d54d7 | ||
|
|
be5aa53106 | ||
|
|
95f79e6f02 | ||
|
|
25028ed1b8 | ||
|
|
93357d8157 | ||
|
|
a0ae9ee6fa | ||
|
|
7423cd0112 | ||
|
|
dc55d2b724 | ||
|
|
22ac04576f | ||
|
|
8b548dccc7 | ||
|
|
19d047dcbe | ||
|
|
6e240defdb | ||
|
|
ff91a6fe72 | ||
|
|
e076fff33c | ||
|
|
2d1720c15f | ||
|
|
9ac7503c4e | ||
|
|
a816ed2343 | ||
|
|
4a553de100 | ||
|
|
8702a4c7ab | ||
|
|
0bda7f332e | ||
|
|
d60d00b7b6 | ||
|
|
6e715df9e1 | ||
|
|
2a781c4a9d | ||
|
|
acb248c035 | ||
|
|
18e41cfbe9 | ||
|
|
930a959779 | ||
|
|
ff1a560547 | ||
|
|
7ba3e25813 | ||
|
|
4bb706d140 | ||
|
|
215171ad46 | ||
|
|
c20a04b752 | ||
|
|
3f859fdb11 | ||
|
|
556681a829 | ||
|
|
ee0bb55c06 | ||
|
|
2c0bc19f75 | ||
|
|
286aa51e78 | ||
|
|
145eb580e4 | ||
|
|
46211c26d2 | ||
|
|
e0262c23b0 | ||
|
|
7f80f4f958 | ||
|
|
6a54b37181 | ||
|
|
2c8bf28065 | ||
|
|
8c372572fc | ||
|
|
18c1ce0a22 | ||
|
|
b99fa7aaa4 | ||
|
|
105522b24e | ||
|
|
41b7b03db2 | ||
|
|
8e2a87421c | ||
|
|
b3b76fe682 | ||
|
|
695bfc89ac | ||
|
|
2fd9f945c8 | ||
|
|
6bbe4181fc | ||
|
|
29b834cf56 | ||
|
|
e588dce959 | ||
|
|
2f5265bee6 | ||
|
|
4d3062c62a | ||
|
|
984efe193b | ||
|
|
2554f06759 | ||
|
|
ff9c94f616 | ||
|
|
8c0dc7d8c9 | ||
|
|
b033b150b1 | ||
|
|
9b4ab2e126 | ||
|
|
8d5bc73643 | ||
|
|
ea44750268 | ||
|
|
55c294ac24 | ||
|
|
41ae455ee2 | ||
|
|
b17b36cbce | ||
|
|
6010190940 | ||
|
|
d9e118e754 | ||
|
|
481b9e389f | ||
|
|
177fbb1117 | ||
|
|
7a23f84001 | ||
|
|
b118fa6c8f | ||
|
|
305f01acb5 | ||
|
|
372e5625c3 | ||
|
|
b4043e944c | ||
|
|
2983575952 | ||
|
|
1996b11451 | ||
|
|
883784dcc3 | ||
|
|
21ce72dcf0 | ||
|
|
b51465a8d4 | ||
|
|
513fc1aa20 | ||
|
|
e75b329e62 | ||
|
|
4251322aad | ||
|
|
4e4c090373 | ||
|
|
d40e5d458c | ||
|
|
dbdeaa337c | ||
|
|
256319bd06 | ||
|
|
2049886dcf | ||
|
|
1b12f365ba | ||
|
|
34443d6515 | ||
|
|
cfc10e9efd | ||
|
|
c1beee44ef | ||
|
|
2ed83b0d6e | ||
|
|
68deec5bcd | ||
|
|
e2884b182a | ||
|
|
3c9ff54ae8 | ||
|
|
16f094168a | ||
|
|
42ca640769 | ||
|
|
d1d86ed9b3 | ||
|
|
c5f8a8e139 | ||
|
|
7b4a34f6fc | ||
|
|
bfe7e89bd0 | ||
|
|
e7433d633c | ||
|
|
5cb3947c45 | ||
|
|
f709255d62 | ||
|
|
d159c57e1f | ||
|
|
34876b7616 | ||
|
|
1ab549036c | ||
|
|
6696b35d74 |
No files matched your search
@@ -0,0 +1,73 @@
|
|||||||
|
# Exclude top-level dirs not needed for build
|
||||||
|
/bin/
|
||||||
|
/bin64/
|
||||||
|
/build/
|
||||||
|
/cfg/
|
||||||
|
/cmake/
|
||||||
|
/CMakeFiles/
|
||||||
|
/debian/
|
||||||
|
/doc/
|
||||||
|
/man/
|
||||||
|
|
||||||
|
# Build artifacts
|
||||||
|
**/*.o
|
||||||
|
**/*.obj
|
||||||
|
**/*.so
|
||||||
|
**/*.dll
|
||||||
|
**/*.exe
|
||||||
|
**/*.exp
|
||||||
|
**/*.lib
|
||||||
|
**/*.pdb
|
||||||
|
**/*.ilk
|
||||||
|
**/*.idb
|
||||||
|
**/*.err
|
||||||
|
**/*.ld.so
|
||||||
|
**/*.dSYM
|
||||||
|
**/*.var
|
||||||
|
build*/
|
||||||
|
buildlinux.sh
|
||||||
|
tmp/
|
||||||
|
|
||||||
|
# macOS
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# Editor / IDE
|
||||||
|
**/*.swp
|
||||||
|
**/*.swo
|
||||||
|
**/*~
|
||||||
|
**/*.bak
|
||||||
|
**/*.tmp
|
||||||
|
**/*.log
|
||||||
|
.project
|
||||||
|
.cproject
|
||||||
|
.classpath
|
||||||
|
.settings/
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# Git
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
|
||||||
|
# Claude / docs
|
||||||
|
CLAUDE.md
|
||||||
|
.claude/
|
||||||
|
|
||||||
|
# Generated version files
|
||||||
|
version
|
||||||
|
version.c
|
||||||
|
version.sh
|
||||||
|
verfile.sh
|
||||||
|
|
||||||
|
# Local config / keys
|
||||||
|
**/*.key
|
||||||
|
**/*.pem
|
||||||
|
**/*.pfx
|
||||||
|
3proxy.cfg
|
||||||
|
3proxy-ssl.cfg
|
||||||
|
3proxy-pcre.cfg
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
res
|
||||||
|
3proxy.res
|
||||||
|
copytgz.sh
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
|
||||||
|
- package-ecosystem: docker
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
@@ -0,0 +1,139 @@
|
|||||||
|
name: OpenWrt ipk build
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
env:
|
||||||
|
OPENWRT_RELEASE: 24.10.0
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ipk:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
attestations: write
|
||||||
|
name: "${{ matrix.arch }}"
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- target: ramips/mt7621
|
||||||
|
arch: mipsel_24kc
|
||||||
|
- target: ath79/generic
|
||||||
|
arch: mips_24kc
|
||||||
|
- target: ipq40xx/generic
|
||||||
|
arch: arm_cortex-a7_neon-vfpv4
|
||||||
|
- target: mediatek/filogic
|
||||||
|
arch: aarch64_cortex-a53
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: env
|
||||||
|
run: echo "RELEASE=$(tr -d ' \t\r\n' < RELEASE)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Install build dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y build-essential libncurses-dev zlib1g-dev gawk git \
|
||||||
|
gettext libssl-dev xsltproc wget unzip python3 rsync file zstd
|
||||||
|
|
||||||
|
- name: Fetch SDK
|
||||||
|
run: |
|
||||||
|
BASE="https://downloads.openwrt.org/releases/$OPENWRT_RELEASE/targets/${{ matrix.target }}"
|
||||||
|
# The SDK file name carries the toolchain flavour, which differs between
|
||||||
|
# targets (musl vs musl_eabi), so take it from the directory listing.
|
||||||
|
NAME=$(curl -fsSL "$BASE/" | grep -oE 'openwrt-sdk-[^"]*\.tar\.zst' | head -1)
|
||||||
|
if [ -z "$NAME" ]; then echo "no SDK for ${{ matrix.target }}"; exit 1; fi
|
||||||
|
echo "fetching $NAME"
|
||||||
|
curl -fsSL "$BASE/$NAME" -o sdk.tar.zst
|
||||||
|
tar --zstd -xf sdk.tar.zst
|
||||||
|
mv "${NAME%.tar.zst}" sdk
|
||||||
|
rm sdk.tar.zst
|
||||||
|
|
||||||
|
- name: Stage the package
|
||||||
|
run: |
|
||||||
|
mkdir -p sdk/package/3proxy sdk/dl
|
||||||
|
cp -a scripts/openwrt/. sdk/package/3proxy/
|
||||||
|
# Build the checkout rather than a published tarball, so the workflow
|
||||||
|
# does not depend on the release archive existing yet.
|
||||||
|
git archive --format=tar.gz --prefix="3proxy-$RELEASE/" -o "sdk/dl/3proxy-$RELEASE.tar.gz" HEAD
|
||||||
|
HASH=$(sha256sum "sdk/dl/3proxy-$RELEASE.tar.gz" | cut -d' ' -f1)
|
||||||
|
sed -i "s|^PKG_VERSION:=.*|PKG_VERSION:=$RELEASE|" sdk/package/3proxy/Makefile
|
||||||
|
sed -i "s|^PKG_HASH:=.*|PKG_HASH:=$HASH|" sdk/package/3proxy/Makefile
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
cd sdk
|
||||||
|
./scripts/feeds update base packages
|
||||||
|
./scripts/feeds install libopenssl libpcre2
|
||||||
|
echo CONFIG_PACKAGE_3proxy=m >> .config
|
||||||
|
make defconfig
|
||||||
|
make package/3proxy/compile -j$(nproc)
|
||||||
|
|
||||||
|
- name: Collect
|
||||||
|
run: |
|
||||||
|
find sdk/bin -name '3proxy_*.ipk' -exec cp {} . \;
|
||||||
|
ls -l *.ipk
|
||||||
|
for f in *.ipk; do echo "$f"; done
|
||||||
|
|
||||||
|
- name: Get artifact ipk
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: "3proxy-${{ env.RELEASE }}-${{ matrix.arch }}.ipk"
|
||||||
|
path: "*.ipk"
|
||||||
|
|
||||||
|
- name: Import signing key
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$GPG_PRIVATE_KEY" ]; then echo "GPG_PRIVATE_KEY is not set"; exit 1; fi
|
||||||
|
mkdir -p ~/.gnupg && chmod 700 ~/.gnupg
|
||||||
|
printf 'allow-loopback-pinentry\ndefault-cache-ttl 7200\nmax-cache-ttl 7200\n' > ~/.gnupg/gpg-agent.conf
|
||||||
|
gpgconf --kill gpg-agent || true
|
||||||
|
printf '%s' "$GPG_PRIVATE_KEY" | gpg --batch --import
|
||||||
|
KEYID=$(gpg --list-secret-keys --with-colons | awk -F: '/^sec:/{print $5; exit}')
|
||||||
|
echo "GPG_KEYID=$KEYID" >> $GITHUB_ENV
|
||||||
|
echo prime > /tmp/prime.txt
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
||||||
|
-u "$KEYID" --detach-sign -o /dev/null /tmp/prime.txt
|
||||||
|
rm -f /tmp/prime.txt
|
||||||
|
|
||||||
|
- name: Checksums and detached signatures
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
# opkg verifies the signature of a feed index, never of a package file,
|
||||||
|
# so the checksums and their signature are what a manual install can be
|
||||||
|
# checked against.
|
||||||
|
sha256sum *.ipk > SHA256SUMS-openwrt-${{ matrix.arch }}
|
||||||
|
for f in *.ipk SHA256SUMS-openwrt-${{ matrix.arch }}; do
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
||||||
|
-u "$GPG_KEYID" --armor --detach-sign "$f"
|
||||||
|
done
|
||||||
|
sha256sum -c SHA256SUMS-openwrt-${{ matrix.arch }}
|
||||||
|
gpg --verify SHA256SUMS-openwrt-${{ matrix.arch }}.asc SHA256SUMS-openwrt-${{ matrix.arch }}
|
||||||
|
|
||||||
|
- name: Attest build provenance
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
uses: actions/attest-build-provenance@v4
|
||||||
|
with:
|
||||||
|
subject-path: |
|
||||||
|
*.ipk
|
||||||
|
|
||||||
|
- name: Upload to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: |
|
||||||
|
gh release upload "$TAG" *.ipk *.ipk.asc \
|
||||||
|
SHA256SUMS-openwrt-${{ matrix.arch }} SHA256SUMS-openwrt-${{ matrix.arch }}.asc
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
name: RPM/DEB build aarch64
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
attestations: write
|
||||||
|
name: "${{ matrix.target }}"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- ubuntu-24.04-arm
|
||||||
|
runs-on: ${{ matrix.target }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
- name: env
|
||||||
|
run: |
|
||||||
|
pwd
|
||||||
|
echo "RELEASE=$(cat RELEASE)" >> $GITHUB_ENV
|
||||||
|
BUILDDATE=$(sed -n 's/^#define BUILDDATE "\(.*\)"$/\1/p' src/version.h)
|
||||||
|
[ -n "$BUILDDATE" ] || BUILDDATE=$(date -u +%y%m%d%H%M%S)
|
||||||
|
echo "VERSION=$BUILDDATE" >> $GITHUB_ENV
|
||||||
|
SOURCE_DATE_EPOCH=$(date -u -d "20${BUILDDATE:0:2}-${BUILDDATE:2:2}-${BUILDDATE:4:2} ${BUILDDATE:6:2}:${BUILDDATE:8:2}:${BUILDDATE:10:2}" +%s)
|
||||||
|
echo "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH" >> $GITHUB_ENV
|
||||||
|
- name: echo env
|
||||||
|
run: echo "release $RELEASE version $VERSION"
|
||||||
|
- name: Linux libraries
|
||||||
|
run: |
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install libssl-dev libpam-dev libpcre2-dev rpm build-essential debhelper
|
||||||
|
- name: configure rpm env
|
||||||
|
run: |
|
||||||
|
mkdir ~/debian
|
||||||
|
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
||||||
|
tar -czf ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz --transform "s,^,3proxy-$RELEASE/," .
|
||||||
|
ln -s ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/rpmbuild/SOURCES/$RELEASE.tar.gz
|
||||||
|
cp scripts/rh/3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec
|
||||||
|
cp ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/debian/3proxy_$RELEASE.orig.tar.gz
|
||||||
|
- name: rpmbuild
|
||||||
|
run: |
|
||||||
|
mkdir -p rpmout
|
||||||
|
for EL in 8 9 10; do
|
||||||
|
docker run --rm \
|
||||||
|
-v "$HOME/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz:/src.tar.gz:ro" \
|
||||||
|
-v "$PWD/scripts/rh/3proxy.spec:/3proxy.spec:ro" \
|
||||||
|
-v "$PWD/rpmout:/out" \
|
||||||
|
-e RELEASE="$RELEASE" -e HOSTUID="$(id -u)" -e HOSTGID="$(id -g)" \
|
||||||
|
-e SOURCE_DATE_EPOCH="$SOURCE_DATE_EPOCH" \
|
||||||
|
"almalinux:$EL" bash -c '
|
||||||
|
set -e
|
||||||
|
dnf -y install rpm-build gcc make openssl-devel pcre2-devel pam-devel tar gzip
|
||||||
|
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
||||||
|
cp /src.tar.gz ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz
|
||||||
|
ln -sf ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/rpmbuild/SOURCES/$RELEASE.tar.gz
|
||||||
|
cp /3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec
|
||||||
|
cd ~/rpmbuild/SPECS
|
||||||
|
rpmbuild -ba \
|
||||||
|
--define "use_source_date_epoch_as_buildtime 1" \
|
||||||
|
--define "clamp_mtime_to_source_date_epoch 1" \
|
||||||
|
--define "_buildhost 3proxy.org" \
|
||||||
|
3proxy-$RELEASE.spec
|
||||||
|
cp ~/rpmbuild/RPMS/*/*.rpm /out/
|
||||||
|
chown "$HOSTUID:$HOSTGID" /out/*.rpm || chmod 0666 /out/*.rpm'
|
||||||
|
done
|
||||||
|
for f in rpmout/*.rpm; do
|
||||||
|
dist=$(rpm -qp --qf '%{RELEASE}' "$f" | sed 's/^1\.//')
|
||||||
|
arch=$(rpm -qp --qf '%{ARCH}' "$f")
|
||||||
|
mv "$f" "3proxy-$RELEASE.$dist.$arch.rpm"
|
||||||
|
done
|
||||||
|
rmdir rpmout
|
||||||
|
ls -l *.rpm
|
||||||
|
- name: Get artifact rpm
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: "3proxy-${{ env.RELEASE }}-arm64.rpm"
|
||||||
|
path: "*.rpm"
|
||||||
|
- name: debbuild
|
||||||
|
run: |
|
||||||
|
docker run --rm \
|
||||||
|
-v "$HOME/debian:/debian" \
|
||||||
|
-e RELEASE="$RELEASE" -e VERSION="$VERSION" \
|
||||||
|
-e SOURCE_DATE_EPOCH="$SOURCE_DATE_EPOCH" \
|
||||||
|
ubuntu:22.04 bash -c '
|
||||||
|
set -e
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y build-essential debhelper fakeroot libssl-dev libpcre2-dev libpam0g-dev
|
||||||
|
cd /debian
|
||||||
|
tar xzf 3proxy_$RELEASE.orig.tar.gz
|
||||||
|
cd 3proxy-$RELEASE
|
||||||
|
{ echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium"
|
||||||
|
echo " "
|
||||||
|
echo " *3proxy $RELEASE build"
|
||||||
|
echo " "
|
||||||
|
echo " -- z3APA3A <3apa3a@3proxy.org> $(date -R -u -d @$SOURCE_DATE_EPOCH)"
|
||||||
|
echo ""
|
||||||
|
} > debian/changelog
|
||||||
|
dpkg-buildpackage'
|
||||||
|
cp ~/debian/3proxy_$RELEASE-"$VERSION"_arm64.deb ./3proxy-$RELEASE.arm64.deb
|
||||||
|
- name: Get artifact deb
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: "3proxy-${{ env.RELEASE }}-arm64.deb"
|
||||||
|
path: "*.deb"
|
||||||
|
- name: Import signing key
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$GPG_PRIVATE_KEY" ]; then echo "GPG_PRIVATE_KEY is not set"; exit 1; fi
|
||||||
|
mkdir -p ~/.gnupg && chmod 700 ~/.gnupg
|
||||||
|
printf 'allow-loopback-pinentry\ndefault-cache-ttl 7200\nmax-cache-ttl 7200\n' > ~/.gnupg/gpg-agent.conf
|
||||||
|
gpgconf --kill gpg-agent || true
|
||||||
|
printf '%s' "$GPG_PRIVATE_KEY" | gpg --batch --import
|
||||||
|
KEYID=$(gpg --list-secret-keys --with-colons | awk -F: '/^sec:/{print $5; exit}')
|
||||||
|
echo "GPG_KEYID=$KEYID" >> $GITHUB_ENV
|
||||||
|
echo prime > /tmp/prime.txt
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
||||||
|
-u "$KEYID" --detach-sign -o /dev/null /tmp/prime.txt
|
||||||
|
rm -f /tmp/prime.txt
|
||||||
|
- name: Sign rpm
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
GPGBIN=$(command -v gpg)
|
||||||
|
if [ -z "$GPGBIN" ]; then echo "gpg not found"; exit 1; fi
|
||||||
|
umask 077
|
||||||
|
printf '%s' "$GPG_PASSPHRASE" > /tmp/gpgpass
|
||||||
|
echo test > /tmp/signtest
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase-file /tmp/gpgpass \
|
||||||
|
-u "$GPG_KEYID" --detach-sign -o /tmp/signtest.sig /tmp/signtest
|
||||||
|
echo "key can sign"
|
||||||
|
{ echo "%_gpg_name $GPG_KEYID"
|
||||||
|
echo "%__gpg $GPGBIN"
|
||||||
|
echo '%__gpg_sign_cmd %{__gpg} gpg --batch --no-armor --pinentry-mode loopback --passphrase-file /tmp/gpgpass --no-secmem-warning --digest-algo sha256 -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}'
|
||||||
|
} > ~/.rpmmacros
|
||||||
|
rpm --addsign *.rpm
|
||||||
|
rm -f /tmp/gpgpass /tmp/signtest /tmp/signtest.sig
|
||||||
|
for f in *.rpm; do
|
||||||
|
sig=$(rpm -qp --qf '%{RSAHEADER:pgpsig}' "$f" 2>/dev/null)
|
||||||
|
case "$sig" in ""|"(none)")
|
||||||
|
sig=$(rpm -qp --qf '%{DSAHEADER:pgpsig}' "$f" 2>/dev/null) ;;
|
||||||
|
esac
|
||||||
|
case "$sig" in ""|"(none)")
|
||||||
|
echo "$f is not signed"
|
||||||
|
echo "--- rpm version ---"; rpm --version
|
||||||
|
echo "--- sign cmd ---"; rpm --eval '%{__gpg_sign_cmd}'
|
||||||
|
echo "--- secret keys ---"; gpg --list-secret-keys --with-colons | grep -E '^(sec|ssb):' || true
|
||||||
|
exit 1 ;;
|
||||||
|
esac
|
||||||
|
echo "$f: $sig"
|
||||||
|
done
|
||||||
|
- name: Checksums and detached signatures
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
sha256sum *.rpm *.deb > SHA256SUMS-arm64
|
||||||
|
for f in *.deb SHA256SUMS-arm64; do
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
||||||
|
-u "$GPG_KEYID" --armor --detach-sign "$f"
|
||||||
|
done
|
||||||
|
sha256sum -c SHA256SUMS-arm64
|
||||||
|
gpg --verify SHA256SUMS-arm64.asc SHA256SUMS-arm64
|
||||||
|
- name: Attest build provenance
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
uses: actions/attest-build-provenance@v4
|
||||||
|
with:
|
||||||
|
subject-path: |
|
||||||
|
*.rpm
|
||||||
|
*.deb
|
||||||
|
- name: Upload to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" *.rpm *.deb *.deb.asc SHA256SUMS-arm64 SHA256SUMS-arm64.asc
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
name: DEB build armhf
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
attestations: write
|
||||||
|
name: "${{ matrix.target }}"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- ubuntu-latest
|
||||||
|
runs-on: ${{ matrix.target }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
- name: env
|
||||||
|
run: |
|
||||||
|
pwd
|
||||||
|
echo "RELEASE=$(cat RELEASE)" >> $GITHUB_ENV
|
||||||
|
BUILDDATE=$(sed -n 's/^#define BUILDDATE "\(.*\)"$/\1/p' src/version.h)
|
||||||
|
[ -n "$BUILDDATE" ] || BUILDDATE=$(date -u +%y%m%d%H%M%S)
|
||||||
|
echo "VERSION=$BUILDDATE" >> $GITHUB_ENV
|
||||||
|
SOURCE_DATE_EPOCH=$(date -u -d "20${BUILDDATE:0:2}-${BUILDDATE:2:2}-${BUILDDATE:4:2} ${BUILDDATE:6:2}:${BUILDDATE:8:2}:${BUILDDATE:10:2}" +%s)
|
||||||
|
echo "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH" >> $GITHUB_ENV
|
||||||
|
- name: configure deb env
|
||||||
|
run: |
|
||||||
|
mkdir ~/debian
|
||||||
|
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
||||||
|
tar -czf ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz --transform "s,^,3proxy-$RELEASE/," .
|
||||||
|
ln -s ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/rpmbuild/SOURCES/$RELEASE.tar.gz
|
||||||
|
cp scripts/rh/3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec
|
||||||
|
cp ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/debian/3proxy_$RELEASE.orig.tar.gz
|
||||||
|
- name: debbuild
|
||||||
|
run: |
|
||||||
|
docker run --rm \
|
||||||
|
-v "$HOME/debian:/debian" \
|
||||||
|
-e RELEASE="$RELEASE" -e VERSION="$VERSION" \
|
||||||
|
-e SOURCE_DATE_EPOCH="$SOURCE_DATE_EPOCH" \
|
||||||
|
ubuntu:22.04 bash -c '
|
||||||
|
set -e
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
dpkg --add-architecture armhf
|
||||||
|
sed -i "s|^deb |deb [arch=amd64] |" /etc/apt/sources.list
|
||||||
|
{ echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse"
|
||||||
|
echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted universe multiverse"
|
||||||
|
} >> /etc/apt/sources.list
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y crossbuild-essential-armhf build-essential debhelper fakeroot \
|
||||||
|
libssl-dev:armhf libpcre2-dev:armhf libpam0g-dev:armhf
|
||||||
|
cd /debian
|
||||||
|
tar xzf 3proxy_$RELEASE.orig.tar.gz
|
||||||
|
cd 3proxy-$RELEASE
|
||||||
|
{ echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium"
|
||||||
|
echo " "
|
||||||
|
echo " *3proxy $RELEASE build"
|
||||||
|
echo " "
|
||||||
|
echo " -- z3APA3A <3apa3a@3proxy.org> $(date -R -u -d @$SOURCE_DATE_EPOCH)"
|
||||||
|
echo ""
|
||||||
|
} > debian/changelog
|
||||||
|
export PATH=/usr/arm-linux-gnueabihf/bin:$PATH
|
||||||
|
export CC=arm-linux-gnueabihf-gcc
|
||||||
|
export LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:$LD_LIBRARY_PATH
|
||||||
|
dpkg-buildpackage'
|
||||||
|
cp ~/debian/3proxy_$RELEASE-"$VERSION"_armhf.deb ./3proxy-$RELEASE.arm.deb
|
||||||
|
- name: Get artifact deb
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: "3proxy-${{ env.RELEASE }}-arm.deb"
|
||||||
|
path: "*.deb"
|
||||||
|
- name: Import signing key
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$GPG_PRIVATE_KEY" ]; then echo "GPG_PRIVATE_KEY is not set"; exit 1; fi
|
||||||
|
mkdir -p ~/.gnupg && chmod 700 ~/.gnupg
|
||||||
|
printf 'allow-loopback-pinentry\ndefault-cache-ttl 7200\nmax-cache-ttl 7200\n' > ~/.gnupg/gpg-agent.conf
|
||||||
|
gpgconf --kill gpg-agent || true
|
||||||
|
printf '%s' "$GPG_PRIVATE_KEY" | gpg --batch --import
|
||||||
|
KEYID=$(gpg --list-secret-keys --with-colons | awk -F: '/^sec:/{print $5; exit}')
|
||||||
|
echo "GPG_KEYID=$KEYID" >> $GITHUB_ENV
|
||||||
|
echo prime > /tmp/prime.txt
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
||||||
|
-u "$KEYID" --detach-sign -o /dev/null /tmp/prime.txt
|
||||||
|
rm -f /tmp/prime.txt
|
||||||
|
- name: Checksums and detached signatures
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
sha256sum *.deb > SHA256SUMS-arm
|
||||||
|
for f in *.deb SHA256SUMS-arm; do
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
||||||
|
-u "$GPG_KEYID" --armor --detach-sign "$f"
|
||||||
|
done
|
||||||
|
sha256sum -c SHA256SUMS-arm
|
||||||
|
gpg --verify SHA256SUMS-arm.asc SHA256SUMS-arm
|
||||||
|
- name: Attest build provenance
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
uses: actions/attest-build-provenance@v4
|
||||||
|
with:
|
||||||
|
subject-path: |
|
||||||
|
*.deb
|
||||||
|
- name: Upload to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" *.deb *.deb.asc SHA256SUMS-arm SHA256SUMS-arm.asc
|
||||||
@@ -0,0 +1,189 @@
|
|||||||
|
name: RPM/DEB build x86-64
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
attestations: write
|
||||||
|
name: "${{ matrix.target }}"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- ubuntu-latest
|
||||||
|
runs-on: ${{ matrix.target }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
- name: env
|
||||||
|
run: |
|
||||||
|
pwd
|
||||||
|
echo "RELEASE=$(cat RELEASE)" >> $GITHUB_ENV
|
||||||
|
BUILDDATE=$(sed -n 's/^#define BUILDDATE "\(.*\)"$/\1/p' src/version.h)
|
||||||
|
[ -n "$BUILDDATE" ] || BUILDDATE=$(date -u +%y%m%d%H%M%S)
|
||||||
|
echo "VERSION=$BUILDDATE" >> $GITHUB_ENV
|
||||||
|
SOURCE_DATE_EPOCH=$(date -u -d "20${BUILDDATE:0:2}-${BUILDDATE:2:2}-${BUILDDATE:4:2} ${BUILDDATE:6:2}:${BUILDDATE:8:2}:${BUILDDATE:10:2}" +%s)
|
||||||
|
echo "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH" >> $GITHUB_ENV
|
||||||
|
- name: echo env
|
||||||
|
run: echo "release $RELEASE version $VERSION"
|
||||||
|
- name: Linux libraries
|
||||||
|
run: |
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install libssl-dev libpam-dev libpcre2-dev rpm build-essential debhelper
|
||||||
|
- name: configure rpm/deb env
|
||||||
|
run: |
|
||||||
|
mkdir ~/debian
|
||||||
|
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
||||||
|
tar -czf ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz --transform "s,^,3proxy-$RELEASE/," .
|
||||||
|
ln -s ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/rpmbuild/SOURCES/$RELEASE.tar.gz
|
||||||
|
cp scripts/rh/3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec
|
||||||
|
cp ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/debian/3proxy_$RELEASE.orig.tar.gz
|
||||||
|
- name: rpmbuild
|
||||||
|
run: |
|
||||||
|
mkdir -p rpmout
|
||||||
|
for EL in 8 9 10; do
|
||||||
|
docker run --rm \
|
||||||
|
-v "$HOME/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz:/src.tar.gz:ro" \
|
||||||
|
-v "$PWD/scripts/rh/3proxy.spec:/3proxy.spec:ro" \
|
||||||
|
-v "$PWD/rpmout:/out" \
|
||||||
|
-e RELEASE="$RELEASE" -e HOSTUID="$(id -u)" -e HOSTGID="$(id -g)" \
|
||||||
|
-e SOURCE_DATE_EPOCH="$SOURCE_DATE_EPOCH" \
|
||||||
|
"almalinux:$EL" bash -c '
|
||||||
|
set -e
|
||||||
|
dnf -y install rpm-build gcc make openssl-devel pcre2-devel pam-devel tar gzip
|
||||||
|
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
||||||
|
cp /src.tar.gz ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz
|
||||||
|
ln -sf ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/rpmbuild/SOURCES/$RELEASE.tar.gz
|
||||||
|
cp /3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec
|
||||||
|
cd ~/rpmbuild/SPECS
|
||||||
|
rpmbuild -ba \
|
||||||
|
--define "use_source_date_epoch_as_buildtime 1" \
|
||||||
|
--define "clamp_mtime_to_source_date_epoch 1" \
|
||||||
|
--define "_buildhost 3proxy.org" \
|
||||||
|
3proxy-$RELEASE.spec
|
||||||
|
cp ~/rpmbuild/RPMS/*/*.rpm /out/
|
||||||
|
chown "$HOSTUID:$HOSTGID" /out/*.rpm || chmod 0666 /out/*.rpm'
|
||||||
|
done
|
||||||
|
for f in rpmout/*.rpm; do
|
||||||
|
dist=$(rpm -qp --qf '%{RELEASE}' "$f" | sed 's/^1\.//')
|
||||||
|
arch=$(rpm -qp --qf '%{ARCH}' "$f")
|
||||||
|
mv "$f" "3proxy-$RELEASE.$dist.$arch.rpm"
|
||||||
|
done
|
||||||
|
rmdir rpmout
|
||||||
|
ls -l *.rpm
|
||||||
|
- name: Get artifact rpm
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: "3proxy-${{ env.RELEASE }}-x86_64.rpm"
|
||||||
|
path: "*.rpm"
|
||||||
|
- name: debbuild
|
||||||
|
run: |
|
||||||
|
docker run --rm \
|
||||||
|
-v "$HOME/debian:/debian" \
|
||||||
|
-e RELEASE="$RELEASE" -e VERSION="$VERSION" \
|
||||||
|
-e SOURCE_DATE_EPOCH="$SOURCE_DATE_EPOCH" \
|
||||||
|
ubuntu:22.04 bash -c '
|
||||||
|
set -e
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y build-essential debhelper fakeroot libssl-dev libpcre2-dev libpam0g-dev
|
||||||
|
cd /debian
|
||||||
|
tar xzf 3proxy_$RELEASE.orig.tar.gz
|
||||||
|
cd 3proxy-$RELEASE
|
||||||
|
{ echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium"
|
||||||
|
echo " "
|
||||||
|
echo " *3proxy $RELEASE build"
|
||||||
|
echo " "
|
||||||
|
echo " -- z3APA3A <3apa3a@3proxy.org> $(date -R -u -d @$SOURCE_DATE_EPOCH)"
|
||||||
|
echo ""
|
||||||
|
} > debian/changelog
|
||||||
|
dpkg-buildpackage'
|
||||||
|
cp ~/debian/3proxy_$RELEASE-"$VERSION"_amd64.deb ./3proxy-$RELEASE.x86_64.deb
|
||||||
|
- name: Get artifact deb
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: "3proxy-${{ env.RELEASE }}-x86_64.deb"
|
||||||
|
path: "*.deb"
|
||||||
|
|
||||||
|
- name: Import signing key
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$GPG_PRIVATE_KEY" ]; then echo "GPG_PRIVATE_KEY is not set"; exit 1; fi
|
||||||
|
mkdir -p ~/.gnupg && chmod 700 ~/.gnupg
|
||||||
|
printf 'allow-loopback-pinentry\ndefault-cache-ttl 7200\nmax-cache-ttl 7200\n' > ~/.gnupg/gpg-agent.conf
|
||||||
|
gpgconf --kill gpg-agent || true
|
||||||
|
printf '%s' "$GPG_PRIVATE_KEY" | gpg --batch --import
|
||||||
|
KEYID=$(gpg --list-secret-keys --with-colons | awk -F: '/^sec:/{print $5; exit}')
|
||||||
|
echo "GPG_KEYID=$KEYID" >> $GITHUB_ENV
|
||||||
|
echo prime > /tmp/prime.txt
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
||||||
|
-u "$KEYID" --detach-sign -o /dev/null /tmp/prime.txt
|
||||||
|
rm -f /tmp/prime.txt
|
||||||
|
- name: Sign rpm
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
GPGBIN=$(command -v gpg)
|
||||||
|
if [ -z "$GPGBIN" ]; then echo "gpg not found"; exit 1; fi
|
||||||
|
umask 077
|
||||||
|
printf '%s' "$GPG_PASSPHRASE" > /tmp/gpgpass
|
||||||
|
echo test > /tmp/signtest
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase-file /tmp/gpgpass \
|
||||||
|
-u "$GPG_KEYID" --detach-sign -o /tmp/signtest.sig /tmp/signtest
|
||||||
|
echo "key can sign"
|
||||||
|
{ echo "%_gpg_name $GPG_KEYID"
|
||||||
|
echo "%__gpg $GPGBIN"
|
||||||
|
echo '%__gpg_sign_cmd %{__gpg} gpg --batch --no-armor --pinentry-mode loopback --passphrase-file /tmp/gpgpass --no-secmem-warning --digest-algo sha256 -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}'
|
||||||
|
} > ~/.rpmmacros
|
||||||
|
rpm --addsign *.rpm
|
||||||
|
rm -f /tmp/gpgpass /tmp/signtest /tmp/signtest.sig
|
||||||
|
for f in *.rpm; do
|
||||||
|
sig=$(rpm -qp --qf '%{RSAHEADER:pgpsig}' "$f" 2>/dev/null)
|
||||||
|
case "$sig" in ""|"(none)")
|
||||||
|
sig=$(rpm -qp --qf '%{DSAHEADER:pgpsig}' "$f" 2>/dev/null) ;;
|
||||||
|
esac
|
||||||
|
case "$sig" in ""|"(none)")
|
||||||
|
echo "$f is not signed"
|
||||||
|
echo "--- rpm version ---"; rpm --version
|
||||||
|
echo "--- sign cmd ---"; rpm --eval '%{__gpg_sign_cmd}'
|
||||||
|
echo "--- secret keys ---"; gpg --list-secret-keys --with-colons | grep -E '^(sec|ssb):' || true
|
||||||
|
exit 1 ;;
|
||||||
|
esac
|
||||||
|
echo "$f: $sig"
|
||||||
|
done
|
||||||
|
- name: Checksums and detached signatures
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
sha256sum *.rpm *.deb > SHA256SUMS-x86_64
|
||||||
|
for f in *.deb SHA256SUMS-x86_64; do
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
||||||
|
-u "$GPG_KEYID" --armor --detach-sign "$f"
|
||||||
|
done
|
||||||
|
sha256sum -c SHA256SUMS-x86_64
|
||||||
|
gpg --verify SHA256SUMS-x86_64.asc SHA256SUMS-x86_64
|
||||||
|
- name: Attest build provenance
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
uses: actions/attest-build-provenance@v4
|
||||||
|
with:
|
||||||
|
subject-path: |
|
||||||
|
*.rpm
|
||||||
|
*.deb
|
||||||
|
- name: Upload to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" *.rpm *.deb *.deb.asc SHA256SUMS-x86_64 SHA256SUMS-x86_64.asc
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
name: Build Win32 3proxy-lite with Watcom
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
attestations: write
|
||||||
|
name: "${{ matrix.target }}"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- windows-2022
|
||||||
|
runs-on: ${{ matrix.target }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
# - name: configure
|
||||||
|
# run: ./configure
|
||||||
|
- name: Setup Open Watcom
|
||||||
|
uses: open-watcom/setup-watcom@v1
|
||||||
|
- name: set date
|
||||||
|
run: |
|
||||||
|
$NOW = Get-Date -Format "yyMMddHHmmss"
|
||||||
|
echo "now: $NOW"
|
||||||
|
$RELEASE = Get-Content -Path "RELEASE" -Raw
|
||||||
|
echo "release: $RELEASE"
|
||||||
|
echo "RELEASE=$RELEASE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
echo "BUILDDATE=/D `"BUILDDATE=\`"$NOW\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
- name: make Watcom
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
echo "volatile char VerSion[]=^"3APA3A-3proxy-Internal-Build: 3proxy-%RELEASE%-%NOW%\r\n^";" >>src/3proxy.c
|
||||||
|
nmake /F Makefile.watcom
|
||||||
|
- name: make dist dir
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
mkdir dist
|
||||||
|
mkdir dist\3proxy
|
||||||
|
mkdir dist\3proxy\bin
|
||||||
|
mkdir dist\3proxy\cfg
|
||||||
|
mkdir dist\3proxy\cfg\sql
|
||||||
|
mkdir dist\3proxy\doc
|
||||||
|
mkdir dist\3proxy\doc\ru
|
||||||
|
mkdir dist\3proxy\doc\html
|
||||||
|
mkdir dist\3proxy\doc\html\plugins
|
||||||
|
mkdir dist\3proxy\doc\html\man5
|
||||||
|
mkdir dist\3proxy\doc\html\man8
|
||||||
|
mkdir dist\3proxy\doc\html\devel
|
||||||
|
copy bin\3proxy.exe dist\3proxy\bin\
|
||||||
|
copy bin\*.dll dist\3proxy\bin\
|
||||||
|
copy bin\3proxy_crypt.exe dist\3proxy\bin\
|
||||||
|
copy cfg\*.* dist\3proxy\cfg\
|
||||||
|
copy cfg\sql\*.* dist\3proxy\cfg\sql\
|
||||||
|
copy doc\ru\*.* dist\3proxy\doc\ru\
|
||||||
|
copy doc\html\*.* dist\3proxy\doc\html\
|
||||||
|
copy doc\html\plugins\*.* dist\3proxy\doc\html\plugins\
|
||||||
|
copy doc\html\man8\*.* dist\3proxy\doc\html\man8\
|
||||||
|
copy doc\html\man5\*.* dist\3proxy\doc\html\man5\
|
||||||
|
copy doc\html\devel\*.* dist\3proxy\doc\html\devel\
|
||||||
|
copy copying dist\3proxy\
|
||||||
|
copy authors dist\3proxy\
|
||||||
|
copy README.md dist\3proxy\
|
||||||
|
copy rus.3ps dist\3proxy\
|
||||||
|
- name: Get artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: "3proxy-${{ env.RELEASE }}-lite"
|
||||||
|
path: dist/
|
||||||
|
- name: Create zip
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: pwsh
|
||||||
|
run: Compress-Archive -Path dist/* -DestinationPath 3proxy-${{ env.RELEASE }}-lite.zip
|
||||||
|
- name: Checksums and detached signature
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$GPG_PRIVATE_KEY" ]; then echo "GPG_PRIVATE_KEY is not set"; exit 1; fi
|
||||||
|
printf '%s' "$GPG_PRIVATE_KEY" | gpg --batch --import
|
||||||
|
KEYID=$(gpg --list-secret-keys --with-colons | awk -F: '/^sec:/{print $5; exit}')
|
||||||
|
sha256sum *.zip > SHA256SUMS-win-lite
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
||||||
|
-u "$KEYID" --armor --detach-sign SHA256SUMS-win-lite
|
||||||
|
sha256sum -c SHA256SUMS-win-lite
|
||||||
|
- name: Attest build provenance
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
uses: actions/attest-build-provenance@v4
|
||||||
|
with:
|
||||||
|
subject-path: |
|
||||||
|
*.zip
|
||||||
|
- name: Upload to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" *.zip SHA256SUMS-win-lite SHA256SUMS-win-lite.asc
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
name: Build 3proxy with MSYS2 UCRT64
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
name: "msys2-ucrt64"
|
||||||
|
runs-on: windows-2022
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
- name: Setup MSYS2 (UCRT64)
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
msystem: UCRT64
|
||||||
|
update: true
|
||||||
|
install: >-
|
||||||
|
make
|
||||||
|
mingw-w64-ucrt-x86_64-gcc
|
||||||
|
mingw-w64-ucrt-x86_64-pcre2
|
||||||
|
mingw-w64-ucrt-x86_64-openssl
|
||||||
|
mingw-w64-ucrt-x86_64-zlib
|
||||||
|
- name: set date
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
$NOW = Get-Date -Format "yyMMddHHmmss"
|
||||||
|
$RELEASE = Get-Content -Path "RELEASE" -Raw
|
||||||
|
echo "NOW=$NOW" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
echo "RELEASE=$RELEASE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
- name: make Windows (Makefile.win)
|
||||||
|
shell: msys2 {0}
|
||||||
|
env:
|
||||||
|
LIBSTATIC: 'true'
|
||||||
|
run: make -f Makefile.win
|
||||||
|
- name: make dist dir
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
mkdir dist
|
||||||
|
mkdir dist\3proxy
|
||||||
|
mkdir dist\3proxy\bin
|
||||||
|
mkdir dist\3proxy\cfg
|
||||||
|
mkdir dist\3proxy\cfg\sql
|
||||||
|
mkdir dist\3proxy\doc
|
||||||
|
mkdir dist\3proxy\doc\ru
|
||||||
|
mkdir dist\3proxy\doc\html
|
||||||
|
mkdir dist\3proxy\doc\html\plugins
|
||||||
|
mkdir dist\3proxy\doc\html\man5
|
||||||
|
mkdir dist\3proxy\doc\html\man8
|
||||||
|
mkdir dist\3proxy\doc\html\devel
|
||||||
|
copy bin\3proxy.exe dist\3proxy\bin\
|
||||||
|
copy bin\*.dll dist\3proxy\bin\
|
||||||
|
copy bin\3proxy_crypt.exe dist\3proxy\bin\
|
||||||
|
copy cfg\*.* dist\3proxy\cfg\
|
||||||
|
copy cfg\sql\*.* dist\3proxy\cfg\sql\
|
||||||
|
copy doc\ru\*.* dist\3proxy\doc\ru\
|
||||||
|
copy doc\html\*.* dist\3proxy\doc\html\
|
||||||
|
copy doc\html\plugins\*.* dist\3proxy\doc\html\plugins\
|
||||||
|
copy doc\html\man8\*.* dist\3proxy\doc\html\man8\
|
||||||
|
copy doc\html\man5\*.* dist\3proxy\doc\html\man5\
|
||||||
|
copy doc\html\devel\*.* dist\3proxy\doc\html\devel\
|
||||||
|
copy copying dist\3proxy\
|
||||||
|
copy authors dist\3proxy\
|
||||||
|
copy README.md dist\3proxy\
|
||||||
|
copy rus.3ps dist\3proxy\
|
||||||
|
- name: Get artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: "3proxy-${{ env.RELEASE }}-msys2-ucrt64"
|
||||||
|
path: dist/
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
name: Build Win32 3proxy with MSVC
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
attestations: write
|
||||||
|
name: "${{ matrix.target }}"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- windows-2022
|
||||||
|
runs-on: ${{ matrix.target }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
# - name: configure
|
||||||
|
# run: ./configure
|
||||||
|
- name: set date
|
||||||
|
run: |
|
||||||
|
$NOW = Get-Date -Format "yyMMddHHmmss"
|
||||||
|
$RELEASE = Get-Content -Path "RELEASE" -Raw
|
||||||
|
echo "RELEASE=$RELEASE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
echo "BUILDDATE=/D `"BUILDDATE=\`"$NOW\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
- name: install packages
|
||||||
|
run: vcpkg install pcre2:x86-windows-static wolfssl:x86-windows-static
|
||||||
|
- name: Add msbuild to PATH
|
||||||
|
uses: microsoft/setup-msbuild@v3
|
||||||
|
- name: make Windows MSVC
|
||||||
|
if: ${{ startsWith(matrix.target, 'windows') }}
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
|
||||||
|
D:
|
||||||
|
cd "D:/a/3proxy/3proxy"
|
||||||
|
set "LIB=%LIB%;c:/vcpkg/installed/x86-windows-static/lib"
|
||||||
|
set "INCLUDE=%INCLUDE%;c:/vcpkg/installed/x86-windows-static/include"
|
||||||
|
echo "volatile char VerSion[]=^"3APA3A-3proxy-Internal-Build: 3proxy-%RELEASE%-%NOW%\r\n^";" >>src/3proxy.c
|
||||||
|
nmake /F Makefile.msvc WOLFSSL=1
|
||||||
|
- name: make dist dir
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
mkdir dist
|
||||||
|
mkdir dist\3proxy
|
||||||
|
mkdir dist\3proxy\bin
|
||||||
|
mkdir dist\3proxy\cfg
|
||||||
|
mkdir dist\3proxy\cfg\sql
|
||||||
|
mkdir dist\3proxy\doc
|
||||||
|
mkdir dist\3proxy\doc\ru
|
||||||
|
mkdir dist\3proxy\doc\html
|
||||||
|
mkdir dist\3proxy\doc\html\plugins
|
||||||
|
mkdir dist\3proxy\doc\html\man5
|
||||||
|
mkdir dist\3proxy\doc\html\man8
|
||||||
|
mkdir dist\3proxy\doc\html\devel
|
||||||
|
copy bin\3proxy.exe dist\3proxy\bin\
|
||||||
|
copy bin\*.dll dist\3proxy\bin\
|
||||||
|
copy bin\3proxy_crypt.exe dist\3proxy\bin\
|
||||||
|
copy cfg\*.* dist\3proxy\cfg\
|
||||||
|
copy cfg\sql\*.* dist\3proxy\cfg\sql\
|
||||||
|
copy doc\ru\*.* dist\3proxy\doc\ru\
|
||||||
|
copy doc\html\*.* dist\3proxy\doc\html\
|
||||||
|
copy doc\html\plugins\*.* dist\3proxy\doc\html\plugins\
|
||||||
|
copy doc\html\man8\*.* dist\3proxy\doc\html\man8\
|
||||||
|
copy doc\html\man5\*.* dist\3proxy\doc\html\man5\
|
||||||
|
copy doc\html\devel\*.* dist\3proxy\doc\html\devel\
|
||||||
|
copy copying dist\3proxy\
|
||||||
|
copy authors dist\3proxy\
|
||||||
|
copy README.md dist\3proxy\
|
||||||
|
copy rus.3ps dist\3proxy\
|
||||||
|
- name: Get artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: "3proxy-${{ env.RELEASE }}-x86"
|
||||||
|
path: dist/
|
||||||
|
- name: Create zip
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: pwsh
|
||||||
|
run: Compress-Archive -Path dist/* -DestinationPath 3proxy-${{ env.RELEASE }}-x86.zip
|
||||||
|
- name: Checksums and detached signature
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$GPG_PRIVATE_KEY" ]; then echo "GPG_PRIVATE_KEY is not set"; exit 1; fi
|
||||||
|
printf '%s' "$GPG_PRIVATE_KEY" | gpg --batch --import
|
||||||
|
KEYID=$(gpg --list-secret-keys --with-colons | awk -F: '/^sec:/{print $5; exit}')
|
||||||
|
sha256sum *.zip > SHA256SUMS-win-x86
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
||||||
|
-u "$KEYID" --armor --detach-sign SHA256SUMS-win-x86
|
||||||
|
sha256sum -c SHA256SUMS-win-x86
|
||||||
|
- name: Attest build provenance
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
uses: actions/attest-build-provenance@v4
|
||||||
|
with:
|
||||||
|
subject-path: |
|
||||||
|
*.zip
|
||||||
|
- name: Upload to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" *.zip SHA256SUMS-win-x86 SHA256SUMS-win-x86.asc
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
name: Build Win64 3proxy with MSVC
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
attestations: write
|
||||||
|
name: "${{ matrix.target }}"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- windows-2022
|
||||||
|
runs-on: ${{ matrix.target }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
# - name: configure
|
||||||
|
# run: ./configure
|
||||||
|
- name: set date
|
||||||
|
run: |
|
||||||
|
$NOW = Get-Date -Format "yyMMddHHmmss"
|
||||||
|
$RELEASE = Get-Content -Path "RELEASE" -Raw
|
||||||
|
echo "NOW=$NOW" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
echo "RELEASE=$RELEASE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
echo "BUILDDATE=/D `"BUILDDATE=\`"$NOW\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
- name: install packages
|
||||||
|
run: vcpkg install pcre2:x64-windows-static wolfssl:x64-windows-static
|
||||||
|
- name: Add msbuild to PATH
|
||||||
|
uses: microsoft/setup-msbuild@v3
|
||||||
|
- name: make Windows MSVC
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
D:
|
||||||
|
cd "D:/a/3proxy/3proxy"
|
||||||
|
set "LIB=%LIB%;c:/vcpkg/installed/x64-windows-static/lib"
|
||||||
|
set "INCLUDE=%INCLUDE%;c:/vcpkg/installed/x64-windows-static/include"
|
||||||
|
echo "volatile char VerSion[]=^"3APA3A-3proxy-Internal-Build: 3proxy-%RELEASE%-%NOW%\r\n^";" >>src/3proxy.c
|
||||||
|
echo %NOW% / %RELEASE% / %BUILDDATE% / %VERSION%
|
||||||
|
nmake /F Makefile.msvc WOLFSSL=1
|
||||||
|
- name: make dist dir
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
mkdir dist
|
||||||
|
mkdir dist\3proxy
|
||||||
|
mkdir dist\3proxy\bin64
|
||||||
|
mkdir dist\3proxy\cfg
|
||||||
|
mkdir dist\3proxy\cfg\sql
|
||||||
|
mkdir dist\3proxy\doc
|
||||||
|
mkdir dist\3proxy\doc\ru
|
||||||
|
mkdir dist\3proxy\doc\html
|
||||||
|
mkdir dist\3proxy\doc\html\plugins
|
||||||
|
mkdir dist\3proxy\doc\html\man5
|
||||||
|
mkdir dist\3proxy\doc\html\man8
|
||||||
|
mkdir dist\3proxy\doc\html\devel
|
||||||
|
copy bin\3proxy.exe dist\3proxy\bin64\
|
||||||
|
copy bin\*.dll dist\3proxy\bin64\
|
||||||
|
copy bin\3proxy_crypt.exe dist\3proxy\bin64\
|
||||||
|
copy cfg\*.* dist\3proxy\cfg\
|
||||||
|
copy cfg\sql\*.* dist\3proxy\cfg\sql\
|
||||||
|
copy doc\ru\*.* dist\3proxy\doc\ru\
|
||||||
|
copy doc\html\*.* dist\3proxy\doc\html\
|
||||||
|
copy doc\html\plugins\*.* dist\3proxy\doc\html\plugins\
|
||||||
|
copy doc\html\man8\*.* dist\3proxy\doc\html\man8\
|
||||||
|
copy doc\html\man5\*.* dist\3proxy\doc\html\man5\
|
||||||
|
copy doc\html\devel\*.* dist\3proxy\doc\html\devel\
|
||||||
|
copy copying dist\3proxy\
|
||||||
|
copy authors dist\3proxy\
|
||||||
|
copy README.md dist\3proxy\
|
||||||
|
copy rus.3ps dist\3proxy\
|
||||||
|
- name: Get artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: "3proxy-${{ env.RELEASE }}-x64"
|
||||||
|
path: dist/
|
||||||
|
- name: Create zip
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: pwsh
|
||||||
|
run: Compress-Archive -Path dist/* -DestinationPath 3proxy-${{ env.RELEASE }}-x64.zip
|
||||||
|
- name: Checksums and detached signature
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$GPG_PRIVATE_KEY" ]; then echo "GPG_PRIVATE_KEY is not set"; exit 1; fi
|
||||||
|
printf '%s' "$GPG_PRIVATE_KEY" | gpg --batch --import
|
||||||
|
KEYID=$(gpg --list-secret-keys --with-colons | awk -F: '/^sec:/{print $5; exit}')
|
||||||
|
sha256sum *.zip > SHA256SUMS-win-x64
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
||||||
|
-u "$KEYID" --armor --detach-sign SHA256SUMS-win-x64
|
||||||
|
sha256sum -c SHA256SUMS-win-x64
|
||||||
|
- name: Attest build provenance
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
uses: actions/attest-build-provenance@v4
|
||||||
|
with:
|
||||||
|
subject-path: |
|
||||||
|
*.zip
|
||||||
|
- name: Upload to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" *.zip SHA256SUMS-win-x64 SHA256SUMS-win-x64.asc
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
name: Build Win-arm64 3proxy with MSVC
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
attestations: write
|
||||||
|
name: "${{ matrix.target }}"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- windows-2022
|
||||||
|
runs-on: ${{ matrix.target }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
# - name: configure
|
||||||
|
# run: ./configure
|
||||||
|
- name: set date
|
||||||
|
run: |
|
||||||
|
$NOW = Get-Date -Format "yyMMddHHmmss"
|
||||||
|
$RELEASE = Get-Content -Path "RELEASE" -Raw
|
||||||
|
echo "RELEASE=$RELEASE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
echo "BUILDDATE=/D `"BUILDDATE=\`"$NOW\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
- name: install packages
|
||||||
|
run: vcpkg install pcre2:arm64-windows-static wolfssl:arm64-windows-static
|
||||||
|
- name: Add msbuild to PATH
|
||||||
|
uses: microsoft/setup-msbuild@v3
|
||||||
|
- name: make Windows MSVC
|
||||||
|
if: ${{ startsWith(matrix.target, 'windows') }}
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsx86_arm64.bat"
|
||||||
|
D:
|
||||||
|
cd "D:/a/3proxy/3proxy"
|
||||||
|
set "LIB=%LIB%;c:/vcpkg/installed/arm64-windows-static/lib"
|
||||||
|
set "INCLUDE=%INCLUDE%;c:/vcpkg/installed/arm64-windows-static/include"
|
||||||
|
echo "volatile char VerSion[]=^"3APA3A-3proxy-Internal-Build: 3proxy-%RELEASE%-%NOW%\r\n^";" >>src/3proxy.c
|
||||||
|
nmake /F Makefile.msvc WOLFSSL=1
|
||||||
|
- name: make dist dir
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
mkdir dist
|
||||||
|
mkdir dist\3proxy
|
||||||
|
mkdir dist\3proxy\bin64
|
||||||
|
mkdir dist\3proxy\cfg
|
||||||
|
mkdir dist\3proxy\cfg\sql
|
||||||
|
mkdir dist\3proxy\doc
|
||||||
|
mkdir dist\3proxy\doc\ru
|
||||||
|
mkdir dist\3proxy\doc\html
|
||||||
|
mkdir dist\3proxy\doc\html\plugins
|
||||||
|
mkdir dist\3proxy\doc\html\man5
|
||||||
|
mkdir dist\3proxy\doc\html\man8
|
||||||
|
mkdir dist\3proxy\doc\html\devel
|
||||||
|
copy bin\3proxy.exe dist\3proxy\bin64\
|
||||||
|
copy bin\*.dll dist\3proxy\bin64\
|
||||||
|
copy bin\3proxy_crypt.exe dist\3proxy\bin64\
|
||||||
|
copy cfg\*.* dist\3proxy\cfg\
|
||||||
|
copy cfg\sql\*.* dist\3proxy\cfg\sql\
|
||||||
|
copy doc\ru\*.* dist\3proxy\doc\ru\
|
||||||
|
copy doc\html\*.* dist\3proxy\doc\html\
|
||||||
|
copy doc\html\plugins\*.* dist\3proxy\doc\html\plugins\
|
||||||
|
copy doc\html\man8\*.* dist\3proxy\doc\html\man8\
|
||||||
|
copy doc\html\man5\*.* dist\3proxy\doc\html\man5\
|
||||||
|
copy doc\html\devel\*.* dist\3proxy\doc\html\devel\
|
||||||
|
copy copying dist\3proxy\
|
||||||
|
copy authors dist\3proxy\
|
||||||
|
copy README.md dist\3proxy\
|
||||||
|
copy rus.3ps dist\3proxy\
|
||||||
|
- name: Get artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: "3proxy-${{ env.RELEASE }}-arm64"
|
||||||
|
path: dist/
|
||||||
|
- name: Create zip
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: pwsh
|
||||||
|
run: Compress-Archive -Path dist/* -DestinationPath 3proxy-${{ env.RELEASE }}-arm64.zip
|
||||||
|
- name: Checksums and detached signature
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$GPG_PRIVATE_KEY" ]; then echo "GPG_PRIVATE_KEY is not set"; exit 1; fi
|
||||||
|
printf '%s' "$GPG_PRIVATE_KEY" | gpg --batch --import
|
||||||
|
KEYID=$(gpg --list-secret-keys --with-colons | awk -F: '/^sec:/{print $5; exit}')
|
||||||
|
sha256sum *.zip > SHA256SUMS-win-arm64
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
||||||
|
-u "$KEYID" --armor --detach-sign SHA256SUMS-win-arm64
|
||||||
|
sha256sum -c SHA256SUMS-win-arm64
|
||||||
|
- name: Attest build provenance
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
uses: actions/attest-build-provenance@v4
|
||||||
|
with:
|
||||||
|
subject-path: |
|
||||||
|
*.zip
|
||||||
|
- name: Upload to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" *.zip SHA256SUMS-win-arm64 SHA256SUMS-win-arm64.asc
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
name: C/C++ CI Linux
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths: [ '**.c', '**.h', 'Makefile.Linux', 'tests/**', '.github/configs', '.github/workflows/c-cpp-Linux.yml' ]
|
||||||
|
pull_request:
|
||||||
|
paths: [ "**.c", "**.h", "Makefile.Linux", "tests/**", ".github/configs", ".github/workflows/c-cpp-Linux.yml" ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
name: "${{ matrix.target }}"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- ubuntu-latest
|
||||||
|
- ubuntu-24.04-arm
|
||||||
|
runs-on: ${{ matrix.target }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
# - name: configure
|
||||||
|
# run: ./configure
|
||||||
|
- name: Linux libraries
|
||||||
|
if: ${{ startsWith(matrix.target, 'ubuntu') }}
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y libssl-dev libpam-dev libpcre2-dev
|
||||||
|
- name: make
|
||||||
|
run: make -f Makefile.Linux MAILPROXY=true FTP=true
|
||||||
|
- name: regression tests
|
||||||
|
run: python3 tests/run.py
|
||||||
|
- name: mkdir
|
||||||
|
run: mkdir ~/3proxy
|
||||||
|
- name: make install
|
||||||
|
run: make -f Makefile.Linux DESTDIR=~/3proxy install
|
||||||
|
- name: make clean Linux
|
||||||
|
run: make -f Makefile.Linux clean
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
name: C/C++ CI MacOS
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths: [ '**.c', '**.h', 'Makefile.FreeBSD', 'tests/**', '.github/configs', '.github/workflows/c-cpp-MacOS.yml' ]
|
||||||
|
pull_request:
|
||||||
|
paths: [ "**.c", "**.h", "Makefile.FreeBSD", "tests/**", ".github/configs", ".github/workflows/c-cpp-MacOS.yml" ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
name: "${{ matrix.target }}"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- macos-15
|
||||||
|
runs-on: ${{ matrix.target }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
# - name: configure
|
||||||
|
# run: ./configure
|
||||||
|
- name: Mac libraries
|
||||||
|
run: brew install pcre2
|
||||||
|
- name: make MacOS
|
||||||
|
run: make -f Makefile.FreeBSD
|
||||||
|
env:
|
||||||
|
LDFLAGS: "-L/usr/local/lib -L/opt/homebrew/lib -L/opt/homebrew/opt/openssl/lib"
|
||||||
|
CFLAGS: "-I/usr/local/include -I/opt/homebrew/include -I/usr/local/opt/openssl/include -I/opt/homebrew/opt/openssl/include"
|
||||||
|
- name: regression tests
|
||||||
|
run: python3 tests/run.py
|
||||||
|
- name: make clean MacOS
|
||||||
|
run: make -f Makefile.FreeBSD clean
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
name: C/C++ CI Windows
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths: [ '**.c', '**.h', 'Makefile.msvc', 'tests/**', '.github/configs', '.github/workflows/c-cpp-Windows.yml' ]
|
||||||
|
pull_request:
|
||||||
|
paths: [ "**.c", "**.h", "Makefile.msvc", "tests/**", ".github/configs", ".github/workflows/c-cpp-Windows.yml" ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
name: "${{ matrix.target }}"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- windows-2022
|
||||||
|
runs-on: ${{ matrix.target }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
- name: install Windows libraries
|
||||||
|
run: vcpkg install pcre2:x64-windows wolfssl:x64-windows-static && c:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-pcre2 mingw-w64-x86_64-wolfssl
|
||||||
|
- name: make Windows
|
||||||
|
run: make -f Makefile.win
|
||||||
|
env:
|
||||||
|
LDFLAGS: '-L "c:/msys64/mingw64/lib"'
|
||||||
|
CFLAGS: '-I "c:/msys64/mingw64/include"'
|
||||||
|
- name: regression tests (MinGW)
|
||||||
|
run: |
|
||||||
|
$env:PATH = "c:\msys64\mingw64\bin;$env:PATH"
|
||||||
|
python tests\run.py --bin bin\3proxy.exe
|
||||||
|
- name: make clean Windows
|
||||||
|
run: make -f Makefile.win clean
|
||||||
|
- name: Add msbuild to PATH
|
||||||
|
uses: microsoft/setup-msbuild@v3
|
||||||
|
- name: make Windows MSVC
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
D:
|
||||||
|
cd "D:/a/3proxy/3proxy"
|
||||||
|
set "LIB=%LIB%;c:/vcpkg/installed/x64-windows-static/lib;c:/vcpkg/installed/x64-windows/lib"
|
||||||
|
set "INCLUDE=%INCLUDE%;c:/vcpkg/installed/x64-windows-static/include;c:/vcpkg/installed/x64-windows/include"
|
||||||
|
nmake /F Makefile.msvc WOLFSSL=1 || exit /b 1
|
||||||
|
set "PATH=%PATH%;c:/vcpkg/installed/x64-windows/bin"
|
||||||
|
python tests\run.py --bin bin\3proxy.exe || exit /b 1
|
||||||
|
nmake /F Makefile.msvc clean
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
name: C/C++ CI cmake
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths: [ '**.c', '**.h', '**.cmake', 'CMakeLists.txt', 'tests/**', '.github/configs', '.github/workflows/c-cpp-cmake.yml' ]
|
||||||
|
pull_request:
|
||||||
|
paths: [ "**.c", "**.h", "**.cmake", "CMakeLists.txt", "tests/**", ".github/configs", ".github/workflows/c-cpp-cmake.yml" ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
name: "${{ matrix.target }}"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
target:
|
||||||
|
- ubuntu-latest
|
||||||
|
- ubuntu-24.04-arm
|
||||||
|
- macos-15
|
||||||
|
- windows-2022
|
||||||
|
runs-on: ${{ matrix.target }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
# - name: configure
|
||||||
|
# run: ./configure
|
||||||
|
- name: Linux libraries
|
||||||
|
if: ${{ startsWith(matrix.target, 'ubuntu') }}
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y libssl-dev libpam-dev libpcre2-dev
|
||||||
|
- name: Mac libraries
|
||||||
|
if: ${{ startsWith(matrix.target, 'macos') }}
|
||||||
|
run: brew install pcre2
|
||||||
|
- name: install Windows libraries
|
||||||
|
if: ${{ startsWith(matrix.target, 'windows') }}
|
||||||
|
run: vcpkg install pcre2:x64-windows
|
||||||
|
- name: make with CMake POSIX
|
||||||
|
if: ${{ ! startsWith(matrix.target, 'windows') }}
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake ..
|
||||||
|
cmake --build .
|
||||||
|
mkdir ~/3proxy
|
||||||
|
DESTDIR=~/3proxy cmake --install .
|
||||||
|
cd ..
|
||||||
|
python3 tests/run.py --bin build/bin/3proxy
|
||||||
|
rm -rf build/
|
||||||
|
- name: make with CMake Win
|
||||||
|
if: ${{ startsWith(matrix.target, 'windows') }}
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
set "LIB=%LIB%;c:/program files/openssl/lib/VC/x64/MT;c:/vcpkg/installed/x64-windows/lib"
|
||||||
|
set "INCLUDE=%INCLUDE%;c:/program files/openssl/include;c:/vcpkg/installed/x64-windows/include"
|
||||||
|
cmake ..
|
||||||
|
dir
|
||||||
|
cmake --build .
|
||||||
|
cd ..
|
||||||
|
set "PATH=%PATH%;c:/vcpkg/installed/x64-windows/bin"
|
||||||
|
python tests\run.py || exit /b 1
|
||||||
|
rmdir /s /q build
|
||||||
|
|
||||||
|
wolfssl:
|
||||||
|
name: "ubuntu-latest (wolfSSL)"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
- name: Install wolfSSL
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y libwolfssl-dev
|
||||||
|
- name: make with CMake (wolfSSL preferred)
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake ..
|
||||||
|
cmake --build .
|
||||||
|
cd ..
|
||||||
|
python3 tests/run.py --bin build/bin/3proxy
|
||||||
|
rm -rf build/
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
name: Build Docker images (test, no publish)
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build ${{ matrix.file }} (${{ matrix.platform }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
file: [Dockerfile.minimal, Dockerfile.busybox, Dockerfile.full]
|
||||||
|
platform: [linux/amd64, linux/arm64]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
|
- name: Build image
|
||||||
|
uses: docker/build-push-action@v7
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ${{ matrix.file }}
|
||||||
|
platforms: ${{ matrix.platform }}
|
||||||
|
push: false
|
||||||
|
load: ${{ matrix.platform == 'linux/amd64' }}
|
||||||
@@ -0,0 +1,193 @@
|
|||||||
|
name: Build Docker images
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
env:
|
||||||
|
DOCKERHUB_IMAGE: docker.io/3proxy/3proxy
|
||||||
|
GHCR_IMAGE: ghcr.io/3proxy/3proxy
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: ${{ matrix.image }} ${{ matrix.platform }}
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
image: [full, busybox, minimal]
|
||||||
|
platform: [linux/amd64, linux/arm64, linux/arm/v7]
|
||||||
|
include:
|
||||||
|
- platform: linux/amd64
|
||||||
|
runner: ubuntu-latest
|
||||||
|
- platform: linux/arm64
|
||||||
|
runner: ubuntu-24.04-arm
|
||||||
|
- platform: linux/arm/v7
|
||||||
|
runner: ubuntu-24.04-arm
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: Platform name
|
||||||
|
id: platform
|
||||||
|
run: echo "pair=$(echo '${{ matrix.platform }}' | tr / -)" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
if: matrix.platform == 'linux/arm/v7'
|
||||||
|
uses: docker/setup-qemu-action@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
|
- name: Login to GHCR
|
||||||
|
uses: docker/login-action@v4
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push by digest
|
||||||
|
id: build
|
||||||
|
uses: docker/build-push-action@v7
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile.${{ matrix.image }}
|
||||||
|
platforms: ${{ matrix.platform }}
|
||||||
|
provenance: false
|
||||||
|
sbom: false
|
||||||
|
outputs: type=image,name=${{ env.GHCR_IMAGE }},push-by-digest=true,name-canonical=true,push=true
|
||||||
|
|
||||||
|
- name: Export digest
|
||||||
|
env:
|
||||||
|
DIGEST: ${{ steps.build.outputs.digest }}
|
||||||
|
run: |
|
||||||
|
mkdir -p /tmp/digests
|
||||||
|
touch "/tmp/digests/${DIGEST#sha256:}"
|
||||||
|
|
||||||
|
- name: Upload digest
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: digests-${{ matrix.image }}-${{ steps.platform.outputs.pair }}
|
||||||
|
path: /tmp/digests/*
|
||||||
|
if-no-files-found: error
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
publish:
|
||||||
|
name: Publish ${{ matrix.image }}
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
id-token: write
|
||||||
|
attestations: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- image: full
|
||||||
|
suffix: ''
|
||||||
|
floating: latest
|
||||||
|
- image: busybox
|
||||||
|
suffix: .busybox
|
||||||
|
floating: busybox
|
||||||
|
- image: minimal
|
||||||
|
suffix: .minimal
|
||||||
|
floating: minimal
|
||||||
|
steps:
|
||||||
|
- name: Download digests
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
path: /tmp/digests
|
||||||
|
pattern: digests-${{ matrix.image }}-*
|
||||||
|
merge-multiple: true
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
|
- name: Install cosign
|
||||||
|
uses: sigstore/cosign-installer@v3
|
||||||
|
with:
|
||||||
|
cosign-release: v2.4.3
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v4
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Login to GHCR
|
||||||
|
uses: docker/login-action@v4
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Determine tags
|
||||||
|
id: tags
|
||||||
|
env:
|
||||||
|
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
||||||
|
SUFFIX: ${{ matrix.suffix }}
|
||||||
|
FLOATING: ${{ matrix.floating }}
|
||||||
|
run: |
|
||||||
|
if [[ "$RELEASE_TAG" != "" ]]; then
|
||||||
|
RELEASE="${RELEASE_TAG#v}"
|
||||||
|
echo "versioned=${RELEASE}${SUFFIX}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "moving=${FLOATING}" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
DATETIME=$(date +%d%m%y%H%M%S)
|
||||||
|
BRANCH=$(echo "${GITHUB_REF#refs/heads/}" | tr "/" "-")
|
||||||
|
echo "versioned=${DATETIME}-${BRANCH}${SUFFIX}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "moving=${BRANCH}${SUFFIX}" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Create manifest list and push
|
||||||
|
working-directory: /tmp/digests
|
||||||
|
env:
|
||||||
|
VERSIONED: ${{ steps.tags.outputs.versioned }}
|
||||||
|
MOVING: ${{ steps.tags.outputs.moving }}
|
||||||
|
run: |
|
||||||
|
docker buildx imagetools create \
|
||||||
|
-t "${DOCKERHUB_IMAGE}:${VERSIONED}" \
|
||||||
|
-t "${DOCKERHUB_IMAGE}:${MOVING}" \
|
||||||
|
-t "${GHCR_IMAGE}:${VERSIONED}" \
|
||||||
|
-t "${GHCR_IMAGE}:${MOVING}" \
|
||||||
|
$(printf "${GHCR_IMAGE}@sha256:%s " *)
|
||||||
|
|
||||||
|
- name: Get pushed digest
|
||||||
|
id: digest
|
||||||
|
env:
|
||||||
|
VERSIONED: ${{ steps.tags.outputs.versioned }}
|
||||||
|
run: |
|
||||||
|
DIGEST=$(docker buildx imagetools inspect "${DOCKERHUB_IMAGE}:${VERSIONED}" \
|
||||||
|
--format '{{json .Manifest}}' | jq -r .digest)
|
||||||
|
echo "digest=${DIGEST}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Attest Docker Hub image
|
||||||
|
uses: actions/attest-build-provenance@v4
|
||||||
|
with:
|
||||||
|
subject-name: ${{ env.DOCKERHUB_IMAGE }}
|
||||||
|
subject-digest: ${{ steps.digest.outputs.digest }}
|
||||||
|
push-to-registry: false
|
||||||
|
|
||||||
|
- name: Attest GHCR image
|
||||||
|
uses: actions/attest-build-provenance@v4
|
||||||
|
with:
|
||||||
|
subject-name: ${{ env.GHCR_IMAGE }}
|
||||||
|
subject-digest: ${{ steps.digest.outputs.digest }}
|
||||||
|
push-to-registry: false
|
||||||
|
|
||||||
|
- name: Sign images
|
||||||
|
env:
|
||||||
|
DIGEST: ${{ steps.digest.outputs.digest }}
|
||||||
|
run: |
|
||||||
|
cosign sign --yes "${DOCKERHUB_IMAGE}@${DIGEST}"
|
||||||
|
cosign sign --yes "${GHCR_IMAGE}@${DIGEST}"
|
||||||
|
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
name: Release source tarball
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tarball:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
attestations: write
|
||||||
|
name: "source tarball"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: env
|
||||||
|
run: |
|
||||||
|
if [ -f RELEASE ]; then
|
||||||
|
RELEASE=$(tr -d ' \t\r\n' < RELEASE)
|
||||||
|
else
|
||||||
|
RELEASE=$(tr -d ' \t\r\n' < DEVEL)
|
||||||
|
fi
|
||||||
|
echo "RELEASE=$RELEASE" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Create tarball
|
||||||
|
run: |
|
||||||
|
# git archive is reproducible from the tag: anyone can regenerate the
|
||||||
|
# tarball and compare it against the published checksum.
|
||||||
|
git archive --format=tar.gz -9 \
|
||||||
|
--prefix="3proxy-${{ env.RELEASE }}/" \
|
||||||
|
-o "3proxy-${{ env.RELEASE }}.tar.gz" HEAD
|
||||||
|
tar tzf "3proxy-${{ env.RELEASE }}.tar.gz" >/dev/null
|
||||||
|
ls -l *.tar.gz
|
||||||
|
|
||||||
|
- name: Get artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: "3proxy-${{ env.RELEASE }}-src"
|
||||||
|
path: "*.tar.gz"
|
||||||
|
|
||||||
|
- name: Import signing key
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$GPG_PRIVATE_KEY" ]; then echo "GPG_PRIVATE_KEY is not set"; exit 1; fi
|
||||||
|
mkdir -p ~/.gnupg && chmod 700 ~/.gnupg
|
||||||
|
printf 'allow-loopback-pinentry\n' > ~/.gnupg/gpg-agent.conf
|
||||||
|
gpgconf --kill gpg-agent || true
|
||||||
|
printf '%s' "$GPG_PRIVATE_KEY" | gpg --batch --import
|
||||||
|
KEYID=$(gpg --list-secret-keys --with-colons | awk -F: '/^sec:/{print $5; exit}')
|
||||||
|
echo "GPG_KEYID=$KEYID" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Checksums and detached signatures
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
sha256sum *.tar.gz > SHA256SUMS-src
|
||||||
|
for f in *.tar.gz SHA256SUMS-src; do
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
||||||
|
-u "$GPG_KEYID" --armor --detach-sign "$f"
|
||||||
|
done
|
||||||
|
sha256sum -c SHA256SUMS-src
|
||||||
|
gpg --verify SHA256SUMS-src.asc SHA256SUMS-src
|
||||||
|
|
||||||
|
- name: Attest build provenance
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
uses: actions/attest-build-provenance@v4
|
||||||
|
with:
|
||||||
|
subject-path: |
|
||||||
|
*.tar.gz
|
||||||
|
|
||||||
|
- name: Upload to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" *.tar.gz *.tar.gz.asc SHA256SUMS-src SHA256SUMS-src.asc
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
name: Update HTML documentation
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
paths:
|
||||||
|
- 'man/**'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docs:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: Install groff
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y groff
|
||||||
|
|
||||||
|
- name: Generate HTML from man pages
|
||||||
|
run: |
|
||||||
|
mkdir -p doc/html/man5 doc/html/man8
|
||||||
|
echo \<html\>\<title\>3proxy documentation\</title\>\<body\>\<h2\>3proxy documentation\</h2\> >doc/html/index.html
|
||||||
|
echo \<a href=\"securityen.html\"\>Security recommendations\</a\>\<br\> >>doc/html/index.html
|
||||||
|
echo \<a href=\"highload.html\"\>Optimizing 3proxy for high loads\</a\>\<br\> >>doc/html/index.html
|
||||||
|
echo \<a href=\"howtoe.html\"\>How To \(English, very incomplete\)\</a\>\<br\> >>doc/html/index.html
|
||||||
|
echo \<a href=\"howtor.html\"\>How To \(Russian\)\</a\>\<br\> >>doc/html/index.html
|
||||||
|
echo \<a href=\"devref.html\"\>Developer reference\</a\>\<br\> >>doc/html/index.html
|
||||||
|
echo \<h3\>Man pages:\</h3\> >>doc/html/index.html
|
||||||
|
cd man
|
||||||
|
for i in *.8; do ((bash -c "groff -mandoc -Thtml $i | grep -v DOCTYPE| grep -v text/css| grep -v 'meta ' | grep -v /style | grep -v { | grep -v /title | grep -v www.w3.org | grep -v CreationDate" > ../doc/html/man8/$i.html ) && echo \<br\>\<A HREF=\"man8/$i.html\"\>$i\</A\> >> ../doc/html/index.html); done
|
||||||
|
for i in *.5; do ((bash -c "groff -mandoc -Thtml $i | grep -v DOCTYPE| grep -v text/css| grep -v 'meta ' | grep -v /style | grep -v { | grep -v /title | grep -v www.w3.org | grep -v CreationDate" > ../doc/html/man5/$i.html ) && echo \<br\>\<A HREF=\"man5/$i.html\"\>$i\</A\> >> ../doc/html/index.html); done
|
||||||
|
cd ..
|
||||||
|
echo \</body\>\</html\> >>doc/html/index.html
|
||||||
|
|
||||||
|
- name: Commit
|
||||||
|
run: |
|
||||||
|
if [ -z "$(git status --porcelain doc/html)" ]; then
|
||||||
|
echo "documentation already up to date"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add doc/html
|
||||||
|
git commit -m "Update HTML documentation from man pages"
|
||||||
|
git push
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
name: Update version files
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- RELEASE
|
||||||
|
- DEVEL
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
version:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: Regenerate version files
|
||||||
|
run: |
|
||||||
|
# A release branch carries RELEASE, a development branch DEVEL, whose
|
||||||
|
# version may have a suffix such as 2.0.0-devel.
|
||||||
|
if [ -f RELEASE ]; then VERFILE=RELEASE
|
||||||
|
elif [ -f DEVEL ]; then VERFILE=DEVEL
|
||||||
|
else echo "neither RELEASE nor DEVEL is present"; exit 1
|
||||||
|
fi
|
||||||
|
RELEASE=$(tr -d ' \t\r\n' < "$VERFILE")
|
||||||
|
if [ -z "$RELEASE" ]; then echo "$VERFILE is empty"; exit 1; fi
|
||||||
|
|
||||||
|
# the numbered fields take the numeric part, the strings keep all of it
|
||||||
|
NUMBERS=${RELEASE%%[!0-9.]*}
|
||||||
|
NUMBERS=${NUMBERS%.}
|
||||||
|
if [ -z "$NUMBERS" ]; then echo "no version number in '$RELEASE'"; exit 1; fi
|
||||||
|
MAJOR=$(echo "$NUMBERS" | cut -d . -f 1)
|
||||||
|
SUBMAJOR=$(echo "$NUMBERS" | cut -d . -f 2)
|
||||||
|
MINOR=$(echo "$NUMBERS" | cut -d . -f 3)
|
||||||
|
SUBMINOR=$(echo "$NUMBERS" | cut -d . -f 4)
|
||||||
|
[ -n "$SUBMAJOR" ] || SUBMAJOR=0
|
||||||
|
[ -n "$MINOR" ] || MINOR=0
|
||||||
|
[ -n "$SUBMINOR" ] || SUBMINOR=0
|
||||||
|
|
||||||
|
# The build date is minted once per release and then carried in
|
||||||
|
# version.h, so that rebuilding the same commit yields the same
|
||||||
|
# version string and the same package names.
|
||||||
|
OLDRELEASE=$(sed -n 's/^#define VERSION "3proxy-\(.*\)"$/\1/p' src/version.h 2>/dev/null)
|
||||||
|
OLDBUILDDATE=$(sed -n 's/^#define BUILDDATE "\(.*\)"$/\1/p' src/version.h 2>/dev/null)
|
||||||
|
if [ "$OLDRELEASE" = "$RELEASE" ] && [ -n "$OLDBUILDDATE" ]; then
|
||||||
|
BUILDDATE="$OLDBUILDDATE"
|
||||||
|
else
|
||||||
|
BUILDDATE=$(date -u +%y%m%d%H%M%S)
|
||||||
|
fi
|
||||||
|
# rpm refuses a hyphen in Version, so a suffix becomes a tilde, which
|
||||||
|
# also sorts before the release of the same number
|
||||||
|
RPMVERSION=$(echo "$RELEASE" | tr '-' '~')
|
||||||
|
echo "$VERFILE $RELEASE -> $MAJOR $SUBMAJOR $MINOR $SUBMINOR, rpm $RPMVERSION, build date $BUILDDATE"
|
||||||
|
SOURCE_DATE_EPOCH=$(date -u -d "20${BUILDDATE:0:2}-${BUILDDATE:2:2}-${BUILDDATE:4:2} ${BUILDDATE:6:2}:${BUILDDATE:8:2}:${BUILDDATE:10:2}" +%s)
|
||||||
|
YEAR=$(date -u -d @$SOURCE_DATE_EPOCH +%Y)
|
||||||
|
|
||||||
|
DEBVERSION=$(head -1 debian/changelog | cut -d "(" -f 2 | cut -d ")" -f 1)
|
||||||
|
if [ "$DEBVERSION" != "$RELEASE-1" ]; then
|
||||||
|
mv debian/changelog debian/changelog.old
|
||||||
|
{ echo "3proxy ($RELEASE-1) buster; urgency=medium"
|
||||||
|
echo ""
|
||||||
|
echo " *3proxy $RELEASE initial build"
|
||||||
|
echo ""
|
||||||
|
echo " -- z3APA3A <3apa3a@3proxy.org> $(date -R -u -d @$SOURCE_DATE_EPOCH)"
|
||||||
|
echo ""
|
||||||
|
cat debian/changelog.old
|
||||||
|
} > debian/changelog
|
||||||
|
rm -f debian/changelog.old
|
||||||
|
fi
|
||||||
|
|
||||||
|
mv scripts/rh/3proxy.spec scripts/rh/3proxy.spec.old
|
||||||
|
{ echo "Name: 3proxy"
|
||||||
|
echo "Version: $RPMVERSION"
|
||||||
|
echo "Release: 1%{?dist}"
|
||||||
|
tail --lines=+4 scripts/rh/3proxy.spec.old
|
||||||
|
} > scripts/rh/3proxy.spec
|
||||||
|
rm -f scripts/rh/3proxy.spec.old
|
||||||
|
|
||||||
|
{ echo "#ifndef VERSION"
|
||||||
|
echo "#define VERSION \"3proxy-$RELEASE\""
|
||||||
|
echo "#endif"
|
||||||
|
echo "#ifndef BUILDDATE"
|
||||||
|
echo "#define BUILDDATE \"$BUILDDATE\""
|
||||||
|
echo "#endif"
|
||||||
|
echo "#define MAJOR3PROXY $MAJOR"
|
||||||
|
echo "#define SUBMAJOR3PROXY $SUBMAJOR"
|
||||||
|
echo "#define MINOR3PROXY $MINOR"
|
||||||
|
echo "#define SUBMINOR3PROXY $SUBMINOR"
|
||||||
|
echo "#define RELEASE3PROXY \"3proxy-$RELEASE(\" BUILDDATE \")\\0\""
|
||||||
|
echo "#ifndef YEAR3PROXY"
|
||||||
|
echo "#define YEAR3PROXY \"$YEAR\""
|
||||||
|
echo "#endif"
|
||||||
|
} > src/version.h
|
||||||
|
|
||||||
|
- name: Commit
|
||||||
|
run: |
|
||||||
|
if [ -z "$(git status --porcelain debian/changelog scripts/rh/3proxy.spec src/version.h)" ]; then
|
||||||
|
echo "version files already up to date"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add debian/changelog scripts/rh/3proxy.spec src/version.h
|
||||||
|
git commit -m "Update version files for $(tr -d ' \t\r\n' < $(test -f RELEASE && echo RELEASE || echo DEVEL))"
|
||||||
|
git push
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
name: Update wiki
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
paths:
|
||||||
|
- 'doc/html/**'
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Update HTML documentation"]
|
||||||
|
types: [completed]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: update-wiki
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
wiki:
|
||||||
|
# the wiki mirrors master, so a run started by anything else is not for it
|
||||||
|
if: github.event_name != 'workflow_run' || github.event.workflow_run.head_branch == 'master'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
ref: master
|
||||||
|
|
||||||
|
- name: Clone wiki
|
||||||
|
run: |
|
||||||
|
git clone --quiet \
|
||||||
|
"https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.wiki.git" wiki
|
||||||
|
|
||||||
|
- name: Copy documentation
|
||||||
|
run: |
|
||||||
|
cp -f doc/html/man8/3proxy.8.html wiki/3proxy.md
|
||||||
|
cp -f doc/html/man8/3proxy_crypt.8.html wiki/3proxy_crypt.md
|
||||||
|
cp -f doc/html/man8/ftppr.8.html wiki/ftppr.md
|
||||||
|
cp -f doc/html/man8/pop3p.8.html wiki/pop3p.md
|
||||||
|
cp -f doc/html/man8/imapp.8.html wiki/imapp.md
|
||||||
|
cp -f doc/html/man8/proxy.8.html wiki/proxy.md
|
||||||
|
cp -f doc/html/man8/smtpp.8.html wiki/smtpp.md
|
||||||
|
cp -f doc/html/man8/socks.8.html wiki/socks.md
|
||||||
|
cp -f doc/html/man8/tlspr.8.html wiki/tlspr.md
|
||||||
|
cp -f doc/html/man8/tcppm.8.html wiki/tcppm.md
|
||||||
|
cp -f doc/html/man8/udppm.8.html wiki/udppm.md
|
||||||
|
cp -f doc/html/man5/3proxy.cfg.5.html wiki/3proxy.cfg.md
|
||||||
|
cp -f doc/html/highload.html wiki/High-Load.md
|
||||||
|
cp -f doc/html/howtoe.html wiki/How-To.md
|
||||||
|
cp -f doc/html/howtor.html "wiki/How-To-(русский).md"
|
||||||
|
cp -f doc/html/securityen.html wiki/Security-recommendations.md
|
||||||
|
cp -f doc/html/devel/devref.html wiki/DevelopeReference.md
|
||||||
|
cp -f doc/html/plugins/TransparentPlugin.html wiki/TransparentPlugin.md
|
||||||
|
cp -f doc/html/plugins/StringsPlugin.html wiki/StringsPlugin.md
|
||||||
|
cp -f doc/html/plugins/TrafficPlugin.html wiki/TrafficPlugin.md
|
||||||
|
cp -f doc/html/plugins/WindowsAuthentication.html wiki/WindowsAuthentication.md
|
||||||
|
cp -f doc/html/plugins/TransparentPlugin.ru.html "wiki/TransparentPlugin-(русский).md"
|
||||||
|
cp -f doc/html/plugins/StringsPlugin.ru.html "wiki/StringsPlugin-(русский).md"
|
||||||
|
cp -f doc/html/plugins/TrafficPlugin.ru.html "wiki/TrafficPlugin-(русский).md"
|
||||||
|
cp -f doc/html/plugins/WindowsAuthentication.ru.html "wiki/WindowsAuthentication-(русский).md"
|
||||||
|
|
||||||
|
- name: Commit
|
||||||
|
run: |
|
||||||
|
cd wiki
|
||||||
|
if [ -z "$(git status --porcelain)" ]; then
|
||||||
|
echo "wiki already up to date"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
git status --short
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add -A
|
||||||
|
git commit -m "Update documentation from master"
|
||||||
|
git push
|
||||||
+37
-6
@@ -5,7 +5,24 @@
|
|||||||
*.pydevproject
|
*.pydevproject
|
||||||
.project
|
.project
|
||||||
.metadata
|
.metadata
|
||||||
bin/
|
*.exe
|
||||||
|
*.dll
|
||||||
|
*.exp
|
||||||
|
*.lib
|
||||||
|
*.key
|
||||||
|
*.pem
|
||||||
|
*.so
|
||||||
|
bin/3proxy
|
||||||
|
bin/proxy
|
||||||
|
bin/socks
|
||||||
|
bin/tcppm
|
||||||
|
bin/udppm
|
||||||
|
bin/pop3p
|
||||||
|
bin/imapp
|
||||||
|
bin/smtpp
|
||||||
|
bin/ftppr
|
||||||
|
bin/mycrypt
|
||||||
|
bin/tlspr
|
||||||
bin64/
|
bin64/
|
||||||
dll/
|
dll/
|
||||||
tmp/
|
tmp/
|
||||||
@@ -18,6 +35,9 @@ tmp/
|
|||||||
*.err
|
*.err
|
||||||
res
|
res
|
||||||
version.c
|
version.c
|
||||||
|
version
|
||||||
|
version.sh
|
||||||
|
buildlinux.sh
|
||||||
3proxy.res
|
3proxy.res
|
||||||
|
|
||||||
src/3proxy
|
src/3proxy
|
||||||
@@ -26,6 +46,7 @@ src/socks
|
|||||||
src/tcppm
|
src/tcppm
|
||||||
src/udppm
|
src/udppm
|
||||||
src/pop3p
|
src/pop3p
|
||||||
|
src/imapp
|
||||||
src/smtpp
|
src/smtpp
|
||||||
src/ftppr
|
src/ftppr
|
||||||
src/icqpr
|
src/icqpr
|
||||||
@@ -33,12 +54,9 @@ src/mycrypt
|
|||||||
src/dighosts
|
src/dighosts
|
||||||
*.ld.so
|
*.ld.so
|
||||||
*.dSYM
|
*.dSYM
|
||||||
doc/html/man3/
|
|
||||||
doc/html/man8/
|
|
||||||
*.var
|
*.var
|
||||||
verfile.sh
|
verfile.sh
|
||||||
Makefile
|
/Makefile
|
||||||
Changelog
|
|
||||||
copytgz.sh
|
copytgz.sh
|
||||||
*~.nib
|
*~.nib
|
||||||
local.properties
|
local.properties
|
||||||
@@ -77,7 +95,6 @@ local.properties
|
|||||||
[Rr]elease/
|
[Rr]elease/
|
||||||
x64/
|
x64/
|
||||||
build/
|
build/
|
||||||
[Bb]in/
|
|
||||||
[Oo]bj/
|
[Oo]bj/
|
||||||
|
|
||||||
# MSTest test Results
|
# MSTest test Results
|
||||||
@@ -242,3 +259,17 @@ pip-log.txt
|
|||||||
|
|
||||||
#Mr Developer
|
#Mr Developer
|
||||||
.mr.developer.cfg
|
.mr.developer.cfg
|
||||||
|
CLAUDE.md
|
||||||
|
bin/3proxy_crypt
|
||||||
|
bin/3proxy_ftppr
|
||||||
|
bin/3proxy_pop3p
|
||||||
|
bin/3proxy_imapp
|
||||||
|
bin/3proxy_proxy
|
||||||
|
bin/3proxy_smtpp
|
||||||
|
bin/3proxy_socks
|
||||||
|
bin/3proxy_tcppm
|
||||||
|
bin/3proxy_tlspr
|
||||||
|
bin/3proxy_udppm
|
||||||
|
build*/*
|
||||||
|
testcerts/
|
||||||
|
/.claude
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
mQINBGqIZCIBEADF3zxdMo2dvUGAlQm3aIcQiqmpLMHucvLfSK3fHtwagO8f03CO
|
||||||
|
bEx9EfIK/U6BzLwEJ0CxyClzfvgo9COVpi5EjES9sI2LXzcgc4hGaYO0Q4Unj//0
|
||||||
|
W/G8aarDaLF2NRKMLf07eaYGBRJjqHnmeHgOHdr+SnN0JtMSadWMHoliB8esnabz
|
||||||
|
5CO4JabTrhwoez3DMLSgJNIod7wL6PJJv/2BeRahwNr2CjaXmzZKr/j7fc1MKLij
|
||||||
|
bsvJ5OmLmngZr6CHDa9cBhVhiH+7RgWLCsRlEGxEv7w0afp/T0xDwNAPkGzk5ObC
|
||||||
|
BrdXvypTAbNyUoVT8qSVJwkneZ4S0Ts4rRRNfNpaus4tsCmgyGKzsrbxvbiBOTPW
|
||||||
|
jB/fjkgr6X9M/AQ3yGpXrwXRJrM/nSfjUyOEHXttTC9HpGt41NH/mpC4mDWa1Kxi
|
||||||
|
FMxuo1+dw2kpDKl0Bp78IGdCo5akHwftFr8aHgmfZoGXAGJRHPAWbJGjC2ARy8yp
|
||||||
|
QOpxba0S3VlCU6bs8MDKl6cpWItnlXcl/GD/Qc55bjLXjFv1pbn2RUSYZS+n9wDX
|
||||||
|
64syZf3dZ/N5U4ydmybWfiLFUXqKQLtdO8QAWQGt4TSwKptTmI581/MMCTQ8qWZL
|
||||||
|
zgFj6C/8K0SZ4lMOv+5zfc2+QOoWw7E2Ws3stEKTyWjOMm/QMJAGumqvqwARAQAB
|
||||||
|
tCozcHJveHkgcmVsZWFzZSBzaWduaW5nIDwzcHJveHlAM3Byb3h5Lm9yZz6JAm0E
|
||||||
|
EwEIAFcWIQT8EiFEmfzHuhz/bNwDEjhOOnOUCwUCaohkIhsUgAAAAAAEAA5tYW51
|
||||||
|
MiwyLjUrMS4xMiwwLDMCGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQ
|
||||||
|
AxI4TjpzlAsCwRAAtH3OO42yCd2B8Od4yS1yBDkaIFwEm8hF68eou6uaSDkKG8YZ
|
||||||
|
C3DUH7qk0nXEMQu/5J6RWZKlW1C8D3AkUR9A1g54o6mUg4IL5196XsrQRdVu64YF
|
||||||
|
nLCk17Piku1lMk+Re6bZ6uJv5UlSv8d0dvxmAYzjusyPyBC2VXy7B0CoDif6AmXt
|
||||||
|
aw2/V6m0dRrfFo4W9mJKUqTAJcdBOKzEiQb7qLnzuwy4CB5qsvnEQTqymoCXFXzg
|
||||||
|
VDCSKRLXnbDPbIs0TvsCmthn/w1hCgftPq4W0s7EUJBOhbrjF59+AuTb+U1wIXNR
|
||||||
|
1+DPF+V+5RlwWjOWMlsOVGk2jaxjVY8wuaD3rE6ISJkt1pRv/WVdY984rT7Eu94J
|
||||||
|
ZHnxPjFrb2ohFKjoBCt60kbgZbuQ6yvEma5lAF9K63gwMNNyGZvq6QWl58iouzuS
|
||||||
|
3B9t7EwGwFstJfaXVhn/rnIHoExgxVZMbbsmXiGJyE2KcfVmlZcEi0MIyqEeBSDD
|
||||||
|
gjpE4yVO6StBtJKfXra8rMwtsbWBw9MptPhcLvdWtN6TG0CxDyTHhdL1pSLNcwX1
|
||||||
|
CTVpwi6+WmGogcv0WFNn5caQUpu9le/v/5qLRK08KWOH8inMJmTfpJg/9869YJuF
|
||||||
|
vDKdzJd6jug5YQRfV/7YVC2hdSOBLvBuDpRINePrj9CKJ34qG+jRSJ5xwYk=
|
||||||
|
=IS3Y
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
3proxy-1.0.1 Released October, 10 2026
|
||||||
|
|
||||||
|
! Fix: crash (segmentation fault) on configuration reload (SIGUSR1) on a busy server: a closing session could still use its service after the reload had freed it; the race existed since 0.9.7, the 5 second linger added in 0.9.9 made it much more likely (#1278)
|
||||||
|
! Fix: -Di and -De (bind to interface) were not applied to SOCKSv5 UDP ASSOCIATE and BIND sockets, the FTP proxy data connection and connect back (#1277)
|
||||||
|
! Fix: SOCKSv5 UDP ASSOCIATE over IPv6: the source address of a datagram was truncated and the reply was sent to the wrong address (#1279)
|
||||||
|
! Fix: SOCKSv5 UDP ASSOCIATE: an access rule with host names matched any datagram sent to a literal address; the address is used as the host name now, as it is for TCP requests
|
||||||
|
! Fix: a request rewritten with pcre_rewrite was only logged and was sent unchanged to the server on a direct connection; the rewritten path and query are what the server receives now
|
||||||
|
! Fix: buffer could be insufficient for the headers the HTTP proxy adds after a pcre_rewrite had grown the request
|
||||||
|
! Fix: heap buffer overflow in pcre_rewrite: a $N reference to a group which did not match was written out as its digits, which the space allocated for the result did not count
|
||||||
|
! Fix: pcre_extend did nothing, the rules it appended were never consulted; the manual described an argument the command does not take
|
||||||
|
! Fix: certificates generated for TLS MitM (openssl) carried no subject and authority key identifiers and were refused by strict verifiers, including macOS clients, OpenSSL with x509_strict and Python 3.13
|
||||||
|
! Fix: null pointer dereference in ftppr on PASS without USER and in smtpp on a user name without a host
|
||||||
|
! Fix: no service started with wolfSSL on glibc: the default thread stack was too small for wolfSSL thread-local storage, pthread_create() failed and the failure was not reported
|
||||||
|
! Fix: dnspr did not work on Windows; Windows builds answer UDP from a socket of their own again
|
||||||
|
+ Built-in HTTP server: httpsrv service with http rules to serve files (cached or with sendfile / TransmitFile), redirects, rewrites, fixed replies and proxypass to forward requests as the proxy does, so one port can serve both a site and a proxy; admin is httpsrv with the administration pages
|
||||||
|
+ Host names in access rules may be regular expressions with a pcre: (or regex:) prefix
|
||||||
|
+ transparent / notransparent commands: transparent proxying is built in (netfilter on Linux, pf on BSD, socket for divert-to and ipfw fwd), TransparentPlugin is removed and a configuration loading it keeps working
|
||||||
|
+ parent: weight may be written as a fraction (.5) or a percentage (50%); weight 0 is a fallback parent used only when every weighted parent of its group has failed; a failed parent is left out of the next attempt of the same connection
|
||||||
|
+ parent extport / intport: range of local ports for outgoing connections and for sockets facing the client (UDP ASSOCIATE, FTP data)
|
||||||
|
+ A parent given by host name is resolved for each connection when nserver is used, instead of once on configuration load
|
||||||
|
+ $$ in the configuration stands for a single dollar sign, a dollar inside quotes is ordinary text
|
||||||
|
+ OpenWrt package (procd init script, UCI configuration) and OpenWrt builds for mipsel_24kc, mips_24kc, arm_cortex-a7_neon-vfpv4 and aarch64_cortex-a53
|
||||||
|
- pop3p, imapp, smtpp and ftppr are not in a default build: build with MAILPROXY=true and FTP=true (CMake: 3PROXY_USE_MAILPROXY, 3PROXY_USE_FTP); without them the mail proxies run as tlspr negotiating STARTTLS, and ftppr refuses clients
|
||||||
|
- FTP over HTTP proxy (ftp:// URLs) is not in a default build either and has to be enabled explicitly: build with FTP=true (CMake: 3PROXY_USE_FTP), without it the HTTP proxy does not fetch ftp:// URLs
|
||||||
|
- Windows binaries are no longer signed with a self-signed Authenticode certificate, it gave no trust and triggered antivirus false positives
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
3proxy-1.0.1 Вышел 10 Октября 2026
|
||||||
|
|
||||||
|
! Исправление: падение (segmentation fault) при перезагрузке конфигурации (SIGUSR1) на нагруженном сервере: закрывающаяся сессия могла обращаться к службе после того, как перезагрузка её освободила; гонка существовала с 0.9.7, а добавленная в 0.9.9 задержка закрытия (linger) в 5 секунд сделала её гораздо вероятнее (#1278)
|
||||||
|
! Исправление: -Di и -De (привязка к интерфейсу) не применялись к сокетам SOCKSv5 UDP ASSOCIATE и BIND, к соединению данных FTP прокси и к обратному соединению (connect back) (#1277)
|
||||||
|
! Исправление: SOCKSv5 UDP ASSOCIATE по IPv6: адрес отправителя датаграммы обрезался, и ответ отправлялся не на тот адрес (#1279)
|
||||||
|
! Исправление: SOCKSv5 UDP ASSOCIATE: правило доступа с именами хостов срабатывало для любой датаграммы, отправленной на адрес, а не на имя; теперь адрес используется как имя хоста, так же как для запросов TCP
|
||||||
|
! Исправление: запрос, изменённый pcre_rewrite, только записывался в журнал, а при прямом соединении серверу отправлялся без изменений; теперь сервер получает изменённые путь и строку запроса
|
||||||
|
! Исправление: буфера могло не хватить для заголовков, добавляемых HTTP прокси, после того как pcre_rewrite увеличил запрос
|
||||||
|
! Исправление: переполнение буфера в куче в pcre_rewrite: ссылка $N на группу, не участвовавшую в совпадении, выводилась своими цифрами, которые не учитывались при выделении памяти под результат
|
||||||
|
! Исправление: pcre_extend ничего не делал, добавленные им правила никогда не проверялись; в документации был описан аргумент, который команда не принимает
|
||||||
|
! Исправление: сертификаты, создаваемые для TLS MitM (openssl), не содержали идентификаторов ключа субъекта и издателя и отвергались строгой проверкой, в том числе клиентами macOS, OpenSSL с x509_strict и Python 3.13
|
||||||
|
! Исправление: обращение по нулевому указателю в ftppr при PASS без USER и в smtpp при имени пользователя без хоста
|
||||||
|
! Исправление: с wolfSSL на glibc не запускалась ни одна служба: стека потока по умолчанию не хватало для thread-local памяти wolfSSL, pthread_create() завершался ошибкой, о которой не сообщалось
|
||||||
|
! Исправление: dnspr не работал в Windows; сборки для Windows снова отвечают по UDP с отдельного сокета
|
||||||
|
+ Встроенный HTTP сервер: служба httpsrv с правилами http для отдачи файлов (из кэша или через sendfile / TransmitFile), перенаправлений, перезаписи, фиксированных ответов и proxypass для передачи запроса прокси, так что один порт может обслуживать и сайт, и прокси; admin — это httpsrv со страницами администрирования
|
||||||
|
+ Имена хостов в правилах доступа могут быть регулярными выражениями с префиксом pcre: (или regex:)
|
||||||
|
+ Команды transparent / notransparent: прозрачное проксирование встроено в 3proxy (netfilter в Linux, pf в BSD, socket для divert-to и ipfw fwd), TransparentPlugin удалён, конфигурация, загружающая его, продолжает работать
|
||||||
|
+ parent: вес можно задавать дробью (.5) или в процентах (50%); вес 0 означает резервный parent, который используется только когда отказали все parent его группы с ненулевым весом; отказавший parent исключается из следующей попытки того же соединения
|
||||||
|
+ parent extport / intport: диапазон локальных портов для исходящих соединений и для сокетов на стороне клиента (UDP ASSOCIATE, данные FTP)
|
||||||
|
+ parent, заданный именем хоста, разрешается для каждого соединения, если используется nserver, а не один раз при загрузке конфигурации
|
||||||
|
+ $$ в конфигурации обозначает одиночный знак доллара, доллар в кавычках — обычный символ
|
||||||
|
+ Пакет для OpenWrt (скрипт запуска procd, конфигурация UCI) и сборки OpenWrt для mipsel_24kc, mips_24kc, arm_cortex-a7_neon-vfpv4 и aarch64_cortex-a53
|
||||||
|
- pop3p, imapp, smtpp и ftppr не входят в сборку по умолчанию: собирайте с MAILPROXY=true и FTP=true (CMake: 3PROXY_USE_MAILPROXY, 3PROXY_USE_FTP); без них почтовые прокси работают как tlspr с согласованием STARTTLS, а ftppr отказывает клиентам
|
||||||
|
- FTP через HTTP прокси (адреса ftp://) также не входит в сборку по умолчанию и должен быть включён явно: собирайте с FTP=true (CMake: 3PROXY_USE_FTP), без этого HTTP прокси не обрабатывает адреса ftp://
|
||||||
|
- Двоичные файлы для Windows больше не подписываются самоподписанным сертификатом Authenticode: доверия он не давал и вызывал ложные срабатывания антивирусов
|
||||||
+1018
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,67 @@
|
|||||||
|
# 3proxy.busybox is fully functional 3proxy build based on busybox:musl
|
||||||
|
# built against wolfSSL and PCRE2.
|
||||||
|
#
|
||||||
|
# Examples are for podman, for docker change 'podman' to 'docker'
|
||||||
|
#
|
||||||
|
#to build:
|
||||||
|
# podman build -f Dockerfile.busybox -t 3proxy.busybox .
|
||||||
|
#to run:
|
||||||
|
#
|
||||||
|
# echo nserver 8.8.8.8 >/path/to/local/config/directory/3proxy.cfg
|
||||||
|
# echo proxy -p3129 >>/path/to/local/config/directory/3proxy.cfg
|
||||||
|
# podman run --read-only -p 3129:3129 -v /path/to/local/config/directory:/etc/3proxy --name 3proxy.busybox 3proxy.busybox
|
||||||
|
#
|
||||||
|
# use "log" without pathname in config to log to stdout.
|
||||||
|
# plugins are located in /usr/local/3proxy/libexec (/libexec for chroot config)
|
||||||
|
# symlinked as /lib and /lib64 in both root and chroot configurations, so no need
|
||||||
|
# to specify full path to plugin.
|
||||||
|
#
|
||||||
|
# Since 0.9.6 image is distroless, no reason to use chroot, chroot
|
||||||
|
# configuration is supported for compatibility only.
|
||||||
|
|
||||||
|
|
||||||
|
FROM docker.io/alpine:latest AS wolfssl
|
||||||
|
RUN apk add --no-cache build-base curl autoconf automake libtool linux-headers
|
||||||
|
RUN TAG=$(curl -s https://api.github.com/repos/wolfSSL/wolfssl/releases/latest \
|
||||||
|
| sed -n 's/.*"tag_name": *"\([^"]*\)".*/\1/p') && \
|
||||||
|
echo "wolfssl tag: $TAG" && \
|
||||||
|
curl -sL https://api.github.com/repos/wolfSSL/wolfssl/tarball/$TAG -o /tmp/w.tar.gz && \
|
||||||
|
mkdir /src && tar -xzf /tmp/w.tar.gz -C /src --strip-components=1 && \
|
||||||
|
cd /src && \
|
||||||
|
autoreconf -i && \
|
||||||
|
./configure --enable-opensslextra --enable-certgen \
|
||||||
|
--enable-tls13 --enable-sni --enable-session-ticket \
|
||||||
|
--enable-static --disable-shared --prefix=/usr/local && \
|
||||||
|
make -j$(nproc) && make install
|
||||||
|
|
||||||
|
FROM docker.io/alpine:latest AS buildenv
|
||||||
|
RUN apk add --no-cache gcc make musl-dev linux-headers pcre2-dev
|
||||||
|
COPY --from=wolfssl /usr/local /usr/local
|
||||||
|
COPY . 3proxy
|
||||||
|
RUN cd 3proxy && mkdir -p bin &&\
|
||||||
|
make -f Makefile.Linux LIBSTATIC=true PAM_CHECK=false WOLFSSL_CHECK=true \
|
||||||
|
EXTRA_LDFLAGS="-L/usr/local/lib" &&\
|
||||||
|
strip bin/3proxy &&\
|
||||||
|
strip bin/*so &&\
|
||||||
|
mkdir /dist &&\
|
||||||
|
mkdir /dist/etc &&\
|
||||||
|
mkdir /dist/etc/3proxy &&\
|
||||||
|
mkdir /dist/bin &&\
|
||||||
|
mkdir /dist/usr &&\
|
||||||
|
mkdir /dist/usr/local &&\
|
||||||
|
mkdir /dist/usr/local/3proxy &&\
|
||||||
|
mkdir /dist/usr/local/3proxy/conf &&\
|
||||||
|
mkdir /dist/usr/local/3proxy/libexec &&\
|
||||||
|
cp bin/3proxy /dist/bin &&\
|
||||||
|
cp bin/*.so /dist/usr/local/3proxy/libexec &&\
|
||||||
|
cp scripts/3proxy.cfg.inchroot /dist/etc/3proxy/3proxy.cfg
|
||||||
|
RUN cd /dist &&\
|
||||||
|
ln -s /lib lib64 &&\
|
||||||
|
ln -s /lib usr/lib &&\
|
||||||
|
ln -s /lib usr/lib64
|
||||||
|
RUN cp /lib/ld-musl-*.so.* /dist/usr/local/3proxy/libexec || true
|
||||||
|
|
||||||
|
FROM docker.io/busybox:musl
|
||||||
|
COPY --from=buildenv /dist /
|
||||||
|
RUN mkdir -p /lib /lib64 && ln -sf /usr/local/3proxy/libexec/* /lib/ && cd /usr/local/3proxy/ && ln -s libexec lib && ln -s libexec lib64 && mkdir usr && ln -s libexec usr/lib && ln -s libexec usr/lib64
|
||||||
|
CMD ["/bin/3proxy", "/etc/3proxy/3proxy.cfg"]
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
# 3proxy.full is fully functional distroless 3proxy build
|
||||||
|
#
|
||||||
|
# Examples are for podman, for docker change 'podman' to 'docker'
|
||||||
|
#
|
||||||
|
#to build:
|
||||||
|
# podman build -f Dockerfile.full -t 3proxy.full .
|
||||||
|
#to run:
|
||||||
|
#
|
||||||
|
# echo nserver 8.8.8.8 >/path/to/local/config/directory/3proxy.cfg
|
||||||
|
# echo proxy -p3129 >>/path/to/local/config/directory/3proxy.cfg
|
||||||
|
# podman run --read-only -p 3129:3129 -v /path/to/local/config/directory:/etc/3proxy --name 3proxy.full 3proxy.full
|
||||||
|
#
|
||||||
|
# use "log" without pathname in config to log to stdout.
|
||||||
|
# plugins are located in /usr/local/3proxy/libexec (/libexec for chroot config)
|
||||||
|
# symlinked as /lib and /lib64 in both root and chroot configurations, so no need
|
||||||
|
# to specify full path to plugin.
|
||||||
|
#
|
||||||
|
# Since 0.9.6 image is distroless, no reason to use chroot, chroot
|
||||||
|
# configuration is supported for compatibility only.
|
||||||
|
|
||||||
|
|
||||||
|
FROM docker.io/gcc AS buildenv
|
||||||
|
COPY . 3proxy
|
||||||
|
RUN cd 3proxy &&\
|
||||||
|
apt --assume-yes update && apt --assume-yes install libssl-dev libpcre2-dev &&\
|
||||||
|
mkdir -p bin &&\
|
||||||
|
make -f Makefile.Linux LIBSTATIC=true PAM_CHECK=false &&\
|
||||||
|
strip bin/3proxy &&\
|
||||||
|
mkdir /dist &&\
|
||||||
|
mkdir /dist/etc &&\
|
||||||
|
mkdir /dist/etc/3proxy &&\
|
||||||
|
mkdir /dist/bin &&\
|
||||||
|
mkdir /dist/usr &&\
|
||||||
|
mkdir /dist/usr/local &&\
|
||||||
|
mkdir /dist/usr/local/3proxy &&\
|
||||||
|
mkdir /dist/usr/local/3proxy/libexec &&\
|
||||||
|
mkdir /dist/usr/local/3proxy/conf &&\
|
||||||
|
cp bin/3proxy /dist/bin &&\
|
||||||
|
cp bin/*.so /dist/usr/local/3proxy/libexec &&\
|
||||||
|
cp scripts/3proxy.cfg.inchroot /dist/etc/3proxy/3proxy.cfg
|
||||||
|
RUN cd /dist &&\
|
||||||
|
ln -s /usr/local/3proxy/libexec lib64 &&\
|
||||||
|
ln -s /usr/local/3proxy/libexec lib &&\
|
||||||
|
ln -s /usr/local/3proxy/libexec usr/lib &&\
|
||||||
|
ln -s /usr/local/3proxy/libexec usr/lib64 &&\
|
||||||
|
ln -s /usr/local/3proxy/libexec /dist/usr/local/3proxy/libexec/`gcc -dumpmachine`
|
||||||
|
RUN cp /lib/ld-*.so.* /dist/usr/local/3proxy/libexec || true
|
||||||
|
RUN cp /lib64/ld-*.so.* /dist/usr/local/3proxy/libexec || true
|
||||||
|
RUN cp "/lib/`gcc -dumpmachine`"/libc.so.* /dist/usr/local/3proxy/libexec &&\
|
||||||
|
cp "/lib/`gcc -dumpmachine`"/libdl.so.* /dist/usr/local/3proxy/libexec
|
||||||
|
RUN cd /dist/usr/local/3proxy/ &&\
|
||||||
|
ln -s libexec lib &&\
|
||||||
|
ln -s libexec lib64 &&\
|
||||||
|
mkdir usr
|
||||||
|
RUN cd /dist/usr/local/3proxy/usr &&\
|
||||||
|
ln -s ../libexec lib &&\
|
||||||
|
ln -s ../libexec lib64 &&\
|
||||||
|
strip /dist/usr/local/3proxy/libexec/*.so
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
COPY --from=buildenv /dist /
|
||||||
|
CMD ["/bin/3proxy", "/etc/3proxy/3proxy.cfg"]
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
# dockerfile for "interactive" minimal 3proxy execution, no configuration mounting is required, configuration
|
||||||
|
# is accepted from stdin. Use "end" command to indicate the end of configuration. Use "log" for stdout logging.
|
||||||
|
#
|
||||||
|
# Examples are for podman. For docker change 'podman' to 'docker'.
|
||||||
|
#
|
||||||
|
# This is a scratch-based docker with statically linked 3proxy executable
|
||||||
|
# built against musl and wolfSSL.
|
||||||
|
#
|
||||||
|
# Limitations for minimal version:
|
||||||
|
# no support for plugins and system resolver.
|
||||||
|
# 'nserver' or 'fakeresolve' are mandatory in configuration.
|
||||||
|
#
|
||||||
|
# Build:
|
||||||
|
#
|
||||||
|
# podman build -f Dockerfile.minimal -t 3proxy.minimal .
|
||||||
|
#
|
||||||
|
# Run example:
|
||||||
|
#
|
||||||
|
# podman run --read-only -i -p 3129:3129 --name 3proxy 3proxy.minimal
|
||||||
|
#or
|
||||||
|
# podman start -ai 3proxy
|
||||||
|
#<nserver 8.8.8.8
|
||||||
|
#<nscache 65535
|
||||||
|
#<log
|
||||||
|
#<proxy -p3129
|
||||||
|
#<end
|
||||||
|
#
|
||||||
|
|
||||||
|
FROM docker.io/alpine:latest AS wolfssl
|
||||||
|
RUN apk add --no-cache build-base curl autoconf automake libtool linux-headers
|
||||||
|
RUN TAG=$(curl -s https://api.github.com/repos/wolfSSL/wolfssl/releases/latest \
|
||||||
|
| sed -n 's/.*"tag_name": *"\([^"]*\)".*/\1/p') && \
|
||||||
|
echo "wolfssl tag: $TAG" && \
|
||||||
|
curl -sL https://api.github.com/repos/wolfSSL/wolfssl/tarball/$TAG -o /tmp/w.tar.gz && \
|
||||||
|
mkdir /src && tar -xzf /tmp/w.tar.gz -C /src --strip-components=1 && \
|
||||||
|
cd /src && \
|
||||||
|
autoreconf -i && \
|
||||||
|
./configure --enable-opensslextra --enable-certgen \
|
||||||
|
--enable-tls13 --enable-sni --enable-session-ticket \
|
||||||
|
--enable-static --disable-shared --prefix=/usr/local && \
|
||||||
|
make -j$(nproc) && make install
|
||||||
|
|
||||||
|
FROM docker.io/alpine:latest AS buildenv
|
||||||
|
RUN apk add --no-cache gcc make musl-dev linux-headers
|
||||||
|
COPY --from=wolfssl /usr/local /usr/local
|
||||||
|
COPY . 3proxy
|
||||||
|
RUN cd 3proxy && mkdir -p bin &&\
|
||||||
|
make -f Makefile.Linux STATIC=true WOLFSSL_CHECK=true \
|
||||||
|
EXTRA_LDFLAGS="-L/usr/local/lib" &&\
|
||||||
|
strip bin/3proxy
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
COPY --from=buildenv 3proxy/bin/3proxy /bin/3proxy
|
||||||
|
CMD ["/bin/3proxy"]
|
||||||
@@ -0,0 +1,149 @@
|
|||||||
|
#
|
||||||
|
# 3 proxy Makefile for GCC/Unix
|
||||||
|
#
|
||||||
|
# add -DWITH_ODBC to CFLAGS and -lodbc to LDFLAGS to compile with ODBC
|
||||||
|
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
||||||
|
|
||||||
|
BUILDDIR = ../bin/
|
||||||
|
PREFIX ?= 3proxy_
|
||||||
|
CRYPT_PREFIX ?= $(PREFIX)
|
||||||
|
MANDIR ?= /usr/share/man
|
||||||
|
CC ?= cc
|
||||||
|
|
||||||
|
CFLAGS ?= -O3 -flto
|
||||||
|
CFLAGS += -c -fno-strict-aliasing -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_UN
|
||||||
|
COUT = -o
|
||||||
|
LN ?= ${CC}
|
||||||
|
LDFLAGS ?= -O3 -flto
|
||||||
|
LDFLAGS += -pthread -fno-strict-aliasing
|
||||||
|
# Use EXTRA_CFLAGS/EXTRA_LDFLAGS to add flags from the make command line.
|
||||||
|
# Setting CFLAGS or LDFLAGS there instead overrides every assignment in this
|
||||||
|
# makefile, including the += above and the STATIC/LIBSTATIC handling below.
|
||||||
|
CFLAGS += $(EXTRA_CFLAGS)
|
||||||
|
LDFLAGS += $(EXTRA_LDFLAGS)
|
||||||
|
# -lpthreads may be reuiured on some platforms instead of -pthreads
|
||||||
|
# -ldl or -lld may be required for some platforms
|
||||||
|
DCFLAGS ?= -fPIC
|
||||||
|
MAILPROXY ?= false
|
||||||
|
ifeq ($(MAILPROXY),true)
|
||||||
|
CFLAGS += -DWITH_POP3P -DWITH_IMAPP -DWITH_SMTPP
|
||||||
|
MAIL_EXES = $(BUILDDIR)$(PREFIX)pop3p$(EXESUFFICS) $(BUILDDIR)$(PREFIX)imapp$(EXESUFFICS) $(BUILDDIR)$(PREFIX)smtpp$(EXESUFFICS)
|
||||||
|
endif
|
||||||
|
FTP ?= false
|
||||||
|
ifeq ($(FTP),true)
|
||||||
|
CFLAGS += -DWITH_FTP
|
||||||
|
FTP_EXES = $(BUILDDIR)$(PREFIX)ftppr$(EXESUFFICS)
|
||||||
|
endif
|
||||||
|
HTTPSRV ?= true
|
||||||
|
ifeq ($(HTTPSRV),true)
|
||||||
|
CFLAGS += -DWITH_HTTPSRV
|
||||||
|
HTTPSRV_OBJS = srvhttpsrv$(OBJSUFFICS) srvwebadmin$(OBJSUFFICS)
|
||||||
|
endif
|
||||||
|
DLFLAGS ?= -shared
|
||||||
|
DLSUFFICS = .so
|
||||||
|
LIBS ?=
|
||||||
|
LIBSPREFIX = -l
|
||||||
|
LIBSSUFFIX =
|
||||||
|
LNOUT = -o
|
||||||
|
EXESUFFICS =
|
||||||
|
OBJSUFFICS = .o
|
||||||
|
DEFINEOPTION = -D
|
||||||
|
COMPFILES = *~
|
||||||
|
REMOVECOMMAND = rm -f
|
||||||
|
AFTERCLEAN = (find . -type f -name "*.o" -delete && find src/ -type f -name "Makefile.var" -delete && find bin/ -type f -perm +111 -delete) || true
|
||||||
|
TYPECOMMAND = cat
|
||||||
|
COMPATLIBS =
|
||||||
|
MAKEFILE = Makefile.FreeBSD
|
||||||
|
PLUGINS ?= StringsPlugin TrafficPlugin FilePlugin
|
||||||
|
|
||||||
|
# Transparent proxying, built in. The destination of a redirected connection
|
||||||
|
# comes from pf where its headers are available, and from the socket where a
|
||||||
|
# redirection leaves it there (OpenBSD divert-to, FreeBSD ipfw fwd). macOS
|
||||||
|
# has /dev/pf but ships no pfvar.h, so only the socket route is built there
|
||||||
|
# and no macOS redirection leaves the address on the socket.
|
||||||
|
CFLAGS += -DWITH_TRANSPARENT
|
||||||
|
TRANSPARENT_OBJS = transparent$(OBJSUFFICS)
|
||||||
|
|
||||||
|
PF_CHECK ?= $(shell printf "\#include <sys/types.h>\\n\#include <sys/socket.h>\\n\#include <net/if.h>\\n\#include <net/pfvar.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpf.o -c - 2>/dev/null && rm testpf.o && echo true||echo false)
|
||||||
|
ifeq ($(PF_CHECK), true)
|
||||||
|
CFLAGS += -DWITH_PF
|
||||||
|
endif
|
||||||
|
ifeq ($(STATIC), true)
|
||||||
|
LDFLAGS += -static
|
||||||
|
CFLAGS += -DNOPLUGINS -DNOSTDRESOLVE -DNOCRYPT
|
||||||
|
ZLIB = -lz -lzstd
|
||||||
|
PLUGINS =
|
||||||
|
PAM_CHECK = false
|
||||||
|
endif
|
||||||
|
ifeq ($(LIBSTATIC), true)
|
||||||
|
STATIC_PREFIX = -Wl,-Bstatic
|
||||||
|
STATIC_SUFFIX = -Wl,-Bdynamic
|
||||||
|
ZLIB = -lz -lzstd
|
||||||
|
endif
|
||||||
|
WOLFSSL_CHECK ?= $(shell printf "\#include <wolfssl/options.h>\\n\#include <wolfssl/openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testwssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestwssl testwssl.o $(STATIC_PREFIX) -lwolfssl $(STATIC_SUFFIX) 2>/dev/null && rm testwssl testwssl.o && echo true||echo false)
|
||||||
|
ifeq ($(WOLFSSL_CHECK), true)
|
||||||
|
LIBS += $(STATIC_PREFIX) -lwolfssl $(STATIC_SUFFIX)
|
||||||
|
CFLAGS += -DWITH_SSL -DWITH_WOLFSSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
ZLIB :=
|
||||||
|
else
|
||||||
|
OPENSSL_CHECK ?= $(shell printf "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestssl testssl.o $(STATIC_PREFIX) $(ZLIB) -lcrypto -lssl $(STATIC_SUFFIX) 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
||||||
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
|
LIBS += $(STATIC_PREFIX) $(ZLIB) -l crypto -l ssl $(STATIC_SUFFIX)
|
||||||
|
CFLAGS += -DWITH_SSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
else
|
||||||
|
ZLIB :=
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
PCRE_CHECK ?= $(shell printf "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpcre.o - 2>/dev/null && $(CC) -o testpcre testpcre.o $(LDFLAGS) -lpcre2-8 2>/dev/null && rm testpcre testpcre.o && echo true||echo false)
|
||||||
|
ifeq ($(PCRE_CHECK), true)
|
||||||
|
CFLAGS += -DWITH_PCRE
|
||||||
|
PCRE_OBJS = pcre$(OBJSUFFICS)
|
||||||
|
PCRE_LIBS = $(STATIC_PREFIX) -lpcre2-8 $(STATIC_SUFFIX)
|
||||||
|
endif
|
||||||
|
PAM_CHECK ?= $(shell printf "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpam.o - 2>/dev/null && $(CC) $(LDFLAGS) -o testpam testpam.o -lpam 2>/dev/null && rm testpam testpam.o && echo true||echo false)
|
||||||
|
ifeq ($(PAM_CHECK), true)
|
||||||
|
PLUGINS += PamAuth
|
||||||
|
endif
|
||||||
|
|
||||||
|
include Makefile.inc
|
||||||
|
|
||||||
|
DESTDIR ?=
|
||||||
|
prefix ?= /usr/local
|
||||||
|
BINPREFIX ?= $(prefix)/bin
|
||||||
|
|
||||||
|
install: all
|
||||||
|
if [ ! -d "$(DESTDIR)$(BINPREFIX)" ]; then mkdir -p $(DESTDIR)$(BINPREFIX)/; fi
|
||||||
|
install bin/3proxy $(DESTDIR)$(BINPREFIX)/3proxy
|
||||||
|
install bin/$(CRYPT_PREFIX)crypt $(DESTDIR)$(BINPREFIX)/$(CRYPT_PREFIX)crypt
|
||||||
|
for f in proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr; do \
|
||||||
|
if [ -f bin/$(PREFIX)$$f ]; then install bin/$(PREFIX)$$f $(DESTDIR)$(BINPREFIX)/$(PREFIX)$$f; fi; \
|
||||||
|
done
|
||||||
|
install -d $(DESTDIR)$(prefix)/etc/3proxy/conf
|
||||||
|
install -d $(DESTDIR)$(prefix)/etc/rc.d/
|
||||||
|
sed -e 's|@CMAKE_INSTALL_FULL_BINDIR@|$(BINPREFIX)|g' -e 's|@CMAKE_INSTALL_FULL_SYSCONFDIR@|$(prefix)/etc|g' scripts/rc.d/3proxy.in > $(DESTDIR)$(prefix)/etc/rc.d/3proxy
|
||||||
|
chmod 755 $(DESTDIR)$(prefix)/etc/rc.d/3proxy
|
||||||
|
sed -e 's|@CMAKE_INSTALL_FULL_BINDIR@|$(BINPREFIX)|g' -e 's|@3PROXY_CONFDIR@|$(prefix)/etc/3proxy/conf|g' -e 's|@CRYPT_PREFIX@|$(CRYPT_PREFIX)|g' scripts/add3proxyuser.sh.in > $(DESTDIR)$(BINPREFIX)/add3proxyuser
|
||||||
|
chmod 755 $(DESTDIR)$(BINPREFIX)/add3proxyuser
|
||||||
|
if [ -s $(DESTDIR)$(prefix)/etc/3proxy/3proxy.cfg ]; then echo $(prefix)/etc/3proxy/3proxy.cfg already exists; else sed -e 's|@CMAKE_INSTALL_FULL_SYSCONFDIR@|$(prefix)/etc|g' -e 's|@3PROXY_CONFDIR@|$(prefix)/etc/3proxy/conf|g' -e 's|@3PROXY_COUNTERDIR@|/opt/3proxy|g' scripts/3proxy.cfg.in > $(DESTDIR)$(prefix)/etc/3proxy/3proxy.cfg; chmod 640 $(DESTDIR)$(prefix)/etc/3proxy/3proxy.cfg; fi
|
||||||
|
if [ ! -d $(DESTDIR)/var/log/3proxy/ ]; then mkdir -p $(DESTDIR)/var/log/3proxy/; fi
|
||||||
|
mkdir -p $(DESTDIR)/opt/3proxy
|
||||||
|
touch $(DESTDIR)$(prefix)/etc/3proxy/conf/passwd
|
||||||
|
touch $(DESTDIR)$(prefix)/etc/3proxy/conf/counters
|
||||||
|
touch $(DESTDIR)$(prefix)/etc/3proxy/conf/bandlimiters
|
||||||
|
install -d $(DESTDIR)$(MANDIR)/man8
|
||||||
|
install -m 644 man/3proxy.8 $(DESTDIR)$(MANDIR)/man8/3proxy.8
|
||||||
|
for f in proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr; do \
|
||||||
|
if [ -f man/$$f.8 ] && [ -f bin/$(PREFIX)$$f ]; then install -m 644 man/$$f.8 $(DESTDIR)$(MANDIR)/man8/$(PREFIX)$$f.8; fi; \
|
||||||
|
done
|
||||||
|
install -m 644 man/3proxy_crypt.8 $(DESTDIR)$(MANDIR)/man8/$(CRYPT_PREFIX)crypt.8
|
||||||
|
install -d $(DESTDIR)$(MANDIR)/man5
|
||||||
|
install -m 644 man/3proxy.cfg.5 $(DESTDIR)$(MANDIR)/man5/3proxy.cfg.5
|
||||||
|
@if [ "$(DESTDIR)" = "" ]; then \
|
||||||
|
sh scripts/postinstall.sh $(prefix); \
|
||||||
|
fi
|
||||||
|
echo Run $(BINPREFIX)/add3proxyuser to add \'admin\' user
|
||||||
|
|
||||||
|
allplugins:
|
||||||
|
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done
|
||||||
+159
-46
@@ -1,21 +1,48 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for GCC/Linux/Cygwin
|
# 3 proxy Makefile for GCC/Linux/Cygwin
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
# add -DWITH_ODBC to CFLAGS and -lodbc to LIBS to compile with ODBC
|
||||||
# libraries
|
|
||||||
#
|
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LIBS to compile with ODBC
|
|
||||||
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
||||||
|
#
|
||||||
|
# Linux splice() support is not built by default, it is slower than the
|
||||||
|
# read/write path for most traffic. Add -DWITHSPLICE to CFLAGS to build it,
|
||||||
|
# it must additionally be enabled per service with the -s option.
|
||||||
|
|
||||||
BUILDDIR =
|
BUILDDIR = ../bin/
|
||||||
CC = gcc
|
PREFIX ?= 3proxy_
|
||||||
|
CRYPT_PREFIX ?= $(PREFIX)
|
||||||
|
CC ?= gcc
|
||||||
|
|
||||||
CFLAGS = -g -O2 -c -pthread -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL
|
CFLAGS ?= -O3 -flto
|
||||||
|
CFLAGS += -fno-strict-aliasing -c -pthread -D_GNU_SOURCE -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER -D WITH_UN
|
||||||
COUT = -o
|
COUT = -o
|
||||||
LN = gcc
|
LN ?= ${CC}
|
||||||
DCFLAGS = -fpic
|
DCFLAGS ?= -fPIC
|
||||||
LDFLAGS = -O2 -pthread
|
LDFLAGS ?= -O3 -flto
|
||||||
DLFLAGS = -shared
|
LDFLAGS += -fno-strict-aliasing -pthread
|
||||||
|
# Use EXTRA_CFLAGS/EXTRA_LDFLAGS to add flags from the make command line.
|
||||||
|
# Setting CFLAGS or LDFLAGS there instead overrides every assignment in this
|
||||||
|
# makefile, including the += above and the STATIC/LIBSTATIC handling below.
|
||||||
|
CFLAGS += $(EXTRA_CFLAGS)
|
||||||
|
LDFLAGS += $(EXTRA_LDFLAGS)
|
||||||
|
# The HTTP server serves the endpoints declared by http lines. The admin
|
||||||
|
# interface is built on top of it, so turning it off removes both.
|
||||||
|
MAILPROXY ?= false
|
||||||
|
ifeq ($(MAILPROXY),true)
|
||||||
|
CFLAGS += -DWITH_POP3P -DWITH_IMAPP -DWITH_SMTPP
|
||||||
|
MAIL_EXES = $(BUILDDIR)$(PREFIX)pop3p$(EXESUFFICS) $(BUILDDIR)$(PREFIX)imapp$(EXESUFFICS) $(BUILDDIR)$(PREFIX)smtpp$(EXESUFFICS)
|
||||||
|
endif
|
||||||
|
FTP ?= false
|
||||||
|
ifeq ($(FTP),true)
|
||||||
|
CFLAGS += -DWITH_FTP
|
||||||
|
FTP_EXES = $(BUILDDIR)$(PREFIX)ftppr$(EXESUFFICS)
|
||||||
|
endif
|
||||||
|
HTTPSRV ?= true
|
||||||
|
ifeq ($(HTTPSRV),true)
|
||||||
|
CFLAGS += -DWITH_HTTPSRV
|
||||||
|
HTTPSRV_OBJS = srvhttpsrv$(OBJSUFFICS) srvwebadmin$(OBJSUFFICS)
|
||||||
|
endif
|
||||||
|
DLFLAGS ?= -shared
|
||||||
DLSUFFICS = .ld.so
|
DLSUFFICS = .ld.so
|
||||||
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
||||||
LIBSPREFIX = -l
|
LIBSPREFIX = -l
|
||||||
@@ -26,77 +53,163 @@ OBJSUFFICS = .o
|
|||||||
DEFINEOPTION = -D
|
DEFINEOPTION = -D
|
||||||
COMPFILES = *~
|
COMPFILES = *~
|
||||||
REMOVECOMMAND = rm -f
|
REMOVECOMMAND = rm -f
|
||||||
|
AFTERCLEAN = (find . -type f -name "*.o" -delete && find src/ -type f -name "Makefile.var" -delete && find bin/ -type f -executable -delete) || true
|
||||||
TYPECOMMAND = cat
|
TYPECOMMAND = cat
|
||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.Linux
|
MAKEFILE = Makefile.Linux
|
||||||
# PamAuth requires libpam, you may require pam-devel package to be installed
|
# PamAuth requires libpam, you may require pam-devel package to be installed
|
||||||
# SSLPlugin requires -lcrypto -lssl
|
# SSLPlugin requires -lcrypto -lssl
|
||||||
#LIBS = -lcrypto -lssl -ldl
|
#LIBS = -lcrypto -lssl -ldl
|
||||||
LIBS = -ldl
|
#PLUGINS = StringsPlugin TrafficPlugin PamAuth LdapPlugin
|
||||||
#PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin PamAuth
|
PLUGINS ?= StringsPlugin TrafficPlugin FilePlugin
|
||||||
PLUGINS = StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin
|
|
||||||
|
|
||||||
|
# Transparent proxying, built in: it needs the packet filter of the platform
|
||||||
|
CFLAGS += -DWITH_TRANSPARENT
|
||||||
|
TRANSPARENT_OBJS = transparent$(OBJSUFFICS)
|
||||||
|
ifeq ($(STATIC), true)
|
||||||
|
LDFLAGS += -static
|
||||||
|
CFLAGS += -DNOPLUGINS -DNOSTDRESOLVE -DNOCRYPT
|
||||||
|
ZLIB = -lz -lzstd
|
||||||
|
PLUGINS =
|
||||||
|
PAM_CHECK = false
|
||||||
|
else
|
||||||
|
LIBS += -ldl
|
||||||
|
endif
|
||||||
|
ifeq ($(LIBSTATIC), true)
|
||||||
|
STATIC_PREFIX = -Wl,-Bstatic
|
||||||
|
STATIC_SUFFIX = -Wl,-Bdynamic
|
||||||
|
ZLIB = -lz -lzstd
|
||||||
|
endif
|
||||||
|
|
||||||
|
WOLFSSL_CHECK ?= $(shell printf "\#include <wolfssl/options.h>\\n\#include <wolfssl/openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testwssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestwssl testwssl.o $(STATIC_PREFIX) -lwolfssl $(STATIC_SUFFIX) 2>/dev/null && rm testwssl testwssl.o && echo true||echo false)
|
||||||
|
ifeq ($(WOLFSSL_CHECK), true)
|
||||||
|
LIBS += $(STATIC_PREFIX) -lwolfssl $(STATIC_SUFFIX)
|
||||||
|
CFLAGS += -DWITH_SSL -DWITH_WOLFSSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
ZLIB :=
|
||||||
|
else
|
||||||
|
OPENSSL_CHECK ?= $(shell printf "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestssl testssl.o $(STATIC_PREFIX) $(ZLIB) -lcrypto -lssl $(STATIC_SUFFIX) 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
||||||
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
|
LIBS += $(STATIC_PREFIX) $(ZLIB) -lcrypto -lssl $(STATIC_SUFFIX)
|
||||||
|
CFLAGS += -DWITH_SSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
else
|
||||||
|
ZLIB :=
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
PCRE_CHECK ?= $(shell printf "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpcre.o - 2>/dev/null && $(CC) -o testpcre testpcre.o $(LDFLAGS) $(STATIC_PREFIX) -lpcre2-8 $(STATIC_SUFFIX) 2>/dev/null && rm testpcre testpcre.o && echo true||echo false)
|
||||||
|
ifeq ($(PCRE_CHECK), true)
|
||||||
|
CFLAGS += -DWITH_PCRE
|
||||||
|
PCRE_OBJS = pcre$(OBJSUFFICS)
|
||||||
|
PCRE_LIBS = $(STATIC_PREFIX) -lpcre2-8 $(STATIC_SUFFIX)
|
||||||
|
endif
|
||||||
|
PAM_CHECK ?= $(shell printf "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpam.o - 2>/dev/null && $(CC) $(LDFLAGS) -o testpam testpam.o -lpam 2>/dev/null && rm testpam testpam.o && echo true||echo false)
|
||||||
|
ifeq ($(PAM_CHECK), true)
|
||||||
|
PLUGINS += PamAuth
|
||||||
|
endif
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
allplugins:
|
allplugins:
|
||||||
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done
|
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done
|
||||||
|
|
||||||
DESTDIR =
|
DESTDIR ?=
|
||||||
prefix = /usr/local
|
prefix ?=
|
||||||
exec_prefix = $(prefix)
|
exec_prefix ?= $(prefix)
|
||||||
man_prefix = $(prefix)/share
|
man_prefix ?= /usr/share
|
||||||
|
chroot_prefix ?= /usr/local
|
||||||
|
|
||||||
INSTALL = /usr/bin/install
|
INSTALL ?= /usr/bin/install
|
||||||
INSTALL_BIN = $(INSTALL) -m 755
|
INSTALL_BIN = $(INSTALL) -m 755
|
||||||
INSTALL_DATA = $(INSTALL) -m 644
|
INSTALL_DATA = $(INSTALL) -m 644
|
||||||
INSTALL_OBJS = src/3proxy \
|
INSTALL_OBJS = bin/3proxy \
|
||||||
src/dighosts \
|
bin/$(CRYPT_PREFIX)crypt \
|
||||||
src/ftppr \
|
bin/$(PREFIX)proxy \
|
||||||
src/mycrypt \
|
bin/$(PREFIX)socks \
|
||||||
src/pop3p \
|
bin/$(PREFIX)tcppm \
|
||||||
src/proxy \
|
bin/$(PREFIX)tlspr \
|
||||||
src/socks \
|
bin/$(PREFIX)udppm
|
||||||
src/tcppm \
|
# the mail proxies and ftppr are only there when they were built
|
||||||
src/udppm
|
ifeq ($(MAILPROXY),true)
|
||||||
|
INSTALL_OBJS += bin/$(PREFIX)imapp bin/$(PREFIX)pop3p bin/$(PREFIX)smtpp
|
||||||
|
endif
|
||||||
|
ifeq ($(FTP),true)
|
||||||
|
INSTALL_OBJS += bin/$(PREFIX)ftppr
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
INSTALL_CFG_OBJS = scripts/3proxy.cfg \
|
INSTALL_CFG = scripts/3proxy.cfg.chroot
|
||||||
scripts/add3proxyuser.sh
|
INSTALL_CFG_INCHROOT = scripts/3proxy.cfg.inchroot
|
||||||
INSTALL_CFG_DEST = config
|
|
||||||
|
|
||||||
INSTALL_CFG_OBJS2 = passwd counters bandlimiters
|
INSTALL_CFG_OBJS2 = counters bandlimiters
|
||||||
|
|
||||||
MANDIR1 = $(DESTDIR)$(man_prefix)/man/man1
|
INSTALL_INITD_SCRIPT = scripts/init.d/3proxy.in
|
||||||
MANDIR3 = $(DESTDIR)$(man_prefix)/man/man3
|
INSTALL_SYSTEMD_SCRIPT = scripts/3proxy.service.in
|
||||||
|
|
||||||
|
CHROOTDIR = $(DESTDIR)$(chroot_prefix)/3proxy
|
||||||
|
CHROOTREL = ../..$(chroot_prefix)/3proxy
|
||||||
|
MANDIR5 = $(DESTDIR)$(man_prefix)/man/man5
|
||||||
MANDIR8 = $(DESTDIR)$(man_prefix)/man/man8
|
MANDIR8 = $(DESTDIR)$(man_prefix)/man/man8
|
||||||
BINDIR = $(DESTDIR)$(exec_prefix)/bin
|
BINDIR = $(DESTDIR)$(exec_prefix)/bin
|
||||||
ETCDIR = $(DESTDIR)$(prefix)/etc/3proxy
|
ETCDIR = $(DESTDIR)/etc/3proxy
|
||||||
|
INITDDIR = $(DESTDIR)/etc/init.d
|
||||||
|
LOGBASE = $(DESTDIR)/var/log
|
||||||
|
LOGDIR = $(LOGBASE)/3proxy
|
||||||
|
INSTALL_CFG_DEST = $(ETCDIR)/conf
|
||||||
|
SYSTEMDDIR = $(DESTDIR)/usr/lib/systemd/system/
|
||||||
|
|
||||||
install-bin:
|
install-bin:
|
||||||
$(INSTALL_BIN) -d $(BINDIR)
|
$(INSTALL_BIN) -d $(BINDIR)
|
||||||
$(INSTALL_BIN) -s $(INSTALL_OBJS) $(BINDIR)
|
$(INSTALL_BIN) -s $(INSTALL_OBJS) $(BINDIR)
|
||||||
|
$(INSTALL_BIN) -s bin/*.ld.so $(CHROOTDIR)/libexec
|
||||||
|
$(INSTALL_BIN) scripts/add3proxyuser.sh.in $(BINDIR)/add3proxyuser
|
||||||
|
|
||||||
install-etc-dir:
|
install-etc-dir:
|
||||||
$(INSTALL_BIN) -d $(ETCDIR)
|
$(INSTALL_BIN) -d $(ETCDIR)
|
||||||
|
|
||||||
install-etc-default-config:
|
install-chroot-dir:
|
||||||
if [ -f $(ETCDIR)/$(INSTALL_CFG_DEST) ]; then \
|
$(INSTALL_BIN) -d $(CHROOTDIR)
|
||||||
: ; \
|
$(INSTALL_BIN) -d $(CHROOTDIR)/conf
|
||||||
else \
|
$(INSTALL_BIN) -d $(CHROOTDIR)/logs
|
||||||
$(INSTALL_DATA) $(INSTALL_CFG_OBJS) $(ETCDIR)/$(INSTALL_CFG_DEST) \
|
$(INSTALL_BIN) -d $(CHROOTDIR)/count
|
||||||
|
$(INSTALL_BIN) -d $(CHROOTDIR)/libexec
|
||||||
|
|
||||||
|
install-etc-default-config: install-chroot-dir
|
||||||
|
if [ ! -d $(INSTALL_CFG_DEST) ]; then \
|
||||||
|
ln -s $(CHROOTREL)/conf $(INSTALL_CFG_DEST); \
|
||||||
|
$(INSTALL_BIN) $(INSTALL_CFG) $(ETCDIR)/3proxy.cfg; \
|
||||||
|
$(INSTALL_BIN) $(INSTALL_CFG_INCHROOT) $(INSTALL_CFG_DEST)/3proxy.cfg; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install-etc: install-etc-dir
|
install-etc: install-etc-dir install-etc-default-config
|
||||||
for file in $(INSTALL_CFG_OBJS2); \
|
for file in $(INSTALL_CFG_OBJS2); \
|
||||||
do \
|
do \
|
||||||
touch $(ETCDIR)/$$file; chmod 0600 $(ETCDIR)/$$file; \
|
touch $(INSTALL_CFG_DEST)/$$file; chmod 0600 $(INSTALL_CFG_DEST)/$$file; \
|
||||||
done;
|
done;
|
||||||
|
|
||||||
install-man:
|
install-man:
|
||||||
$(INSTALL_BIN) -d $(MANDIR3)
|
$(INSTALL_BIN) -d $(MANDIR5)
|
||||||
$(INSTALL_BIN) -d $(MANDIR8)
|
$(INSTALL_BIN) -d $(MANDIR8)
|
||||||
$(INSTALL_DATA) man/*.3 $(MANDIR3)
|
$(INSTALL_DATA) man/3proxy.cfg.5 $(MANDIR5)
|
||||||
$(INSTALL_DATA) man/*.8 $(MANDIR8)
|
$(INSTALL_DATA) man/3proxy.8 $(MANDIR8)
|
||||||
|
for f in proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr; do \
|
||||||
|
if [ -f man/$$f.8 ] && [ -f bin/$(PREFIX)$$f ]; then $(INSTALL_DATA) man/$$f.8 $(MANDIR8)/$(PREFIX)$$f.8; fi; \
|
||||||
|
done
|
||||||
|
$(INSTALL_DATA) man/3proxy_crypt.8 $(MANDIR8)/$(CRYPT_PREFIX)crypt.8
|
||||||
|
|
||||||
install: install-bin install-etc install-man
|
install-init:
|
||||||
|
$(INSTALL_BIN) -d $(SYSTEMDDIR)
|
||||||
|
sed -e 's|@CMAKE_INSTALL_FULL_BINDIR@|$(exec_prefix)/bin|g' -e 's|@CMAKE_INSTALL_FULL_SYSCONFDIR@|/etc|g' $(INSTALL_SYSTEMD_SCRIPT) > $(SYSTEMDDIR)/3proxy.service
|
||||||
|
$(INSTALL_BIN) -d $(INITDDIR)
|
||||||
|
$(INSTALL_BIN) $(INSTALL_INITD_SCRIPT) $(INITDDIR)/3proxy
|
||||||
|
|
||||||
|
install-log:
|
||||||
|
$(INSTALL_BIN) -d $(LOGBASE)
|
||||||
|
@if [ ! -d $(LOGDIR) ]; then \
|
||||||
|
ln -s $(CHROOTREL)/logs $(LOGDIR);\
|
||||||
|
fi
|
||||||
|
|
||||||
|
install: install-chroot-dir install-bin install-etc install-log install-man install-init
|
||||||
|
@if [ "$(DESTDIR)" = "" ]; then \
|
||||||
|
sh debian/preinst; \
|
||||||
|
sh debian/postinst; \
|
||||||
|
fi
|
||||||
+45
-9
@@ -1,19 +1,34 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for Solaris/SunCC
|
# 3 proxy Makefile for Solaris/SunCC
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
#
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
# add -DWITH_ODBC to CFLAGS and -lodbc to LDFLAGS to compile with ODBC
|
||||||
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
||||||
|
|
||||||
BUILDDIR =
|
BUILDDIR = ../bin/
|
||||||
CC = cc
|
PREFIX ?= 3proxy_
|
||||||
CFLAGS = -xO3 -c -D_SOLARIS -D_THREAD_SAFE -DGETHOSTBYNAME_R -D_REENTRANT -DNOODBC -DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL
|
CRYPT_PREFIX ?= $(PREFIX)
|
||||||
|
CC ?= cc
|
||||||
|
CFLAGS = -xO3 -c -D_SOLARIS -D_THREAD_SAFE -DGETHOSTBYNAME_R -D_REENTRANT -DFD_SETSIZE=4096 -DWITH_POLL
|
||||||
COUT = -o ./
|
COUT = -o ./
|
||||||
LN = cc
|
LN = $(CC)
|
||||||
LDFLAGS = -xO3
|
LDFLAGS = -xO3
|
||||||
DCFLAGS = -fpic
|
DCFLAGS = -fPIC
|
||||||
|
MAILPROXY ?= false
|
||||||
|
ifeq ($(MAILPROXY),true)
|
||||||
|
CFLAGS += -DWITH_POP3P -DWITH_IMAPP -DWITH_SMTPP
|
||||||
|
MAIL_EXES = $(BUILDDIR)$(PREFIX)pop3p$(EXESUFFICS) $(BUILDDIR)$(PREFIX)imapp$(EXESUFFICS) $(BUILDDIR)$(PREFIX)smtpp$(EXESUFFICS)
|
||||||
|
endif
|
||||||
|
FTP ?= false
|
||||||
|
ifeq ($(FTP),true)
|
||||||
|
CFLAGS += -DWITH_FTP
|
||||||
|
FTP_EXES = $(BUILDDIR)$(PREFIX)ftppr$(EXESUFFICS)
|
||||||
|
endif
|
||||||
|
HTTPSRV ?= true
|
||||||
|
ifeq ($(HTTPSRV),true)
|
||||||
|
CFLAGS += -DWITH_HTTPSRV
|
||||||
|
HTTPSRV_OBJS = srvhttpsrv$(OBJSUFFICS) srvwebadmin$(OBJSUFFICS)
|
||||||
|
endif
|
||||||
DLFLAGS = -shared
|
DLFLAGS = -shared
|
||||||
DLSUFFICS = .ld.so
|
DLSUFFICS = .ld.so
|
||||||
LIBS = -lpthread -lsocket -lnsl -lresolv -ldl
|
LIBS = -lpthread -lsocket -lnsl -lresolv -ldl
|
||||||
@@ -25,10 +40,31 @@ OBJSUFFICS = .o
|
|||||||
DEFINEOPTION = -D
|
DEFINEOPTION = -D
|
||||||
COMPFILES = *~
|
COMPFILES = *~
|
||||||
REMOVECOMMAND = rm -f
|
REMOVECOMMAND = rm -f
|
||||||
|
AFTERCLEAN = (find . -type f -name "*.o" -delete && find src/ -type f -name "Makefile.var" -delete && find bin/ -type f -executable -delete) || true
|
||||||
TYPECOMMAND = cat
|
TYPECOMMAND = cat
|
||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.Solaris
|
MAKEFILE = Makefile.Solaris
|
||||||
PLUGINS = StringsPlugin TrafficPlugin PCREPlugin
|
PLUGINS = StringsPlugin TrafficPlugin FilePlugin
|
||||||
|
|
||||||
|
WOLFSSL_CHECK = $(shell printf "\#include <wolfssl/options.h>\\n\#include <wolfssl/openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testwssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -o testwssl testwssl.o -lwolfssl 2>/dev/null && rm testwssl testwssl.o && echo true||echo false)
|
||||||
|
ifeq ($(WOLFSSL_CHECK), true)
|
||||||
|
LIBS += -lwolfssl
|
||||||
|
CFLAGS += -DWITH_SSL -DWITH_WOLFSSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
else
|
||||||
|
OPENSSL_CHECK = $(shell printf "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -o testssl testssl.o -lcrypto -lssl 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
||||||
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
|
LIBS += -l crypto -l ssl
|
||||||
|
CFLAGS += -DWITH_SSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
PCRE_CHECK = $(shell printf "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpcre.o - 2>/dev/null && $(CC) -o testpcre testpcre.o $(LDFLAGS) -Wl,-Bstatic -lpcre2-8 -Wl,-Bdynamic 2>/dev/null && rm testpcre testpcre.o && echo true||echo false)
|
||||||
|
ifeq ($(PCRE_CHECK), true)
|
||||||
|
CFLAGS += -DWITH_PCRE
|
||||||
|
PCRE_OBJS = pcre$(OBJSUFFICS)
|
||||||
|
PCRE_LIBS = -Wl,-Bstatic -lpcre2-8 -Wl,-Bdynamic
|
||||||
|
endif
|
||||||
|
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
#
|
|
||||||
# 3 proxy Makefile for Solaris/gcc
|
|
||||||
#
|
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
|
||||||
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
|
||||||
|
|
||||||
|
|
||||||
BUILDDIR =
|
|
||||||
CC = gcc
|
|
||||||
CFLAGS = -O3 -c -D_SOLARIS -D_THREAD_SAFE -DGETHOSTBYNAME_R -D_REENTRANT -DNOODBC -DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL
|
|
||||||
COUT = -o ./
|
|
||||||
LN = gcc
|
|
||||||
LDFLAGS = -O3
|
|
||||||
DCFLAGS = -fpic
|
|
||||||
DLFLAGS = -shared
|
|
||||||
DLSUFFICS = .ld.so
|
|
||||||
LIBS = -lpthread -lsocket -lnsl -lresolv -ldl
|
|
||||||
LIBSPREFIX = -l
|
|
||||||
LIBSSUFFIX =
|
|
||||||
LNOUT = -o ./
|
|
||||||
EXESUFFICS =
|
|
||||||
OBJSUFFICS = .o
|
|
||||||
DEFINEOPTION = -D
|
|
||||||
COMPFILES = *~
|
|
||||||
REMOVECOMMAND = rm -f
|
|
||||||
TYPECOMMAND = cat
|
|
||||||
COMPATLIBS =
|
|
||||||
MAKEFILE = Makefile.Solaris-gcc
|
|
||||||
PLUGINS = StringsPlugin TrafficPlugin PCREPlugin
|
|
||||||
|
|
||||||
include Makefile.inc
|
|
||||||
|
|
||||||
allplugins:
|
|
||||||
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
SUBDIRS = src man
|
|
||||||
EXTRA_DIST = doc cfg
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
#
|
|
||||||
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
|
||||||
#
|
|
||||||
# You can try to add /D "WITH_STD_MALLOC" to CFLAGS to use standard malloc
|
|
||||||
# libraries
|
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
|
||||||
CC = cl
|
|
||||||
CFLAGS = /FD /MDd /nologo /W3 /ZI /Wp64 /GS /Gs /RTCsu /EHs- /GA /GF /DEBUG /D "WITH_STD_MALLOC" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /c
|
|
||||||
COUT = /Fo
|
|
||||||
LN = link
|
|
||||||
LDFLAGS = /nologo /subsystem:console /machine:I386 /DEBUG
|
|
||||||
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib
|
|
||||||
LNOUT = /out:
|
|
||||||
EXESUFFICS = .exe
|
|
||||||
OBJSUFFICS = .obj
|
|
||||||
DEFINEOPTION = /D
|
|
||||||
COMPFILES = *.pch *.idb
|
|
||||||
REMOVECOMMAND = del 2>NUL >NUL
|
|
||||||
TYPECOMMAND = type
|
|
||||||
COMPATLIBS =
|
|
||||||
MAKEFILE = Makefile.debug
|
|
||||||
|
|
||||||
include Makefile.inc
|
|
||||||
|
|
||||||
allplugins:
|
|
||||||
+4
-3
@@ -3,10 +3,11 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
all:
|
all:
|
||||||
$(TYPECOMMAND) $(MAKEFILE) > src/Makefile.var
|
@$(TYPECOMMAND) $(MAKEFILE) > src/Makefile.var
|
||||||
@cd src && $(MAKE)
|
@cd src && $(MAKE)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@$(REMOVECOMMAND) *$(OBJSUFFICS) $(COMPFILES)
|
@cd src && $(REMOVECOMMAND) *$(OBJSUFFICS) $(COMPFILES) && cd ..
|
||||||
@cd src && $(MAKE) clean
|
@$(AFTERCLEAN)
|
||||||
|
|
||||||
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
#
|
|
||||||
# 3 proxy Makefile for Intel C compiler for Windows (for both make and nmake)
|
|
||||||
#
|
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
|
||||||
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
|
||||||
|
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
|
||||||
CC = icl
|
|
||||||
CFLAGS = /nologo /MD /W3 /G6 /GX /O2 /D "WITH_STD_MALLOC" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /Fp"proxy.pch" /YX /FD /c
|
|
||||||
COUT = /Fo
|
|
||||||
LN = xilink
|
|
||||||
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:I386
|
|
||||||
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib
|
|
||||||
DLFLAGS = /DLL
|
|
||||||
DLSUFFICS = .dll
|
|
||||||
LNOUT = /out:
|
|
||||||
EXESUFFICS = .exe
|
|
||||||
OBJSUFFICS = .obj
|
|
||||||
DEFINEOPTION = /D
|
|
||||||
COMPFILES = *.pch *.idb
|
|
||||||
REMOVECOMMAND = del 2>NUL
|
|
||||||
TYPECOMMAND = type
|
|
||||||
COMPATLIBS =
|
|
||||||
MAKEFILE = Makefile.intl
|
|
||||||
PLUGINS = WindowsAuthentication TrafficPlugin PCREPlugin
|
|
||||||
|
|
||||||
include Makefile.inc
|
|
||||||
|
|
||||||
allplugins:
|
|
||||||
for /D %%i in ($(PLUGINS)) do (copy Makefile Makefile.var plugins\%%i && cd plugins\%%i && nmake && del *.obj *.idb &&cd ..\..)
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
#
|
|
||||||
# 3 proxy Makefile for GCC/windows
|
|
||||||
#
|
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
|
||||||
# library support
|
|
||||||
|
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
|
||||||
CC = clang
|
|
||||||
CFLAGS = -O2 -c -pthread -static -DWITH_STD_MALLOC -DNOIPV6
|
|
||||||
COUT = -o
|
|
||||||
LN = clang
|
|
||||||
LDFLAGS = -O2 -static -s
|
|
||||||
DLFLAGS = -shared
|
|
||||||
DLSUFFICS = .dll
|
|
||||||
LIBS = -lws2_32 -lodbc32 -ladvapi32
|
|
||||||
LIBSPREFIX = -l
|
|
||||||
LIBSSUFFIX =
|
|
||||||
LNOUT = -o
|
|
||||||
EXESUFFICS = .exe
|
|
||||||
OBJSUFFICS = .o
|
|
||||||
DEFINEOPTION = -D
|
|
||||||
COMPFILES = *.tmp
|
|
||||||
REMOVECOMMAND = rm -f
|
|
||||||
TYPECOMMAND = cat
|
|
||||||
COMPATLIBS =
|
|
||||||
MAKEFILE = Makefile.win
|
|
||||||
PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin PCREPlugin
|
|
||||||
|
|
||||||
include Makefile.inc
|
|
||||||
|
|
||||||
allplugins:
|
|
||||||
for /D %%i in ($(PLUGINS)) do (copy Makefile plugins\%%i && copy Makefile.var plugins\%%i && cd plugins\%%i && nmake && del *.o &&cd ..\..)
|
|
||||||
+25
-14
@@ -1,21 +1,30 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
#
|
||||||
|
# ODBC support is enabled by default on Windows (/D WITH_ODBC, odbc32.lib)
|
||||||
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
|
PREFIX = 3proxy_
|
||||||
|
CRYPT_PREFIX = 3proxy_
|
||||||
CC = cl
|
CC = cl
|
||||||
CFLAGS = /nologo /MT /W3 /Ox /GS /EHs- /GA /GF /D "MSVC" /D "WITH_STD_MALLOC" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /Fp"proxy.pch" /FD /c
|
VERSION = $(VERSION)
|
||||||
|
BUILDDATE = $(BUILDDATE)
|
||||||
|
!IFDEF WOLFSSL
|
||||||
|
SSL_DEFS = /D "WITH_SSL" /D "WITH_WOLFSSL"
|
||||||
|
SSL_LIBS = wolfssl.lib
|
||||||
|
!ELSE
|
||||||
|
SSL_DEFS = /D "WITH_SSL"
|
||||||
|
SSL_LIBS = libcrypto.lib libssl.lib
|
||||||
|
!ENDIF
|
||||||
|
CFLAGS = /D "WITH_HTTPSRV" /nologo /MT /W3 /Ox /GS /EHs- /GA /GF /D "MSVC" /D "WITH_WSAPOLL" /D "NDEBUG" /D "WIN32" $(SSL_DEFS) /D "WITH_PCRE" /D "WITH_ODBC" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "NO_SHARE_UDP_SOCKET" /Fp"proxy.pch" /FD /c $(BUILDDATE) $(VERSION)
|
||||||
COUT = /Fo
|
COUT = /Fo
|
||||||
LN = link
|
LN = link
|
||||||
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:I386
|
LDFLAGS = /nologo /subsystem:console /incremental:no
|
||||||
DLFLAGS = /DLL
|
DLFLAGS = /DLL
|
||||||
DLSUFFICS = .dll
|
DLSUFFICS = .dll
|
||||||
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib libeay32MT.lib ssleay32MT.lib
|
LIBS = ws2_32.lib mswsock.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib Crypt32.lib $(SSL_LIBS) pcre2-8.lib
|
||||||
LIBSOLD = libeay32MT.lib ssleay32MT.lib
|
|
||||||
LIBSPREFIX =
|
LIBSPREFIX =
|
||||||
LIBSSUFFIX = .lib
|
LIBSSUFFIX = .lib
|
||||||
LIBEXT = .lib
|
LIBEXT = .lib
|
||||||
@@ -24,20 +33,22 @@ EXESUFFICS = .exe
|
|||||||
OBJSUFFICS = .obj
|
OBJSUFFICS = .obj
|
||||||
DEFINEOPTION = /D
|
DEFINEOPTION = /D
|
||||||
COMPFILES = *.pch *.idb
|
COMPFILES = *.pch *.idb
|
||||||
REMOVECOMMAND = del 2>NUL >NUL
|
REMOVECOMMAND = del
|
||||||
TYPECOMMAND = type
|
TYPECOMMAND = type
|
||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.msvc
|
MAKEFILE = Makefile.msvc
|
||||||
PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin PCREPlugin FilePlugin SSLPlugin
|
PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin FilePlugin
|
||||||
VERFILE = $(VERFILE)
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
PCRE_OBJS = pcre$(OBJSUFFICS)
|
||||||
|
HTTPSRV_OBJS = srvhttpsrv$(OBJSUFFICS) srvwebadmin$(OBJSUFFICS)
|
||||||
|
VERFILE = 3proxy.res $(VERFILE)
|
||||||
|
VERSIONDEP = 3proxy.res $(VERSIONDEP)
|
||||||
|
AFTERCLEAN = if exist src\*.res (del src\*.res) && if exist src\*.err (del src\*.err)
|
||||||
|
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
../3proxy.res:
|
3proxy.res:
|
||||||
rc /fo../3proxy.res ../3proxy.rc
|
rc 3proxy.rc
|
||||||
|
|
||||||
3proxyres.obj: ../3proxy.res
|
|
||||||
cvtres /out:3proxyres.obj /MACHINE:I386 ../3proxy.res
|
|
||||||
|
|
||||||
allplugins:
|
allplugins:
|
||||||
for /D %%i in ($(PLUGINS)) do (copy Makefile plugins\%%i && copy Makefile.var plugins\%%i && cd plugins\%%i && nmake && del *.obj *.idb &&cd ..\..)
|
for /D %%i in ($(PLUGINS)) do (copy Makefile plugins\%%i && copy Makefile.var plugins\%%i && cd plugins\%%i && nmake && del *.obj *.idb &&cd ..\..)
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
#
|
|
||||||
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
|
||||||
#
|
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
|
||||||
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
|
||||||
|
|
||||||
BUILDDIR = ../bin64/
|
|
||||||
CC = cl
|
|
||||||
CFLAGS = /nologo /MT /W3 /Ox /EHs- /GS /GA /GF /D "MSVC" /D "WITH_STD_MALLOC" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /Fp"proxy.pch" /FD /c
|
|
||||||
COUT = /Fo
|
|
||||||
LN = link
|
|
||||||
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:x64
|
|
||||||
DLFLAGS = /DLL
|
|
||||||
DLSUFFICS = .dll
|
|
||||||
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib libeay32MT.lib ssleay32MT.lib
|
|
||||||
LIBSOLD = libeay32MT.lib ssleay32MT.lib
|
|
||||||
LIBSPREFIX =
|
|
||||||
LIBSSUFFIX = .lib
|
|
||||||
LIBEXT = .lib
|
|
||||||
LNOUT = /out:
|
|
||||||
EXESUFFICS = .exe
|
|
||||||
OBJSUFFICS = .obj
|
|
||||||
DEFINEOPTION = /D
|
|
||||||
COMPFILES = *.pch *.idb
|
|
||||||
REMOVECOMMAND = del 2>NUL >NUL
|
|
||||||
TYPECOMMAND = type
|
|
||||||
COMPATLIBS =
|
|
||||||
MAKEFILE = Makefile.msvc64
|
|
||||||
PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin PCREPlugin FilePlugin SSLPlugin
|
|
||||||
VERFILE = $(VERFILE)
|
|
||||||
|
|
||||||
#../3proxy.res:
|
|
||||||
# rc /fo../3proxy.res ../3proxy.rc
|
|
||||||
|
|
||||||
#3proxyres.obj: ../3proxy.res
|
|
||||||
# cvtres /out:3proxyres.obj /MACHINE:X64 ../3proxy.res
|
|
||||||
|
|
||||||
include Makefile.inc
|
|
||||||
|
|
||||||
../3proxy.res:
|
|
||||||
rc /fo../3proxy.res ../3proxy.rc
|
|
||||||
|
|
||||||
3proxyres.obj: ../3proxy.res
|
|
||||||
cvtres /out:3proxyres.obj /machine:x64 ../3proxy.res
|
|
||||||
|
|
||||||
|
|
||||||
allplugins:
|
|
||||||
for /D %%i in ($(PLUGINS)) do (copy Makefile plugins\%%i && copy Makefile.var plugins\%%i && cd plugins\%%i && nmake && del *.obj *.idb &&cd ..\..)
|
|
||||||
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
#
|
|
||||||
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
|
||||||
#
|
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
|
||||||
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
|
||||||
CC = cl
|
|
||||||
CFLAGS = /DARM /D "NOODBC" /nologo /MT /W3 /Wp64 /Ox /GS /EHs- /GA /GF /D "MSVC" /D "_WINCE" /D "WITH_STD_MALLOC" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /Fp"proxy.pch" /FD /c
|
|
||||||
COUT = /Fo
|
|
||||||
LN = link
|
|
||||||
LDFLAGS = /nologo /subsystem:console /incremental:no
|
|
||||||
DLFLAGS = /DLL
|
|
||||||
DLSUFFICS = .dll
|
|
||||||
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib
|
|
||||||
LIBEXT = .lib
|
|
||||||
LNOUT = /out:
|
|
||||||
EXESUFFICS = .exe
|
|
||||||
OBJSUFFICS = .obj
|
|
||||||
DEFINEOPTION = /D
|
|
||||||
COMPFILES = *.pch *.idb
|
|
||||||
REMOVECOMMAND = del 2>NUL >NUL
|
|
||||||
TYPECOMMAND = type
|
|
||||||
COMPATLIBS =
|
|
||||||
MAKEFILE = Makefile.msvc
|
|
||||||
PLUGINS = WindowsAuthentication TrafficPlugin StringsPlugin PCREPlugin
|
|
||||||
|
|
||||||
|
|
||||||
include Makefile.inc
|
|
||||||
|
|
||||||
allplugins:
|
|
||||||
for /D %%i in ($(PLUGINS)) do (copy Makefile plugins\%%i && copy Makefile.var plugins\%%i && cd plugins\%%i && nmake && del *.obj *.idb &&cd ..\..)
|
|
||||||
|
|
||||||
+116
-31
@@ -1,59 +1,144 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for GCC/Unix
|
# 3 proxy Makefile for GCC/Unix
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
#
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
# add -DWITH_ODBC to CFLAGS and -lodbc to LDFLAGS to compile with ODBC
|
||||||
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
||||||
|
|
||||||
BUILDDIR =
|
BUILDDIR = ../bin/
|
||||||
CC = gcc
|
PREFIX ?= 3proxy_
|
||||||
|
CRYPT_PREFIX ?= $(PREFIX)
|
||||||
|
MANDIR ?= /usr/share/man
|
||||||
|
CC ?= gcc
|
||||||
|
|
||||||
# you may need -L/usr/pkg/lib for older NetBSD versions
|
# you may need -L/usr/pkg/lib for older NetBSD versions
|
||||||
CFLAGS = -g -O2 -c -pthread -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL
|
CFLAGS ?= -O3 -flto
|
||||||
|
CFLAGS += -fno-strict-aliasing -c -pthread -D_THREAD_SAFE -D_REENTRANT -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_UN
|
||||||
COUT = -o
|
COUT = -o
|
||||||
LN = gcc
|
LN ?= $(CC)
|
||||||
LDFLAGS = -O2 -pthread
|
LDFLAGS ?= -O3 -flto
|
||||||
|
LDFLAGS += -pthread -fno-strict-aliasing
|
||||||
|
# Use EXTRA_CFLAGS/EXTRA_LDFLAGS to add flags from the make command line.
|
||||||
|
# Setting CFLAGS or LDFLAGS there instead overrides every assignment in this
|
||||||
|
# makefile, including the += above and the STATIC/LIBSTATIC handling below.
|
||||||
|
CFLAGS += $(EXTRA_CFLAGS)
|
||||||
|
LDFLAGS += $(EXTRA_LDFLAGS)
|
||||||
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
||||||
# -ldl or -lld may be required for some platforms
|
# -ldl or -lld may be required for some platforms
|
||||||
DCFLAGS = -fpic
|
DCFLAGS ?= -fPIC
|
||||||
DLFLAGS = -shared
|
MAILPROXY ?= false
|
||||||
DLSUFFICS = .ld.so
|
ifeq ($(MAILPROXY),true)
|
||||||
LIBS =
|
CFLAGS += -DWITH_POP3P -DWITH_IMAPP -DWITH_SMTPP
|
||||||
LIBSPREFIX = -l
|
MAIL_EXES = $(BUILDDIR)$(PREFIX)pop3p$(EXESUFFICS) $(BUILDDIR)$(PREFIX)imapp$(EXESUFFICS) $(BUILDDIR)$(PREFIX)smtpp$(EXESUFFICS)
|
||||||
LIBSSUFFIX =
|
endif
|
||||||
|
FTP ?= false
|
||||||
|
ifeq ($(FTP),true)
|
||||||
|
CFLAGS += -DWITH_FTP
|
||||||
|
FTP_EXES = $(BUILDDIR)$(PREFIX)ftppr$(EXESUFFICS)
|
||||||
|
endif
|
||||||
|
HTTPSRV ?= true
|
||||||
|
ifeq ($(HTTPSRV),true)
|
||||||
|
CFLAGS += -DWITH_HTTPSRV
|
||||||
|
HTTPSRV_OBJS = srvhttpsrv$(OBJSUFFICS) srvwebadmin$(OBJSUFFICS)
|
||||||
|
endif
|
||||||
|
DLFLAGS ?= -shared
|
||||||
|
DLSUFFICS ?= .ld.so
|
||||||
|
LIBS ?=
|
||||||
|
LIBSPREFIX ?= -l
|
||||||
|
LIBSSUFFIX ?=
|
||||||
LNOUT = -o
|
LNOUT = -o
|
||||||
EXESUFFICS =
|
EXESUFFICS =
|
||||||
OBJSUFFICS = .o
|
OBJSUFFICS = .o
|
||||||
DEFINEOPTION = -D
|
DEFINEOPTION = -D
|
||||||
COMPFILES = *~
|
COMPFILES = *~
|
||||||
REMOVECOMMAND = rm -f
|
REMOVECOMMAND = rm -f
|
||||||
|
AFTERCLEAN = (find . -type f -name "*.o" -delete && find src/ -type f -name "Makefile.var" -delete && find bin/ -type f -executable -delete) || true
|
||||||
TYPECOMMAND = cat
|
TYPECOMMAND = cat
|
||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.unix
|
MAKEFILE = Makefile.unix
|
||||||
PLUGINS = StringsPlugin TrafficPlugin PCREPlugin PamAuth
|
PLUGINS ?= StringsPlugin TrafficPlugin FilePlugin
|
||||||
|
|
||||||
|
# Transparent proxying is not built here: this makefile is for the systems
|
||||||
|
# without a redirection 3proxy can read the original destination from. Where
|
||||||
|
# the platform has one - OpenBSD divert-to is the case that fits - uncomment:
|
||||||
|
#CFLAGS += -DWITH_TRANSPARENT
|
||||||
|
#TRANSPARENT_OBJS = transparent$(OBJSUFFICS)
|
||||||
|
ifeq ($(STATIC), true)
|
||||||
|
LDFLAGS += -static
|
||||||
|
CFLAGS += -DNOPLUGINS -DNOSTDRESOLVE -DNOCRYPT
|
||||||
|
ZLIB = -lz -lzstd
|
||||||
|
PLUGINS =
|
||||||
|
PAM_CHECK = false
|
||||||
|
endif
|
||||||
|
ifeq ($(LIBSTATIC), true)
|
||||||
|
STATIC_PREFIX = -Wl,-Bstatic
|
||||||
|
STATIC_SUFFIX = -Wl,-Bdynamic
|
||||||
|
ZLIB = -lz -lzstd
|
||||||
|
endif
|
||||||
|
WOLFSSL_CHECK ?= $(shell printf "\#include <wolfssl/options.h>\\n\#include <wolfssl/openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testwssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestwssl testwssl.o $(STATIC_PREFIX) -lwolfssl $(STATIC_SUFFIX) 2>/dev/null && rm testwssl testwssl.o && echo true||echo false)
|
||||||
|
ifeq ($(WOLFSSL_CHECK), true)
|
||||||
|
LIBS += $(STATIC_PREFIX) -lwolfssl $(STATIC_SUFFIX)
|
||||||
|
CFLAGS += -DWITH_SSL -DWITH_WOLFSSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
ZLIB :=
|
||||||
|
else
|
||||||
|
OPENSSL_CHECK ?= $(shell printf "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestssl testssl.o $(STATIC_PREFIX) $(ZLIB) -lcrypto -lssl $(STATIC_SUFFIX) 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
||||||
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
|
LIBS += $(STATIC_PREFIX) $(ZLIB) -lcrypto -lssl $(STATIC_SUFFIX)
|
||||||
|
CFLAGS += -DWITH_SSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
else
|
||||||
|
ZLIB :=
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
PCRE_CHECK ?= $(shell printf "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpcre.o - 2>/dev/null && $(CC) -o testpcre testpcre.o $(LDFLAGS) $(STATIC_PREFIX) -lpcre2-8 $(STATIC_SUFFIX) 2>/dev/null && rm testpcre testpcre.o && echo true||echo false)
|
||||||
|
ifeq ($(PCRE_CHECK), true)
|
||||||
|
CFLAGS += -DWITH_PCRE
|
||||||
|
PCRE_OBJS = pcre$(OBJSUFFICS)
|
||||||
|
PCRE_LIBS = $(STATIC_PREFIX) -lpcre2-8 $(STATIC_SUFFIX)
|
||||||
|
endif
|
||||||
|
PAM_CHECK ?= $(shell printf "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpam.o - 2>/dev/null && $(CC) $(LDFLAGS) -o testpam testpam.o -lpam 2>/dev/null && rm testpam testpam.o && echo true||echo false)
|
||||||
|
ifeq ($(PAM_CHECK), true)
|
||||||
|
PLUGINS += PamAuth
|
||||||
|
endif
|
||||||
|
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
|
DESTDIR ?=
|
||||||
|
prefix ?= /usr/local
|
||||||
|
BINPREFIX ?= $(prefix)/bin
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
if [ ! -d /usr/local/etc/3proxy/bin ]; then mkdir -p /usr/local/etc/3proxy/bin/; fi
|
if [ ! -d "$(DESTDIR)$(BINPREFIX)" ]; then mkdir -p $(DESTDIR)$(BINPREFIX)/; fi
|
||||||
install src/3proxy /usr/local/etc/3proxy/bin/3proxy
|
install bin/3proxy $(DESTDIR)$(BINPREFIX)/3proxy
|
||||||
install src/mycrypt /usr/local/etc/3proxy/bin/mycrypt
|
install bin/$(CRYPT_PREFIX)crypt $(DESTDIR)$(BINPREFIX)/$(CRYPT_PREFIX)crypt
|
||||||
install scripts/rc.d/proxy.sh /usr/local/etc/rc.d/proxy.sh
|
for f in proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr; do \
|
||||||
install scripts/add3proxyuser.sh /usr/local/etc/3proxy/bin/
|
if [ -f bin/$(PREFIX)$$f ]; then install bin/$(PREFIX)$$f $(DESTDIR)$(BINPREFIX)/$(PREFIX)$$f; fi; \
|
||||||
if [ -s /usr/local/etc/3proxy/3proxy.cfg ]; then
|
done
|
||||||
echo /usr/local/etc/3proxy/3proxy.cfg already exists
|
install -d $(DESTDIR)$(prefix)/etc/3proxy/conf
|
||||||
else
|
install -d $(DESTDIR)$(prefix)/etc/rc.d/
|
||||||
install scripts/3proxy.cfg /usr/local/etc/3proxy/
|
sed -e 's|@CMAKE_INSTALL_FULL_BINDIR@|$(BINPREFIX)|g' -e 's|@CMAKE_INSTALL_FULL_SYSCONFDIR@|$(prefix)/etc|g' scripts/rc.d/3proxy.in > $(DESTDIR)$(prefix)/etc/rc.d/3proxy
|
||||||
if [ ! -d /var/log/3proxy/ ]; then
|
chmod 755 $(DESTDIR)$(prefix)/etc/rc.d/3proxy
|
||||||
mkdir /var/log/3proxy/
|
sed -e 's|@CMAKE_INSTALL_FULL_BINDIR@|$(BINPREFIX)|g' -e 's|@3PROXY_CONFDIR@|$(prefix)/etc/3proxy/conf|g' -e 's|@CRYPT_PREFIX@|$(CRYPT_PREFIX)|g' scripts/add3proxyuser.sh.in > $(DESTDIR)$(BINPREFIX)/add3proxyuser
|
||||||
fi
|
chmod 755 $(DESTDIR)$(BINPREFIX)/add3proxyuser
|
||||||
touch /usr/local/etc/3proxy/passwd
|
if [ -s $(DESTDIR)$(prefix)/etc/3proxy/3proxy.cfg ]; then echo $(prefix)/etc/3proxy/3proxy.cfg already exists; else sed -e 's|@CMAKE_INSTALL_FULL_SYSCONFDIR@|$(prefix)/etc|g' -e 's|@3PROXY_CONFDIR@|$(prefix)/etc/3proxy/conf|g' -e 's|@3PROXY_COUNTERDIR@|/opt/3proxy|g' scripts/3proxy.cfg.in > $(DESTDIR)$(prefix)/etc/3proxy/3proxy.cfg; chmod 640 $(DESTDIR)$(prefix)/etc/3proxy/3proxy.cfg; fi
|
||||||
touch /usr/local/etc/3proxy/counters
|
if [ ! -d $(DESTDIR)/var/log/3proxy/ ]; then mkdir -p $(DESTDIR)/var/log/3proxy/; fi
|
||||||
touch /usr/local/etc/3proxy/bandlimiters
|
mkdir -p $(DESTDIR)/opt/3proxy
|
||||||
echo Run /usr/local/etc/3proxy/bin/add3proxyuser.sh to add \'admin\' user
|
touch $(DESTDIR)$(prefix)/etc/3proxy/conf/passwd
|
||||||
|
touch $(DESTDIR)$(prefix)/etc/3proxy/conf/counters
|
||||||
|
touch $(DESTDIR)$(prefix)/etc/3proxy/conf/bandlimiters
|
||||||
|
install -d $(DESTDIR)$(MANDIR)/man8
|
||||||
|
install -m 644 man/3proxy.8 $(DESTDIR)$(MANDIR)/man8/3proxy.8
|
||||||
|
for f in proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr; do \
|
||||||
|
if [ -f man/$$f.8 ] && [ -f bin/$(PREFIX)$$f ]; then install -m 644 man/$$f.8 $(DESTDIR)$(MANDIR)/man8/$(PREFIX)$$f.8; fi; \
|
||||||
|
done
|
||||||
|
install -m 644 man/3proxy_crypt.8 $(DESTDIR)$(MANDIR)/man8/$(CRYPT_PREFIX)crypt.8
|
||||||
|
install -d $(DESTDIR)$(MANDIR)/man5
|
||||||
|
install -m 644 man/3proxy.cfg.5 $(DESTDIR)$(MANDIR)/man5/3proxy.cfg.5
|
||||||
|
@if [ "$(DESTDIR)" = "" ]; then \
|
||||||
|
sh scripts/postinstall.sh $(prefix); \
|
||||||
fi
|
fi
|
||||||
|
echo Run $(BINPREFIX)/add3proxyuser to add \'admin\' user
|
||||||
|
|
||||||
allplugins:
|
allplugins:
|
||||||
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done
|
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
DESTDIR =
|
|
||||||
prefix = /usr/local
|
|
||||||
exec_prefix = $(prefix)
|
|
||||||
man_prefix = $(prefix)/share
|
|
||||||
|
|
||||||
INSTALL = /usr/bin/install
|
|
||||||
INSTALL_BIN = $(INSTALL) -m 755
|
|
||||||
INSTALL_DATA = $(INSTALL) -m 644
|
|
||||||
INSTALL_OBJS = src/3proxy \
|
|
||||||
src/dighosts \
|
|
||||||
src/ftppr \
|
|
||||||
src/mycrypt \
|
|
||||||
src/pop3p \
|
|
||||||
src/proxy \
|
|
||||||
src/socks \
|
|
||||||
src/tcppm \
|
|
||||||
src/udppm \
|
|
||||||
scripts/add3proxyuser.sh
|
|
||||||
|
|
||||||
INSTALL_CFG_OBJS = scripts/3proxy.cfg
|
|
||||||
INSTALL_CFG_DEST = config
|
|
||||||
|
|
||||||
INSTALL_CFG_OBJS2 = passwd counters bandlimiters
|
|
||||||
|
|
||||||
MANDIR1 = $(DESTDIR)$(man_prefix)/man/man1
|
|
||||||
MANDIR3 = $(DESTDIR)$(man_prefix)/man/man3
|
|
||||||
MANDIR8 = $(DESTDIR)$(man_prefix)/man/man8
|
|
||||||
BINDIR = $(DESTDIR)$(exec_prefix)/bin
|
|
||||||
ETCDIR = $(DESTDIR)$(prefix)/etc/3proxy
|
|
||||||
|
|
||||||
install-bin:
|
|
||||||
$(INSTALL_BIN) -d $(BINDIR)
|
|
||||||
$(INSTALL_BIN) -s $(INSTALL_OBJS) $(BINDIR)
|
|
||||||
|
|
||||||
install-etc-dir:
|
|
||||||
$(INSTALL_BIN) -d $(ETCDIR)
|
|
||||||
|
|
||||||
install-etc-default-config:
|
|
||||||
if [ -f $(ETCDIR)/$(INSTALL_CFG_DEST) ]; then \
|
|
||||||
: ; \
|
|
||||||
else \
|
|
||||||
$(INSTALL_DATA) $(INSTALL_CFG_OBJS) $(ETCDIR)/$(INSTALL_CFG_DEST) \
|
|
||||||
fi
|
|
||||||
|
|
||||||
install-etc: install-etc-dir
|
|
||||||
for file in $(INSTALL_CFG_OBJS2); \
|
|
||||||
do \
|
|
||||||
touch $(ETCDIR)/$$file; chmod 0600 $(ETCDIR)/$$file; \
|
|
||||||
done;
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
$(INSTALL_BIN) -d $(MANDIR1)
|
|
||||||
$(INSTALL_BIN) -d $(MANDIR3)
|
|
||||||
$(INSTALL_BIN) -d $(MANDIR8)
|
|
||||||
$(INSTALL_DATA) man/*.1 $(MANDIR1)
|
|
||||||
$(INSTALL_DATA) man/*.3 $(MANDIR3)
|
|
||||||
$(INSTALL_DATA) man/*.8 $(MANDIR8)
|
|
||||||
|
|
||||||
install: install-bin install-etc install-man
|
|
||||||
|
|
||||||
+35
-12
@@ -1,43 +1,66 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for Open Watcom 2
|
# 3 proxy Makefile for Open Watcom 2
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
#
|
||||||
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
|
PREFIX = 3proxy_
|
||||||
|
CRYPT_PREFIX = 3proxy_
|
||||||
CC = cl
|
CC = cl
|
||||||
CFLAGS = /nologo /Ox /MT /D "NOIPV6" /D "NODEBUG" /D "NOODBC" /D"WATCOM" /D "MSVC" /D "WITH_STD_MALLOC" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /c
|
CFLAGS = /D "WITH_HTTPSRV" /nologo /Ox /MT /D "NOIPV6" /D "NO_UN" /D "NODEBUG" /D "NORADIUS" /D"WATCOM" /D "NO_SHARE_UDP_SOCKET" /D "MSVC" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRId64=\"I64d\"" /D "PRIu64=\"I64u\"" /D "SCNu64=\"I64u\"" /D "SCNx64=\"I64x\"" /D "SCNd64=\"I64d\"" /D "PRIx64=\"I64x\"" /c $(VERSION) $(BUILDDATE)
|
||||||
COUT = /Fo
|
COUT = /Fo
|
||||||
LN = link
|
LN = link
|
||||||
LDFLAGS = /nologo /subsystem:console /incremental:no
|
LDFLAGS = /nologo /subsystem:console /incremental:no
|
||||||
DLFLAGS = /DLL
|
DLFLAGS = /DLL
|
||||||
DLSUFFICS = .dll
|
DLSUFFICS = .dll
|
||||||
LIBS = ws2_32.lib advapi32.lib user32.lib kernel32.lib
|
LIBS = ws2_32.lib mswsock.lib advapi32.lib user32.lib kernel32.lib
|
||||||
LIBSOLD = libeay32MT.lib ssleay32MT.lib
|
|
||||||
LIBSPREFIX =
|
LIBSPREFIX =
|
||||||
LIBSSUFFIX = .lib
|
LIBSSUFFIX = .lib
|
||||||
LIBEXT = .lib
|
LIBEXT = .lib
|
||||||
LNOUT = /out:
|
LNOUT = /out:
|
||||||
EXESUFFICS = .exe
|
EXESUFFICS = .exe
|
||||||
OBJSUFFICS = .obj
|
OBJSUFFICS = .obj
|
||||||
|
HTTPSRV_OBJS = srvhttpsrv$(OBJSUFFICS) srvwebadmin$(OBJSUFFICS)
|
||||||
DEFINEOPTION = /D
|
DEFINEOPTION = /D
|
||||||
COMPFILES = *.pch *.idb *.err
|
COMPFILES = *.pch *.idb *.err
|
||||||
REMOVECOMMAND = del 2>NUL >NUL
|
REMOVECOMMAND = del 2>NUL >NUL
|
||||||
TYPECOMMAND = type
|
TYPECOMMAND = type
|
||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.watcom
|
MAKEFILE = Makefile.watcom
|
||||||
PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin PCREPlugin
|
PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin
|
||||||
VERFILE = $(VERFILE)
|
VERFILE = $(VERFILE)
|
||||||
|
VERSION = $(VERSION)
|
||||||
|
VERSIONDEP = 3proxy.res $(VERSIONDEP)
|
||||||
|
BUILDDATE = $(BUILDDATE)
|
||||||
|
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
../3proxy.res:
|
3proxy.res:
|
||||||
rc /fo../3proxy.res ../3proxy.rc
|
rc 3proxy.rc
|
||||||
|
|
||||||
3proxyres.obj: ../3proxy.res
|
|
||||||
cvtres /out:3proxyres.obj ../3proxy.res
|
|
||||||
|
|
||||||
allplugins:
|
allplugins:
|
||||||
call ../makeplugins.bat
|
copy Makefile plugins\utf8tocp1251
|
||||||
|
copy Makefile.var plugins\utf8tocp1251
|
||||||
|
cd plugins\utf8tocp1251
|
||||||
|
nmake
|
||||||
|
del *.obj *.idb
|
||||||
|
cd ../../
|
||||||
|
copy Makefile plugins\WindowsAuthentication
|
||||||
|
copy Makefile.var plugins\WindowsAuthentication
|
||||||
|
cd plugins\WindowsAuthentication
|
||||||
|
nmake
|
||||||
|
del *.obj *.idb
|
||||||
|
cd ../../
|
||||||
|
copy Makefile plugins\TrafficPlugin
|
||||||
|
copy Makefile.var plugins\TrafficPlugin
|
||||||
|
cd plugins\TrafficPlugin
|
||||||
|
nmake
|
||||||
|
del *.obj *.idb
|
||||||
|
cd ../../
|
||||||
|
copy Makefile plugins\StringsPlugin
|
||||||
|
copy Makefile.var plugins\StringsPlugin
|
||||||
|
cd plugins\StringsPlugin
|
||||||
|
nmake
|
||||||
|
del *.obj *.idb
|
||||||
|
cd ../../
|
||||||
+79
-12
@@ -1,22 +1,46 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for GCC/windows
|
# 3 proxy Makefile for GCC/windows
|
||||||
#
|
#
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
#
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
# ODBC support is enabled by default on Windows (-DWITH_ODBC, -lodbc32)
|
||||||
# library support
|
|
||||||
|
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
CC = gcc
|
PREFIX ?= 3proxy_
|
||||||
CFLAGS = -O2 -s -c -mthreads -DWITH_STD_MALLOC -DNOIPV6
|
CRYPT_PREFIX ?= $(PREFIX)
|
||||||
|
CC ?= gcc
|
||||||
|
CFLAGS ?= -O3 -flto
|
||||||
|
CFLAGS += -fno-strict-aliasing -c -mthreads -DWITH_WSAPOLL -DWITH_ODBC
|
||||||
|
# Windows does not take a recv and a send on one socket from two threads,
|
||||||
|
# so a UDP service answers from a socket of its own
|
||||||
|
CFLAGS += -DNO_SHARE_UDP_SOCKET
|
||||||
COUT = -o
|
COUT = -o
|
||||||
LN = gcc
|
LN ?= $(CC)
|
||||||
LDFLAGS = -O2 -s -mthreads
|
LDFLAGS ?= -O3 -flto
|
||||||
DLFLAGS = -shared
|
LDFLAGS += -fno-strict-aliasing -mthreads
|
||||||
|
# Use EXTRA_CFLAGS/EXTRA_LDFLAGS to add flags from the make command line.
|
||||||
|
# Setting CFLAGS or LDFLAGS there instead overrides every assignment in this
|
||||||
|
# makefile, including the += above and the STATIC/LIBSTATIC handling below.
|
||||||
|
CFLAGS += $(EXTRA_CFLAGS)
|
||||||
|
LDFLAGS += $(EXTRA_LDFLAGS)
|
||||||
|
MAILPROXY ?= false
|
||||||
|
ifeq ($(MAILPROXY),true)
|
||||||
|
CFLAGS += -DWITH_POP3P -DWITH_IMAPP -DWITH_SMTPP
|
||||||
|
MAIL_EXES = $(BUILDDIR)$(PREFIX)pop3p$(EXESUFFICS) $(BUILDDIR)$(PREFIX)imapp$(EXESUFFICS) $(BUILDDIR)$(PREFIX)smtpp$(EXESUFFICS)
|
||||||
|
endif
|
||||||
|
FTP ?= false
|
||||||
|
ifeq ($(FTP),true)
|
||||||
|
CFLAGS += -DWITH_FTP
|
||||||
|
FTP_EXES = $(BUILDDIR)$(PREFIX)ftppr$(EXESUFFICS)
|
||||||
|
endif
|
||||||
|
HTTPSRV ?= true
|
||||||
|
ifeq ($(HTTPSRV),true)
|
||||||
|
CFLAGS += -DWITH_HTTPSRV
|
||||||
|
HTTPSRV_OBJS = srvhttpsrv$(OBJSUFFICS) srvwebadmin$(OBJSUFFICS)
|
||||||
|
endif
|
||||||
|
DLFLAGS ?= -shared
|
||||||
DLSUFFICS = .dll
|
DLSUFFICS = .dll
|
||||||
LIBS = -lws2_32 -lodbc32 -ladvapi32
|
LIBS += -lws2_32 -lmswsock -lodbc32 -ladvapi32 -luser32 -lbcrypt
|
||||||
LIBSPREFIX = -l
|
LIBSPREFIX = -l
|
||||||
LIBSSUFFIX =
|
LIBSSUFFIX =
|
||||||
LNOUT = -o
|
LNOUT = -o
|
||||||
@@ -28,9 +52,52 @@ REMOVECOMMAND = rm -f
|
|||||||
TYPECOMMAND = cat
|
TYPECOMMAND = cat
|
||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.win
|
MAKEFILE = Makefile.win
|
||||||
PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin PCREPlugin
|
PLUGINS := utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin FilePlugin
|
||||||
|
VERFILE := 3proxyres.o $(VERFILE)
|
||||||
|
VERSION := $(VERSION)
|
||||||
|
VERSIONDEP := 3proxyres.o $(VERSIONDEP)
|
||||||
|
BUILDDATE := $(BUILDDATE)
|
||||||
|
AFTERCLEAN = (find . -type f -name "*.o" -delete && find . -type f -name "*.res" -delete && find src/ -type f -name "Makefile.var" -delete && find bin/ -type f -executable -delete) || true
|
||||||
|
|
||||||
|
ifndef OPENSSL_CHECK
|
||||||
|
ifeq ($(LIBSTATIC), true)
|
||||||
|
STATIC_PREFIX = -Wl,-Bstatic
|
||||||
|
STATIC_SUFFIX = -Wl,-Bdynamic
|
||||||
|
ZLIB = -lz
|
||||||
|
endif
|
||||||
|
WOLFSSL_CHECK = $(shell printf "\#include <wolfssl/options.h>\\n\#include <wolfssl/openssl/ssl.h>\\n int main(){return 0;}" | tr -d '\\\\' | $(CC) -x c $(CFLAGS) $(LDFLAGS) $(STATIC_PREFIX) -lwolfssl $(STATIC_SUFFIX) -o testwssl - 2>/dev/null && rm testwssl && echo true||echo false)
|
||||||
|
ifeq ($(WOLFSSL_CHECK), true)
|
||||||
|
LIBS += $(STATIC_PREFIX) -lwolfssl $(STATIC_SUFFIX) -lws2_32
|
||||||
|
CFLAGS += -DWITH_SSL -DWITH_WOLFSSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
ZLIB :=
|
||||||
|
else
|
||||||
|
OPENSSL_CHECK = $(shell printf "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d '\\\\' | $(CC) -x c $(CFLAGS) $(LDFLAGS) $(STATIC_PREFIX) $(ZLIB) -l crypto -l ssl $(STATIC_SUFFIX) -o testssl - 2>/dev/null && rm testssl && echo true||echo false)
|
||||||
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
|
LIBS += $(STATIC_PREFIX) $(ZLIB) -l crypto -l ssl $(STATIC_SUFFIX) -lcrypt32
|
||||||
|
CFLAGS += -DWITH_SSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
else
|
||||||
|
ZLIB :=
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
PAM_CHECK = $(shell printf "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d '\\\\' | $(CC) -x c $(CFLAGS) $(LDFLAGS) -l pam -o testpam - 2>/dev/null && rm testpam && echo true||echo false)
|
||||||
|
ifeq ($(PAM_CHECK), true)
|
||||||
|
PLUGINS += PamAuth
|
||||||
|
endif
|
||||||
|
PCRE_CHECK = $(shell printf "\#define PCRE2_CODE_UNIT_WIDTH 8\\n#include <pcre2.h>\\n int main(){return 0;}" | tr -d '\\\\' | $(CC) -x c $(CFLAGS) $(LDFLAGS) $(STATIC_PREFIX) -lpcre2-8 $(STATIC_SUFFIX) -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false)
|
||||||
|
ifeq ($(PCRE_CHECK), true)
|
||||||
|
CFLAGS += -DWITH_PCRE
|
||||||
|
PCRE_OBJS = pcre$(OBJSUFFICS)
|
||||||
|
PCRE_LIBS = $(STATIC_PREFIX) -lpcre2-8 $(STATIC_SUFFIX)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
|
3proxyres.o:
|
||||||
|
windres 3proxy.rc -o 3proxyres.o
|
||||||
|
|
||||||
allplugins:
|
allplugins:
|
||||||
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; rm *.o ; cd ../.. ; done
|
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done
|
||||||
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
#
|
|
||||||
# 3 proxy Makefile for GCC/windows
|
|
||||||
#
|
|
||||||
# You can try to remove -DWITH_STD_MALLOC to CFLAGS to use optimized malloc
|
|
||||||
# libraries
|
|
||||||
#
|
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
|
||||||
# library support
|
|
||||||
|
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
|
||||||
CC = /opt/cegcc/arm-wince-cegcc/bin/gcc
|
|
||||||
CFLAGS = -O2 -s -c -mthreads -DWITH_STD_MALLOC -DNOODBC -D_WINCE -D_WIN32 -D__USE_W32_SOCKETS
|
|
||||||
COUT = -o
|
|
||||||
LN = /opt/cegcc/arm-wince-cegcc/bin/gcc
|
|
||||||
LDFLAGS = -O2 -s -mthreads
|
|
||||||
DLFLAGS = -shared
|
|
||||||
DLSUFFICS = .dll
|
|
||||||
LIBS = -lws2
|
|
||||||
LNOUT = -o
|
|
||||||
EXESUFFICS = .exe
|
|
||||||
OBJSUFFICS = .o
|
|
||||||
DEFINEOPTION = -D
|
|
||||||
COMPFILES = *.tmp
|
|
||||||
REMOVECOMMAND = rm -f
|
|
||||||
TYPECOMMAND = more
|
|
||||||
COMPATLIBS =
|
|
||||||
MAKEFILE = Makefile.winCE
|
|
||||||
PLUGINS = TrafficPlugin StringsPlugin PCREPlugin
|
|
||||||
|
|
||||||
include Makefile.inc
|
|
||||||
|
|
||||||
allplugins:
|
|
||||||
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; rm *.o ; cd ../.. ; done
|
|
||||||
@@ -1,167 +0,0 @@
|
|||||||
/*
|
|
||||||
3APA3A 3proxy tiny proxy server
|
|
||||||
(c) 2002-2016 by Vladimir '3APA3A' Dubrovin <3proxy@3proxy.ru>
|
|
||||||
|
|
||||||
please read License Agreement
|
|
||||||
*/
|
|
||||||
|
|
||||||
Please read doc/html/index.html and man pages.
|
|
||||||
|
|
||||||
Features:
|
|
||||||
1. General
|
|
||||||
+ HTTP/1.1 Proxy with keep-alive client and server support,
|
|
||||||
transparent proxy support.
|
|
||||||
+ Anonymous and random client emulation HTTP proxy mode
|
|
||||||
+ FTP over HTTP support.
|
|
||||||
+ DNS caching with built-in resolver
|
|
||||||
+ HTTPS (CONNECT) proxy
|
|
||||||
+ SOCKSv4/4.5 Proxy
|
|
||||||
+ SOCKSv5 Proxy
|
|
||||||
+ UDP and bind support for SOCKSv5 (fully compatible with
|
|
||||||
SocksCAP/FreeCAP for UDP)
|
|
||||||
+ Transparent SOCKS redirection for HTTP, POP3, FTP, SMTP, ICQ
|
|
||||||
+ POP3 Proxy
|
|
||||||
+ FTP proxy
|
|
||||||
+ DNS proxy
|
|
||||||
+ TCP port mapper
|
|
||||||
+ UDP port mapper
|
|
||||||
+ SMTP proxy
|
|
||||||
+ ICQ/AOL proxy
|
|
||||||
+ Threaded application (no child process).
|
|
||||||
+ Web administration and statistics
|
|
||||||
+ Plugins for functionality extension
|
|
||||||
+ Native 64 bit application for 64 bit OS, including 64-bit editions of
|
|
||||||
Windows.
|
|
||||||
+ IPv6 support
|
|
||||||
2. Proxy chaining and network connections
|
|
||||||
+ Connect back proxy support to bypass firewalls
|
|
||||||
+ Parent proxy support for any type of incoming connection
|
|
||||||
+ Username/password authentication for parent proxy(s).
|
|
||||||
+ HTTPS/SOCKS4/SOCKS5 and redirection parent support
|
|
||||||
+ Random parent selection
|
|
||||||
+ Chain building (multihop proxing)
|
|
||||||
+ Load balancing between few network connections by choosing network
|
|
||||||
interface
|
|
||||||
3. Logging
|
|
||||||
+ turnable log format compatible with any log parser
|
|
||||||
+ stdout logging
|
|
||||||
+ file logging
|
|
||||||
+ syslog logging (Unix)
|
|
||||||
+ ODBC logging
|
|
||||||
+ log file rotation (hourly, daily, weekly, monthly)
|
|
||||||
+ automatic log file comperssion with external archiver (for files)
|
|
||||||
+ automatic removal of older log files
|
|
||||||
+ Character filtering for log files
|
|
||||||
+ different log files for different servces are supported
|
|
||||||
4. Access control
|
|
||||||
+ ACL-driven (user/source/destination/protocol/weekday/daytime or
|
|
||||||
combined) bandwith limitation for incoming and (!)outgoing trafic.
|
|
||||||
+ ACL-driven (user/source/destination/protocol/weekday/daytime or
|
|
||||||
combined) traffic limitation per day, week or month for incoming and
|
|
||||||
(!) outgoing traffic
|
|
||||||
+ User authentication by DNS hostname
|
|
||||||
+ User authentication by username / password
|
|
||||||
+ Access control by username, source IP, destination IP, destination
|
|
||||||
port and destination action (POST, PUT, GET, etc), weekday and daytime.
|
|
||||||
+ Access control by username/password for SOCKSv5 and HTTP/HTTPS/FTP
|
|
||||||
+ Cleartext or encrypted (crypt/MD5 or NT) passwords.
|
|
||||||
+ Connection redirection
|
|
||||||
+ Access control by requested action (CONNECT/BIND,
|
|
||||||
HTTP GET/POST/PUT/HEAD/OTHER).
|
|
||||||
+ NTLM (v1 only) authentication for HTTP proxy access
|
|
||||||
+ All access control entries now support weekday and time limitations
|
|
||||||
+ Hostnames and * templates are supported instead of IP address
|
|
||||||
5. Extensions
|
|
||||||
+ Regular expression filtering (with PCRE) via PCREPlugin
|
|
||||||
currently HTTP traffic only for URLs, HTTP headers and HTTP data.
|
|
||||||
+ Authentication with Windows username/password (cleartext only!)
|
|
||||||
+ SSL/TLS decryptions with certificate spoofing
|
|
||||||
+ NAT support under Linux
|
|
||||||
6. Configuration
|
|
||||||
+ support for configuration files
|
|
||||||
+ support for includes in configuration files
|
|
||||||
+ interface binding
|
|
||||||
+ running as daemon process
|
|
||||||
+ utility for automated networks list building
|
|
||||||
+ configuration reload on any file change
|
|
||||||
Unix
|
|
||||||
+ support for chroot
|
|
||||||
+ support for setgid
|
|
||||||
+ support for setuid
|
|
||||||
+ support for signals
|
|
||||||
Windows
|
|
||||||
+ support --install as service
|
|
||||||
+ support --remove as service
|
|
||||||
+ support for service START, STOP, PAUSE and CONTINUE commands (on
|
|
||||||
PAUSE no new connection accepted, but active connections still in
|
|
||||||
progress, on CONTINUE configuration is reloaded)
|
|
||||||
Windows 95/98/ME
|
|
||||||
+ support --install as service
|
|
||||||
+ support --remove as service
|
|
||||||
6. Compilation
|
|
||||||
+ MSVC (static)
|
|
||||||
+ Intel Windows Compiler (msvcrt.dll)
|
|
||||||
+ Windows/gcc (msvcrt.dll)
|
|
||||||
+ Cygwin/gcc (cygwin.dll)
|
|
||||||
+ Unix/gcc
|
|
||||||
+ Unix/ccc
|
|
||||||
+ Solaris
|
|
||||||
+ Mac OS X, iPhone OS
|
|
||||||
+ Linux and derivered systems
|
|
||||||
+ Lite version for Windows 95/98/NT/2000/XP/2003
|
|
||||||
+ 32 bit and 64 bit versions for Windows Vista and above, Windows 2008 server and above
|
|
||||||
|
|
||||||
3proxy Combined proxy server may be used as
|
|
||||||
executable or service (supports installation and removal).
|
|
||||||
It uses config file to read it's configuration (see
|
|
||||||
3proxy.cfg.sample for details).
|
|
||||||
--install installs and starts proxy as Windows service
|
|
||||||
(config file should be located in the same directory)
|
|
||||||
--remove removes the service (should be stopped before via
|
|
||||||
'net stop 3proxy').
|
|
||||||
3proxy.exe is all-in-one, it doesn't require all others .exe
|
|
||||||
to work.
|
|
||||||
See 3proxy.cfg.sample for examples, see man 3proxy.cfg
|
|
||||||
proxy HTTP proxy server, binds to port 3128
|
|
||||||
ftppr FTP proxy server, binds to port 21
|
|
||||||
socks SOCKS 4/5 proxy server, binds to port 1080
|
|
||||||
ftppr FTP proxy server, please do not mess it with FTP over HTTP
|
|
||||||
proxy used in browsers
|
|
||||||
pop3p POP3 proxy server, binds to port 110. You must specify
|
|
||||||
POP3 username as username@target.host.ip[:port]
|
|
||||||
port is 110 by default.
|
|
||||||
Exmple: in Username configuration for you e-mail reader
|
|
||||||
set someuser@pop.somehost.ru, to obtains mail for someuser
|
|
||||||
from pop.somehost.ru via proxy.
|
|
||||||
smtpp SMTP proxy server, binds to port 25. You must specify
|
|
||||||
SMTP username as username@target.host.ip[:port]
|
|
||||||
port is 25 by default.
|
|
||||||
Exmple: in Username configuration for you e-mail reader
|
|
||||||
set someuser@mail.somehost.ru, to send mail as someuser
|
|
||||||
via mail.somehost.ru via proxy.
|
|
||||||
icqpr ICQ/AIM proxy. Maps some TCP port to TCP port of ICQ
|
|
||||||
server and performs packets translation. Example:
|
|
||||||
icqpr 5190 login.icq.com 5190
|
|
||||||
tcppm TCP port mapping. Maps some TCP port on local machine to
|
|
||||||
TCP port on remote host.
|
|
||||||
udppm UDP port mapping. Maps some UDP port on local machine to
|
|
||||||
UDP port on remote machine. Only one user simulationeously
|
|
||||||
can use UDP mapping, so it cann't be used for public service
|
|
||||||
in large networks. It's OK to use it to map to DNS server
|
|
||||||
in small network or to map Counter-Strike server for single
|
|
||||||
client (you can use few mappings on different ports for
|
|
||||||
different clients in last case).
|
|
||||||
mycrypt Program to obtain crypted password fro cleartext. Supports
|
|
||||||
both MD5/crypt and NT password.
|
|
||||||
mycrypt password
|
|
||||||
produces NT password
|
|
||||||
mycrypt salt password
|
|
||||||
produces MD5/crypt password with salt "salt".
|
|
||||||
dighosts Utility for building networks list from web page.
|
|
||||||
|
|
||||||
|
|
||||||
Run utility with --help option for command line reference.
|
|
||||||
|
|
||||||
Latest version is available from http://3proxy.ru/
|
|
||||||
|
|
||||||
Want to donate the project? http://3proxy.ru/donations/
|
|
||||||
@@ -0,0 +1,420 @@
|
|||||||
|
# 3APA3A 3proxy tiny proxy server
|
||||||
|
|
||||||
|
(c) 2002-2026 by Vladimir '3APA3A' Dubrovin <vlad@3proxy.org>
|
||||||
|
|
||||||
|
## Repository
|
||||||
|
|
||||||
|
### Branches
|
||||||
|
|
||||||
|
- **Master** (current/latest) branch - 3proxy 1.0
|
||||||
|
- **0.9** (LTS) branch - 3proxy 0.9.9.x
|
||||||
|
- **Devel** branch - 3proxy 2.0-devel (don't use it)
|
||||||
|
|
||||||
|
### Binaries (deb / rpm / Windows zip)
|
||||||
|
|
||||||
|
https://github.com/3proxy/3proxy/releases
|
||||||
|
|
||||||
|
### Package repository (apt / dnf)
|
||||||
|
|
||||||
|
Signed apt and dnf repositories are published at https://3proxy.org/repo/ in
|
||||||
|
two channels: `current` (master) and `lts` (0.9 branch).
|
||||||
|
|
||||||
|
Debian 12 and Ubuntu 22.04 or newer:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo curl -fsSL https://3proxy.org/repo/3proxy-release-key.asc \
|
||||||
|
-o /usr/share/keyrings/3proxy.asc
|
||||||
|
sudo tee /etc/apt/sources.list.d/3proxy.sources <<EOF
|
||||||
|
Types: deb
|
||||||
|
URIs: https://3proxy.org/repo/deb
|
||||||
|
Suites: current
|
||||||
|
Components: main
|
||||||
|
Signed-By: /usr/share/keyrings/3proxy.asc
|
||||||
|
EOF
|
||||||
|
sudo apt update && sudo apt install 3proxy
|
||||||
|
```
|
||||||
|
|
||||||
|
AlmaLinux, RHEL, Rocky and CentOS Stream 8, 9 and 10:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo tee /etc/yum.repos.d/3proxy.repo <<EOF
|
||||||
|
[3proxy]
|
||||||
|
name=3proxy
|
||||||
|
baseurl=https://3proxy.org/repo/rpm/current/el\$releasever/\$basearch/
|
||||||
|
enabled=1
|
||||||
|
gpgcheck=1
|
||||||
|
repo_gpgcheck=1
|
||||||
|
gpgkey=https://3proxy.org/repo/3proxy-release-key.asc
|
||||||
|
EOF
|
||||||
|
sudo dnf install 3proxy
|
||||||
|
```
|
||||||
|
|
||||||
|
Both the packages and the repository metadata are signed. See
|
||||||
|
https://3proxy.org/repo/ for the `lts` channel and for release key details.
|
||||||
|
|
||||||
|
### Docker images
|
||||||
|
|
||||||
|
https://hub.docker.com/r/3proxy/3proxy
|
||||||
|
https://github.com/3proxy/3proxy/pkgs/container/3proxy
|
||||||
|
|
||||||
|
### Archive of old versions
|
||||||
|
|
||||||
|
https://github.com/z3APA3A/3proxy-archive
|
||||||
|
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
Documentation (man pages and HTML) available with download, on https://3proxy.org/ and in github wiki https://github.com/3proxy/3proxy/wiki
|
||||||
|
|
||||||
|
## Docker images
|
||||||
|
|
||||||
|
3 docker configurations are provided, default (full) also tagged as `:latest`, `:busybox` and `:minimal`, all refer to newest stable version. Except busybox, images are distroless and contain only binaries, you can not sh inside the container. `:busybox` contains busybox shell. Images are based on current (master) branch.
|
||||||
|
|
||||||
|
Images marked as LTS (`:lts`, `:lts-busybox`, `:lts-minimal`) are built from LTS branch (0.9.9.x)
|
||||||
|
|
||||||
|
### Default image (`:latest`):
|
||||||
|
|
||||||
|
Full installation requires to mount /etc/3proxy/3proxy.cfg files.
|
||||||
|
|
||||||
|
For docker, config can be provided via `docker config`
|
||||||
|
|
||||||
|
```
|
||||||
|
echo "log
|
||||||
|
nserver 8.8.8.8
|
||||||
|
nscache 65536
|
||||||
|
proxy -p3129" | docker config create 3proxy
|
||||||
|
docker run --read-only -p 3129:3129 --config source=3proxy,target=/etc/3proxy/3proxy.cfg --name 3proxy.full docker.io/3proxy/3proxy
|
||||||
|
```
|
||||||
|
|
||||||
|
`podman` does not support `config` as above.
|
||||||
|
Mounts may be used as config alternative. `podman` used in example below can be replaced with `docker`:
|
||||||
|
|
||||||
|
```
|
||||||
|
echo "log
|
||||||
|
nserver 8.8.8.8
|
||||||
|
nscache 65536
|
||||||
|
proxy -p3129" >/path/to/local/config/directory/3proxy.cfg
|
||||||
|
podman run --read-only -p 3129:3129 -v /path/to/local/config/directory/3proxy.cfg:/etc/3proxy/3proxy.cfg --name 3proxy.full 3proxy.full
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
use `log` without pathname in config to log to stdout.
|
||||||
|
plugins are located in /usr/local/3proxy/libexec (/libexec for chroot config) and since 0.9.6 symlinked by /lib and /lib64 in both chroot and non-chroot configurations, so no full path is required in `plugin` command. Use e.g. `plugin SSLPlugin.ls.so ssl_plugin`. SSLPlugin is supported since 0.9.6. Some proxy types (e.g. SOCKSv5 UDPASSCOC, SOCKSv5 BIND functionality, ftp proxy) require access to ephemeral port, you may use e.g. -`-network host` mode or `-P` for `docker run`.
|
||||||
|
|
||||||
|
since 0.9.6 images are distroless (except :busybox) it's recommended to use with read only file system, there are no benefits from chroot. For compatibility, you still can use chroot installation by mounting directory with 3proxy.cfg to /usr/local/3proxy/config.
|
||||||
|
|
||||||
|
### Busybox image (`:busybox`):
|
||||||
|
|
||||||
|
`full` with busybox added, to allow `sh` and few more commands like `sed` inside container. All libraries are in /lib, so chroot configuration can not use plugins.
|
||||||
|
|
||||||
|
### Interactive `:minimal` image:
|
||||||
|
|
||||||
|
Dockerfile for "interactive" minimal 3proxy execution, no configuration mounting is required, configuration
|
||||||
|
is accepted from stdin. Use `end` command to indicate the end of configuration. Use `log` for stdout logging.
|
||||||
|
|
||||||
|
|
||||||
|
`plugin` is not supported, `nserver` or `fakeresolve` are mandatory, because system resolver is not supported, no support for RADIUS and IPv6.
|
||||||
|
|
||||||
|
Run example:
|
||||||
|
|
||||||
|
`docker run --read-only -i -p 3129:3129 --name 3proxy docker.io/3proxy/3proxy:minimal`
|
||||||
|
or
|
||||||
|
`docker start -ai 3proxy` to start existing container
|
||||||
|
|
||||||
|
send this to standard input (example):
|
||||||
|
```
|
||||||
|
nserver 8.8.8.8
|
||||||
|
nscache 65535
|
||||||
|
log
|
||||||
|
proxy -p3129
|
||||||
|
end
|
||||||
|
```
|
||||||
|
`nserver` is required for DNS resolutions.
|
||||||
|
|
||||||
|
Some proxy types (e.g. SOCKSv5 UDPASSCOC, SOCKSv5 BIND functionality, ftp proxy) require access to ephemeral port, you may use e.g. `--network host` mode or `-P` to `docker run`.
|
||||||
|
|
||||||
|
`:minimal` without version specified uses current stable version.
|
||||||
|
|
||||||
|
## Building and installation
|
||||||
|
|
||||||
|
### Windows Installation
|
||||||
|
|
||||||
|
Install and start proxy as Windows service:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
3proxy [path_to_config_file] --install
|
||||||
|
```
|
||||||
|
|
||||||
|
Config file should be located in the same directory or may be optionally specified.
|
||||||
|
|
||||||
|
Remove the service (should be stopped before via `net stop 3proxy`):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
3proxy --remove
|
||||||
|
```
|
||||||
|
|
||||||
|
### Building and installation on Linux
|
||||||
|
|
||||||
|
#### With Makefile
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/z3apa3a/3proxy
|
||||||
|
cd 3proxy
|
||||||
|
ln -s Makefile.Linux Makefile
|
||||||
|
make
|
||||||
|
sudo make install
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Default Configuration (for Makefile.Linux installation)
|
||||||
|
|
||||||
|
3proxy uses 2 configuration files in :
|
||||||
|
- `/etc/3proxy/3proxy.cfg` (before-chroot) - This configuration file is executed before chroot and should not be modified.
|
||||||
|
- `/usr/local/3proxy/conf/3proxy.cfg` symlinked from `/etc/3proxy/conf/3proxy.cfg` (after-chroot) - Main configuration file. Modify this file if required.
|
||||||
|
|
||||||
|
All paths in `/usr/local/3proxy/conf/3proxy.cfg` are relative to chroot directory (`/usr/local/3proxy`). For future versions it's planned to move 3proxy chroot directory to `/var`.
|
||||||
|
|
||||||
|
Log files are created in `/usr/local/3proxy/logs` symlinked from `/var/log/3proxy`.
|
||||||
|
|
||||||
|
By default, socks is started on 0.0.0.0:1080 and proxy on 0.0.0.0:3128 with basic auth, no users are added by default.
|
||||||
|
|
||||||
|
#### Adding Users
|
||||||
|
|
||||||
|
Use `add3proxyuser` script to add users:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
add3proxyuser username password [day_limit] [bandwidth]
|
||||||
|
```
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
- `day_limit` - traffic limit in MB per day
|
||||||
|
- `bandwidth` - bandwidth in bits per second (1048576 = 1Mbps)
|
||||||
|
|
||||||
|
Or modify `/etc/3proxy/conf/` files directly.
|
||||||
|
|
||||||
|
#### With CMake
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/z3apa3a/3proxy
|
||||||
|
cd 3proxy
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake ..
|
||||||
|
cmake --build .
|
||||||
|
sudo cmake --install .
|
||||||
|
```
|
||||||
|
|
||||||
|
CMake does not use chroot configuration, config file is `/etc/3proxy/3proxy.cfg`
|
||||||
|
|
||||||
|
### MacOS X / FreeBSD / *BSD
|
||||||
|
|
||||||
|
#### With Makefile
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/z3apa3a/3proxy
|
||||||
|
cd 3proxy
|
||||||
|
ln -s Makefile.FreeBSD Makefile
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
|
Binaries are in `bin/` directory.
|
||||||
|
|
||||||
|
#### With CMake (recommended)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/z3apa3a/3proxy
|
||||||
|
cd 3proxy
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake ..
|
||||||
|
cmake --build .
|
||||||
|
sudo cmake --install .
|
||||||
|
```
|
||||||
|
|
||||||
|
This installs:
|
||||||
|
- Binaries to `/usr/local/bin/`
|
||||||
|
- Configuration to `/etc/3proxy/`
|
||||||
|
- Plugins to `/usr/local/lib/3proxy/`
|
||||||
|
- rc scripts to `rc.d` for BSD
|
||||||
|
- launchd plist to `/Library/LaunchDaemons/` for MacOS
|
||||||
|
|
||||||
|
#### Service Management on macOS
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Load and start service
|
||||||
|
sudo launchctl load /Library/LaunchDaemons/org.3proxy.3proxy.plist
|
||||||
|
|
||||||
|
# Stop service
|
||||||
|
sudo launchctl stop org.3proxy.3proxy
|
||||||
|
|
||||||
|
# Start service
|
||||||
|
sudo launchctl start org.3proxy.3proxy
|
||||||
|
|
||||||
|
# Unload and disable service
|
||||||
|
sudo launchctl unload /Library/LaunchDaemons/org.3proxy.3proxy.plist
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
### 1. General
|
||||||
|
|
||||||
|
- IPv4 / IPv6 support for incoming and outgoing connection, can be used as a proxy between IPv4 and IPv6 networks in either direction
|
||||||
|
- Unix domain sockets support
|
||||||
|
- HTTP/1.1 Proxy with keep-alive client and server support, transparent proxy support
|
||||||
|
- HTTPS (CONNECT) proxy (compatible with HTTP/2 / SPDY)
|
||||||
|
- Anonymous and random client IP emulation for HTTP proxy mode
|
||||||
|
- FTP over HTTP support
|
||||||
|
- DNS caching with built-in resolver
|
||||||
|
- DNS proxy
|
||||||
|
- DNS over TCP support, redirecting DNS traffic via parent proxy
|
||||||
|
- SOCKSv4/4.5 Proxy
|
||||||
|
- SOCKSv5 Proxy
|
||||||
|
- SOCKSv5 UDP and BIND support (fully compatible with SocksCAP/FreeCAP for UDP)
|
||||||
|
- Transparent SOCKS redirection for HTTP, POP3, FTP, SMTP
|
||||||
|
- SNI proxy (based on TLS hostname)
|
||||||
|
- TLS (SSL) server and client, 3proxy may be used as https:// type proxy or stunnel replacement
|
||||||
|
- POP3 Proxy
|
||||||
|
- FTP proxy
|
||||||
|
- TCP port mapper (port forwarding)
|
||||||
|
- UDP port mapper (port forwarding)
|
||||||
|
- SMTP proxy
|
||||||
|
- Threaded application (no child process)
|
||||||
|
- Web administration and statistics
|
||||||
|
- Plugins for functionality extension
|
||||||
|
- Native 32/64 bit application
|
||||||
|
|
||||||
|
### 2. Proxy Chaining and Network Connections
|
||||||
|
|
||||||
|
- Can be used as a bridge between client and different proxy type (e.g. convert incoming HTTP proxy request from client to SOCKSv5 request to parent server)
|
||||||
|
- Connect back proxy support to bypass firewalls
|
||||||
|
- Parent proxy support for any type of incoming connection
|
||||||
|
- Username/password authentication for parent proxy(s)
|
||||||
|
- HTTPS/SOCKS4/SOCKS5 and ip/port redirection parent support
|
||||||
|
- Random parent selection
|
||||||
|
- Chain building (multihop proxing)
|
||||||
|
- Load balancing between few network connections by choosing network interface
|
||||||
|
|
||||||
|
### 3. Logging
|
||||||
|
|
||||||
|
- Tuneable log format compatible with any log parser
|
||||||
|
- stdout logging
|
||||||
|
- File logging
|
||||||
|
- Syslog logging (Unix)
|
||||||
|
- ODBC logging
|
||||||
|
- RADIUS accounting
|
||||||
|
- Log file rotation
|
||||||
|
- Automatic log file processing with external archiver (for files)
|
||||||
|
- Character filtering for log files
|
||||||
|
- Different log files for different services are supported
|
||||||
|
|
||||||
|
### 4. Access Control
|
||||||
|
|
||||||
|
- ACL-driven Access control by username, source IP, destination IP/hostname, destination port and destination action (POST, PUT, GET, etc), weekday and daytime
|
||||||
|
- ACL-driven (user/source/destination/protocol/weekday/daytime or combined) bandwidth limitation for incoming and (!)outgoing traffic
|
||||||
|
- ACL-driven traffic limitation per day, week or month for incoming and outgoing traffic
|
||||||
|
- Connection limitation and ratelimiting
|
||||||
|
- User authentication by username / password
|
||||||
|
- RADIUS Authentication and Authorization
|
||||||
|
- User authentication by DNS hostname
|
||||||
|
- Authentication cache with possibility to limit user to single IP address
|
||||||
|
- Access control by username/password for SOCKSv5 and HTTP/HTTPS/FTP
|
||||||
|
- Cleartext or encrypted passwords
|
||||||
|
- Connection redirection
|
||||||
|
- Access control by requested action (CONNECT/BIND, HTTP GET/POST/PUT/HEAD/OTHER)
|
||||||
|
- All access control entries now support weekday and time limitations
|
||||||
|
- Hostnames and * templates are supported instead of IP address
|
||||||
|
|
||||||
|
### 5. Extensions
|
||||||
|
|
||||||
|
- Regular expression filtering (with PCRE2) via PCREPlugin
|
||||||
|
- Authentication with Windows username/password (cleartext only)
|
||||||
|
- SSL/TLS decryptions with certificate spoofing
|
||||||
|
- Transparent redirection support for Linux and *BSD
|
||||||
|
|
||||||
|
### 6. Configuration
|
||||||
|
|
||||||
|
- Support for configuration files
|
||||||
|
- Support for includes in configuration files
|
||||||
|
- Interface binding
|
||||||
|
- Socket options
|
||||||
|
- Running as daemon process
|
||||||
|
- Utility for automated networks list building
|
||||||
|
- Configuration reload on any file change
|
||||||
|
|
||||||
|
**Unix:**
|
||||||
|
- Support for chroot
|
||||||
|
- Support for setgid
|
||||||
|
- Support for setuid
|
||||||
|
- Support for signals (SIGUSR1 to reload configuration)
|
||||||
|
|
||||||
|
**Windows:**
|
||||||
|
- Support `--install` as service
|
||||||
|
- Support `--remove` as service
|
||||||
|
- Support for service START, STOP, PAUSE and CONTINUE commands (on PAUSE no new connection accepted, but active connections still in progress, on CONTINUE configuration is reloaded)
|
||||||
|
|
||||||
|
**Windows 95/98/ME:**
|
||||||
|
- Support `--install` as service
|
||||||
|
- Support `--remove` as service
|
||||||
|
|
||||||
|
### 7. Compilation
|
||||||
|
|
||||||
|
- MSVC (static)
|
||||||
|
- OpenWatcom (static)
|
||||||
|
- Intel Windows Compiler (msvcrt.dll)
|
||||||
|
- Windows/gcc (msvcrt.dll)
|
||||||
|
- Cygwin/gcc (cygwin.dll)
|
||||||
|
- Unix/gcc
|
||||||
|
- Unix/ccc
|
||||||
|
- Solaris
|
||||||
|
- Mac OS X, iPhone OS
|
||||||
|
- Linux and derived systems
|
||||||
|
- Lite version for Windows 95/98/NT/2000/XP/2003
|
||||||
|
- 32 bit and 64 bit versions for Windows Vista and above, Windows 2008 server and above
|
||||||
|
|
||||||
|
## Executables
|
||||||
|
|
||||||
|
### 3proxy
|
||||||
|
Combined proxy server may be used as executable or service (supports installation and removal). It uses config file to read its configuration (see `3proxy.cfg.sample` for details). `3proxy.exe` is all-in-one, it doesn't require all others .exe to work. See `3proxy.cfg.sample` for examples, see `man 3proxy.cfg`
|
||||||
|
|
||||||
|
### 3proxy_proxy
|
||||||
|
HTTP proxy server, binds to port 3128
|
||||||
|
|
||||||
|
### 3proxy_ftppr
|
||||||
|
FTP proxy server, binds to port 21. Please do not mess it with FTP over HTTP proxy used in browsers
|
||||||
|
|
||||||
|
### 3proxy_socks
|
||||||
|
SOCKS 4/5 proxy server, binds to port 1080
|
||||||
|
|
||||||
|
### 3proxy_pop3p
|
||||||
|
POP3 proxy server, binds to port 110. You must specify POP3 username as `username@popserver[:port]` (port is 110 by default).
|
||||||
|
|
||||||
|
Example: in Username configuration for your e-mail reader set `someuser@pop.somehost.ru`, to obtain mail for someuser from pop.somehost.ru via proxy.
|
||||||
|
|
||||||
|
### 3proxy_smtpp
|
||||||
|
SMTP proxy server, binds to port 25. You must specify SMTP username as `username@smtpserver[:port]` (port is 25 by default).
|
||||||
|
|
||||||
|
Example: in Username configuration for your e-mail reader set `someuser@mail.somehost.ru`, to send mail as someuser via mail.somehost.ru via proxy.
|
||||||
|
|
||||||
|
### 3proxy_tcppm
|
||||||
|
TCP port mapping. Maps some TCP port on local machine to TCP port on remote host.
|
||||||
|
|
||||||
|
### 3proxy_tlspr
|
||||||
|
TLS proxy (SNI proxy) - sniffs hostname from TLS handshake
|
||||||
|
|
||||||
|
### 3proxy_udppm
|
||||||
|
UDP port mapping. Maps some UDP port on local machine to UDP port on remote machine. Only one user simultaneously can use UDP mapping, so it can't be used for public service in large networks. It's OK to use it to map to DNS server in small network or to map Counter-Strike server for single client (you can use few mappings on different ports for different clients in last case).
|
||||||
|
|
||||||
|
### 3proxy_crypt
|
||||||
|
Program to obtain crypted password for cleartext. Supports both salted and NT password.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
3proxy_crypt password # produces NT password
|
||||||
|
3proxy_crypt salt password # produces password hash with salt "salt"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Run utility with `--help` option for command line reference.
|
||||||
|
|
||||||
|
Latest version is available from https://3proxy.org/
|
||||||
|
|
||||||
|
Want to donate the project? https://3proxy.org/donations/
|
||||||
-106
@@ -1,106 +0,0 @@
|
|||||||
08/04/2014 3[APA3A]tiny proxy 0.7
|
|
||||||
|
|
||||||
Features:
|
|
||||||
1. General
|
|
||||||
+ HTTP/1.1 Proxy with keep-alive client and server support,
|
|
||||||
transparent proxy support.
|
|
||||||
+ Anonymous and random client emulation HTTP proxy mode
|
|
||||||
+ FTP over HTTP support.
|
|
||||||
+ DNS caching with built-in resolver
|
|
||||||
+ HTTPS (CONNECT) proxy
|
|
||||||
+ SOCKSv4/4.5 Proxy
|
|
||||||
+ SOCKSv5 Proxy
|
|
||||||
+ UDP and bind support for SOCKSv5 (fully compatible with
|
|
||||||
SocksCAP/FreeCAP for UDP)
|
|
||||||
+ Transparent SOCKS redirection for HTTP, POP3, FTP, SMTP, ICQ
|
|
||||||
+ POP3 Proxy
|
|
||||||
+ FTP proxy
|
|
||||||
+ DNS proxy
|
|
||||||
+ TCP port mapper
|
|
||||||
+ UDP port mapper
|
|
||||||
+ SMTP proxy
|
|
||||||
+ ICQ/AOL proxy
|
|
||||||
+ MSN proxy
|
|
||||||
+ Threaded application (no child process).
|
|
||||||
+ Web administration and statistics
|
|
||||||
+ Plugins for functionality extension
|
|
||||||
+ Native 64 bit application for 64 bit OS, including 64-bit editions of
|
|
||||||
Windows XP, Vista, 2003, 2008.
|
|
||||||
2. Proxy chaining and network connections
|
|
||||||
+ Parent proxy support for any type of incoming connection
|
|
||||||
+ Username/password authentication for parent proxy(s).
|
|
||||||
+ HTTPS/SOCKS4/SOCKS5 and redirection parent support
|
|
||||||
+ Random parent selection
|
|
||||||
+ Chain building (multihop proxing)
|
|
||||||
+ Load balancing between few network connections by choosing network
|
|
||||||
interface
|
|
||||||
3. Logging
|
|
||||||
+ turnable log format compatible with any log parser
|
|
||||||
+ stdout logging
|
|
||||||
+ file logging
|
|
||||||
+ syslog logging (Unix)
|
|
||||||
+ ODBC logging (Windows and Unix)
|
|
||||||
+ log file rotation (hourly, daily, weekly, monthly)
|
|
||||||
+ automatic log file comperssion with external archiver (for files)
|
|
||||||
+ automatic removal of older log files
|
|
||||||
+ Character filtering for log files
|
|
||||||
+ different log files for different servces are supported
|
|
||||||
4. Access control
|
|
||||||
+ ACL-driven (user/source/destination/protocol/weekday/daytime or
|
|
||||||
combined) bandwith limitation for incoming and (!)outgoing trafic.
|
|
||||||
+ ACL-driven (user/source/destination/protocol/weekday/daytime or
|
|
||||||
combined) traffic limitation per day, week or month for incoming and
|
|
||||||
(!) outgoing traffic
|
|
||||||
+ User authorization by NetBIOS messanger name
|
|
||||||
+ Access control by username, source IP, destination IP, destination
|
|
||||||
port and destination action (POST, PUT, GET, etc), weekday and daytime.
|
|
||||||
+ Access control by username/password for SOCKSv5 and HTTP/HTTPS/FTP
|
|
||||||
+ Cleartext or encrypted (crypt/MD5 or NT) passwords.
|
|
||||||
+ Connection redirection
|
|
||||||
+ Access control by requested action (CONNECT/BIND,
|
|
||||||
HTTP GET/POST/PUT/HEAD/OTHER).
|
|
||||||
+ NTLM (v1 only) authentication for HTTP proxy access
|
|
||||||
+ All access control entries now support weekday and time limitations
|
|
||||||
+ Hostnames and * templates are supported instead of IP address
|
|
||||||
5. Extensions
|
|
||||||
+ Regular expression filtering (with PCRE) via PCREPlugin
|
|
||||||
currently HTTP traffic only for URLs, HTTP headers and HTTP data.
|
|
||||||
+ Authentication with Windows username/password (cleartext only!)
|
|
||||||
6. Configuration
|
|
||||||
+ support for configuration files
|
|
||||||
+ support for includes in configuration files
|
|
||||||
+ interface binding
|
|
||||||
+ running as daemon process
|
|
||||||
+ utility for automated networks list building
|
|
||||||
+ configuration reload on any file change
|
|
||||||
Unix
|
|
||||||
+ support for chroot
|
|
||||||
+ support for setgid
|
|
||||||
+ support for setuid
|
|
||||||
+ support for signals
|
|
||||||
Windows NT/2K/XP/2K3
|
|
||||||
+ support --install as service
|
|
||||||
+ support --remove as service
|
|
||||||
+ support for service START, STOP, PAUSE and CONTINUE commands (on
|
|
||||||
PAUSE no new connection accepted, but active connections still in
|
|
||||||
progress, on CONTINUE configuration is reloaded)
|
|
||||||
Windows 95/98/ME
|
|
||||||
+ support --install as service
|
|
||||||
+ support --remove as service
|
|
||||||
6. Compilation
|
|
||||||
+ MSVC (static)
|
|
||||||
+ Intel Windows Compiler (msvcrt.dll)
|
|
||||||
+ Windows/gcc (msvcrt.dll)
|
|
||||||
+ Cygwin/gcc (cygwin.dll)
|
|
||||||
+ Unix/gcc
|
|
||||||
+ Unix/ccc
|
|
||||||
+ Solaris
|
|
||||||
+ Mac OS X, iPhone OS
|
|
||||||
|
|
||||||
|
|
||||||
Planned for future (0.8) release:
|
|
||||||
- SSL handling / SSL decryption by certificate spoofing
|
|
||||||
- NAT support under *nix
|
|
||||||
- Addon antiviral, HTTP cache filters modules, authentication
|
|
||||||
modules for different protocols (RADIUS, PAM etc).
|
|
||||||
|
|
||||||
+93
@@ -0,0 +1,93 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
| ------- | ------------------ |
|
||||||
|
| 0.9.8 | :white_check_mark: |
|
||||||
|
| < 0.9.8 | :x: |
|
||||||
|
|
||||||
|
## Hardening a deployment
|
||||||
|
|
||||||
|
Configuration is where most of the risk lives. The security recommendations are
|
||||||
|
kept in [doc/html/securityen.html](doc/html/securityen.html), published at
|
||||||
|
<https://3proxy.org/securityen.html>: how to run the service, what the
|
||||||
|
ACLs have to cover, and the settings whose defaults are safe only until
|
||||||
|
something else is enabled alongside them.
|
||||||
|
|
||||||
|
Read it before exposing a service. Recurring points from it:
|
||||||
|
|
||||||
|
- Run unprivileged, never suid, and chroot where the platform allows.
|
||||||
|
- Name the internal and external interfaces explicitly, and limit sources and
|
||||||
|
destinations with ACLs rather than relying on defaults.
|
||||||
|
- Enabling IPv6 makes ACLs written in IPv4 incomplete: the same host is
|
||||||
|
reachable through an IPv4-mapped address, and the IPv6 loopback is an
|
||||||
|
address of its own.
|
||||||
|
- Anything that terminates or intercepts TLS holds key material and sees full
|
||||||
|
request URLs; both the key and the logs need protecting.
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
Report to 3proxy@3proxy.org or via [GitHub security reporting](https://github.com/3proxy/3proxy/security)
|
||||||
|
|
||||||
|
For High/Critical patched version is released within 2 weeks
|
||||||
|
|
||||||
|
## Verifying downloads
|
||||||
|
|
||||||
|
Release binaries and the source tarball are published with SHA256 checksums, an
|
||||||
|
OpenPGP signature and a GitHub build provenance attestation.
|
||||||
|
|
||||||
|
The release signing key is `3proxy-release-key.asc` in the root of this
|
||||||
|
repository, an RSA-4096 key:
|
||||||
|
|
||||||
|
```
|
||||||
|
pub rsa4096 2026-08-21 [SC]
|
||||||
|
FC12 2144 99FC C7BA 1CFF 6CDC 0312 384E 3A73 940B
|
||||||
|
uid 3proxy release signing <3proxy@3proxy.org>
|
||||||
|
```
|
||||||
|
|
||||||
|
Import it once:
|
||||||
|
|
||||||
|
```
|
||||||
|
gpg --import 3proxy-release-key.asc
|
||||||
|
```
|
||||||
|
|
||||||
|
Checksums and the checksum file signature:
|
||||||
|
|
||||||
|
```
|
||||||
|
gpg --verify SHA256SUMS-x86_64.asc SHA256SUMS-x86_64
|
||||||
|
sha256sum -c SHA256SUMS-x86_64
|
||||||
|
```
|
||||||
|
|
||||||
|
The source tarball published with each release is signed as well:
|
||||||
|
|
||||||
|
```
|
||||||
|
gpg --verify SHA256SUMS-src.asc SHA256SUMS-src
|
||||||
|
sha256sum -c SHA256SUMS-src
|
||||||
|
gpg --verify 3proxy-0.9.9.tar.gz.asc 3proxy-0.9.9.tar.gz
|
||||||
|
```
|
||||||
|
|
||||||
|
Prefer it over the `Source code (tar.gz)` link GitHub generates automatically:
|
||||||
|
only the published tarball is signed. It is produced with `git archive` from
|
||||||
|
the release tag, so it can be regenerated and compared byte for byte.
|
||||||
|
|
||||||
|
RPM packages are signed, the signature is checked by rpm itself:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo rpm --import 3proxy-release-key.asc
|
||||||
|
rpm -K 3proxy-0.9.9.x86_64.rpm
|
||||||
|
```
|
||||||
|
|
||||||
|
DEB packages are published with a detached signature:
|
||||||
|
|
||||||
|
```
|
||||||
|
gpg --verify 3proxy-0.9.9.x86_64.deb.asc 3proxy-0.9.9.x86_64.deb
|
||||||
|
```
|
||||||
|
|
||||||
|
Build provenance (which workflow, commit and runner produced the file) is
|
||||||
|
verified with the GitHub CLI:
|
||||||
|
|
||||||
|
```
|
||||||
|
gh attestation verify 3proxy-0.9.9.x86_64.rpm --owner 3proxy
|
||||||
|
gh attestation verify oci://docker.io/3proxy/3proxy:latest --owner 3proxy
|
||||||
|
```
|
||||||
@@ -1 +1 @@
|
|||||||
(c) 2002-2014 by Vladimir '3APA3A' Dubrovin <3proxy@3proxy.ru>
|
(c) 2002-2025 by Vladimir '3APA3A' Dubrovin <vlad@3proxy.org>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
*.cfg
|
||||||
|
*.old
|
||||||
+30
-30
@@ -2,7 +2,7 @@
|
|||||||
# Yes, 3proxy.cfg can be executable, in this case you should place
|
# Yes, 3proxy.cfg can be executable, in this case you should place
|
||||||
# something like
|
# something like
|
||||||
#config /usr/local/3proxy/3proxy.cfg
|
#config /usr/local/3proxy/3proxy.cfg
|
||||||
# to show which configuration 3proxy should re-read on realod.
|
# to show which configuration 3proxy should re-read on reload.
|
||||||
|
|
||||||
#system "echo Hello world!"
|
#system "echo Hello world!"
|
||||||
# you may use system to execute some external command if proxy starts
|
# you may use system to execute some external command if proxy starts
|
||||||
@@ -24,7 +24,7 @@ timeouts 1 5 30 60 180 1800 15 60
|
|||||||
# Here we can change timeout values
|
# Here we can change timeout values
|
||||||
|
|
||||||
users 3APA3A:CL:3apa3a "test:CR:$1$qwer$CHFTUFGqkjue9HyhcMHEe1"
|
users 3APA3A:CL:3apa3a "test:CR:$1$qwer$CHFTUFGqkjue9HyhcMHEe1"
|
||||||
# note that "" required, overvise $... is treated as include file name.
|
# note that "" required, otherwise $... is treated as include file name.
|
||||||
# $1$qwer$CHFTUFGqkjue9HyhcMHEe1 is 'test' in MD5 crypt format.
|
# $1$qwer$CHFTUFGqkjue9HyhcMHEe1 is 'test' in MD5 crypt format.
|
||||||
#users $/usr/local/etc/3proxy/passwd
|
#users $/usr/local/etc/3proxy/passwd
|
||||||
# this example shows you how to include passwd file. For included files
|
# this example shows you how to include passwd file. For included files
|
||||||
@@ -37,9 +37,9 @@ users 3APA3A:CL:3apa3a "test:CR:$1$qwer$CHFTUFGqkjue9HyhcMHEe1"
|
|||||||
service
|
service
|
||||||
# service is required under NT if you want 3proxy to start as service
|
# service is required under NT if you want 3proxy to start as service
|
||||||
|
|
||||||
#log /usr/local/etc/3proxy/logs/3proxy.log D
|
#log /var/log/3proxy/log D
|
||||||
log c:\3proxy\logs\3proxy.log D
|
log c:\3proxy\logs\3proxy.log D
|
||||||
# log allows to specify log file location and rotation, D means logfile
|
# log allows you to specify log file location and rotation, D means logfile
|
||||||
# is created daily
|
# is created daily
|
||||||
|
|
||||||
#logformat "L%d-%m-%Y %H:%M:%S %z %N.%p %E %U %C:%c %R:%r %O %I %h %T"
|
#logformat "L%d-%m-%Y %H:%M:%S %z %N.%p %E %U %C:%c %R:%r %O %I %h %T"
|
||||||
@@ -60,7 +60,7 @@ log c:\3proxy\logs\3proxy.log D
|
|||||||
#
|
#
|
||||||
#Compatible with ISA 2000/2004 firewall FWSEXTD.log (fields are TAB-delimited):
|
#Compatible with ISA 2000/2004 firewall FWSEXTD.log (fields are TAB-delimited):
|
||||||
#
|
#
|
||||||
#"- + L%C %U unnknown:0:0.0 N %Y-%m-%d %H:%M:%S fwsrv 3PROXY - %n %R %r %D %O %I %r TCP Connect - - - %E - - - - -"
|
#"- + L%C %U unknown:0:0.0 N %Y-%m-%d %H:%M:%S fwsrv 3PROXY - %n %R %r %D %O %I %r TCP Connect - - - %E - - - - -"
|
||||||
#
|
#
|
||||||
#Compatible with HTTPD standard log (Apache and others)
|
#Compatible with HTTPD standard log (Apache and others)
|
||||||
#
|
#
|
||||||
@@ -90,7 +90,7 @@ auth iponly
|
|||||||
# auth specifies type of user authentication. If you specify none proxy
|
# auth specifies type of user authentication. If you specify none proxy
|
||||||
# will not do anything to check name of the user. If you specify
|
# will not do anything to check name of the user. If you specify
|
||||||
# nbname proxy will send NetBIOS name request packet to UDP/137 of
|
# nbname proxy will send NetBIOS name request packet to UDP/137 of
|
||||||
# client and parse request for NetBIOS name of messanger service.
|
# client and parse request for NetBIOS name of messenger service.
|
||||||
# Strong means that proxy will check password. For strong authentication
|
# Strong means that proxy will check password. For strong authentication
|
||||||
# unknown user will not be allowed to use proxy regardless of ACL.
|
# unknown user will not be allowed to use proxy regardless of ACL.
|
||||||
# If you do not want username to be checked but wanna ACL to work you should
|
# If you do not want username to be checked but wanna ACL to work you should
|
||||||
@@ -102,7 +102,7 @@ auth iponly
|
|||||||
#parent 1000 http 192.168.1.2 80 * * * 80
|
#parent 1000 http 192.168.1.2 80 * * * 80
|
||||||
#allow * 192.168.1.0/24 * 25,53,110,20-21,1024-65535
|
#allow * 192.168.1.0/24 * 25,53,110,20-21,1024-65535
|
||||||
# we will allow everything if username matches ADMINISTRATOR or root or
|
# we will allow everything if username matches ADMINISTRATOR or root or
|
||||||
# client ip is 127.0.0.1 or 192.168.1.1. Overwise we will redirect any request
|
# client ip is 127.0.0.1 or 192.168.1.1. Otherwise we will redirect any request
|
||||||
# to port 80 to our Web-server 192.168.0.2.
|
# to port 80 to our Web-server 192.168.0.2.
|
||||||
# We will allow any outgoing connections from network 192.168.1.0/24 to
|
# We will allow any outgoing connections from network 192.168.1.0/24 to
|
||||||
# SMTP, POP3, FTP, DNS and unprivileged ports.
|
# SMTP, POP3, FTP, DNS and unprivileged ports.
|
||||||
@@ -124,7 +124,7 @@ internal 192.168.1.1
|
|||||||
# have open proxy in your network in this case.
|
# have open proxy in your network in this case.
|
||||||
|
|
||||||
auth none
|
auth none
|
||||||
# no authentication is requires
|
# no authentication is required
|
||||||
|
|
||||||
dnspr
|
dnspr
|
||||||
|
|
||||||
@@ -134,17 +134,9 @@ dnspr
|
|||||||
|
|
||||||
#external $./external.ip
|
#external $./external.ip
|
||||||
#internal $./internal.ip
|
#internal $./internal.ip
|
||||||
# this is just an alternative form fo giving external and internal address
|
# this is just an alternative form for giving external and internal address
|
||||||
# allows you to read this addresses from files
|
# allows you to read this addresses from files
|
||||||
|
|
||||||
auth strong
|
|
||||||
# We want to protect internal interface
|
|
||||||
deny * * 127.0.0.1,192.168.1.1
|
|
||||||
# and llow HTTP and HTTPS traffic.
|
|
||||||
allow * * * 80-88,8080-8088 HTTP
|
|
||||||
allow * * * 443,8443 HTTPS
|
|
||||||
proxy -n
|
|
||||||
|
|
||||||
auth none
|
auth none
|
||||||
# pop3p will be used without any authentication. It's bad choice
|
# pop3p will be used without any authentication. It's bad choice
|
||||||
# because it's possible to use pop3p to access any port
|
# because it's possible to use pop3p to access any port
|
||||||
@@ -157,26 +149,16 @@ tcppm 25 mail.my.provider 25
|
|||||||
# Now we can use our proxy as SMTP and DNS server.
|
# Now we can use our proxy as SMTP and DNS server.
|
||||||
# -s switch for UDP means "single packet" service - instead of setting
|
# -s switch for UDP means "single packet" service - instead of setting
|
||||||
# association for period of time association will only be set for 1 packet.
|
# association for period of time association will only be set for 1 packet.
|
||||||
# It's very userfull for services like DNS but not for some massive services
|
# It's very useful for services like DNS but not for some massive services
|
||||||
# like multimedia streams or online games.
|
# like multimedia streams or online games.
|
||||||
|
|
||||||
auth strong
|
|
||||||
flush
|
|
||||||
allow 3APA3A,test
|
|
||||||
maxconn 20
|
|
||||||
socks
|
|
||||||
# for socks we will use password authentication and different access control -
|
|
||||||
# we flush previously configured ACL list and create new one to allow users
|
|
||||||
# test and 3APA3A to connect from any location
|
|
||||||
|
|
||||||
|
|
||||||
auth strong
|
auth strong
|
||||||
flush
|
flush
|
||||||
internal 127.0.0.1
|
internal 127.0.0.1
|
||||||
allow 3APA3A 127.0.0.1
|
allow 3APA3A 127.0.0.1
|
||||||
maxconn 3
|
maxconn 3
|
||||||
admin
|
admin
|
||||||
#only allow acces to admin interface for user 3APA3A from 127.0.0.1 address
|
#only allow access to admin interface for user 3APA3A from 127.0.0.1 address
|
||||||
#via 127.0.0.1 address.
|
#via 127.0.0.1 address.
|
||||||
|
|
||||||
# map external 80 and 443 ports to internal Web server
|
# map external 80 and 443 ports to internal Web server
|
||||||
@@ -196,6 +178,24 @@ admin
|
|||||||
#chroot /usr/local/jail
|
#chroot /usr/local/jail
|
||||||
#setgid 65535
|
#setgid 65535
|
||||||
#setuid 65535
|
#setuid 65535
|
||||||
# now we needn't any root rights. We can chroot and setgid/setuid.
|
# now we no longer need root rights. We can chroot and setgid/setuid.
|
||||||
|
|
||||||
|
|
||||||
|
auth strong
|
||||||
|
flush
|
||||||
|
# We want to protect internal interface
|
||||||
|
deny * * 127.0.0.1,192.168.1.1
|
||||||
|
# and allow HTTP and HTTPS traffic.
|
||||||
|
allow * * * 80-88,8080-8088 HTTP
|
||||||
|
allow * * * 443,8443 HTTPS
|
||||||
|
proxy -n
|
||||||
|
|
||||||
|
flush
|
||||||
|
allow 3APA3A,test
|
||||||
|
maxconn 20
|
||||||
|
socks
|
||||||
|
# for socks we will use password authentication and different access control -
|
||||||
|
# we flush previously configured ACL list and create new one to allow users
|
||||||
|
# test and 3APA3A to connect from any location
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
# FindODBC.cmake
|
||||||
|
#
|
||||||
|
# Find the ODBC library
|
||||||
|
#
|
||||||
|
# This module defines:
|
||||||
|
# ODBC_FOUND - whether the ODBC library was found
|
||||||
|
# ODBC_INCLUDE_DIRS - the ODBC include directories
|
||||||
|
# ODBC_LIBRARIES - the ODBC libraries
|
||||||
|
|
||||||
|
# Try pkg-config first
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
if(PkgConfig_FOUND)
|
||||||
|
pkg_check_modules(PC_ODBC QUIET odbc)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Find include directory
|
||||||
|
find_path(ODBC_INCLUDE_DIR
|
||||||
|
NAMES sql.h
|
||||||
|
HINTS
|
||||||
|
${PC_ODBC_INCLUDE_DIRS}
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
)
|
||||||
|
|
||||||
|
# Find library
|
||||||
|
if(WIN32)
|
||||||
|
# On Windows, ODBC is typically available as odbc32
|
||||||
|
find_library(ODBC_LIBRARY
|
||||||
|
NAMES odbc32
|
||||||
|
HINTS
|
||||||
|
${PC_ODBC_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
# On Unix, look for odbc
|
||||||
|
find_library(ODBC_LIBRARY
|
||||||
|
NAMES odbc iodbc
|
||||||
|
HINTS
|
||||||
|
${PC_ODBC_LIBRARY_DIRS}
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib/x86_64-linux-gnu
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(ODBC
|
||||||
|
REQUIRED_VARS ODBC_LIBRARY ODBC_INCLUDE_DIR
|
||||||
|
)
|
||||||
|
|
||||||
|
if(ODBC_FOUND)
|
||||||
|
set(ODBC_LIBRARIES ${ODBC_LIBRARY})
|
||||||
|
set(ODBC_INCLUDE_DIRS ${ODBC_INCLUDE_DIR})
|
||||||
|
|
||||||
|
if(NOT TARGET ODBC::ODBC)
|
||||||
|
add_library(ODBC::ODBC UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(ODBC::ODBC PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${ODBC_LIBRARY}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${ODBC_INCLUDE_DIR}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(ODBC_INCLUDE_DIR ODBC_LIBRARY)
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# FindPAM.cmake
|
||||||
|
#
|
||||||
|
# Find the PAM library
|
||||||
|
#
|
||||||
|
# This module defines:
|
||||||
|
# PAM_FOUND - whether the PAM library was found
|
||||||
|
# PAM_INCLUDE_DIRS - the PAM include directories
|
||||||
|
# PAM_LIBRARIES - the PAM libraries
|
||||||
|
|
||||||
|
# Find include directory
|
||||||
|
find_path(PAM_INCLUDE_DIR
|
||||||
|
NAMES security/pam_appl.h pam/pam_appl.h
|
||||||
|
HINTS
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
)
|
||||||
|
|
||||||
|
# Find library
|
||||||
|
find_library(PAM_LIBRARY
|
||||||
|
NAMES pam
|
||||||
|
HINTS
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib/x86_64-linux-gnu
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(PAM
|
||||||
|
REQUIRED_VARS PAM_LIBRARY PAM_INCLUDE_DIR
|
||||||
|
)
|
||||||
|
|
||||||
|
if(PAM_FOUND)
|
||||||
|
set(PAM_LIBRARIES ${PAM_LIBRARY})
|
||||||
|
set(PAM_INCLUDE_DIRS ${PAM_INCLUDE_DIR})
|
||||||
|
|
||||||
|
if(NOT TARGET PAM::PAM)
|
||||||
|
add_library(PAM::PAM UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(PAM::PAM PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${PAM_LIBRARY}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${PAM_INCLUDE_DIR}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(PAM_INCLUDE_DIR PAM_LIBRARY)
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
# FindPCRE2.cmake
|
||||||
|
#
|
||||||
|
# Find the PCRE2 library
|
||||||
|
#
|
||||||
|
# This module defines:
|
||||||
|
# PCRE2_FOUND - whether the PCRE2 library was found
|
||||||
|
# PCRE2_INCLUDE_DIRS - the PCRE2 include directories
|
||||||
|
# PCRE2_LIBRARIES - the PCRE2 libraries
|
||||||
|
# PCRE2_VERSION - the PCRE2 version
|
||||||
|
|
||||||
|
# Try pkg-config first
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
if(PkgConfig_FOUND)
|
||||||
|
pkg_check_modules(PC_PCRE2 QUIET libpcre2-8)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Find include directory
|
||||||
|
find_path(PCRE2_INCLUDE_DIR
|
||||||
|
NAMES pcre2.h
|
||||||
|
HINTS
|
||||||
|
${PC_PCRE2_INCLUDE_DIRS}
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
PATH_SUFFIXES
|
||||||
|
pcre2
|
||||||
|
)
|
||||||
|
|
||||||
|
# Find library
|
||||||
|
find_library(PCRE2_LIBRARY
|
||||||
|
NAMES pcre2-8 pcre2-8d pcre2
|
||||||
|
HINTS
|
||||||
|
${PC_PCRE2_LIBRARY_DIRS}
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
# Extract version from header
|
||||||
|
if(PCRE2_INCLUDE_DIR AND EXISTS "${PCRE2_INCLUDE_DIR}/pcre2.h")
|
||||||
|
file(STRINGS "${PCRE2_INCLUDE_DIR}/pcre2.h" PCRE2_VERSION_MAJOR_LINE
|
||||||
|
REGEX "^#define[ \t]+PCRE2_MAJOR[ \t]+[0-9]+")
|
||||||
|
file(STRINGS "${PCRE2_INCLUDE_DIR}/pcre2.h" PCRE2_VERSION_MINOR_LINE
|
||||||
|
REGEX "^#define[ \t]+PCRE2_MINOR[ \t]+[0-9]+")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+PCRE2_MAJOR[ \t]+([0-9]+)" "\\1"
|
||||||
|
PCRE2_VERSION_MAJOR "${PCRE2_VERSION_MAJOR_LINE}")
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+PCRE2_MINOR[ \t]+([0-9]+)" "\\1"
|
||||||
|
PCRE2_VERSION_MINOR "${PCRE2_VERSION_MINOR_LINE}")
|
||||||
|
set(PCRE2_VERSION "${PCRE2_VERSION_MAJOR}.${PCRE2_VERSION_MINOR}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(PCRE2
|
||||||
|
REQUIRED_VARS PCRE2_LIBRARY PCRE2_INCLUDE_DIR
|
||||||
|
VERSION_VAR PCRE2_VERSION
|
||||||
|
)
|
||||||
|
|
||||||
|
if(PCRE2_FOUND)
|
||||||
|
set(PCRE2_LIBRARIES ${PCRE2_LIBRARY})
|
||||||
|
set(PCRE2_INCLUDE_DIRS ${PCRE2_INCLUDE_DIR})
|
||||||
|
|
||||||
|
if(NOT TARGET PCRE2::PCRE2)
|
||||||
|
add_library(PCRE2::PCRE2 UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(PCRE2::PCRE2 PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${PCRE2_LIBRARY}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${PCRE2_INCLUDE_DIR}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(PCRE2_INCLUDE_DIR PCRE2_LIBRARY)
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
#
|
||||||
|
# 3proxy plugin definitions
|
||||||
|
#
|
||||||
|
# This file defines functions for building plugins
|
||||||
|
#
|
||||||
|
|
||||||
|
# Function to add a plugin with dependencies
|
||||||
|
function(add_3proxy_plugin PLUGIN_NAME)
|
||||||
|
set(options "")
|
||||||
|
set(oneValueArgs "")
|
||||||
|
set(multiValueArgs SOURCES LIBRARIES INCLUDE_DIRS COMPILE_DEFINITIONS LINK_OPTIONS)
|
||||||
|
|
||||||
|
cmake_parse_arguments(PLUGIN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(PLUGIN_SUFFIX ".dll")
|
||||||
|
else()
|
||||||
|
set(PLUGIN_SUFFIX ".ld.so")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_library(${PLUGIN_NAME} SHARED ${PLUGIN_SOURCES})
|
||||||
|
|
||||||
|
set_target_properties(${PLUGIN_NAME} PROPERTIES
|
||||||
|
PREFIX ""
|
||||||
|
SUFFIX ${PLUGIN_SUFFIX}
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||||
|
)
|
||||||
|
|
||||||
|
# Always link with Threads
|
||||||
|
target_link_libraries(${PLUGIN_NAME} PRIVATE Threads::Threads)
|
||||||
|
|
||||||
|
if(PLUGIN_LIBRARIES)
|
||||||
|
target_link_libraries(${PLUGIN_NAME} PRIVATE ${PLUGIN_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PLUGIN_INCLUDE_DIRS)
|
||||||
|
target_include_directories(${PLUGIN_NAME} PRIVATE ${PLUGIN_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PLUGIN_COMPILE_DEFINITIONS)
|
||||||
|
target_compile_definitions(${PLUGIN_NAME} PRIVATE ${PLUGIN_COMPILE_DEFINITIONS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PLUGIN_LINK_OPTIONS)
|
||||||
|
set_target_properties(${PLUGIN_NAME} PROPERTIES LINK_OPTIONS "${PLUGIN_LINK_OPTIONS}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_include_directories(${PLUGIN_NAME} PRIVATE
|
||||||
|
${CMAKE_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
@@ -1,12 +1,8 @@
|
|||||||
3proxy 0.7 Public License Agreement
|
3proxy 0.9 Public License Agreement
|
||||||
|
|
||||||
(c) 2000-2014 by 3APA3A (3APA3A@security.nnov.ru)
|
(c) 2000-2025 by 3APA3A (3APA3A@3proxy.ru)
|
||||||
(c) 2000-2014 by SecurityVulns.com (http://3proxy.ru/)
|
(c) 2000-2025 by 3proxy.org (https://3proxy.org/)
|
||||||
(c) 2000-2014 by Vladimir Dubrovin (vlad@sandy.ru)
|
(c) 2000-2025 by Vladimir Dubrovin (vlad@3proxy.org)
|
||||||
|
|
||||||
This software uses:
|
|
||||||
RSA Data Security, Inc. MD4 Message-Digest Algorithm
|
|
||||||
RSA Data Security, Inc. MD5 Message-Digest Algorithm
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
@@ -39,23 +35,23 @@ are met (BSD style license):
|
|||||||
Instead of this license, you can also use and redistribute this software under
|
Instead of this license, you can also use and redistribute this software under
|
||||||
terms of compatible license, including:
|
terms of compatible license, including:
|
||||||
|
|
||||||
1. Apache License, Version 2.0
|
1. Apache License, Version 2.0 or (at your option) any later version
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
2. GNU General Public License as published by
|
2. GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.gnu.org/licenses/gpl.txt
|
https://www.gnu.org/licenses/gpl.txt
|
||||||
|
|
||||||
3. GNU Lesser General Public License as published by the
|
3. GNU Lesser General Public License as published by the
|
||||||
Free Software Foundation; either version 2.1 of the License, or
|
Free Software Foundation; either version 2.1 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.gnu.org/licenses/lgpl.txt
|
https://www.gnu.org/licenses/lgpl.txt
|
||||||
|
|
||||||
|
|
||||||
Vendored
Whitespace-only changes.
Vendored
+60
@@ -0,0 +1,60 @@
|
|||||||
|
3proxy (1.0.1-1) buster; urgency=medium
|
||||||
|
|
||||||
|
*3proxy 1.0.1 initial build
|
||||||
|
|
||||||
|
-- z3APA3A <3apa3a@3proxy.org> Sat, 10 Oct 2026 16:21:01 +0000
|
||||||
|
|
||||||
|
3proxy (1.0.0-1) buster; urgency=medium
|
||||||
|
|
||||||
|
*3proxy 1.0.0 initial build
|
||||||
|
|
||||||
|
-- z3APA3A <3apa3a@3proxy.org> Sat, 22 Aug 2026 12:13:00 +0000
|
||||||
|
|
||||||
|
3proxy (0.9.9-1) buster; urgency=medium
|
||||||
|
|
||||||
|
*3proxy 0.9.9 initial build
|
||||||
|
|
||||||
|
-- z3APA3A <3apa3a@3proxy.org> Thu, 20 Aug 2026 18:29:37 +0300
|
||||||
|
|
||||||
|
3proxy (0.9.8-1) buster; urgency=medium
|
||||||
|
|
||||||
|
*3proxy 0.9.8 initial build
|
||||||
|
|
||||||
|
-- z3APA3A <3apa3a@3proxy.org> Fri, 07 Aug 2026 17:44:30 +0300
|
||||||
|
|
||||||
|
3proxy (0.9.7-1) buster; urgency=medium
|
||||||
|
|
||||||
|
*3proxy 0.9.7 initial build
|
||||||
|
|
||||||
|
-- z3APA3A <3apa3a@3proxy.org> Sat, 04 Jul 2026 11:55:03 +0300
|
||||||
|
|
||||||
|
3proxy (0.9.6-1) buster; urgency=medium
|
||||||
|
|
||||||
|
*3proxy 0.9.6 initial build
|
||||||
|
|
||||||
|
-- z3APA3A <3apa3a@3proxy.org> Sat, 11 Apr 2026 13:03:32 +0300
|
||||||
|
|
||||||
|
3proxy (0.9.5-1) buster; urgency=medium
|
||||||
|
|
||||||
|
*3proxy 0.9.5 initial build
|
||||||
|
|
||||||
|
-- z3APA3A <3apa3a@3proxy.org> Sun, 09 Mar 2025 15:55:48 +0300
|
||||||
|
|
||||||
|
3proxy (0.9.4-1) buster; urgency=medium
|
||||||
|
|
||||||
|
*3proxy 0.9.4 initial build
|
||||||
|
|
||||||
|
-- z3APA3A <3apa3a@3proxy.org> Fri, 02 Jul 2021 00:47:00 +0300
|
||||||
|
|
||||||
|
3proxy (0.9.3-1) buster; urgency=medium
|
||||||
|
|
||||||
|
*3proxy 0.9.3 initial build
|
||||||
|
|
||||||
|
-- z3APA3A <3apa3a@3proxy.org> Thu, 03 Dec 2020 21:13:58 +0300
|
||||||
|
|
||||||
|
3proxy (0.9.2-1) buster; urgency=medium
|
||||||
|
|
||||||
|
*3proxy 0.9.2 initial build
|
||||||
|
|
||||||
|
-- z3APA3A <3apa3a@3proxy.org> Thu, 19 Nov 2020 19:19:19 +0300
|
||||||
|
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
9
|
||||||
Vendored
+4
@@ -0,0 +1,4 @@
|
|||||||
|
/etc/3proxy/3proxy.cfg
|
||||||
|
/usr/local/3proxy/conf/3proxy.cfg
|
||||||
|
/usr/local/3proxy/conf/bandlimiters
|
||||||
|
/usr/local/3proxy/conf/counters
|
||||||
Vendored
+18
@@ -0,0 +1,18 @@
|
|||||||
|
Source: 3proxy
|
||||||
|
Maintainer: z3APA3A <3apa3a@3proxy.org>
|
||||||
|
Section: net
|
||||||
|
Priority: optional
|
||||||
|
Standards-Version: 4.0.0
|
||||||
|
Build-Depends: debhelper (>=10)
|
||||||
|
Homepage: https://3proxy.org/
|
||||||
|
Vcs-Git: https://github.com/z3APA3A/3proxy
|
||||||
|
Vcs-Browser: https://github.com/z3APA3A/3proxy
|
||||||
|
|
||||||
|
Package: 3proxy
|
||||||
|
Architecture: any
|
||||||
|
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||||
|
Description: tiny free proxy server
|
||||||
|
3Proxy tiny free proxy server is really tiny freeware proxy servers set.
|
||||||
|
It includes HTTP proxy with HTTPS and FTP support, SOCKSv4/SOCKSv4.5/SOCKSv5 proxy (socks/socks.exe), POP3 proxy, SMTP proxy, FTP proxy, caching DNS proxy, TCP and UDP portmappers.
|
||||||
|
You can use every proxy as a standalone program (socks, proxy, tcppm, udppm, tlspr) or use combined program (3proxy). Combined proxy additionally supports features like access control, bandwidth limiting, limiting daily/weekly/monthly traffic amount, proxy chaining, log rotation, syslog and ODBC logging, etc.
|
||||||
|
It's created to be small, simple and yet very functional.
|
||||||
Vendored
+13
@@ -0,0 +1,13 @@
|
|||||||
|
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
|
Upstream-Name: 3proxy
|
||||||
|
Upstream-Contact: 3proxy@3proxy.org
|
||||||
|
Source: https://3proxy.org/
|
||||||
|
|
||||||
|
Files: *
|
||||||
|
Copyright: 2000-2026 Vladimir Dubrovin <vlad@3proxy.org>
|
||||||
|
License: BSD-3-clause or Apache or GPL-2+ or LGPL-2+
|
||||||
|
|
||||||
|
Files: src/libs/blake2*.*
|
||||||
|
Copyright: 2012, Samuel Neves <sneves@dei.uc.pt>
|
||||||
|
License: public-domain (CC0 1.0 Universal) or OpenSSL license or Apache 2.0
|
||||||
|
|
||||||
Vendored
+43
@@ -0,0 +1,43 @@
|
|||||||
|
[ -f /bin/add3proxyuser ] && sed -i -e 's|@CMAKE_INSTALL_FULL_BINDIR@|/bin|g' -e 's|@3PROXY_CONFDIR@|/etc/3proxy/conf|g' -e 's|@CRYPT_PREFIX@|3proxy_|g' /bin/add3proxyuser; \
|
||||||
|
[ -f /etc/init.d/3proxy ] && sed -i -e 's|@CMAKE_INSTALL_FULL_BINDIR@|/bin|g' -e 's|@CMAKE_INSTALL_FULL_SYSCONFDIR@|/etc|g' -e 's|USER=proxy|USER=root|g' /etc/init.d/3proxy; \
|
||||||
|
[ -f /usr/lib/systemd/system/3proxy.service ] && sed -i -e 's|@CMAKE_INSTALL_FULL_BINDIR@|/bin|g' -e 's|@CMAKE_INSTALL_FULL_SYSCONFDIR@|/etc|g' -e 's|User=proxy|User=root|g' /usr/lib/systemd/system/3proxy.service; \
|
||||||
|
|
||||||
|
if [ -d /etc/3proxy ]; then \
|
||||||
|
chmod -R o-rwx /etc/3proxy; \
|
||||||
|
chown -R proxy:proxy /etc/3proxy; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d /usr/local/3proxy ]; then \
|
||||||
|
chmod -R o-rwx /usr/local/3proxy; \
|
||||||
|
chown -R proxy:proxy /usr/local/3proxy; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
if /bin/systemctl >/dev/null 2>&1; then \
|
||||||
|
/usr/sbin/update-rc.d 3proxy disable || true; \
|
||||||
|
/usr/sbin/chkconfig 3proxy off || true; \
|
||||||
|
/bin/systemctl enable 3proxy.service; \
|
||||||
|
elif [ -x /usr/sbin/update-rc.d ]; then \
|
||||||
|
/usr/sbin/update-rc.d 3proxy defaults; \
|
||||||
|
/usr/sbin/update-rc.d 3proxy enable; \
|
||||||
|
elif [ -x /usr/sbin/chkconfig ]; then \
|
||||||
|
/usr/sbin/chkconfig 3proxy on; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo 3proxy installed.
|
||||||
|
if /bin/systemctl >/dev/null 2>&1; then \
|
||||||
|
/bin/systemctl stop 3proxy.service ;\
|
||||||
|
/bin/systemctl start 3proxy.service ;\
|
||||||
|
echo use ;\
|
||||||
|
echo " "systemctl start 3proxy.service ;\
|
||||||
|
echo to start proxy ;\
|
||||||
|
echo " "systemctl stop 3proxy.service ;\
|
||||||
|
echo to stop proxy ;\
|
||||||
|
elif [ -x /usr/sbin/service ]; then \
|
||||||
|
/usr/sbin/service 3proxy stop || true;\
|
||||||
|
/usr/sbin/service 3proxy start || true;\
|
||||||
|
echo " "service 3proxy start ;\
|
||||||
|
echo to start proxy ;\
|
||||||
|
echo " "service 3proxy stop ;\
|
||||||
|
echo to stop proxy ;\
|
||||||
|
fi
|
||||||
Vendored
+4
@@ -0,0 +1,4 @@
|
|||||||
|
if [ -x /usr/sbin/useradd ]; then \
|
||||||
|
/usr/bin/getent group proxy >/dev/null || (/usr/sbin/groupadd -f -r proxy || true); \
|
||||||
|
/usr/bin/getent passwd proxy >/dev/null || (/usr/sbin/useradd -Mr -s /bin/false -g proxy -c 3proxy proxy || true); \
|
||||||
|
fi
|
||||||
Vendored
+23
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/make -f
|
||||||
|
|
||||||
|
%:
|
||||||
|
dh $@
|
||||||
|
|
||||||
|
override_dh_auto_configure:
|
||||||
|
ln -sf Makefile.Linux Makefile
|
||||||
|
|
||||||
|
override_dh_auto_build:
|
||||||
|
$(MAKE)
|
||||||
|
|
||||||
|
override_dh_auto_install:
|
||||||
|
$(MAKE) DESTDIR=debian/3proxy install
|
||||||
|
|
||||||
|
override_dh_installman:
|
||||||
|
|
||||||
|
override_dh_usrlocal:
|
||||||
|
|
||||||
|
override_dh_auto_clean:
|
||||||
|
find src/ -type f -name "*.o" -delete
|
||||||
|
find src/ -type f -name "Makefile.var" -delete
|
||||||
|
find bin/ -type f -executable -delete
|
||||||
|
rm -f Makefile
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
3.0 (quilt)
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
3proxy 0.7
|
||||||
|
|
||||||
|
This release is partially forced: while no new significant functions are
|
||||||
|
added, 0.7 is code is much more stable and less buggy than 0.6. Since
|
||||||
|
there is no new development for a long time, except few minor bugfixes,
|
||||||
|
I decided to finally release 0.7. You may want it if you:
|
||||||
|
|
||||||
|
Use HTTP proxy
|
||||||
|
Use 3proxy under *BSD/Mac OS X/iPhone OS
|
||||||
|
Use plugins, specially traffic related ones, like PCRE.
|
||||||
|
|
||||||
|
I have no time for active developement. There are interesting features
|
||||||
|
in nearly ready state, e.g. SSL support / SSL decryption via
|
||||||
|
certificates spoofing, NAT support and SSL auto-detection. You can step
|
||||||
|
into development, if you are interested.
|
||||||
|
|
||||||
|
There are some configuration changes:
|
||||||
|
|
||||||
|
auth iponly is now default (because most misconfigurations were
|
||||||
|
because of default auth none)
|
||||||
|
maxconn is now 500 by default (because WebKit browsers ignore
|
||||||
|
standards and create a lot of connections even if proxy is configured)
|
||||||
|
NTLM is disabled by default (-n options, -n1 to enable) because
|
||||||
|
NTLMv1 is disabled by default in Windows since Vista and there is no
|
||||||
|
NTLMv2 library with compatible license. Report me, if any.
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
3proxy-0.7.1.4
|
||||||
|
|
||||||
|
!! Fix transparent flag not reset after keep-alive connection, can lead to
|
||||||
|
|
||||||
|
|
||||||
|
3proxy-0.7.1.3
|
||||||
|
|
||||||
|
! traffic displayed incorrectly
|
||||||
|
! archiver doesn't add suffix if logname contains macro
|
||||||
|
! fix potential race condition on configuration reload
|
||||||
|
! fix FTP over HTTP authentication
|
||||||
|
|
||||||
|
|
||||||
|
3proxy-0.7.1.2
|
||||||
|
|
||||||
|
! Request / header size limitation relaxed for HTTP proxy
|
||||||
|
|
||||||
|
|
||||||
|
3proxy 0.7.1.1
|
||||||
|
|
||||||
|
! Linux compilation issues resolved
|
||||||
|
|
||||||
|
|
||||||
|
3proxy 0.7.1
|
||||||
|
|
||||||
|
Minor improvements and bugfixes:
|
||||||
|
|
||||||
|
+ Windows icons added
|
||||||
|
+ Warnings added for most common misconfigurations
|
||||||
|
+ ftppr NLSD command supported
|
||||||
|
! Ignore NTLM handshake if NTLM is not enabled
|
||||||
|
!! memcpy replaced with memmove for overlapped region
|
||||||
|
! better EINTR handling on *nix
|
||||||
|
! FTP proxy debugging output removed (introduced in 0.7), binding for data connection corrected
|
||||||
|
! memory leak fixed in ldapauth plugin
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
+ IPv6 support
|
||||||
|
+ back connect support
|
||||||
|
+ name resolution over TCP, parent proxy support for dnspr
|
||||||
|
+ SSLPlugin for TLS/SSL traffic decryption
|
||||||
|
! multiple race conditions fixed
|
||||||
|
! reduced memory usage
|
||||||
|
! Generate Forwarded: header instead of X-Forwarded-For:
|
||||||
|
! Default name resolution is non-blocking in *nix
|
||||||
|
! multiple race conditions fixed on configuration reload
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
!!Fix: destination IP may be not checked against ACL
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
! Fix: parent proxy can be used in some cases where it shouldn't
|
||||||
|
! Fix: bandlimiters may not work for older connections on configuration reload
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
Minor bugfixes / improvements:
|
||||||
|
! Fixed: deadlock on insufficient resources
|
||||||
|
! Fixed: race condition in ssl_plugin
|
||||||
|
! Fixed: minor memory leak on configuration reload
|
||||||
|
! Fixed: recursion detection was not working
|
||||||
|
! Fixed: %n for IPv6 in logging terminates log record
|
||||||
|
! Fixed: reverse PTR validation (required for dnsauth)
|
||||||
|
! Fixed: error on external 0.0.0.0 for NOIPV6 (light version)
|
||||||
|
+ Better support for IPv6 in ftppr
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
Bugfixes:
|
||||||
|
! Fixed hostname support in SOCKSv5 UDP portmapping
|
||||||
|
! -fno-strict-aliasing added to gcc options (compiling without this option can lead to unpredictable issues under Debian with gcc 6 and potentially others)
|
||||||
|
! Fixed LDAP plugin compilation issues (LDAP plugin is still listed as unsupported though)
|
||||||
|
and some minor fixes and improvements.
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
Bugfixes:
|
||||||
|
!! Fixed out-of-bound write and few minor bugs on configuration saving in admin
|
||||||
|
! fixed: $ is not correctly handled in the beginning of quoted line on configuration parsing
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
!! Fix transparent flag not reset after keep-alive connection, can lead to DoS by authenticated user.
|
||||||
|
! Do not use SO_REUSEADDR by default (leads to random 00013 errors under some glibc versions)
|
||||||
|
! Use SASIZE() instead of sizeof() in bind() for FreeBSD compatibility
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
! fixed: use SASIZE() instead of sizeof() in connect() for FreeBSD compatibility
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
+ Build PamPlugin on *nix
|
||||||
|
+ stacksize and -S options, stacksize defaults changed for FreeBSD
|
||||||
|
+ extip redirection type added
|
||||||
|
! SSL plugin fix to correct handling of certificates path
|
||||||
|
! fixed random errors on IPv6 connect
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
!Fix: mutex was used prior to initialization on 'log' command processing
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
! Fix: random 00012 errors in some configurations
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
! Fix 'daemon' command for Linux
|
||||||
|
! Fix 'extip' redirections 00009 errors
|
||||||
|
! Fix counters for older Win platforms
|
||||||
|
! Resolve logging race conditions
|
||||||
|
! attempt to fix pam_auth race conditions
|
||||||
|
! FTP proxy workaround for broken gethostname() on some libc limplementations
|
||||||
|
! authcache IP matching corrected
|
||||||
|
! fix SOCKSv5 BIND/UDP ASSOC
|
||||||
|
! use setreuid/setregid instead of setuid / setgid
|
||||||
|
|
||||||
|
+ OpenWatcom makefiles for Windows
|
||||||
|
+ -u2 support for proxy
|
||||||
|
+ support %i in logformat
|
||||||
|
+ force/noforce configuration commands to disconnect / do not disconnect clients if nolonger match ACL after configuration change
|
||||||
|
+ support longer external passwords
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
!! Fix resolver for non-compressed reply parsing (on mixed-case sensitive resolvers)
|
||||||
|
! Fix plugins export on OpenWatcom compiler (light version)
|
||||||
|
! Fix SOCKSv5
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
! Fix: tcppm may fail if used with parent proxy
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
+ Socket options, interface binding
|
||||||
|
+ Connection limiting / connection rate limiting
|
||||||
|
+ RADIUS support (beta)
|
||||||
|
+ Zero copy (splice) support for Linux
|
||||||
|
+ Possibility to limit user to single IP (via authentication cache)
|
||||||
|
! bugfixes, improvements
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
Bugfixes:
|
||||||
|
! Fixed: socket may be closed before all data received/sent
|
||||||
|
! Fixed: bandlimin non-working
|
||||||
|
! Fixed: countall/nocountall
|
||||||
|
! Fixed: few race conditions
|
||||||
|
|
||||||
|
Improvements:
|
||||||
|
+ deb/rpm build, systemd support (experimental)
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
Bugfixes:
|
||||||
|
! Fixed: bandwidth limiters (once again)
|
||||||
|
! Fixed: data filtering plugins (PCREPlugin, SSLPlugin). SSLPlugin use on Linux requires to disable splice (-s0)
|
||||||
|
! FIxed: standalone proxies do not react on HUP (Ctrl+C) in Linux/Unix
|
||||||
|
! Fixed: few minor bugs
|
||||||
|
|
||||||
|
Improvements:
|
||||||
|
+ deb for arm platforms (experimental)
|
||||||
|
+ Openssl 1.1 support for SSLPlugin
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
Bugfixes:
|
||||||
|
! Fixed: systemd description file (proxy may fail to start after reboot or via systemctl)
|
||||||
|
! Fixed: group/account creation in installation scripts
|
||||||
|
! Fixed: countall/nocounall do not work in some configurations
|
||||||
|
! Fixed: counters do not work if counter file is not specified
|
||||||
|
! Fixed: counters without rotation (type N) are incorrectly shown in web admin interface
|
||||||
|
! Fixed: %n may be incomplete or missed in long log records
|
||||||
|
! Fixed: connect back functionality does not work
|
||||||
|
|
||||||
|
Improvements:
|
||||||
|
+ Docker builds
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
! Fix: invalid handling of '-' character in ACL hostname
|
||||||
|
! Fix: minor bugfixes and improvements
|
||||||
|
+ parentretry command added (defaults to 2) to retry connections to parent proxies
|
||||||
|
- icqpr related code (OSCAR proxy) removed, due to drop of OSCAR support by messengers
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
!! Security fix: proxy can potentially crash on on some platforms due to overlapping regions in strcpy() (thanks to @lenix123 for reporting)
|
||||||
|
+ new proxy service type: `tlspr` - SNI proxy, may also be used as parent `tls` type, sniffs hostname from TLS handhake, read more in https://github.com/3proxy/3proxy/wiki/tlspr https://github.com/3proxy/3proxy/wiki/How-To-(incomplete)#TLSPR
|
||||||
|
+ new proxy service type: `auto` - autodetect proxy type between `proxy` and `socks`
|
||||||
|
+ SSLPlugin is rewritten, production-ready, supports TLS (SSL) server (may be used to create https:// type proxy), certificates checks and cypher options, see https://github.com/3proxy/3proxy/wiki/SSLPlugin
|
||||||
|
+ -g option is added for grace delay to reduce CPU load, see https://github.com/3proxy/3proxy/wiki/High-Load
|
||||||
|
! Multiple minor bugfixes
|
||||||
|
! More supported sockets options
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
+ ssl_client and multiple configuration options added to SSLPlugin, SSLPlugin code significantly improved and bugfixed. See https://github.com/3proxy/3proxy/wiki/SSLPlugin. 3proxy can now be used as stunnel replacement for many scenarios.
|
||||||
|
+ HAProxy proxy protocol v1 support as client and server, add -H option for service to expect HA proxy v1 protocol header, use ha parent type: parent 1000 ha 0.0.0.0 0 to send v1 header.
|
||||||
|
+ tlspr is supported in auto
|
||||||
|
+ tlspr supports -s option, it breaks HELLO packet to prevent some DPIs from detecting SNI
|
||||||
|
+ maxseg configuration option and TCP_MAXSEG socket flag support added. It sets maximum size of TCP segment to fix PathMTU discovery problems
|
||||||
|
+ -Ne / -Ni options added to specify external / internal NAT address for SOCKSv5
|
||||||
|
+ cmake environment added
|
||||||
|
! External pcre2 (pcre2-8) library is used for PCRE, pcre code is removed from 3proxy
|
||||||
|
! Multiple minor bugfixes
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
+ PCRE2 and SSL/TLS code moved from plugins into main 3proxy binary; dynamic linking with ssl/pcre by default, STATIC/LIBSTATIC options for static linking
|
||||||
|
+ Unix sockets support for parent proxies, tcppm, internal listeners and -i option; abstract (fileless) unix sockets on Linux
|
||||||
|
+ ssl_client_mode = 3 to use 'secure' parent types: https, tcps, socks5s, connect+s, etc.
|
||||||
|
+ New authcache types: cacheacl, dstaddr, dstport, dsthost, dstoper, srvaddr, srvport; authcache is now configurable per service
|
||||||
|
+ Hashtables for password lists and authcache, faster password lookups
|
||||||
|
+ 3proxy_crypt: new internal password hashing replacing mycrypt
|
||||||
|
+ udppm switched to hashtables and supports multiple connections
|
||||||
|
+ SOCKSv5 UDP parent support; -Ne/-Ni NAT options
|
||||||
|
+ Docker images for more platforms, signed; DLLs signed; public cert added to build
|
||||||
|
+ Grace sleep and linger on connection close; correctly process half-closed connections
|
||||||
|
+ Allow setting internal/external network namespaces on Linux
|
||||||
|
- icqpr/OSCAR code removed
|
||||||
|
! Fix: invalid error in SSL server handshake could break service state
|
||||||
|
! Fix: invalid offset in datafilters
|
||||||
|
! Fix: invalid socket in poll() could break sockmap() on Windows
|
||||||
|
! Fix: deadlock in ftppr
|
||||||
|
! Fix: crash on standalone services
|
||||||
|
! Fix: non-initialized mutex crash under Windows
|
||||||
|
! Fix: socks v5 parent with no auth
|
||||||
|
! Fix: hanging connections in sockmap; unneeded poll in sockmap
|
||||||
|
! Fix: symbols collision with OpenSSL could lead to crash
|
||||||
|
! Fix: compatibility with older SSL versions and older Windows (7 and below)
|
||||||
|
! Multiple minor bugfixes and code cleanup
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
!! Fix: use-after-free on the ftp:// request path in HTTP proxy, a request buffer reallocation left a stale pointer; heap corruption, requires authenticated access
|
||||||
|
!! Fix: buffer overflow in radsend() with an oversized request hostname; RADIUS is experimental, log radius or auth radius with fakeresolve is required to reach it
|
||||||
|
!! Fix: buffer overflow in smtpp when relaying AUTH LOGIN credentials to a server which offers AUTH PLAIN only; requires authorised access to smtpp
|
||||||
|
!! Fix: out-of-bounds read in tlspr on a malformed TLS ClientHello
|
||||||
|
!! Fix: LDAP injection and unsafe counter file names in LdapPlugin; the plugin is unsupported and is not built with 3proxy
|
||||||
|
!! Fix: password and hash comparison in strong authentication is constant-time now
|
||||||
|
!! Fix: bounds validation and match/depth limits in pcre filters
|
||||||
|
+ imapp: IMAPv4 proxy added, supports LOGIN command, AUTH PLAIN and AUTH LOGIN
|
||||||
|
+ STARTTLS support for smtpp, pop3p, imapp and tlspr, on both client and server side; -x option to disable
|
||||||
|
+ wolfSSL is supported as an alternative TLS backend, WOLFSSL_CHECK=true selects it (wolfSSL must be built with --enable-opensslextra)
|
||||||
|
+ Chunked Transfer-Encoding from client is supported by HTTP proxy
|
||||||
|
+ dnspr: -F option added, fake resolve to redirect traffic
|
||||||
|
+ ucrt64 build support; static libraries support in Makefile.win
|
||||||
|
+ minimal and busybox Docker images switched to musl + wolfSSL
|
||||||
|
- splice() support is not built by default anymore, it is slower than the read/write path for most traffic; add -DWITHSPLICE to build it
|
||||||
|
! Fix: hashtable item was added with wrong index on table grow; with large username/password tables it could cause a single record to be missing
|
||||||
|
! Fix: race conditions; stack overflow on FreeBSD
|
||||||
|
! Fix: generated certificates are X.509 v3 with basicConstraints CA:FALSE and extendedKeyUsage serverAuth, required by Apple TLS stack and by Chrome on macOS/iOS
|
||||||
|
! Fix: dnspr was broken since udppm rewrite
|
||||||
|
! Fix: short cleartext passwords failed authentication
|
||||||
|
! Fix: parent negotiation after sending PROXY protocol header
|
||||||
|
! Fix: maxchild dropped to 100 on config reload if not set explicitly
|
||||||
|
! Fix: getrandom() is not used with glibc below 2.25
|
||||||
|
! Fix: IPV6_BOUND_IF definition for legacy MacOS
|
||||||
|
! Fix: cmake build, arm64 Docker build, Makefile.win with UCRT
|
||||||
|
! Multiple minor bugfixes and code cleanup
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
! Fix: DNS replies are validated now: a reply from an address other than the nameserver the query was sent to, and a reply with a question section not matching the query, are dropped; both were accepted before
|
||||||
|
! Fix: socket leak with SOCKSv5 UDP ASSOCIATE through a parent proxy, sockets were accumulated in CLOSE_WAIT state until descriptors ran out
|
||||||
|
! Fix: file descriptor leak in HTTP proxy on the ftp:// request path
|
||||||
|
! Fix: crash with illegal instruction on some platforms (e.g. some musl based Linux builds), caused by a memcpy on overlapping buffers
|
||||||
|
! Fix: extip and ha (HAProxy PROXY protocol) parents are applied to SOCKSv5 UDP ASSOCIATE now
|
||||||
|
! Fix: only socks5 and socks5+ parents are tried for UDP ASSOCIATE, other parent types can not be used for UDP
|
||||||
|
! Fix: udppm through a SOCKSv5 parent did not work
|
||||||
|
! Fix: -Ne and -Ni options were never applied, the option letter was not parsed; -Ne is not applied to the UDP ASSOCIATE reply anymore, -Ni is applied to it
|
||||||
|
! Fix: -4 / -6 handling for UDP in socks; a single UDP association can use both IPv4 and IPv6 destinations now
|
||||||
|
! Fix: a datagram with a null destination address is dropped now
|
||||||
|
! Fix: DNS over TCP: a reply which did not fit a single read was never processed
|
||||||
|
! Documentation: "How to apply ACLs to UDP traffic" added to HOWTO; authentication cache, ACL and UDP notes added to "Optimizing 3proxy for High Load" and to security recommendations
|
||||||
|
+ SOCKSv5 UDP: the destination of every datagram is authorized, so ACLs limiting the destination address, host name or port apply to UDP traffic now; the parent proxy and the external address are selected for the destination of the datagram and not for the UDP ASSOCIATE request
|
||||||
|
+ socks: -U option to control what happens when the destination changes within an UDP association: log it, authorize it, both (default) or neither
|
||||||
|
+ -C option (for TCP services) to terminate the session as soon as any of the sides closes the connection; by default the session is kept until both sides close it (TCP half-close)
|
||||||
|
+ timeouts: LINGER value added (11th, default 5), used to deliver buffered data after one of the sides has closed its sending side and as SO_LINGER value on outgoing connections
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
No changes in 3proxy code, this release only changes how packages are built, signed and published.
|
||||||
|
|
||||||
|
! Fix: TLS, PCRE2 and PAM support was silently left out when 3proxy was built on a system whose /bin/sh is not dash, which is every RPM based distribution and macOS; the library checks built their test program with echo and escape sequences, which only dash expands, so every check failed and the features were dropped without a diagnostic
|
||||||
|
! Fix: rpm packages were built on Ubuntu and required glibc 2.38, libssl.so.3 and libpcre2-8, which no RPM based distribution provides, so they could not be installed anywhere; they are built against AlmaLinux 8, 9 and 10 now and carry an el8, el9 or el10 tag, covering RHEL, AlmaLinux, Rocky and CentOS Stream of the same version
|
||||||
|
! Fix: the rpm package depended on its own interpreter, /bin/3proxy, taken from the first line of the installed configuration file, and could not be installed on el9 or el10 because rpm resolves that dependency to /usr/bin/3proxy
|
||||||
|
! Fix: deb packages required glibc 2.38 and libssl3t64 and installed on Ubuntu 24.04 and newer only; they are built against Ubuntu 22.04 now and install on Ubuntu 22.04 and later as well as Debian 12 and later
|
||||||
|
+ Signed apt and dnf repositories are published at https://3proxy.org/repo/ in two channels: current, built from the master branch, and lts, built from the 0.9 branch; packages and repository metadata are both signed
|
||||||
|
+ Release binaries are published with SHA256 checksums, an OpenPGP signature and a GitHub build provenance attestation; docker images are signed and attested as well
|
||||||
|
+ The release signing key is an RSA-4096 key published as 3proxy-release-key.asc in the repository; rpm 4.14 and earlier can not import an Ed25519 key at all, which would leave RHEL 8 and its derivatives unable to verify anything
|
||||||
|
+ Packages are reproducible: rebuilding a release produces byte identical deb and rpm files, every timestamp is derived from the build date recorded for the release
|
||||||
|
- 32-bit ARM (armhf) is published as a deb package only, Enterprise Linux has no 32-bit ARM build
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
! Fix: crash (segmentation fault) on configuration reload (SIGUSR1) on a busy server: a closing session could still use its service after the reload had freed it; the race existed since 0.9.7, the 5 second linger added in 0.9.9 made it much more likely (#1278)
|
||||||
|
! Fix: -Di and -De (bind to interface) were not applied to SOCKSv5 UDP ASSOCIATE and BIND sockets, the FTP proxy data connection and connect back (#1277)
|
||||||
|
! Fix: SOCKSv5 UDP ASSOCIATE over IPv6: the source address of a datagram was truncated and the reply was sent to the wrong address (#1279)
|
||||||
|
! Fix: SOCKSv5 UDP ASSOCIATE: an access rule with host names matched any datagram sent to a literal address; the address is used as the host name now, as it is for TCP requests
|
||||||
|
! Fix: a request rewritten with pcre_rewrite was only logged and was sent unchanged to the server on a direct connection; the rewritten path and query are what the server receives now
|
||||||
|
! Fix: buffer could be insufficient for the headers the HTTP proxy adds after a pcre_rewrite had grown the request
|
||||||
|
! Fix: heap buffer overflow in pcre_rewrite: a $N reference to a group which did not match was written out as its digits, which the space allocated for the result did not count
|
||||||
|
! Fix: pcre_extend did nothing, the rules it appended were never consulted; the manual described an argument the command does not take
|
||||||
|
! Fix: certificates generated for TLS MitM (openssl) carried no subject and authority key identifiers and were refused by strict verifiers, including macOS clients, OpenSSL with x509_strict and Python 3.13
|
||||||
|
! Fix: null pointer dereference in ftppr on PASS without USER and in smtpp on a user name without a host
|
||||||
|
! Fix: no service started with wolfSSL on glibc: the default thread stack was too small for wolfSSL thread-local storage, pthread_create() failed and the failure was not reported
|
||||||
|
! Fix: dnspr did not work on Windows; Windows builds answer UDP from a socket of their own again
|
||||||
|
+ Built-in HTTP server: httpsrv service with http rules to serve files (cached or with sendfile / TransmitFile), redirects, rewrites, fixed replies and proxypass to forward requests as the proxy does, so one port can serve both a site and a proxy; admin is httpsrv with the administration pages
|
||||||
|
+ Host names in access rules may be regular expressions with a pcre: (or regex:) prefix
|
||||||
|
+ transparent / notransparent commands: transparent proxying is built in (netfilter on Linux, pf on BSD, socket for divert-to and ipfw fwd), TransparentPlugin is removed and a configuration loading it keeps working
|
||||||
|
+ parent: weight may be written as a fraction (.5) or a percentage (50%); weight 0 is a fallback parent used only when every weighted parent of its group has failed; a failed parent is left out of the next attempt of the same connection
|
||||||
|
+ parent extport / intport: range of local ports for outgoing connections and for sockets facing the client (UDP ASSOCIATE, FTP data)
|
||||||
|
+ A parent given by host name is resolved for each connection when nserver is used, instead of once on configuration load
|
||||||
|
+ $$ in the configuration stands for a single dollar sign, a dollar inside quotes is ordinary text
|
||||||
|
+ OpenWrt package (procd init script, UCI configuration) and OpenWrt builds for mipsel_24kc, mips_24kc, arm_cortex-a7_neon-vfpv4 and aarch64_cortex-a53
|
||||||
|
- pop3p, imapp, smtpp and ftppr are not in a default build: build with MAILPROXY=true and FTP=true (CMake: 3PROXY_USE_MAILPROXY, 3PROXY_USE_FTP); without them the mail proxies run as tlspr negotiating STARTTLS, and ftppr refuses clients
|
||||||
|
- FTP over HTTP proxy (ftp:// URLs) is not in a default build either and has to be enabled explicitly: build with FTP=true (CMake: 3PROXY_USE_FTP), without it the HTTP proxy does not fetch ftp:// URLs
|
||||||
|
- Windows binaries are no longer signed with a self-signed Authenticode certificate, it gave no trust and triggered antivirus false positives
|
||||||
@@ -1,508 +0,0 @@
|
|||||||
{\rtf1\adeflang1025\ansi\ansicpg1251\uc1\adeff0\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1049\deflangfe1049{\fonttbl{\f0\froman\fcharset204\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fmodern\fcharset204\fprq1{\*\panose 02070309020205020404}Courier New;}
|
|
||||||
{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f10\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}{\f39\froman\fcharset0\fprq2 Times New Roman;}{\f37\froman\fcharset238\fprq2 Times New Roman CE;}
|
|
||||||
{\f40\froman\fcharset161\fprq2 Times New Roman Greek;}{\f41\froman\fcharset162\fprq2 Times New Roman Tur;}{\f42\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f43\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
|
||||||
{\f44\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f45\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f59\fmodern\fcharset0\fprq1 Courier New;}{\f57\fmodern\fcharset238\fprq1 Courier New CE;}
|
|
||||||
{\f60\fmodern\fcharset161\fprq1 Courier New Greek;}{\f61\fmodern\fcharset162\fprq1 Courier New Tur;}{\f62\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f63\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}
|
|
||||||
{\f64\fmodern\fcharset186\fprq1 Courier New Baltic;}{\f65\fmodern\fcharset163\fprq1 Courier New (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;
|
|
||||||
\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{
|
|
||||||
\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 \snext0 Normal;}{\*\cs10 \additive \ssemihidden
|
|
||||||
Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
|
|
||||||
\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}}
|
|
||||||
{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\listtable{\list\listtemplateid-1938272566{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\'00;}{\levelnumbers\'01;}\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \fbias0 \fi-360\li360\jclisttab\tx360\lin360 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03\'00.\'01;}{\levelnumbers\'01\'03;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0
|
|
||||||
\fi-360\li360\jclisttab\tx360\lin360 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'05\'00.\'01.\'02;}{\levelnumbers\'01\'03\'05;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li720
|
|
||||||
\jclisttab\tx720\lin720 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'07\'00.\'01.\'02.\'03;}{\levelnumbers\'01\'03\'05\'07;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li720
|
|
||||||
\jclisttab\tx720\lin720 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'09\'00.\'01.\'02.\'03.\'04;}{\levelnumbers\'01\'03\'05\'07\'09;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0
|
|
||||||
\fi-1080\li1080\jclisttab\tx1080\lin1080 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0b\'00.\'01.\'02.\'03.\'04.\'05;}{\levelnumbers\'01\'03\'05\'07\'09\'0b;}\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \fbias0 \fi-1080\li1080\jclisttab\tx1080\lin1080 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0d\'00.\'01.\'02.\'03.\'04.\'05.\'06;}{\levelnumbers
|
|
||||||
\'01\'03\'05\'07\'09\'0b\'0d;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1440\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
|
|
||||||
\'0f\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1440\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1
|
|
||||||
\levelspace0\levelindent0{\leveltext\'11\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07.\'08;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f\'11;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1800\li1800\jclisttab\tx1800\lin1800 }{\listname ;}\listid233053280}
|
|
||||||
{\list\listtemplateid269381388\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid1994686728\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0
|
|
||||||
\fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-2036938464\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }
|
|
||||||
{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid1578941516\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255
|
|
||||||
\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid936021434\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0
|
|
||||||
\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-1323636224\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0
|
|
||||||
{\leveltext\leveltemplateid-1892018578\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-108487922
|
|
||||||
\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-4969626\'00;}{\levelnumbers;}\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid1135759886\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listname
|
|
||||||
;}\listid243993609}{\list\listtemplateid1411046654{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat2\levelspace0\levelindent0{\leveltext\'01\'00;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li360
|
|
||||||
\jclisttab\tx360\lin360 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat2\levelspace0\levelindent0{\leveltext\'03\'00.\'01;}{\levelnumbers\'01\'03;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li720\jclisttab\tx720\lin720 }
|
|
||||||
{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'05\'00.\'01.\'02;}{\levelnumbers\'01\'03\'05;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li1440\jclisttab\tx1440\lin1440 }{\listlevel
|
|
||||||
\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'07\'00.\'01.\'02.\'03;}{\levelnumbers\'01\'03\'05\'07;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li1800\jclisttab\tx1800\lin1800 }{\listlevel
|
|
||||||
\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'09\'00.\'01.\'02.\'03.\'04;}{\levelnumbers\'01\'03\'05\'07\'09;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1080\li2520\jclisttab\tx2520\lin2520 }
|
|
||||||
{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0b\'00.\'01.\'02.\'03.\'04.\'05;}{\levelnumbers\'01\'03\'05\'07\'09\'0b;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1080\li2880
|
|
||||||
\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0d\'00.\'01.\'02.\'03.\'04.\'05.\'06;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d;}\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\fbias0 \fi-1440\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0f\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07;}{\levelnumbers
|
|
||||||
\'01\'03\'05\'07\'09\'0b\'0d\'0f;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1440\li3960\jclisttab\tx3960\lin3960 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
|
|
||||||
\'11\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07.\'08;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f\'11;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1800\li4680\jclisttab\tx4680\lin4680 }{\listname ;}\listid368384829}{\list\listtemplateid1424627480\listhybrid
|
|
||||||
{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid1868871046\'01-;}{\levelnumbers;}\loch\af0\hich\af0\dbch\af0\fbias0 \fi-360\li420\jclisttab\tx420\lin420 }{\listlevel
|
|
||||||
\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid68747267\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1140\jclisttab\tx1140\lin1140 }{\listlevel\levelnfc23\levelnfcn23
|
|
||||||
\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid68747269\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li1860\jclisttab\tx1860\lin1860 }{\listlevel\levelnfc23\levelnfcn23\leveljc0
|
|
||||||
\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid68747265\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2580\jclisttab\tx2580\lin2580 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
|
|
||||||
\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid68747267\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3300\jclisttab\tx3300\lin3300 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
|
|
||||||
\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid68747269\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4020\jclisttab\tx4020\lin4020 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative
|
|
||||||
\levelspace0\levelindent0{\leveltext\leveltemplateid68747265\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li4740\jclisttab\tx4740\lin4740 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0
|
|
||||||
\levelindent0{\leveltext\leveltemplateid68747267\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5460\jclisttab\tx5460\lin5460 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
|
|
||||||
\leveltemplateid68747269\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6180\jclisttab\tx6180\lin6180 }{\listname ;}\listid634527506}{\list\listtemplateid1914202178\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0
|
|
||||||
\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid745160830\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0
|
|
||||||
\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-1816475770\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0
|
|
||||||
{\leveltext\leveltemplateid-715330988\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid1569232270
|
|
||||||
\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-297370836\'00;}{\levelnumbers;}\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-346936770\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel
|
|
||||||
\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid416698944\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0
|
|
||||||
\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-596467262\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0
|
|
||||||
\levelspace0\levelindent0{\leveltext\leveltemplateid11278156\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listname ;}\listid1261259807}}{\*\listoverridetable{\listoverride\listid1261259807\listoverridecount0\ls1}
|
|
||||||
{\listoverride\listid634527506\listoverridecount0\ls2}{\listoverride\listid233053280\listoverridecount0\ls3}{\listoverride\listid243993609\listoverridecount0\ls4}{\listoverride\listid368384829\listoverridecount0\ls5}}{\*\rsidtbl \rsid1339617\rsid1586505
|
|
||||||
\rsid1600374\rsid1771507\rsid1986875\rsid2235853\rsid2296829\rsid2567226\rsid2701137\rsid3560132\rsid3671104\rsid3692728\rsid4980816\rsid5776876\rsid5975359\rsid6257560\rsid6570302\rsid7013593\rsid7235628\rsid7749673\rsid8087560\rsid8326885\rsid8672163
|
|
||||||
\rsid8675175\rsid9981679\rsid10440144\rsid10497064\rsid10908886\rsid12060716\rsid12261729\rsid12544729\rsid12806430\rsid13111076\rsid13909505\rsid15236432\rsid15609114\rsid15928529\rsid16077654}{\*\generator Microsoft Word 11.0.0000;}{\info
|
|
||||||
{\title 3proxy developer reference}{\author Vladimir Dubrovin}{\operator Vladimir Dubrovin}{\creatim\yr2007\mo11\dy23\hr19\min28}{\revtim\yr2008\mo1\dy22\hr19\min28}{\version8}{\edmins86}{\nofpages8}{\nofwords2396}{\nofchars13662}{\*\company Sandy}
|
|
||||||
{\nofcharsws16026}{\vern24611}{\*\password 00000000}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}{\xmlns2 urn:schemas-microsoft-com:office:smarttags}}
|
|
||||||
\paperw11906\paperh16838\margl1701\margr850\margt1134\margb1134\gutter0\ltrsect
|
|
||||||
\deftab708\widowctrl\ftnbj\aenddoc\donotembedsysfont1\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin
|
|
||||||
\dghspace180\dgvspace180\dghorigin1701\dgvorigin1134\dghshow1\dgvshow1
|
|
||||||
\jexpand\viewkind1\viewscale130\viewzk2\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\viewnobound1\snaptogridincell
|
|
||||||
\allowfieldendsel\wrppunct\asianbrkrule\rsidroot10497064\newtblstyruls\nogrowautofit \fet0{\*\wgrffmtfilter 013f}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sftnbj {\*\pnseclvl1
|
|
||||||
\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5
|
|
||||||
\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang
|
|
||||||
{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
|
|
||||||
\fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13111076
|
|
||||||
\par }\pard \ltrpar\qc \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid2235853 {\rtlch\fcs1 \af0\afs32 \ltrch\fcs0 \fs32\lang1033\langfe1049\langnp1033\insrsid10497064\charrsid12261729 3proxy developer reference}{
|
|
||||||
\rtlch\fcs1 \af0\afs32 \ltrch\fcs0 \fs32\lang1033\langfe1049\langnp1033\insrsid10497064
|
|
||||||
\par }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \fs20\lang1033\langfe1049\langnp1033\insrsid2235853\charrsid12261729 $Id: devref.rtf,v 1.4 2008/01/24 08:44:57 vlad Exp $
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10497064
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid10497064\charrsid12060716 \hich\af0\dbch\af0\loch\f0 1.\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\widctlpar
|
|
||||||
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin720\itap0\pararsid6570302 {\rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid10497064\charrsid12060716 Understanding Internal 3proxy structure
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid10497064 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10497064
|
|
||||||
\par 3proxy is implemented as multithread application. Server model is implemented as \'93one connection \endash one thread\'94. It means, for every client connection new thre
|
|
||||||
ad is created. This model is effective enough under Windows, because it allows it avoid thread creation on asynchronous operations, yet under most POSIX systems this model can not be considered as most efficient. It\rquote
|
|
||||||
s planned for (very far in future) release to implement more efficient model, where single thread can serve few clients.
|
|
||||||
\par
|
|
||||||
\par
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10497064 \hich\af0\dbch\af0\loch\f0 1.1\tab}}\pard \ltrpar\ql \fi-360\li360\ri0\widctlpar
|
|
||||||
\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls3\ilvl1\adjustright\rin0\lin360\itap0\pararsid6570302 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10497064 main thread:
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid6570302 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid10497064 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10497064
|
|
||||||
3proxy begins with main thread. This thread parses configuration}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid4980816 file and starts main loop}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10497064 . }{
|
|
||||||
\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 During configuration file parsing }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid8672163\charrsid8672163 struct extaparam conf;}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 structure is filled and service threads are started.
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 Main loop cycle }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 takes approximately 1 second and }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid6570302 does these tasks:}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10497064
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid6570302 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 re-reads configuration}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid8672163 file}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 , if necessary
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 \hich\af0\dbch\af0\loch\f0 -\tab}performs scheduled tasks
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 \hich\af0\dbch\af0\loch\f0 -\tab}monitors files (\lquote monitor}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid4980816 \rquote
|
|
||||||
command}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 )}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 , approx. once in a minute}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid6570302
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 \hich\af0\dbch\af0\loch\f0 -\tab}rotates main logfile
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 \hich\af0\dbch\af0\loch\f0 -\tab}dumps counters to }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137
|
|
||||||
file, approx. once in a minute}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid2701137 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 performs termination, if required
|
|
||||||
\par }\pard \ltrpar\ql \li60\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin60\itap0\pararsid8672163 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 I}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 t\rquote s guaranteed every configuration and schedule command is executed from the same thread.
|
|
||||||
|
|
||||||
\par Main thread is implemented in }{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid8672163\charrsid12544729 3proxy.c}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163
|
|
||||||
\par }\pard \ltrpar\ql \li60\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin60\itap0\pararsid6570302 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 \hich\af0\dbch\af0\loch\f0 1.2\tab}}\pard \ltrpar\ql \fi-360\li360\ri0\widctlpar
|
|
||||||
\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls3\ilvl1\adjustright\rin0\lin360\itap0\pararsid8672163 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 service thread}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid6570302
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8672163 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163
|
|
||||||
\par Service threads are started immediately, than service command (e.g. \lquote proxy\rquote or \lquote socks\rquote ) are found during configuration file parsing. Each command creates new thread. Thread does these tasks:
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid8672163 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 parses service command arguments and fills \lquote }{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid8672163\charrsid6257560 struct srvparam srv}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 \rquote structure with service configuration and \lquote }{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid8672163\charrsid6257560 struct clientparam defparam}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 \rquote structure with default client configuration
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6257560 \hich\af0\dbch\af0\loch\f0 -\tab}}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6257560 initializes filters}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132 (filter_open)}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6257560\charrsid8672163
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6257560 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid6257560 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6257560 creates }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid2701137 and initializes }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6257560 listening service socket
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid3560132 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 enters into service loop}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid3560132
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132 \hich\af0\dbch\af0\loch\f0 -\tab}terminates filters (filter_close)
|
|
||||||
\par }\pard \ltrpar\ql \li60\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin60\itap0\pararsid2701137 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 service loop:
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid2701137 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137
|
|
||||||
checks for configuration reload (approximately every second), thread exits if configuration reloaded or 3proxy is in terminating state.
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 \hich\af0\dbch\af0\loch\f0 -\tab}accepts client connection and creates \lquote }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\i\lang1033\langfe1049\langnp1033\insrsid2701137 struct clientparam new}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid2701137\charrsid6257560 param}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137
|
|
||||||
\rquote structure with client configuration
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132 \hich\af0\dbch\af0\loch\f0 -\tab}}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132
|
|
||||||
creates/checks client filters (filter_client)
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132 \hich\af0\dbch\af0\loch\f0 -\tab}creates client thread with newly created \lquote }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\i\lang1033\langfe1049\langnp1033\insrsid3560132 struct clientparam new}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid3560132\charrsid6257560 param}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132
|
|
||||||
\rquote
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid6570302 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5975359 service threads are implemented in }{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid7749673\charrsid12544729 proxymain.c}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid5975359\charrsid7749673
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5975359
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132 Please note: struct clientparam is freed and }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132\charrsid3560132 filter_clear}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132 is executed from different (client) thread.
|
|
||||||
\par
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132 \hich\af0\dbch\af0\loch\f0 1.3\tab}}\pard \ltrpar\ql \fi-360\li360\ri0\widctlpar
|
|
||||||
\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls3\ilvl1\adjustright\rin0\lin360\itap0\pararsid3560132 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132 client thread
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid7749673 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid7749673
|
|
||||||
\par Client threads are started from service thread. Client thread:
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid7749673 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid7749673 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid7749673
|
|
||||||
reads client request (except portmappers) with authentication information and request headers (if any).
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 filters request (if any) with }{
|
|
||||||
\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876\charrsid5776876 filter_request}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid7749673
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 filters headers (if any) with }{
|
|
||||||
\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876\charrsid5776876 filter_header_cli}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}performs authentication and authorization
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}established connection with server
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}sends request to server
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid3560132 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 filters server headers (if any)}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid3560132
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 maps client end s
|
|
||||||
erver sockets to transmit data between client and server
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid5776876 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 logs request. Global counters are also updated on this operation
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid3560132 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 clears client filters (}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid5776876\charrsid5776876 filter_clear}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 )
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}frees }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid5776876\charrsid5776876
|
|
||||||
struct clientparam}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 data
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid5776876 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10908886 in some point client thread may loop to process few client requests from the same connection (e.g. HTTP \lquote established\rquote connection in \lquote proxy\rquote ).
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 Socket mapping does:
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid5776876 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 caches data in internal client and server buffers
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}delays data transmit to limit bandwidth
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}performs data filtering (}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid5776876\charrsid5776876 filter_data_cli}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 / }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876\charrsid5776876
|
|
||||||
filter_data_srv}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 )
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid3560132 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1586505 client threads are implemented in }{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid1586505\charrsid12544729 proxy.c}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid1586505 , }{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid1586505\charrsid12544729 socks.c}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1586505 , }{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid1586505\charrsid12544729 pop3p.c}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1586505 etc.
|
|
||||||
\par
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid1586505\charrsid12060716 \hich\af0\dbch\af0\loch\f0 2.\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\widctlpar
|
|
||||||
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin720\itap0\pararsid1586505 {\rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid1586505\charrsid12060716 Hacking into 3proxy code with plugins
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid3560132 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1586505
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid2296829 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2296829 2.1 }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid1586505 What is 3proxy plugin
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1586505 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1586505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10440144 3proxy plugin is any dynamic/shared library. There is no specific requirement for plugin, actually you can load any dynamic library with \lquote plugin\rquote
|
|
||||||
command. No linking with any libraries are required. However, to interoperate with 3proxy dynamic library must have an export function 3proxy may call to pass the structure with required information.}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid1586505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid10440144\charrsid10440144 typedef int (*PLUGINFUNC) (struct pluginlink *pluginlink, int argc, char** argv);
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10440144
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid10440144\charrsid10440144 struct pluginlink}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10440144
|
|
||||||
is a structure with export information, explained later, argc and argv are argument counter and array of arguments of \'93plugin\'94 command. Plugin should report it\rquote
|
|
||||||
s status with integer return value. 0 is success, positive value indicates non-recoverable error, 3proxy do not parse rest of configuration and enters into termination state, negative value indicates recoverable value, 3proxy logs warning (if possible).}{
|
|
||||||
\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12544729 In case of C++, all 3proxy functions/structures must be extern \'93C\'94.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10440144
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid15928529 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529 All 3proxy structures/functions descriptions are located in
|
|
||||||
}{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid15928529\charrsid15928529 structures.h}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529
|
|
||||||
\par }\pard \ltrpar\ql \li360\ri0\widctlpar\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0\pararsid2296829 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2296829
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid2296829 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2296829 2.2 }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid12544729 Understanding pluginlink structure
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12544729 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12544729
|
|
||||||
\par Because there is no linking between 3proxy and plugin, all 3proxy functions and structures are passed with pluginlink structure. Pluginlink is actually a collection of pointers to 3proxy internal structures and functions. Because plug
|
|
||||||
inlink is constantly extending, you should see it\rquote s definitions in }{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid12544729\charrsid12544729 structures.h}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid12544729 .
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 most important}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12544729 are:
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid12544729\charrsid8087560 struct symbol symbols;
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560 \'93symbols\'94
|
|
||||||
is a kind of name/value export table, made as a list. It can be used by plugins to exchange information and functions between plugins, e.g. to export functions from one plugin to another, where pluginlink is useless, because it\rquote s static. It
|
|
||||||
\rquote s quite simple:}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12544729
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8087560 {\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid8087560\charrsid8087560 struct symbol \{
|
|
||||||
\par \tab struct symbol *next;
|
|
||||||
\par \tab char * name;
|
|
||||||
\par \tab void * value;
|
|
||||||
\par \};
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 n}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560 ame \endash is a name of function or structure
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 v}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560 alue \endash is it\rquote s value.
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560 u}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 se}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560
|
|
||||||
pluginlink->fundbyname function to lookup, e.g.
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid8087560\charrsid13909505 anotherplugindata = pluginlink->findbyname(\'93anotherplugindata\'94);
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560 To export }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 something from your plugin, add your structure to this list.}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560\charrsid8087560
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12544729 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560\charrsid12544729
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid12544729\charrsid13909505 struct extparam *conf;
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12544729 pointer to conf structure, it holds all current 3proxy configuration
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12544729\charrsid12544729
|
|
||||||
\par }\pard \ltrpar\ql \li360\ri0\widctlpar\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0\pararsid2296829 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2296829
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid2296829 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2296829 2.3 }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid12544729 How to get control within plugin}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10440144
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12544729 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12544729
|
|
||||||
\par There are few points you can get control for your plugin, after it\rquote s loaded with \lquote plugin\rquote command.
|
|
||||||
\par
|
|
||||||
\par {\listtext\tab}}\pard \ltrpar\ql \li0\ri0\widctlpar\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls4\ilvl2\adjustright\rin0\lin0\itap0\pararsid13909505 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2296829 2.3.1 }{\rtlch\fcs1
|
|
||||||
\af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12544729 Adding configuration command processor with struct command structure
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid13909505 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505
|
|
||||||
\par A list of configuration file command, available from 3proxy.cfg is extendable. Each command is defined by }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid13909505\charrsid13909505 struct commands}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid13909505 :
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid13909505\charrsid13909505 struct commands \{
|
|
||||||
\par \tab struct commands *next;
|
|
||||||
\par \tab char * command;
|
|
||||||
\par \tab int (* handler)(int argc, unsigned char ** argv);
|
|
||||||
\par \tab int minargs;
|
|
||||||
\par \tab int maxargs;\tab
|
|
||||||
\par \};
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid13909505\charrsid13909505 struct commands *next}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 - next element in list}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid13909505\charrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid13909505\charrsid13909505 char * command}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 \endash command name
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid13909505\charrsid13909505 int (* handler)(i}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid13909505 nt argc, unsigned char ** argv)}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 \endash command handler. It\rquote s called than \lquote command\rquote is found in configuration files, argc is a number of arguments, counting command itself, argv is array of arguments.
|
|
||||||
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid13909505\charrsid12060716 minargs}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 \endash minimum number of arguments command support (>= 1)
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid12060716\charrsid12060716 maxargs}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716 \endash
|
|
||||||
maximum number of arguments command support, 0 means infinity.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505\charrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654 Handler r}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104
|
|
||||||
eturn value of 0 indicates command is successfully processed. Positive return value indicates non-recoverable error, 3proxy enter}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654 s}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid3671104 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654 termination state. Negative value indicate
|
|
||||||
s 3proxy to continue to process command list, it makes it possible to set few handlers for the same command.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716 A list of the command is pointed by pluginlinks->}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716\charrsid12060716 commandhandlers}{\rtlch\fcs1
|
|
||||||
\af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716 ; you must insert you command after first one (do not replace pluginlink->}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716\charrsid12060716 commandhandlers}{
|
|
||||||
\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716 ). It\rquote s guaranteed at least 1 dummy command is always present.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716\charrsid12060716
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716
|
|
||||||
\par Example:
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid12060716\charrsid12060716 int mycommandhandler(int argc, unsigned char **argv);
|
|
||||||
\par struct commands mycommand;
|
|
||||||
\par
|
|
||||||
\par mycommand.command = \'93mycommand\'94;
|
|
||||||
\par mycommand.handler = mycommandhandler;
|
|
||||||
\par mycommand.intargs = 1;
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12060716 {\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid12060716\charrsid12060716 mycommand.intargs = 2;
|
|
||||||
\par mycommand.next = pluginslinks->commandhandlers->next;
|
|
||||||
\par pluginslink->commandhandlers->next = &mycommand;
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716
|
|
||||||
\par Adds processor for \'93mycommand\'94 command with zero on one arguments.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716\charrsid13909505
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid13909505 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716 Adding configuration command is useful, if your plugin expects configuration data.
|
|
||||||
\par
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid3671104 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104
|
|
||||||
\par {\listtext\tab}}\pard \ltrpar\ql \li0\ri0\widctlpar\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls4\ilvl2\adjustright\rin0\lin0\itap0\pararsid3671104 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2296829 2.3.2 }{\rtlch\fcs1
|
|
||||||
\af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104 Adding authentication method with }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104\charrsid3671104 struct auth}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid3671104
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid3671104 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104
|
|
||||||
\par 3proxy supports authentication and authorization. Authentication process determines user account (for example by user
|
|
||||||
name and password), authorization checks, if user account has a right to access given resource and optionally establishes a connection, if required.
|
|
||||||
\par
|
|
||||||
\par \lquote auth\rquote command combines both authentication and authorization method. It\rquote s extandable with struct auth list:
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid3671104\charrsid16077654 struct auth \{
|
|
||||||
\par \tab struct auth *next;
|
|
||||||
\par \tab AUTHFUNC authenticate;
|
|
||||||
\par \tab AUTHFUNC authorize;
|
|
||||||
\par \tab char * desc;
|
|
||||||
\par \};
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid3671104\charrsid16077654 char * desc}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104 \endash name of authentication/authorization method}{\rtlch\fcs1
|
|
||||||
\af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104\charrsid3671104
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid13909505 {\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid3671104\charrsid16077654 authenticate}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104 \endash name of authentication function}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid3671104\charrsid16077654 authorize}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104 \endash name of authorization function
|
|
||||||
\par
|
|
||||||
\par pluginlink->}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104\charrsid3671104 authfuncs}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104
|
|
||||||
points to list of authenticataction structures. Like above, new structure must be inserted after fiest one (or to the end of the list).
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654
|
|
||||||
\par First, authentication is called, if authentication indicates OK status (return value 0), authorization is called. Normally, \lquote }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654\charrsid16077654 checkACL}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654 \rquote (pluginlink->checkACL) is called as authorization function to check user\rquote s request matches to standard allow/deny rules.
|
|
||||||
If for some reason you need to avoid this check, you should call pluginlink->alwaysauth to do some dirty job, like establishing outgoing connection.
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid16077654\charrsid4980816 typedef int (*AUTHFUNC)(struct clientparam * param);
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654
|
|
||||||
\par is both authentication and authorization function. \lquote }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654\charrsid16077654 struct clientparam}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654
|
|
||||||
\rquote holds all information about client connection, including username (param->username) and password (param->password).
|
|
||||||
\par
|
|
||||||
\par Return value of 0 indicates successful authentication/authorization, 1}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1600374 and 3}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654 \endash
|
|
||||||
authorization }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1600374 failed (access denied), use {\*\xmlopen\xmlns2{\factoidname metricconverter}{\xmlattr\xmlattrns0{\xmlattrname ProductID}{\xmlattrvalue 3 in}}}3 in{\*\xmlclose}
|
|
||||||
case you want to indicate access is explicitly denied and {\*\xmlopen\xmlns2{\factoidname metricconverter}{\xmlattr\xmlattrns0{\xmlattrname ProductID}{\xmlattrvalue 3 in}}}3 in{\*\xmlclose} case there is no matching rule. 4,5,6,7,8 \endash
|
|
||||||
authentication failed (e.g. username/password do not match). 4 indicates username }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12806430 does not present in request and }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid1600374 must be requested, if possible. 5 indicates username }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12806430 found in request }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid1600374 can not be found in user\rquote s database/list, 6,7,8 \endash username does not match password for different authentication types. 10 \endash user exceeded some limits, e.g. tr
|
|
||||||
affic. You may use some different code to indicate internal problems.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1600374
|
|
||||||
\par Example:
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1600374\charrsid1600374 int myauthfunc(struct clientparam *param);
|
|
||||||
\par struct auth myauth;
|
|
||||||
\par
|
|
||||||
\par myauth.desc = \'93myauth\'94;
|
|
||||||
\par myauth.authenticate = myauthfunc;
|
|
||||||
\par myauth.authorize = pluginlink->checkACL;
|
|
||||||
\par myauth->next = pluginlink->authfuncs->next;
|
|
||||||
\par pluginlink->authfuncs->next = &myauth;
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1600374
|
|
||||||
\par Installs \'93myauthfunc\'94 as authentication function.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid7235628 There is no need to add \lquote auth\rquote command processor for new authentication type, it\rquote
|
|
||||||
s processed by standard \lquote auth\rquote command processor.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12806430
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid7235628
|
|
||||||
\par {\listtext\tab}}\pard \ltrpar\ql \li0\ri0\widctlpar\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls4\ilvl2\adjustright\rin0\lin0\itap0\pararsid12806430 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2296829 2.3.3 }{\rtlch\fcs1
|
|
||||||
\af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12806430 Adding scheduled functions
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12806430 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12806430
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid4980816 Scheduled functions are described by this structure:
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15928529\charrsid15236432 typedef enum \{NONE, MINUTELY, HOURLY, DAILY, WEEKLY, MONTHLY, ANNUALLY, NEVER\} ROTATION;
|
|
||||||
\par
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4980816 {\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid4980816\charrsid15236432 struct schedule \{
|
|
||||||
\par \tab struct schedule *next;
|
|
||||||
\par \tab ROTATION type;
|
|
||||||
\par \tab void *data;
|
|
||||||
\par \tab int (*function)(void *);
|
|
||||||
\par \tab time_t start_time;
|
|
||||||
\par \};
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12806430 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid4980816
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid15928529 {\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15928529\charrsid15236432 int (*function)(void *)}{\rtlch\fcs1
|
|
||||||
\af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529 \endash scheduled function}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529\charrsid4980816
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15928529\charrsid15236432 void *data}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529 \endash
|
|
||||||
this pointer will be passed as an argument to scheduled functions}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529\charrsid4980816
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15928529\charrsid15236432 ROTATION type}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529 \endash
|
|
||||||
defines how often function is called (once in a minute, hour, etc).
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15928529\charrsid15236432 start_time}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529 \endash time to begin using of scheduled function
|
|
||||||
\par
|
|
||||||
\par Scheduled functions are called every \lquote type\rquote interval after start_time and also on reloading configuration and going to termination state.
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432 Schedule function r}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529 eturn value of 1 means function must be
|
|
||||||
removed from the schedule. 3proxy doesn\rquote t free struct schedule.
|
|
||||||
\par
|
|
||||||
\par Schedule list can be empty. Pointer to schedule is pointed by }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15928529\charrsid15236432 struct schedule ** schedule;}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid15928529 in pluginlink.
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432 Example:}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15236432\charrsid15236432 int myschedfunc(void * data);
|
|
||||||
\par struct schedule myschedule;
|
|
||||||
\par
|
|
||||||
\par myschedule.data = \'93somethinghere\'94;
|
|
||||||
\par myschedule.function = myschedfunc}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15236432 ;}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15236432\charrsid15236432
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12806430 {\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15236432\charrsid15236432 myschedule.type = MINUTELY;}{\rtlch\fcs1
|
|
||||||
\af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15928529\charrsid15236432
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15236432\charrsid15236432 myschedule.starttime = 0;
|
|
||||||
\par myschedule.next = *pluginlink->schedule;
|
|
||||||
\par *pluginlink->schedule = myschedule;
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \ul\lang1033\langfe1049\langnp1033\insrsid15236432\charrsid15236432 NOTE:}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432 time_t is different for different compilers.
|
|
||||||
Make sure to compile plugin and 3proxy with same compiler.
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529
|
|
||||||
\par {\listtext\tab}}\pard \ltrpar\ql \li0\ri0\widctlpar\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls4\ilvl2\adjustright\rin0\lin0\itap0\pararsid4980816 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid4980816 2.3.4 Filters API
|
|
||||||
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4980816 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid4980816
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432 3proxy has filters API, you can use, to process client request and data flowing through proxy. It should be noted, that currently 3proxy doesn\rquote
|
|
||||||
t provide filters with any useful data conversion, so, it\rquote s filter\rquote s task to find data in data flow. In case filter modifies some data, it\rquote s filter\rquote s task again to assure that everything\rquote s fine.}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1771507 If you know some filtering API like MILTER, you will find 3proxy filters very same.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432
|
|
||||||
\par
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid15236432 {\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15236432\charrsid1771507 typedef enum \{
|
|
||||||
\par \tab PASS,
|
|
||||||
\par \tab CONTINUE,
|
|
||||||
\par \tab HANDLED,
|
|
||||||
\par \tab REJECT,
|
|
||||||
\par \tab REMOVE
|
|
||||||
\par \} FILTER_ACTION;
|
|
||||||
\par
|
|
||||||
\par typedef\tab void*\tab \tab FILTER_OPEN(void * idata, struct srvparam * param);
|
|
||||||
\par typedef\tab FILTER_ACTION \tab FILTER_CLIENT(void *fo, struct clientparam * param, void** fc);
|
|
||||||
\par typedef\tab FILTER_ACTION\tab FILTER_BUFFER(void *fc, struct clientparam * param, unsigned char ** buf_p, int * bufsize_p, int offset, int * length_p);
|
|
||||||
\par typedef\tab void\tab \tab FILTER_CLOSE(void *fo);
|
|
||||||
\par
|
|
||||||
\par struct filter \{
|
|
||||||
\par \tab struct filter * next;
|
|
||||||
\par \tab char * instance;
|
|
||||||
\par \tab void * data;
|
|
||||||
\par \tab FILTER_OPEN *filter_open;
|
|
||||||
\par \tab FILTER_CLIENT *filter_client;
|
|
||||||
\par \tab FILTER_BUFFER *filter_request;
|
|
||||||
\par \tab FILTER_BUFFER *filter_header_cli;
|
|
||||||
\par \tab FILTER_BUFFER *filter_header_srv;
|
|
||||||
\par \tab FILTER_BUFFER *filter_data_cli;
|
|
||||||
\par \tab FILTER_BUFFER *filter_data_srv;
|
|
||||||
\par \tab FILTER_CLOSE *filter_clear;
|
|
||||||
\par \tab FILTER_CLOSE *filter_close;
|
|
||||||
\par \};
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1771507 {\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1771507\charrsid1771507 char * instance}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1771507 \endash is some instance identifier. You can use it to find required filter in the list. 3proxy itself doesn\rquote t use this field.}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid1771507\charrsid15236432
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid7013593
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1771507\charrsid1771507 void * data}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1771507 \endash this parameter is passed to filter_open function.
|
|
||||||
\par The rest are filtering functions. Section 1 explains where and then each filter is called.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid7013593 data should not be NULL.}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid1771507
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1771507\charrsid1986875 filter_open}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1771507 must always be defined, if you want filter to be ever used. It
|
|
||||||
\rquote s called then new service is created and is given \'93data\'94 from struct filter and struct srvparam (parsed service configuration). If filter_op
|
|
||||||
en for some filter returns NULL, filter will not be used for this service. Non-NULL return value will be used as \'93fo\'94 parameter for every call to filter_client.
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1771507\charrsid1986875 filter_client}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1771507 }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid1986875 is called upon client connect (before any data is sent/received). It\rquote s good plac
|
|
||||||
e to filter client by IP (and is not good place to filter it by hostname, because this operation takes a long time, 3proxy will not be able to accept new connection). fo is a data pointer received from filter_open, param \endash
|
|
||||||
newly created clientparam structu
|
|
||||||
re, fc is return parameter filter_open must initialize, it will be used as an argument to FILTER_BUFFER functions. PASS return value means this filter will be used for this client request. CONTINUE says to install filters. On different values client conne
|
|
||||||
ction is closed and no client thread is created.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1771507\charrsid15236432
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid15236432 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1771507
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1986875 f}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1986875\charrsid1771507 ilter_reques}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\i\lang1033\langfe1049\langnp1033\insrsid1986875 t, }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1986875\charrsid1771507 filter_header_cli}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1986875 , }{
|
|
||||||
\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1986875\charrsid1771507 filter_header_srv}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1986875 , }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\i\lang1033\langfe1049\langnp1033\insrsid1986875\charrsid1771507 filter_data_cli}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1986875 , }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\i\lang1033\langfe1049\langnp1033\insrsid1986875\charrsid1771507 filter_data_srv}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1986875 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1986875
|
|
||||||
are used to process request and data r}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 eceived from client and server.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1986875\charrsid1986875
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4980816 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid1771507 char ** buf_p}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 is a pointer to current buffer, }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid1771507 int * bufsize_p}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 is a pointer to it\rquote s size. In case you change some data and it doesn\rquote
|
|
||||||
t fit to current buffer, you may allocate new buffer (with pluginlink->myalloc), copy data from old buffer, free old buffer (with pluginlink->myfree) and set new values for *}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid1771507 buf_p}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 and }{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679 *}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid1771507 bufsize_p}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 .
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679 int }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid1771507 * offset_p}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid9981679 offset of the new data in the buffer, }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid1771507 int * length_p}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid9981679 length of all data in the buffer. You should filter only (*length_p - *offset_p) characters starting from }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid9981679
|
|
||||||
(*buf_p + *offset_p)}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 .}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679\charrsid9981679
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid1771507 filter_clear}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679 }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid9981679 is called for each successfule filter_client}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15609114 and should be used to free allocated resources}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid9981679
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid9981679 filter_close}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 is called for each successful filter_open}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15609114 for the same reason}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679
|
|
||||||
\par
|
|
||||||
\par An example of filter API usage you can find in PCREPlugin (see plugins/}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679\charrsid9981679 PCREPlugin}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 /
|
|
||||||
}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679\charrsid9981679 pcre_plugin.c}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 ).
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \ul\lang1033\langfe1049\langnp1033\insrsid15609114\charrsid15609114 Note}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15609114 : if }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid15609114\charrsid15609114 param->nooverwritefilter}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15609114
|
|
||||||
is set for FILTER_BUFFER functions, filter may change data in the buffer, but must not change data length. This flag may be set, if data size if already known and is sent to the client. }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid15609114\charrsid15609114
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15609114\charrsid9981679
|
|
||||||
\par {\listtext\tab}}\pard \ltrpar\ql \li0\ri0\widctlpar\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls4\ilvl2\adjustright\rin0\lin0\itap0\pararsid4980816 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid4980816 2.3.5
|
|
||||||
Replacing log functions, traffic counting functions, bandwidth limitation functions
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4980816 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid4980816
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid13909505 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8326885
|
|
||||||
Log, traffic and bandwidth function can be directly replaced in any over place. All functions may be replaced in conf (pluginlink->conf->logfunc, pluginlink->conf->bandlim
|
|
||||||
func, pluginlink->conf->trafcountfunc). In this case, these functions will be used for services started after the changes are made. }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226 l}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid8326885 ogfunc may also be changed for }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226 struct s}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8326885
|
|
||||||
rvparam (e.g. within filter_open)}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226 , bandlimfunc and trafcountfunc may be changed in struct clientparam for every client individually (e.g. within filter_client).}{\rtlch\fcs1
|
|
||||||
\af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12806430
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid2567226\charrsid2567226 typedef void (*LOGFUNC)(struct clientparam * param, const unsigned char * test);
|
|
||||||
\par typedef void (*TRAFCOUNTFUNC)(struct clientparam * param); }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid2567226
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid2567226\charrsid2567226 typedef unsigned (*BANDLIMFUNC)(struct clientparam * param, unsigned nbytesin, unsigned nbytesout);
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid2567226\charrsid2567226 struct clientparam * param}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid2567226 \endash }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid2567226 information about client request}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226\charrsid2567226
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid2567226\charrsid2567226 char * text}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226 - text string (e.g. request)
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid2567226\charrsid2567226 nbytesin, nbytesout}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226 \endash
|
|
||||||
number of bytes received from / send to server. bandlimfunc returns delay in milliseconds.
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226\charrsid2567226
|
|
||||||
\par }}
|
|
||||||
@@ -0,0 +1,259 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
|
<title>3proxy developer reference</title>
|
||||||
|
<style type="text/css">
|
||||||
|
span.s1 {text-decoration: underline}
|
||||||
|
ol {list-style-type: none}
|
||||||
|
ol.level1 {counter-reset: h1}
|
||||||
|
ol.level1 > li::before {content: counter(h1) ". "; counter-increment: h1; font-weight: bold}
|
||||||
|
ol.level2 {counter-reset: h2}
|
||||||
|
ol.level2 > li::before {content: counter(h1) "." counter(h2) " "; counter-increment: h2}
|
||||||
|
ol.level3 {counter-reset: h3}
|
||||||
|
ol.level3 > li::before {content: counter(h1) "." counter(h2) "." counter(h3) " "; counter-increment: h3}
|
||||||
|
pre {margin: 0.5em 0; padding: 0.5em; background: #f5f5f5; border: 1px solid #ddd}
|
||||||
|
code {font-family: monospace}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>3proxy developer reference</h2>
|
||||||
|
|
||||||
|
<ol class="level1">
|
||||||
|
<li><b>Understanding Internal 3proxy structure</b>
|
||||||
|
<p>3proxy is implemented as multithread application. Server model is implemented as "one connection – one thread". It means, for every client connection new thread is created. This model is effective enough under Windows, because it allows it avoid thread creation on asynchronous operations, yet under most POSIX systems this model can not be considered as most efficient. It's planned for (very far in future) release to implement more efficient model, where single thread can serve few clients.</p>
|
||||||
|
<ol class="level2">
|
||||||
|
<li>main thread
|
||||||
|
<p>3proxy begins with main thread. This thread parses configuration file and starts main loop. During configuration file parsing <code>struct extaparam conf;</code> structure is filled and service threads are started.</p>
|
||||||
|
<p>Main loop cycle takes approximately 1 second and does these tasks:</p>
|
||||||
|
<ul>
|
||||||
|
<li>re-reads configuration file, if necessary</li>
|
||||||
|
<li>performs scheduled tasks</li>
|
||||||
|
<li>monitors files ('monitor' command), approx. once in a minute</li>
|
||||||
|
<li>rotates main logfile</li>
|
||||||
|
<li>dumps counters to file, approx. once in a minute</li>
|
||||||
|
<li>performs termination, if required</li>
|
||||||
|
</ul>
|
||||||
|
<p>It's guaranteed every configuration and schedule command is executed from the same thread.</p>
|
||||||
|
<p>Main thread is implemented in <b>3proxy.c</b></p>
|
||||||
|
</li>
|
||||||
|
<li>service thread
|
||||||
|
<p>Service threads are started immediately, than service command (e.g. 'proxy' or 'socks') are found during configuration file parsing. Each command creates new thread. Thread does these tasks:</p>
|
||||||
|
<ul>
|
||||||
|
<li>parses service command arguments and fills <code>struct srvparam srv</code> structure with service configuration and <code>struct clientparam defparam</code> structure with default client configuration</li>
|
||||||
|
<li>initializes filters (filter_open)</li>
|
||||||
|
<li>creates and initializes listening service socket</li>
|
||||||
|
<li>enters into service loop</li>
|
||||||
|
<li>terminates filters (filter_close)</li>
|
||||||
|
</ul>
|
||||||
|
<p>service loop:</p>
|
||||||
|
<ul>
|
||||||
|
<li>checks for configuration reload (approximately every second), thread exits if configuration reloaded or 3proxy is in terminating state.</li>
|
||||||
|
<li>accepts client connection and creates <code>struct clientparam newparam</code> structure with client configuration</li>
|
||||||
|
<li>creates/checks client filters (filter_client)</li>
|
||||||
|
<li>creates client thread with newly created <code>struct clientparam newparam</code></li>
|
||||||
|
</ul>
|
||||||
|
<p>service threads are implemented in <b>proxymain.c</b></p>
|
||||||
|
<p>Please note: struct clientparam is freed and filter_clear is executed from different (client) thread.</p>
|
||||||
|
</li>
|
||||||
|
<li>client thread
|
||||||
|
<p>Client threads are started from service thread. Client thread:</p>
|
||||||
|
<ul>
|
||||||
|
<li>reads client request (except portmappers) with authentication information and request headers (if any).</li>
|
||||||
|
<li>filters request (if any) with filter_request</li>
|
||||||
|
<li>filters headers (if any) with filter_header_cli</li>
|
||||||
|
<li>performs authentication and authorization</li>
|
||||||
|
<li>established connection with server</li>
|
||||||
|
<li>sends request to server</li>
|
||||||
|
<li>filters server headers (if any)</li>
|
||||||
|
<li>maps client end server sockets to transmit data between client and server</li>
|
||||||
|
<li>logs request. Global counters are also updated on this operation</li>
|
||||||
|
<li>clears client filters (filter_clear)</li>
|
||||||
|
<li>frees <code>struct clientparam</code> data</li>
|
||||||
|
</ul>
|
||||||
|
<p>in some point client thread may loop to process few client requests from the same connection (e.g. HTTP 'established' connection in 'proxy').</p>
|
||||||
|
<p>Socket mapping does:</p>
|
||||||
|
<ul>
|
||||||
|
<li>caches data in internal client and server buffers</li>
|
||||||
|
<li>delays data transmit to limit bandwidth</li>
|
||||||
|
<li>performs data filtering (filter_data_cli / filter_data_srv)</li>
|
||||||
|
</ul>
|
||||||
|
<p>client threads are implemented in <b>proxy.c</b>, <b>socks.c</b>, <b>pop3p.c</b> etc.</p>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</li>
|
||||||
|
<li><b>Hacking into 3proxy code with plugins</b>
|
||||||
|
<ol class="level2">
|
||||||
|
<li>What is 3proxy plugin
|
||||||
|
<p>3proxy plugin is any dynamic/shared library. There is no specific requirement for plugin, actually you can load any dynamic library with 'plugin' command. No linking with any libraries are required. However, to interoperate with 3proxy dynamic library must have an export function 3proxy may call to pass the structure with required information.</p>
|
||||||
|
<pre><code>typedef int (*PLUGINFUNC) (struct pluginlink *pluginlink, int argc, char** argv);</code></pre>
|
||||||
|
<p><code>struct pluginlink</code> is a structure with export information, explained later, argc and argv are argument counter and array of arguments of "plugin" command. Plugin should report it's status with integer return value. 0 is success, positive value indicates non-recoverable error, 3proxy do not parse rest of configuration and enters into termination state, negative value indicates recoverable value, 3proxy logs warning (if possible). In case of C++, all 3proxy functions/structures must be extern "C".</p>
|
||||||
|
<p>All 3proxy structures/functions descriptions are located in <b>structures.h</b></p>
|
||||||
|
</li>
|
||||||
|
<li>Understanding pluginlink structure
|
||||||
|
<p>Because there is no linking between 3proxy and plugin, all 3proxy functions and structures are passed with pluginlink structure. Pluginlink is actually a collection of pointers to 3proxy internal structures and functions. Because pluginlink is constantly extending, you should see it's definitions in <b>structures.h</b>.</p>
|
||||||
|
<p>most important are:</p>
|
||||||
|
<pre><code>struct symbol symbols;</code></pre>
|
||||||
|
<p>"symbols" is a kind of name/value export table, made as a list. It can be used by plugins to exchange information and functions between plugins, e.g. to export functions from one plugin to another, where pluginlink is useless, because it's static. It's quite simple:</p>
|
||||||
|
<pre><code>struct symbol {
|
||||||
|
struct symbol *next;
|
||||||
|
char * name;
|
||||||
|
void * value;
|
||||||
|
};</code></pre>
|
||||||
|
<p><code>name</code> – is a name of function or structure</p>
|
||||||
|
<p><code>value</code> – is it's value.</p>
|
||||||
|
<p>use <code>pluginlink->findbyname</code> function to lookup, e.g.</p>
|
||||||
|
<pre><code>anotherplugindata = pluginlink->findbyname("anotherplugindata");</code></pre>
|
||||||
|
<p>To export something from your plugin, add your structure to this list.</p>
|
||||||
|
<pre><code>struct extparam *conf;</code></pre>
|
||||||
|
<p>pointer to conf structure, it holds all current 3proxy configuration</p>
|
||||||
|
</li>
|
||||||
|
<li>How to get control within plugin
|
||||||
|
<p>There are few points you can get control for your plugin, after it's loaded with 'plugin' command.</p>
|
||||||
|
<ol class="level3">
|
||||||
|
<li>Adding configuration command processor with struct command structure
|
||||||
|
<p>A list of configuration file command, available from 3proxy.cfg is extendable. Each command is defined by <code>struct commands</code>:</p>
|
||||||
|
<pre><code>struct commands {
|
||||||
|
struct commands *next;
|
||||||
|
char * command;
|
||||||
|
int (* handler)(int argc, unsigned char ** argv);
|
||||||
|
int minargs;
|
||||||
|
int maxargs;
|
||||||
|
};</code></pre>
|
||||||
|
<p><code>struct commands *next</code> - next element in list</p>
|
||||||
|
<p><code>char * command</code> – command name</p>
|
||||||
|
<p><code>int (* handler)(int argc, unsigned char ** argv)</code> – command handler. It's called than 'command' is found in configuration files, argc is a number of arguments, counting command itself, argv is array of arguments.</p>
|
||||||
|
<p><code>minargs</code> – minimum number of arguments command support (>= 1)</p>
|
||||||
|
<p><code>maxargs</code> – maximum number of arguments command support, 0 means infinity.</p>
|
||||||
|
<p>Handler return value of 0 indicates command is successfully processed. Positive return value indicates non-recoverable error, 3proxy enters termination state. Negative value indicates 3proxy to continue to process command list, it makes it possible to set few handlers for the same command.</p>
|
||||||
|
<p>A list of the command is pointed by <code>pluginlink->commandhandlers</code>; you must insert you command after first one (do not replace <code>pluginlink->commandhandlers</code>). It's guaranteed at least 1 dummy command is always present.</p>
|
||||||
|
<p>Example:</p>
|
||||||
|
<pre><code>int mycommandhandler(int argc, unsigned char **argv);
|
||||||
|
struct commands mycommand;
|
||||||
|
|
||||||
|
mycommand.command = "mycommand";
|
||||||
|
mycommand.handler = mycommandhandler;
|
||||||
|
mycommand.intargs = 1;
|
||||||
|
mycommand.intargs = 2;
|
||||||
|
mycommand.next = pluginslinks->commandhandlers->next;
|
||||||
|
pluginslink->commandhandlers->next = &mycommand;</code></pre>
|
||||||
|
<p>Adds processor for "mycommand" command with zero on one arguments.</p>
|
||||||
|
<p>Adding configuration command is useful, if your plugin expects configuration data.</p>
|
||||||
|
</li>
|
||||||
|
<li>Adding authentication method with struct auth
|
||||||
|
<p>3proxy supports authentication and authorization. Authentication process determines user account (for example by username and password), authorization checks, if user account has a right to access given resource and optionally establishes a connection, if required.</p>
|
||||||
|
<p>'auth' command combines both authentication and authorization method. It's extandable with struct auth list:</p>
|
||||||
|
<pre><code>struct auth {
|
||||||
|
struct auth *next;
|
||||||
|
AUTHFUNC authenticate;
|
||||||
|
AUTHFUNC authorize;
|
||||||
|
char * desc;
|
||||||
|
};</code></pre>
|
||||||
|
<p><code>char * desc</code> – name of authentication/authorization method</p>
|
||||||
|
<p><code>authenticate</code> – name of authentication function</p>
|
||||||
|
<p><code>authorize</code> – name of authorization function</p>
|
||||||
|
<p><code>pluginlink->authfuncs</code> points to list of authenticataction structures. Like above, new structure must be inserted after fiest one (or to the end of the list).</p>
|
||||||
|
<p>First, authentication is called, if authentication indicates OK status (return value 0), authorization is called. Normally, 'checkACL' (<code>pluginlink->checkACL</code>) is called as authorization function to check user's request matches to standard allow/deny rules. If for some reason you need to avoid this check, you should call <code>pluginlink->alwaysauth</code> to do some dirty job, like establishing outgoing connection.</p>
|
||||||
|
<pre><code>typedef int (*AUTHFUNC)(struct clientparam * param);</code></pre>
|
||||||
|
<p>is both authentication and authorization function. <code>struct clientparam</code> holds all information about client connection, including username (<code>param->username</code>) and password (<code>param->password</code>).</p>
|
||||||
|
<p>Return value of 0 indicates successful authentication/authorization, 1 and 3 – authorization failed (access denied), use 3 in case you want to indicate access is explicitly denied and 3 in case there is no matching rule. 4,5,6,7,8 – authentication failed (e.g. username/password do not match). 4 indicates username does not present in request and must be requested, if possible. 5 indicates username found in request can not be found in user's database/list, 6,7,8 – username does not match password for different authentication types. 10 – user exceeded some limits, e.g. traffic. You may use some different code to indicate internal problems.</p>
|
||||||
|
<p>Example:</p>
|
||||||
|
<pre><code>int myauthfunc(struct clientparam *param);
|
||||||
|
struct auth myauth;
|
||||||
|
|
||||||
|
myauth.desc = "myauth";
|
||||||
|
myauth.authenticate = myauthfunc;
|
||||||
|
myauth.authorize = pluginlink->checkACL;
|
||||||
|
myauth->next = pluginlink->authfuncs->next;
|
||||||
|
pluginlink->authfuncs->next = &myauth;</code></pre>
|
||||||
|
<p>Installs "myauthfunc" as authentication function. There is no need to add 'auth' command processor for new authentication type, it's processed by standard 'auth' command processor.</p>
|
||||||
|
</li>
|
||||||
|
<li>Adding scheduled functions
|
||||||
|
<p>Scheduled functions are described by this structure:</p>
|
||||||
|
<pre><code>typedef enum {NONE, MINUTELY, HOURLY, DAILY, WEEKLY, MONTHLY, ANNUALLY, NEVER} ROTATION;
|
||||||
|
|
||||||
|
struct schedule {
|
||||||
|
struct schedule *next;
|
||||||
|
ROTATION type;
|
||||||
|
void *data;
|
||||||
|
int (*function)(void *);
|
||||||
|
time_t start_time;
|
||||||
|
};</code></pre>
|
||||||
|
<p><code>int (*function)(void *)</code> – scheduled function</p>
|
||||||
|
<p><code>void *data</code> – this pointer will be passed as an argument to scheduled functions</p>
|
||||||
|
<p><code>ROTATION type</code> – defines how often function is called (once in a minute, hour, etc).</p>
|
||||||
|
<p><code>start_time</code> – time to begin using of scheduled function</p>
|
||||||
|
<p>Scheduled functions are called every 'type' interval after start_time and also on reloading configuration and going to termination state.</p>
|
||||||
|
<p>Schedule function return value of 1 means function must be removed from the schedule. 3proxy doesn't free struct schedule.</p>
|
||||||
|
<p>Schedule list can be empty. Pointer to schedule is pointed by <code>struct schedule ** schedule;</code> in pluginlink.</p>
|
||||||
|
<p>Example:</p>
|
||||||
|
<pre><code>int myschedfunc(void * data);
|
||||||
|
struct schedule myschedule;
|
||||||
|
|
||||||
|
myschedule.data = "somethinghere";
|
||||||
|
myschedule.function = myschedfunc;
|
||||||
|
myschedule.type = MINUTELY;
|
||||||
|
myschedule.starttime = 0;
|
||||||
|
myschedule.next = *pluginlink->schedule;
|
||||||
|
*pluginlink->schedule = myschedule;</code></pre>
|
||||||
|
<p><span class="s1">NOTE:</span> time_t is different for different compilers. Make sure to compile plugin and 3proxy with same compiler.</p>
|
||||||
|
</li>
|
||||||
|
<li>Filters API
|
||||||
|
<p>3proxy has filters API, you can use, to process client request and data flowing through proxy. It should be noted, that currently 3proxy doesn't provide filters with any useful data conversion, so, it's filter's task to find data in data flow. In case filter modifies some data, it's filter's task again to assure that everything's fine. If you know some filtering API like MILTER, you will find 3proxy filters very same.</p>
|
||||||
|
<pre><code>typedef enum {
|
||||||
|
PASS,
|
||||||
|
CONTINUE,
|
||||||
|
HANDLED,
|
||||||
|
REJECT,
|
||||||
|
REMOVE
|
||||||
|
} FILTER_ACTION;
|
||||||
|
|
||||||
|
typedef void* FILTER_OPEN(void * idata, struct srvparam * param);
|
||||||
|
typedef FILTER_ACTION FILTER_CLIENT(void *fo, struct clientparam * param, void** fc);
|
||||||
|
typedef FILTER_ACTION FILTER_BUFFER(void *fc, struct clientparam * param, unsigned char ** buf_p, int * bufsize_p, int offset, int * length_p);
|
||||||
|
typedef void FILTER_CLOSE(void *fo);
|
||||||
|
|
||||||
|
struct filter {
|
||||||
|
struct filter * next;
|
||||||
|
char * instance;
|
||||||
|
void * data;
|
||||||
|
FILTER_OPEN *filter_open;
|
||||||
|
FILTER_CLIENT *filter_client;
|
||||||
|
FILTER_BUFFER *filter_request;
|
||||||
|
FILTER_BUFFER *filter_header_cli;
|
||||||
|
FILTER_BUFFER *filter_header_srv;
|
||||||
|
FILTER_BUFFER *filter_data_cli;
|
||||||
|
FILTER_BUFFER *filter_data_srv;
|
||||||
|
FILTER_CLOSE *filter_clear;
|
||||||
|
FILTER_CLOSE *filter_close;
|
||||||
|
};</code></pre>
|
||||||
|
<p><code>char * instance</code> – is some instance identifier. You can use it to find required filter in the list. 3proxy itself doesn't use this field.</p>
|
||||||
|
<p><code>void * data</code> – this parameter is passed to filter_open function. The rest are filtering functions. Section 1 explains where and then each filter is called. data should not be NULL.</p>
|
||||||
|
<p><code>filter_open</code> must always be defined, if you want filter to be ever used. It's called then new service is created and is given "data" from struct filter and struct srvparam (parsed service configuration). If filter_open for some filter returns NULL, filter will not be used for this service. Non-NULL return value will be used as "fo" parameter for every call to filter_client.</p>
|
||||||
|
<p><code>filter_client</code> is called upon client connect (before any data is sent/received). It's good place to filter client by IP (and is not good place to filter it by hostname, because this operation takes a long time, 3proxy will not be able to accept new connection). fo is a data pointer received from filter_open, param – newly created clientparam structure, fc is return parameter filter_open must initialize, it will be used as an argument to FILTER_BUFFER functions. PASS return value means this filter will be used for this client request. CONTINUE says to install filters. On different values client connection is closed and no client thread is created.</p>
|
||||||
|
<p><code>filter_request, filter_header_cli, filter_header_srv, filter_data_cli, filter_data_srv</code> are used to process request and data received from client and server.</p>
|
||||||
|
<p><code>char ** buf_p</code> is a pointer to current buffer, <code>int * bufsize_p</code> is a pointer to it's size. In case you change some data and it doesn't fit to current buffer, you may allocate new buffer (with <code>pluginlink->myalloc</code>), copy data from old buffer, free old buffer (with <code>pluginlink->myfree</code>) and set new values for <code>*buf_p</code> and <code>*bufsize_p</code>.</p>
|
||||||
|
<p><code>int offset</code> offset of the new data in the buffer, <code>int * length_p</code> length of all data in the buffer. You should filter only <code>(*length_p - *offset_p)</code> characters starting from <code>(*buf_p + *offset_p)</code>.</p>
|
||||||
|
<p><code>filter_clear</code> is called for each successfule filter_client and should be used to free allocated resources</p>
|
||||||
|
<p><code>filter_close</code> is called for each successful filter_open for the same reason</p>
|
||||||
|
<p>An example of filter API usage you can find in PCREPlugin (see plugins/PCREPlugin/pcre_plugin.c).</p>
|
||||||
|
<p><span class="s1">Note</span>: if <code>param->nooverwritefilter</code> is set for FILTER_BUFFER functions, filter may change data in the buffer, but must not change data length. This flag may be set, if data size if already known and is sent to the client.</p>
|
||||||
|
</li>
|
||||||
|
<li>Replacing log functions, traffic counting functions, bandwidth limitation functions
|
||||||
|
<p>Log, traffic and bandwidth function can be directly replaced in any over place. All functions may be replaced in conf (<code>pluginlink->conf->logfunc</code>, <code>pluginlink->conf->bandlimfunc</code>, <code>pluginlink->conf->trafcountfunc</code>). In this case, these functions will be used for services started after the changes are made. logfunc may also be changed for struct srvparam (e.g. within filter_open), bandlimfunc and trafcountfunc may be changed in struct clientparam for every client individually (e.g. within filter_client).</p>
|
||||||
|
<pre><code>typedef void (*LOGFUNC)(struct clientparam * param, const unsigned char * test);
|
||||||
|
typedef void (*TRAFCOUNTFUNC)(struct clientparam * param);
|
||||||
|
typedef unsigned (*BANDLIMFUNC)(struct clientparam * param, unsigned nbytesin, unsigned nbytesout);</code></pre>
|
||||||
|
<p><code>struct clientparam * param</code> – information about client request</p>
|
||||||
|
<p><code>char * text</code> - text string (e.g. request)</p>
|
||||||
|
<p><code>nbytesin, nbytesout</code> – number of bytes received from / send to server. bandlimfunc returns delay in milliseconds.</p>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+1
-162
@@ -1,163 +1,2 @@
|
|||||||
<h3>Why ... doesn't work?</h3>
|
|
||||||
|
|
||||||
<p><i>Q: Why does nothing work?</i></p>
|
<H2><A href="howtoe.html">See HowTo:</a></h2>
|
||||||
A: Valid configuration file is required.
|
|
||||||
|
|
||||||
<p><i>Q: Why restrictions (redirections, limits, etc) do not work?</i></p>
|
|
||||||
A: Most probable reasons: 'auth none' or no auth is used. For any ACL based feature one of 'iponly', 'nbname' or 'strong' auths required. Sequence of commands may be invalid. Commands are executed one-by-one and 'proxy', 'tcppm', 'socks' or another service commands must follow valid configuration. Invalid sequence of ACLs. First matching ACL is used (except of internal redirections, see below). If ACL contains at least one records last record is assumed to be 'deny *'.
|
|
||||||
|
|
||||||
<p><i>Q: Why doesn't 3proxy work as service under Windows?</i></p>
|
|
||||||
Possible reasons:
|
|
||||||
<ul>
|
|
||||||
<li>'service' command absents in configuration file. Command is required for
|
|
||||||
3proxy.exe to behave as system service in 3proxy 0.5.2 and prior.
|
|
||||||
<li>there are relative paths in configuration file for included files,
|
|
||||||
log files, etc. Always use absolute paths. For example
|
|
||||||
$"c:\3proxy\networks.local" instead of $networks.local. For debugging remove
|
|
||||||
'service' and 'daemon', log to stdout an try to execute 3proxy from command
|
|
||||||
line from some different directory (for example from disk root).
|
|
||||||
<li>SYSTEM account doesn't have access to executable file, configuration files,
|
|
||||||
log files, etc.
|
|
||||||
<li>configuration files is not located in default path (3proxy.cfg in same
|
|
||||||
location with 3proxy.exe). For alternative configuration file location use
|
|
||||||
<pre>
|
|
||||||
3proxy --install full_path_to_configuration_file
|
|
||||||
</pre>
|
|
||||||
<li>user has no rights to install or start service
|
|
||||||
<li>service is already installed and/or started
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p><A NAME="INTEXT"><i>Q: Why doesn't internal and external commands work as expected</i></A></li></p>
|
|
||||||
A: Check your expectations first.
|
|
||||||
Both internal and external IPs are IPs of the host running 3proxy itself.
|
|
||||||
This configuration option is usefull in situation 3proxy is running on the
|
|
||||||
border host with 2 (or more) connections: e.g. LAN and WAN with different IPs
|
|
||||||
<pre>
|
|
||||||
LAN connection +-------------+ Internet connection
|
|
||||||
LAN <-------------->| 3proxy host |<-------------------> INTERNET
|
|
||||||
^+-------------+^
|
|
||||||
| |
|
|
||||||
Internal IP External IP
|
|
||||||
</pre>
|
|
||||||
If 3proxy is used on the host with single connection, both internal and
|
|
||||||
external are usually same IP.
|
|
||||||
<br>Internal should exist and be UP on the moment 3proxy is started and
|
|
||||||
should never be disconnected/DOWN. If this interface is periodically
|
|
||||||
disconnected (e.g. direct link between 2 hosts), do not specify internal
|
|
||||||
address or use 0.0.0.0 instead. In this case, if you have 2 or more
|
|
||||||
interfaces you must use firewall (preferably) or 3proxy ACLs to avoid open
|
|
||||||
proxy situation.
|
|
||||||
<br>
|
|
||||||
External IP (if specified) must exist in the momet 3proxy
|
|
||||||
serves client request. If external interface is no specified (or 0.0.0.0),
|
|
||||||
system select external IP. It may be possible to access resources of internal
|
|
||||||
network, to prevent this use ACLs. In addition, SOCKSv5 will not support BIND
|
|
||||||
operation, required for incoming connections (this operation is quite rarely
|
|
||||||
implemented in SOCKSv5 clients and usually is not required). In case of
|
|
||||||
dynamic address, do not specify external or use external 0.0.0.0 or, if
|
|
||||||
external address is required, create a script to determine current external
|
|
||||||
IP and save it to file, and use external "$path_to_file" with "monitor" command
|
|
||||||
to automatically reload configuration on address change.
|
|
||||||
|
|
||||||
<p><i>Q: Why doesn't ODBC loggind work?</i></p>
|
|
||||||
A: Check you use system DSN.
|
|
||||||
Check SQL request is valid.
|
|
||||||
The best way to check is to make file or stdout logging, get SQL request from log file or console and execute this request manually.
|
|
||||||
Under Unix, you may also want to adjust 'stacksize' parameter.
|
|
||||||
|
|
||||||
<p><i>Q: Why proxy crash on request processing?</a></i></p>
|
|
||||||
<i>A:</i> default stacksize may be insufficient, if some non-default plugins
|
|
||||||
are used (e.g. PAM and ODBC on Linux) or if compiled on some platforms with
|
|
||||||
invalid system defined values (few versionds of FreeBSD on amd64).
|
|
||||||
Problem can be resolved with 'stacksize' command or '-S' option starting 3proxy 0.8.4.
|
|
||||||
|
|
||||||
|
|
||||||
<p><i>Q: Why doesn't APOP/CRAM-MD5 authentication work with POP3 proxy?</i></p>
|
|
||||||
A: Any Challenge-response authentication require challenge to be transmitted from server. Pop3p doesn't know which server to use before authentication, it makes it impossible to obtain challenge. You can encrypt your POP3 communications with TLS (i.e. stunnel) or IPSec.
|
|
||||||
|
|
||||||
<h3>Redirection to local proxy</h3>
|
|
||||||
|
|
||||||
<p><i>Q: What is it for?</i></p>
|
|
||||||
A: To have control based on request and to have URLs and another protocol specific parameters to be logged.
|
|
||||||
|
|
||||||
<p><i>Q: What are restrictions?</i></p>
|
|
||||||
A: It's hard to redirect services for non-default ports; Internet Explorer supports only SOCKSv4 with no password authentication (Internet Explorer sends username, but not password), for SOCKSv5 only cleartext password authentication is supported.
|
|
||||||
|
|
||||||
<p><i>Q: What are advantages?</i></p>
|
|
||||||
A: You need only to setup SOCKS proxy in browser settings. You can use socksifier, i.e. FreeCAP or SocksCAP with application which is not proxy aware.
|
|
||||||
|
|
||||||
<p><i>Q: How to setup?</i></p>
|
|
||||||
A: You should specify parent proxy with IP of 0.0.0.0 and port 0. Examples:
|
|
||||||
<pre>
|
|
||||||
auth iponly
|
|
||||||
allow * * * 80,8080-8088
|
|
||||||
parent 1000 http 0.0.0.0 0
|
|
||||||
allow * * * 80,8080-8088
|
|
||||||
#redirect ports 80 and 8080-8088 to local HTTP proxy
|
|
||||||
#Second allow is required, because ACLs are checked
|
|
||||||
#twice: first time by socks and second by http proxy.
|
|
||||||
|
|
||||||
allow * * * 21,2121
|
|
||||||
parent 1000 ftp 0.0.0.0 0
|
|
||||||
allow * * * 21,2121
|
|
||||||
#redirect ports 21 and 2121 to local
|
|
||||||
#ftp proxy
|
|
||||||
|
|
||||||
|
|
||||||
allow *
|
|
||||||
#allow rest of connections directly
|
|
||||||
|
|
||||||
socks
|
|
||||||
#now let socks server to start
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<p><i>Q: How it affects different ACL rules?</i></p>
|
|
||||||
A: After local redirections rules are applied again to protocol-level request. Redirection rule itself is skipped. It makes it possible to redirect request again on the external proxy depending on request itself.
|
|
||||||
<pre>
|
|
||||||
allow * * * 80,8080-8088
|
|
||||||
parent 1000 http 0.0.0.0 0
|
|
||||||
#redirect http traffic to internal proxy
|
|
||||||
|
|
||||||
allow * * $c:\3proxy\local.nets 80,8080-8088
|
|
||||||
#allow direct access to local.nets networks
|
|
||||||
allow * * * 80,8080-8088
|
|
||||||
parent 1000 http proxy.3proxy.ru 3128
|
|
||||||
#use parent caching proxy for rest of the networks
|
|
||||||
|
|
||||||
allow *
|
|
||||||
#allow direct connections for rest of socks
|
|
||||||
#requests
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<h3>Can I ...?</h3>
|
|
||||||
|
|
||||||
<p><i>Q: Is it possible to resolve names through parent proxy?</i></p>
|
|
||||||
A: Yes, use 'proxy', 'connect+', 'socks4+' or 'socks5+' as parent proxy type.
|
|
||||||
3proxy itself requires name resolutions for ACL checks, so, if it's impossible
|
|
||||||
to resolve names from 3proxy host, use
|
|
||||||
<pre>
|
|
||||||
fakeresolve
|
|
||||||
</pre>
|
|
||||||
command. Fakeresolve resolves any name to 127.0.0.2.
|
|
||||||
|
|
||||||
|
|
||||||
<p><i>Q: Can I use 3proxy as FTP proxy?</i></p>
|
|
||||||
A: There are two kinds of FTP proxy supported: FTP over HTTP support (known as FTP proxy inside Internet Explorer, Mozilla and another browsers) and real FTP proxy (usable in Far and different FTP clients). Both are supported in 3proxy: first one as a part of HTTP 'proxy' and second one as 'ftppr'.
|
|
||||||
|
|
||||||
<p><i>Q: Can I bind any 3proxy service to non-default port?</i></p>
|
|
||||||
A: proxy -p8080
|
|
||||||
|
|
||||||
<h3>Why so ...?</h3>
|
|
||||||
|
|
||||||
<p><i>Q: Why traffic accounting is incomplete? It differs for what my provider (or another accounting application) shows to me?</i></p>
|
|
||||||
A: 3proxy accounts protocol level traffic. Provider counts channel or IP-level traffic with network and transport headers. In additions, 3proxy doesn't counts DNS resolutions, pings, floods, scans, etc. It makes approx. 10% of difference. That's why you should have 15% reserve if you use 3proxy to limit your traffic. If difference with your provider is significantly above 10% you should look for traffic avoiding proxy server, for example connections through NAT, traffic originated from the host with proxy installed, traffic from server applications, etc.
|
|
||||||
|
|
||||||
<p><i>Q: Why configuration is so difficult and non-intuitive?</i></p>
|
|
||||||
A: Configuration format is created in a way it's easy to parse and matches to internal 3proxy structures. In addition, there are some older things left for compatibility to be cleaned in 3proxy release. And last, I think it's easy and intuitive.
|
|
||||||
|
|
||||||
<p><i>Q: Why the code is so difficult and non-intuitive?</i></p>
|
|
||||||
A: First, I'm not programmer. Second, 3proxy was 'proof of concept' in reply for some conference post. Request was to write proxy server in 100 lines of code. First version of 3proxy had less, with HTTP and SOCKS support and portmappers. Third, there are peoples who want to use 3proxy code in trojans. I don't want to help them. Fourth, the aim is to support different platforms. It's well known - the worse code is, the better it compiles.
|
|
||||||
|
|
||||||
<p><i>Q: Why do you use insecure strcpy, sprintf, etc?</i></p>
|
|
||||||
A: Why not? I try to use insecure function in secure manner. You're welcome to look for vulnerabilities.
|
|
||||||
Loaded 100 of 325 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user