mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-06-18 20:15:42 +02:00
4.7 KiB
4.7 KiB
In [ ]:
# Install prerequesties
!curl -L https://fly.io/install.sh | sh
!curl -fsSL https://deno.land/x/install/install.sh | sh
!apt update && apt -y install jq
import os
%env PATH=/root/.fly/bin:/root/.deno/bin/:{os.environ["PATH"]}
!git clone --recursive https://github.com/vrtmrz/obsidian-livesyncIn [ ]:
# Login up sign up
!flyctl auth signupIn [ ]:
# see https://fly.io/docs/reference/regions/
region = "nrt/Tokyo, Japan" #@param ["jnb/Johannesburg, South Africa","bom/Mumbai, India","sin/Singapore, Singapore","syd/Sydney, Australia","nrt/Tokyo, Japan","ams/Amsterdam, Netherlands","fra/Frankfurt, Germany","lhr/London, United Kingdom","cdg/Paris, France","arn/Stockholm, Sweden","iad/Ashburn, Virginia (US)","ord/Chicago, Illinois (US)","dfw/Dallas, Texas (US)","lax/Los Angeles, California (US)","sjc/San Jose, California (US)","ewr/Secaucus, NJ (US)","yyz/Toronto, Canada","gru/Sao Paulo, Brazil"] {allow-input: true}
%env region={region.split("/")[0]}
#%env appame=
#%env username=
#%env password=
#%env database=
#%env passphrase=
# automatic setup leave it -->
%cd obsidian-livesync/utils/flyio
!./deploy-server.sh | tee deploy-result.txt
## Show result button
from IPython.display import HTML
last_line=""
with open('deploy-result.txt', 'r') as f:
last_line = f.readlines()[-1]
last_line = str.strip(last_line)
if last_line.startswith("obsidian://"):
result = HTML(f"Copy your setup-URI with this button! -> <button onclick=\"navigator.clipboard.writeText('{last_line}')\">Copy setup uri</button><br>Importing passphrase is displayed one. <br>If you want to synchronise in live mode, please apply a preset after ensuring the imported configuration works.")
else:
result = "Failed to encrypt the setup URI"
resultIn [ ]:
!./delete-server.sh