Skip to content

Commit

Permalink
put ttyd on base path
Browse files Browse the repository at this point in the history
  • Loading branch information
mbund committed Dec 9, 2023
1 parent 4eb86eb commit dd68cee
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions autotag1.env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
TTYD_PASSWORD=tag1
TTYD_ID=tag1
1 change: 1 addition & 0 deletions autotag2.env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
TTYD_PASSWORD=tag2
TTYD_ID=tag1
8 changes: 7 additions & 1 deletion bot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const createKubernetesResources = async (id: string, password: string) => {
},
},
data: {
"autotag.env": `TTYD_PASSWORD=${password}`,
"autotag.env": `TTYD_ID=${id}\nTTYD_PASSWORD=${password}\n`,
},
},
});
Expand Down Expand Up @@ -231,6 +231,12 @@ const startTagCommand: Command = {
type: ApplicationCommandOptionType.User,
description: "The second player",
},
{
name: "image",
type: ApplicationCommandOptionType.String,
choices: [{ name: "Arch Linux", value: "archlinux" }],
description: "The image to use",
},
],
},
{
Expand Down
3 changes: 2 additions & 1 deletion images/ttyd-viewable.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ Description=ttyd viewable web terminal

[Service]
Type=simple
ExecStart=/usr/bin/ttyd.x86_64 -p 7682 tmux new -A -s ttyd
EnvironmentFile=/etc/autotag.env
ExecStart=/usr/bin/ttyd.x86_64 -p 7682 -b /${TTYD_ID}/view tmux new -A -s ttyd
WorkingDirectory=/home/admin
Restart=always
User=admin
Expand Down
2 changes: 1 addition & 1 deletion images/ttyd-writable.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Description=ttyd writable web terminal
[Service]
Type=simple
EnvironmentFile=/etc/autotag.env
ExecStart=/usr/bin/ttyd.x86_64 -p 7681 -c admin:${TTYD_PASSWORD} -W tmux new -A -s ttyd
ExecStart=/usr/bin/ttyd.x86_64 -p 7681 -b /${TTYD_ID} -c admin:${TTYD_PASSWORD} -W tmux new -A -s ttyd
WorkingDirectory=/home/admin
Restart=always
User=admin
Expand Down

0 comments on commit dd68cee

Please sign in to comment.