Skip to content

Latest commit

 

History

History
100 lines (68 loc) · 6.01 KB

SETUP.md

File metadata and controls

100 lines (68 loc) · 6.01 KB

Setting up on Divio/Railway

The setup guide is currently in work-in-progress mode and may update without notice. Controbutions are welcome!

Installing required dependencies

  • Official GitHub CLI: https://github.com/cli/cli/blob/trunk/docs/install_linux.md (requires Android 7+ and latest Termux app version from F-droid)
  • The CLI tooling for your PaaS service of choice.
    • Divio CLI: python3 -m pip install --user divio-cli
    • Railway CLI: npm i -g @railway/cli or sudo sh -c "$(curl -sSL https://raw.githubusercontent.com/railwayapp/cli/master/install.sh)" (to install globally if Node.js and NPM isn't installed for Linux/macOS)

Installing on Divio

You need Git, Python3 (for divio-cli package), OpenSSL (for Termux Android app users, the openssl-tool APT package is also required) and OpenSSH installed on the machine.

  1. Fork the repo first.

    • If the official GitHub CLI is ibstalled, you can fork from the command line with gh repo fork ajhalili2006/vaultwarden-on-paas-helpers --clone.
  2. Clone your fork into your machine with git clone https://github.com/YOUR-USERNAME/bitwarden-on-paas-helpers.git. (Only proceed if --clone isn't passed)

    • To also configure the upstream remote for official GH CLI users, do gh repo clone YOUR-USERNAME/vaultwarden-on-paas-helpers.
  3. Login to Divio Control Panel then copy your API token in the Access Token page.

    • To fetch/pull/push to and from the Git repo or access the server through SSH, you need to add your SSH key to your account. Read this guide on how to add your SSH keys.
  4. Create a new project. When prompted to choose an subscription, leave the defaults and hit Save.

  5. Go back to your terminal window and do divio login [PASTE-YOUR-ACCESS-KEY-HERE]

  6. Navigate into your local copy of your fork with cd vaultwarden-on-paas-helpers (may depends on how you clone and where).

  7. Run divio project configure, press y then hit Enter. Then type your new project's slug and hit Enter. You may notice some text simliar to these below after hitting Enter. Now, copy your Git remote and run git remote add divio [YOUR-DIVIO-GIT-REMOTE-HERE].

$ divio project configure
# This action will overwrite the local Divio configuration file for your project or create a new one. Do you want to continue? [y/N]: y
# Please enter the application slug of the local project: bitwardenrs-thepinsteam
# Configuration file: /data/data/com.termux/files/home/bitwardenrs_heroku/.divio/config.json
# Git remote:         git@git.divio.com:bitwardenrs-thepinsteam.git
  1. Run the tools/setup-vaultwarden-instance script with divio argument.

    • You may prompted to re-enter your Divio API key because it doesn't rely on the ~/.netrc file on your drive for security reasons.
    • This might take some while because the script is actively interacting with the API.
    • Once the provisioning of the Postgrrs database is completed, follow the prompts to complete the setup.
  2. Upon reaching this message below, run the tools/push2divio to push to its Git repository and deploy.

==========================================================
The setup was completed successfully. To finish the
deployment and to access the Bitwarden Web Vault,
run the following command to deploy to Divio:

  $ ./tools/push2divio

This will force-push into your project's Git repository
and then run `divio project deploy`.

If you ever need to update your Vaultwarden instance, run
the following command to issue an image rebuild:

  $ ./tools/update-instance divio

By the way, you should pratice manually backing up your
Postgres database to ensure your data is safe, even during
an instance upgrade. Enjoy your new Vaultwarden instance!
==========================================================
  1. Congrats! You successfully deployed an BitwardenRS instance on Divio. Now navigate to https://your-project.us.aldyrn.io and create a account.

Installing on Railway through the starter button

WORK IN PROGRESS

  1. Fire up the deployment page by pressing the button below.

Deploy on Railway

  1. Fill up the required missing fields. Don't forget to set MAKE_IT_FAIL to any value so the startup script will fail artifically instead of complaining about missing required configuration such as SMTP settings and domain name on your runtime logs.

  2. Open your terminal and clone your hard-forked repo with gh repo clone YOUR-USERNAME/vaultwarden-on-paas-helpers (if GitHub CLI is not installed try git clone git@github.com:YOUR-USERNAME/vaultwarden-on-paas-helpers.git.

  3. Navigate into your local copy of your fork with cd vaultwarden-on-paas-helpers (may depends on how you clone and where).

  4. Run ./tools/setup-vaultwarden-instance railway to install the CLI and connect your local repo to the newly-created project, among other things.

    • The script will set MAKE_IT_FAIL to false after completing the setup wizard.

Troubleshooting

  • Can't install Railway CLI on Termux?
    • Railway CLI is currently only work on Linux, macOS and Windows. Probably try following the setup guide on an cloud dev environment like Gitpod.