feat: remove welcome banner

This commit is contained in:
Justin Lin committed 2024-10-13 16:31:17 +08:00
1 parent a6720cfe39
commit 2a3429106c
4 files changed
+10 -20

No files matched your search

+1
View File
@@ -30,6 +30,7 @@ COPY ./ssh_pubkey /home/${USERNAME}/.ssh/authorized_keys
RUN chmod 600 /home/${USERNAME}/.ssh/authorized_keys \ RUN chmod 600 /home/${USERNAME}/.ssh/authorized_keys \
&& chmod 700 /home/${USERNAME}/.ssh \ && chmod 700 /home/${USERNAME}/.ssh \
&& chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}/.ssh && chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}/.ssh
RUN rm -f /etc/motd /etc/issue /etc/issue.net /etc/update-motd.d/*
RUN service ssh start RUN service ssh start
+3 -3
View File
@@ -34,7 +34,7 @@ Include /etc/ssh/sshd_config.d/*.conf
#MaxAuthTries 6 #MaxAuthTries 6
#MaxSessions 10 #MaxSessions 10
#PubkeyAuthentication yes PubkeyAuthentication yes
# Expect .ssh/authorized_keys2 to be disregarded by default in future. # Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2 #AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
@@ -86,11 +86,11 @@ UsePAM yes
#AllowAgentForwarding yes #AllowAgentForwarding yes
#AllowTcpForwarding yes #AllowTcpForwarding yes
#GatewayPorts no #GatewayPorts no
X11Forwarding yes X11Forwarding no
#X11DisplayOffset 10 #X11DisplayOffset 10
#X11UseLocalhost yes #X11UseLocalhost yes
#PermitTTY yes #PermitTTY yes
PrintMotd no #PrintMotd yes
#PrintLastLog yes #PrintLastLog yes
#TCPKeepAlive yes #TCPKeepAlive yes
#PermitUserEnvironment no #PermitUserEnvironment no
+1 -1
View File
@@ -61,7 +61,7 @@ function createConfig() {
bugReportUrl: getUrl('BUG_REPORT_URL'), bugReportUrl: getUrl('BUG_REPORT_URL'),
docker: { docker: {
network: get('DOCKER_NETWORK', 'host'), network: get('DOCKER_NETWORK', 'linux-odyssey-players'),
defaultImage: get('QUEST_IMAGE', 'linuxodyssey/quest-base'), defaultImage: get('QUEST_IMAGE', 'linuxodyssey/quest-base'),
imagePrefix: get('DOCKER_PREFIX', 'linuxodyssey/quest-'), imagePrefix: get('DOCKER_PREFIX', 'linuxodyssey/quest-'),
mountQuest: process.env.MOUNT_QUEST === 'true', mountQuest: process.env.MOUNT_QUEST === 'true',
+5 -16
View File
@@ -17,7 +17,7 @@ const newContainerOptions = (
name, name,
Image: getQuestImage(imageId), Image: getQuestImage(imageId),
HostConfig: { HostConfig: {
NetworkMode: 'linux-odyssey-players', // config.docker.network, NetworkMode: config.docker.network,
Binds: options.binds, Binds: options.binds,
ExtraHosts: ['host.docker.internal:host-gateway'], ExtraHosts: ['host.docker.internal:host-gateway'],
}, },
@@ -53,7 +53,9 @@ export async function getAndStartContainer(
if (!(await container.inspect()).State.Running) { if (!(await container.inspect()).State.Running) {
await container.start() await container.start()
} }
await new Promise((resolve) => setTimeout(resolve, 2000)) await new Promise((resolve) => {
setTimeout(resolve, 1000)
})
return container return container
} }
@@ -61,12 +63,9 @@ export async function attachContainer(
container: Docker.Container, container: Docker.Container,
{ token }: { token: string } { token }: { token: string }
): Promise<Duplex> { ): Promise<Duplex> {
// console.log('attachContainer', await container.inspect())
const containerIp = (await container.inspect()).NetworkSettings.Networks[ const containerIp = (await container.inspect()).NetworkSettings.Networks[
'linux-odyssey-players' config.docker.network
].IPAddress ].IPAddress
console.log('containerIp', containerIp)
console.log('token', token)
const conn = new Client() const conn = new Client()
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@@ -86,9 +85,6 @@ export async function attachContainer(
if (err) { if (err) {
reject(err) reject(err)
} }
stream.on('error', (err) => {
reject(err)
})
stream.on('close', () => { stream.on('close', () => {
console.log('Stream :: close') console.log('Stream :: close')
conn.end() conn.end()
@@ -108,13 +104,6 @@ export async function attachContainer(
debug: console.log, debug: console.log,
}) })
}) })
// const exec = await container.exec({
// Env: [
// `TOKEN=${token}`,
// `API_ENDPOINT=${config.backendUrl}`,
// 'ZDOTDIR=/etc/zsh',
// ],
// })
} }
export async function deleteContainer(id: string) { export async function deleteContainer(id: string) {