Skip to content

Commit fdc4b59

Browse files
Add support Codespaces
1 parent d714b1b commit fdc4b59

File tree

2 files changed

+102
-0
lines changed

2 files changed

+102
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright 2022 Wayback Archiver. All rights reserved.
2+
# Use of this source code is governed by the GNU GPL v3
3+
# license that can be found in the LICENSE file.
4+
#
5+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/go/.devcontainer/base.Dockerfile
6+
# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): 1, 1.16, 1.17, 1-bullseye, 1.16-bullseye, 1.17-bullseye, 1-buster, 1.16-buster, 1.17-buster
7+
ARG VARIANT=1-bullseye
8+
FROM mcr.microsoft.com/vscode/devcontainers/go:0-${VARIANT}
9+
10+
# [Choice] Node.js version: lts/*, 16, 14, 12, 10
11+
# ARG NODE_VERSION="lts/*"
12+
# RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c ". /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
13+
14+
# [Optional] Uncomment this section to install additional OS packages.
15+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
16+
&& apt-get -y install --no-install-recommends \
17+
git \
18+
tor \
19+
ffmpeg \
20+
chromium \
21+
youtube-dl \
22+
webp \
23+
fonts-freefont-ttf \
24+
fonts-font-awesome \
25+
fonts-noto \
26+
fonts-noto-core \
27+
fonts-noto-cjk \
28+
fonts-noto-extra
29+
30+
# [Optional] Uncomment the next line to use go get to install anything else you need
31+
# RUN go get -x <your-dependency-or-tool>
32+
33+
# [Optional] Uncomment this line to install global node packages.
34+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

.devcontainer/devcontainer.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/go
3+
{
4+
"name": "wayback",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"args": {
8+
// Update the VARIANT arg to pick a version of Go: 1, 1.16, 1.17
9+
// Append -bullseye or -buster to pin to an OS version.
10+
// Use -bullseye variants on local arm64/Apple Silicon.
11+
"VARIANT": "1-bullseye",
12+
// Options
13+
"NODE_VERSION": "lts/*"
14+
}
15+
},
16+
"runArgs": [
17+
"--cap-add=SYS_PTRACE",
18+
"--security-opt",
19+
"seccomp=unconfined"
20+
],
21+
// Configure tool-specific properties.
22+
"customizations": {
23+
// Configure properties specific to VS Code.
24+
"vscode": {
25+
// Set *default* container specific settings.json values on container create.
26+
"settings": {
27+
"go.toolsManagement.checkForUpdates": "local",
28+
"go.useLanguageServer": true,
29+
"go.gopath": "/go",
30+
"go.goroot": "/usr/local/go",
31+
"go.toolsGopath": "/go/bin",
32+
"go.formatTool": "goimports",
33+
"go.lintOnSave": "package",
34+
"go.lintTool": "golangci-lint",
35+
"editor.formatOnSave": true
36+
},
37+
// Add the IDs of extensions you want installed when the container is created.
38+
"extensions": [
39+
"golang.Go"
40+
]
41+
}
42+
},
43+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
44+
"forwardPorts": [
45+
8964
46+
],
47+
// Use 'portsAttributes' to set default properties for specific forwarded ports. More info: https://code.visualstudio.com/docs/remote/devcontainerjson-reference.
48+
"portsAttributes": {
49+
"8964": {
50+
"label": "Application port",
51+
"onAutoForward": "notify"
52+
}
53+
},
54+
// Use 'otherPortsAttributes' to configure any ports that aren't configured using 'portsAttributes'.
55+
// "otherPortsAttributes": {
56+
// "onAutoForward": "silent"
57+
// },
58+
// Use 'postCreateCommand' to run commands after the container is created.
59+
// "postCreateCommand": "go version",
60+
// Uncomment to connect as a non-root user. More info: https://aka.ms/vscode-remote/containers/non-root.
61+
"remoteUser": "vscode",
62+
"remoteEnv": {
63+
"DEBUG": true,
64+
"LOG_TIME": true,
65+
"HTTP_LISTEN_ADDR": "0.0.0.0:8964",
66+
"WAYBACK_STORAGE_DIR": "/tmp/reduxer"
67+
}
68+
}

0 commit comments

Comments
 (0)