Commit Graph

116 Commits

Author SHA1 Message Date
Hagb
00f8dd735b Set max open files to a working value
@rikaunite https://github.com/Hagb/docker-easyconnect/issues/245

Solve #245
2023-07-26 16:52:10 +08:00
Hagb
9c1dd38207 Update document and output about tun
tun0 and utun7 is interface (接口) but not device (设备)
2023-07-26 16:28:59 +08:00
Hagb
ea1cf7c42a Add support for timed pinging
It helps to keep connection longer. Tested by @ethanfun.
2023-07-26 15:42:14 +08:00
Hagb
35fb64248c Reserve /tmp/.X11-unix when remove /tmp/ 2023-07-26 15:17:05 +08:00
Hagb
41a77072f4 Fix syntax error 2023-07-26 15:16:57 +08:00
Hagb
e13ece4db1 Use qemu-user >= 8.0.0 which fixes a memory leak bug
https://gitlab.com/qemu-project/qemu/-/issues/866

In docker-easyconnect, it was first mentioned in #128.
2023-07-26 15:16:46 +08:00
Hagb
64891dd7e4 Rename env variable ECPASSWORD to CLIP_TEXT and add related document
ECPASSWORD is used to set clipboard text in VNC, but its name is
confusing. So rename it to a more exact name.

This issue also adds document about clipboard in VNC.

Solve #251.
2023-07-26 03:14:52 +08:00
Hagb
4cc0ac4495 Fix EasyConnect configuration synchronization 2023-07-19 19:40:44 +08:00
Hagb
86850950e9 Make danted log only errors and print to stderr 2023-07-19 07:19:20 +08:00
Hagb
5f2a983384 Unhardcode X display argument and use stalonetray to show systray
Simply closing aTrust windows is just hiding it into systray. A systray
implementation is necessary for closing the frontend of aTrust via GUI.
2023-07-19 07:07:20 +08:00
Hagb
d679b62f7f Set vpn configuration variables to envirnoment variables
Some of them should be passed to our other scripts.
2023-07-19 06:02:14 +08:00
Hagb
70b990a7b2 Start services parallelly 2023-07-19 06:01:26 +08:00
Hagb
eb323718e3 Create temporary tun device for danted
To start danted successfully, all network interfaces listed in the
configuration of danted should occur and has ip(s). After started
successfully, danted can run without troubles even after the status
of thoes network interfaces is changed (such as deleted and recreated).

This commit creates a temporary tun interface with same name as Sangfor
VPN, assigns an ip, starts danted, and then deletes the interface.
2023-07-19 05:39:41 +08:00
Hagb
24613355f1 Use iptables-legacy if support for nftables is too limited 2023-07-16 22:04:20 +08:00
Hagb
9ea0c0b8ec Correct killed processes of aTrust 2023-07-16 19:44:48 +08:00
Hagb
bbffdec6f2 Fix saving url from Sangfor VPN 2023-07-16 03:13:31 +08:00
Hagb
3f1216e637 Add aTrust support (#198) 2023-07-16 01:57:35 +08:00
Hagb
25516e146b Add script to check library deps of Sangfor VPN 2023-07-16 01:54:56 +08:00
Hagb
676631a228 Refactor and prepare to add aTrust
- Change most of `EC` to `VPN` in the source code, since this project will not
  be only for EasyConnect
- Dehardcode
- Refactor for more than one type of Sangfor VPN
2023-07-16 01:51:01 +08:00
Hagb
c5b570dad2 Fix opening url 2023-06-27 00:13:30 +08:00
Hagb
380a726bf5 Remove unnecessary break command 2023-06-25 17:31:51 +08:00
Hagb
b93d0d5aaf Merge branch 'master' into develop 2023-03-08 00:42:20 +08:00
Hagb
8a1dd3b564 Add DISABLE_PKG_VERSION_XML envirnoment variable option
With this option enabled, the configuration file will be set to a
symblic link of /dev/null, which will prevent EasyConnect from storing
the version information to local and checking client version.
2023-03-08 00:31:01 +08:00
Hagb
530b7d5be5 Expose 54530 port
This port is used by EasyConnect for web api, called by EasyConnect GUI
and/or web page of VPN server.

Close #143
2023-01-24 22:36:09 +08:00
Hagb
ea07ea9606 Merge branch 'master' into develop 2023-01-20 04:53:07 +08:00
Hagb
4a1a59247e Adjust default VNC resolution and add an argument for custom value
Fix #201
2023-01-20 04:23:22 +08:00
Hagb
f4ef12f90b Link/copy files between ~/conf and conf directory of EC, but not link to ~/conf itself
This commit is for GUI version:
- overwrite ~/conf/ by the "immutable" configure files such as Version.xml
  that depends the version of EC; (fixes #124, #136, #156, #217)
- in the conf directory of EC, create symbolic links to files in ~/conf,
  except for "ECDomainFile", which is a unix sock used by EC and should
  not be assumed to be supported by the filesystem of ~/conf; (fixes #219)
- sync conf directory of EC to ~/conf before stoping and/or exiting
  (idea from @Einskai);
2023-01-20 03:04:46 +08:00
Hagb
029f0f72c8 No longer set English as default language 2023-01-19 01:17:14 +08:00
Hagb
5ed3825f3e Merge branch 'master' into develop 2023-01-19 00:45:53 +08:00
Hagb
c03ea1ad35 Use stdout to pass definition of {open,close}_port 2023-01-19 00:35:11 +08:00
Hagb
f129e7ad68 Move port forwarding to start.sh 2023-01-19 00:30:17 +08:00
Hagb
582ff64750 Merge branch 'sangfor-output' 2023-01-18 18:16:28 +08:00
Hagb
ad945013a0 Also apply EXIT argument to cli version 2023-01-18 18:09:36 +08:00
Hagb
f28f748c65 Route packets from tun0 to host 2023-01-18 17:48:00 +08:00
Hagb
61e7b60835 Route the packets from 4440 port to host 2023-01-18 17:46:40 +08:00
dhy2000
5b52478e9d 添加中文字体 && 修复 EXIT 参数 (#199)
1. 修复 usr/local/bin/start.sh 中 EXIT 无效的问题
2. 将 Dockerfile 中调用的 apt 改为 apt-get
3. 添加中文字体
2023-01-18 16:26:46 +08:00
Hagb
709994d887 Apply rules in SANGFOR_OUTPUT defined by EC to ip forwarding
EasyConnect may provide some resources by DNAT to 127.0.0.1:4440, which
is in nat/SANGFOR_OUTPUT chain created by EC. By default, there is a
rule in nat/OUTPUT chain created by EC, which jump into SANGFOR_OUTPUT.

To apply these rules to ip forwarding, the commit includes:
- REDIRECT to port 4440 instead of DNAT to 127.0.0.1:4440;
- jump into SANGFOR_OUTPUT also in nat/PREROUTING.

This commit fixes #204.
2023-01-18 04:43:36 +08:00
Hagb
6436a4af53 Force EC to use current iptables 2023-01-18 03:09:29 +08:00
Hagb
227e4a792f Make electron use shared libraries under its direction
Otherwise may cause problem about linking
2023-01-17 22:39:18 +08:00
ghdefe
2173ca6c4f Add startup option: EXIT_LOCK 2022-10-31 14:51:00 +08:00
ghdefe
83c0a8aae3 Add startup optional: DO_NOT_EXIT 2022-10-28 16:43:03 +08:00
Hagb
6bc1043467 Change the method to clean subprocess in start-sangfor.sh
Avoid being stuck when killing subprocess
(https://github.com/Hagb/docker-easyconnect/issues/25#issuecomment-1257207784)
2022-09-26 07:01:15 +08:00
Hagb
1f0521ad8d Remove obsolete config items in tinyproxy.conf 2022-09-25 06:07:17 +08:00
Hagb
e18ff59b47 Suppress error output when trying to rm non-existent ECDomainFile 2022-09-25 06:03:32 +08:00
Hagb
2d5c909e80 Avoid login failure in poor-performance environment
When logining, ECAgent starts to communicate with CSClient via a fifo
file. In 7.6.3, ECAgent can't starts CSClient and svpnservice by itself,
so our script start these two programs once ECAgent begins to complain
the communication failure. In poor-performance environment (such as slow
device and docker with some limits set by user), ECAgent may reach its
timeout before CSClient is ready, and then login will fail.

To avoid such an error, this commit suspends the ECAgent process before
starts CSClient and svpnservice, and continues ECAgent after the fifo
file is created by CSClient.
2022-09-24 09:54:58 +08:00
Hagb
f533949090 Support non-amd64 deb package of EasyConnect
Since non-amd64 deb packages of EasyConnect are proved to exist
(https://github.com/Hagb/docker-easyconnect/issues/25#issuecomment-1233369467),
the deb package should not be assume to be amd64 and architecture
specific code should be rewritten:

- Add EC_HOST build argument to tell Dockerfile the architecture of
  EasyConnect package
- Whether to install cross toolchain and qemu-user and which package
  should be install, is determined by EC_HOST and the local architecture
  now, more specifically by build-scripts/get-echost-names.sh (no longer
  hard-code amd64 cross toolchain)
- fake-hwaddr.so should follow the architecture of the EC deb, so
  fake-hwaddr/Makefile uses CC envirnoment variable instead of
  hard-coded x86_64-linux-gnu-gcc as c compiler now
- qemu_args is removed now. It was used to pass LD_PRELOAD to foreign
  binaries under qemu-user, but now we pass LD_PRELOAD to the qemu
  wrapper and wrapper will pass the LD_PRELOAD to the simulated
  binaries
2022-09-24 08:52:32 +08:00
Hagb
eb8274a27d Make noVNC cross-platform
https://github.com/Hagb/docker-easyconnect/issues/47#issuecomment-1189448697

Use the following programs to provide cross-platform noVNC service with
little size growth:
- busybox httpd: http service for static resources (busybox is not very
  high-performance, but has already been installed)
- websockify in C: tiny websockify service
- tinyproxy with websocket support: provide http reverse proxy, used to
  provide http and websockify in the same port

As an alternation, easy-novnc will be compiled from source code if chosen.
2022-09-21 06:10:44 +08:00
Hagb
ba974b02cd Merge branch 'master' into develop 2022-09-19 15:38:55 +08:00
Hagb
70156b22b1 Set 'sys_type' as 'Linux' in easy_connect.json (#174)
If there isn't sys_type in easy_connect.json, the electron client (called "GUI"
in docker-easyconnect) of EasyConnect will think itself to be in macOS,
which is hardcoded as a default value in the GUI source code.
2022-09-13 02:21:21 +08:00
Hagb
d0dacba5a3 Remove existing symbolic link when creating one
@leafgray #166
2022-09-01 23:11:32 +08:00