Overview
Theia IDE is an open-source extensible framework for building web-based cloud IDEs, with proper multi-language support and VS Code extensions. Tencent Cloud Lighthouse provides the Theia IDE image with Go, Python, Node.js, Clang, and OpenJDK development environments installed, allowing you to easily and quickly develop projects and businesses across platforms.
Directions
2. Click Create to enter the Lighthouse purchase page.
Region: Select a region near your target users to reduce the network latency and improve their access speed.
Image: Select the Theia IDE application image.
Availability zone: Randomly assigned is selected by default. You can select one as well.
Instance bundle: Select an instance bundle according to the required instance configuration (including CPU, memory, system disk, bandwidth, and monthly traffic).
Instance name: Enter a custom instance name. If it is left empty, an "image name + 4-digit random string" will be used as the name by default. When instances are created in batches, their names will be consecutive with auto-incrementing suffixes. For example, if you enter "LH" as the name and purchase three instances, the three instances are named "LH1", "LH2", and "LH3".
Purchase period: Default to 1 month.
Quantity: Default to 1.
3. Click Buy now to submit your order and make the payment as prompted. Then, return to the Lighthouse console.
4. After the instance is created, select the instance from the list to enter its details page.
You can view the configuration items of the Theia IDE application.
5. Select the Pre-installed application tab to enter the application details page.
6. In the Pre-installed software section
, click to copy the command for getting the admin password of Theia. 7. In the Pre-installed software section, click Log in.
8. In the pop-up login window
, paste the command copied in step 6 and press Enter.
Then, you can get the Theia IDE admin account (admin) and password. Store and record them properly. 9. Close the login window and go back to the application details page of the instance.
10. In the Pre-installed software section, click the Access address of Theia 1.37.2.
Note:
We recommend you use Chrome or Firefox for this operation, as other browsers (such as Safari) may have compatibility issues.
11. In the pop-up window, enter the admin account and password obtained in step 8 and click OK.
After successful verification, you can enter the Theia IDE GUI. Subsequent Operations
Selecting the workspace
1. Select Open Workspace on the Theia IDE Getting Started page.
2. In the Open Workspace pop-up window, select /
from the drop-down list to open the directory. In Theia IDE, a directory is a workspace. /data
is used as an example in this document.
3. Click Open to enter the /data
workspace.
Examples
Note:
Theia IDE supports Python, Java, Go, C/C++, and Node.js languages. Sample programs in Python, Go, and C++ are run on the command line and in the GUI here.
Python
1. In the workspace, select File > New Folder at the top of the window.
2. In the pop-up window, create a folder named Python
and a simple sample file main.py
under it.
3. You can run the program in either of the following ways:
Command line:
3.1.1 Select Terminal > New Terminal at the top of the window to open a terminal.
3.1.2 Run the following commands in sequence in the terminal to run the program.
The execution result is as shown below:
GUI:
Click in the top-right corner of the window to run the program. The execution result is as shown below: Go
1. In the workspace, select File > New Folder at the top of the window.
2. In the pop-up window, create a folder named go
and a simple sample file main.go
under it.
3. You can run the program in either of the following ways:
Command line:
3.1.1 Select Terminal > New Terminal at the top of the window to open a terminal.
3.1.2 Run the following commands in sequence in the terminal to run the program.
The execution result is as shown below:
GUI:
3.2.1 Click on the left to open the DEBUG section. 3.2.2 In DEBUG, select Add Configuration from the drop-down list to generate the configuration file.
3.2.3 Open the main.go file and select in the **DEBUG** section to run the program. The execution result is as shown below:
C++
1. In the workspace, select File > New Folder at the top of the window.
2. In the pop-up window, create a folder named c++
and a simple sample file main.cpp
under it.
3. You can run the program in either of the following ways:
Command line:
3.1.1 Select Terminal > New Terminal at the top of the window to open a terminal.
3.1.2 Run the following commands in sequence in the terminal to run the program.
The execution result is as shown below:
GUI:
3.2.1 Click on the left to open the DEBUG section. 3.2.2 In DEBUG, select Add Configuration from the drop-down list to generate the configuration file as.
3.2.3 In the drop-down list of the configuration file, select { } GDB CDT Local debugging.
3.2.4 Replace /${command:askProgramPath} in the configuration file with /c++/a.out and save the change.
3.2.5 Select in the *DEBUG** section to open the Debug console. 3.2.6 Select in the **DEBUG** section to run the program. The execution result is as shown below: Enabling HTTPS access
Note:
You only need to modify the /usr/local/lighthouse/softwares/nginx/conf/include/theia.conf
configuration file but not /usr/local/lighthouse/softwares/nginx/conf/nginx.conf
for your Theia IDE instance.
See the following configuration to modify the file:
server {
listen 443 ssl;
server_tokens off;
keepalive_timeout 5;
root /usr/local/lighthouse/softwares/nginx/html;
index index.php index.html;
access_log logs/theia.log combinediox;
error_log logs/theia.error.log;
server_name cloud.tencent.com;
ssl_certificate 1_cloud.tencent.com_bundle.crt;
ssl_certificate_key 2_cloud.tencent.com.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
auth_digest_user_file /home/lighthouse/passwd.digest;
auth_digest_shm_size 8m;
location / {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
auth_digest 'lighthouse';
auth_digest_timeout 120s;
auth_digest_expires 600s;
auth_digest_replays 60;
proxy_pass http://127.0.0.1:3000;
}
}
server {
listen 80;
server_name cloud.tencent.com;
return 301 https://$host$request_uri;
}
Was this page helpful?