Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0c6a6a4

Browse files
committedFeb 24, 2023
rename response.html to response.example.html
1 parent e55fd05 commit 0c6a6a4

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed
 

‎modules/server_starter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ async def start_code_server(user: str, expire_time: int):
3232
break
3333
await asyncio.sleep(0.1)
3434

35+
# sleep for 2 more seconds to make sure code-server is ready
36+
await asyncio.sleep(2)
37+
3538
Popen(["sudo", "chown", ":www-data", socket_path])
3639

3740
Popen(["sudo", "chmod", "770", socket_path])

‎response.html renamed to ‎response.example.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,4 @@
3030
}
3131
</script>
3232

33-
</body>
34-
35-
</html>
33+
</body>

‎setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
with open("response.html", "r+", encoding="utf8") as template_file:
1+
with open("response.example.html", "r", encoding="utf8") as template_file:
2+
template_html = template_file.read()
3+
4+
with open("response.html", "w", encoding="utf8") as template_file:
25
root_domain = "." + input("Enter your root domain (ex: tobycm.ga): ")
36
vscode_domain = input(f"Enter your VS Code domain (default: vscode{root_domain}): ")
47
if vscode_domain == "":
58
vscode_domain = f"vscode{root_domain}"
69

710
template_file.write(
8-
template_file.read()
11+
template_html
912
.replace("%root_domain%", root_domain)
1013
.replace("%vscode_domain%", vscode_domain)
1114
)

0 commit comments

Comments
 (0)
Please sign in to comment.