Giter Site home page Giter Site logo

wabarc / on-heroku Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 4.0 74 KB

Deploy and maintaining wayback service as a Heroku app easily and quickly.

License: GNU General Public License v3.0

Shell 70.07% Makefile 15.48% Dockerfile 14.45%
wayback wayback-machine heroku maintenance

on-heroku's Introduction

on-heroku

If you prefer to run webapp and worker, please checkout dynos branch.

on-heroku is designed to deploy the wayback service as a Heroku app, expect to reduce the cost of running the wayback service, and providing additional anonymity.

Installation

1-Click Deploy

Deploy Wayback to Heroku with 1-Click

Script (recommended)

The script requires to run with the root user, on a Docker container may be better options.

It will install Node.js in the /tmp directory and remove it automatically after deployment.

# sh <(wget https://raw.githubusercontent.com/wabarc/on-heroku/main/setup -O -)

Running on Docker container:

$ docker run -ti --rm debian:stable-slim bash -c "apt update && apt install -y wget \
    && bash <(wget https://raw.githubusercontent.com/wabarc/on-heroku/main/setup -O -)"

Manual

Install heroku

$ npm i -g heroku

more details

Login

$ heroku login -i
$ heroku keys:add

Pull

$ git clone https://github.com/wabarc/on-heroku.git
$ cd wayback-heroku

Create or add exists heroku app

Create an new heroku app:

$ heroku create --ssh-git your-app-name

or add exists heroku app:

$ heroku git:remote --ssh-git -a your-app-name

more details

Set heroku app stack

$ heroku stack:set container

Set a config var

The WAYBACK_ARGS config var is required by wayback process as an environment variable during running, more useful reference the wabarc/wayback.

$ heroku config:set WAYBACK_ARGS="--ia --is --ip -d telegram -t your-telegram-bot-token --debug"

PS: if you run with the script, the double quote is unnecessary.

more details

Deploy to heroku

$ git push heroku main

Start dyno

$ heroku ps:scale web=1

Deploy with heroku.yml

  1. Clone repository
$ git clone https://github.com/wabarc/on-heroku.git
  1. Add Heroku remote repository
$ git remote add heroku [email protected]:appname.git
  1. Set the stack of your app to container
$ heroku stack:set container
  1. Push to Heroku
$ git push heroku main

Maintenance

If you prefer to run the Heroku app regularly, the maintenance.sh is helpful to turn it into maintenance mode by crontab or other. It requires a Heroku authorization token during on running heroku command, and you can create one from the Heroku dashboard.

Usage

$ sh maintenance.sh
Usage: sh maintenance.sh [options]

Options:
    -a, --app <heroku app name>
    -h, --help Usage
    -k  --api-key <heroku authorization token>
        Heroku authorization token, create an new token:
        https://dashboard.heroku.com/account/applications/authorizations/new
    -m, --mode <maintenance mode>
        Maintenance mode for heroku app, options: on, off (Default: on)

Example

$ wget https://raw.githubusercontent.com/wabarc/on-heroku/main/maintenance.sh -O - | \
    sh -s - -k your-authorization-token -a your-app-name

running on Docker container:

$ docker run -ti --rm alpine:3.12 sh
# wget https://raw.githubusercontent.com/wabarc/on-heroku/main/maintenance.sh -O - | \
    sh -s - -k your-authorization-token -a your-app-name -m off

Related projects

Credits

F.A.Q

For Heroku free accounts, if an app has a free web dyno, and that dyno receives no web traffic in a 30-minute period, it will sleep. You may need a tool (e.g. crontab, Cronitor, New Relic) to request https://your-app.herokuapp.com/healthcheck regularly to prevent it from sleeping.

License

Permissive GPL 3.0 license, see the LICENSE file for details.

on-heroku's People

Contributors

dependabot[bot] avatar renovate[bot] avatar waybackarchiver avatar web-flow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

on-heroku's Issues

Specify Tor's ExitNode

ARG TOR_EXCLUDE_NODE="{cn},{hk},{mo},{sg},{th},{pk},{by},{ru},{ir},{sy},{vn},{ph},{my},{cu}"
ARG TOR_EXCLUDE_EXIT_NODE="{cn},{hk},{mo},{sg},{kp},{th},{pk},{by},{ru},{ir},{sy},{vn},{ph},{my},{cu},{au},{ca},{nz},{gb},{us},{fr},{dk},{nl},{no},{be},{de},{it},{es}"

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
github-actions
.github/workflows/deploy.yml
  • actions/checkout v3
  • actions/checkout v3
  • actions/checkout v3
  • peter-evans/repository-dispatch v2
.github/workflows/testing.yml
  • actions/checkout v3

  • Check this box to trigger a request for Renovate to run again on this repository

Forward requests on-heroku

Proposal:

Heroku supports web app and worker, but they can't be connecting directly. In keepping the worker running wayback service, it requires to forward the HTTP request from web app to the worker's Tor Hidden Service by socat.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.