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.
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 -)"
$ npm i -g heroku
$ heroku login -i
$ heroku keys:add
$ git clone https://github.com/wabarc/on-heroku.git
$ cd wayback-heroku
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
$ heroku stack:set container
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.
$ git push heroku main
$ heroku ps:scale web=1
- Clone repository
$ git clone https://github.com/wabarc/on-heroku.git
- Add Heroku remote repository
$ git remote add heroku git@heroku.com:appname.git
- Set the stack of your app to container
$ heroku stack:set container
- Push to Heroku
$ git push heroku main
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.
$ 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)
$ 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
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.
Permissive GPL 3.0 license, see the LICENSE file for details.