Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier deployment #250

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2022 Wayback Archiver. All rights reserved.
# Use of this source code is governed by the GNU GPL v3
# license that can be found in the LICENSE file.
#
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/go/.devcontainer/base.Dockerfile
waybackarchiver marked this conversation as resolved.
Show resolved Hide resolved
# [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
ARG VARIANT=1-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/go:0-${VARIANT}

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 7: containerImage not pinned by hash Click Remediation section below to solve this issue

# [Choice] Node.js version: lts/*, 16, 14, 12, 10
# ARG NODE_VERSION="lts/*"
# RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c ". /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
git \
tor \
ffmpeg \
chromium \
youtube-dl \
webp \
fonts-freefont-ttf \
fonts-font-awesome \
fonts-noto \
fonts-noto-core \
fonts-noto-cjk \
fonts-noto-extra

# [Optional] Uncomment the next line to use go get to install anything else you need
# RUN go get -x <your-dependency-or-tool>

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
68 changes: 68 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/go
{
"name": "wayback",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update the VARIANT arg to pick a version of Go: 1, 1.16, 1.17
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local arm64/Apple Silicon.
"VARIANT": "1-bullseye",
// Options
"NODE_VERSION": "lts/*"
}
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.gopath": "/go",
"go.goroot": "/usr/local/go",
"go.toolsGopath": "/go/bin",
"go.formatTool": "goimports",
"go.lintOnSave": "package",
"go.lintTool": "golangci-lint",
"editor.formatOnSave": true
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"golang.Go"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
8964
],
// Use 'portsAttributes' to set default properties for specific forwarded ports. More info: https://code.visualstudio.com/docs/remote/devcontainerjson-reference.
"portsAttributes": {
"8964": {
"label": "Application port",
"onAutoForward": "notify"
}
},
// Use 'otherPortsAttributes' to configure any ports that aren't configured using 'portsAttributes'.
// "otherPortsAttributes": {
// "onAutoForward": "silent"
// },
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "go version",
// Uncomment to connect as a non-root user. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"remoteEnv": {
"DEBUG": true,
"LOG_TIME": true,
"HTTP_LISTEN_ADDR": "0.0.0.0:8964",
"WAYBACK_STORAGE_DIR": "/tmp/reduxer"
}
}
2 changes: 2 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,7 @@ header:
- 'Makefile'
- 'Procfile'
- 'cosign.pub'
- '.replit'
- 'replit.nix'

comment: on-failure
14 changes: 14 additions & 0 deletions .replit
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
run = "while :; do set -ex; curl -fsSL https://github.com/wabarc/wayback/raw/main/install.sh | sh -s -- -b ~/.local/bin; wayback ${WAYBACK_ARGS}; sleep 1; done"
language = "bash"

[nix]
channel = "stable-21_11"

[env]
WAYBACK_ARGS = "-d web"
ENABLE_METRICS = "true"
WAYBACK_ENABLE_IA = "true"
WAYBACK_ENABLE_IS = "true"
WAYBACK_ENABLE_IP = "true"
WAYBACK_ENABLE_PH = "true"
WAYBACK_STORAGE_DIR = "/tmp/reduxer"
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ docker run -d wabarc/wayback wayback -d telegram -t YOUR-BOT-TOKEN -c YOUR-CHANN

### 1-Click Deploy

**Note:** These are free hosting options. If you need a quick and simple setup, this method may be ideal.

<a href="https://repl.it/github/wabarc/wayback"><img src="https://repl.it/badge/github/wabarc/wayback" alt="Run on Repl.it" height="32" /></a>
[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/wabarc/wayback)
<a href="https://render.com/deploy?repo=https://github.com/wabarc/on-render">
<img
Expand Down
13 changes: 13 additions & 0 deletions replit.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{ pkgs }: {
deps = [
pkgs.go
pkgs.tor
pkgs.wget
pkgs.chromium
pkgs.ffmpeg
pkgs.libwebp
pkgs.youtube-dl
pkgs.you-get
pkgs.ipfs
];
}