turtledb-com
v0.4.7
Published
A nice internet just big enough for your corner of the World Wide Web.
Downloads
68
Readme
turtledb-com
The easiest way to build a web app.
[!WARNING] THIS PROJECT IS A WORK IN PROGRESS
A Reinvented Internet
- This project takes your directories and puts them on the web.
- It distributes and remembers your changes as you make them.
Getting Started
- have a growth mindset
- install node [^1]
- make a directory for your new web-site
- open a terminal and
cdto your directory [^1] - run
npx turtledb-com -f -rand answer the questions - add some .html to your directory (and .css and .js if you want (and maybe some images?)) [^1]
- see your amazing website online (and wow your friends)
[^1]: You can do it! I believe in you! (but if a step takes more than 10 minutes of "how do I open a terminal on windows?" please let me know. (Let's improve some documentation!🎉))
command line options
npx turtledb-com -h
A short overview of all the available options.
[!NOTE]
-fsyncs from your directory,-rsyncs to the internet
Options:
| flag(s) | description | |---|---| | -V, --version | output the version number | | --env-file | path to .env file | | --username | username to use for Signer (env: TURTLEDB_USERNAME) | | --password | password to use for Signer (env: TURTLEDB_PASSWORD) | | --turtlename | name for dataset (env: TURTLEDB_TURTLENAME) | | -f, --fs-mirror [resolve] | mirror files locally and handle (choices: "ours", "theirs", "throw", "", default: false, preset: "throw", env: TURTLEDB_FS_MIRROR) | | -i, --interactive | flag to start repl (default: false, env: TURTLEDB_INTERACTIVE) | | -a, --archive | save all turtles to files by public key (default: false, env: TURTLEDB_ARCHIVE) | | -v, --verbose [level] | log data flows (choices: "-Infinity", "-3", "-2", "-1", "0", "1", "2", "3", "Infinity", default: 0, preset: 1, env: TURTLEDB_VERBOSE) |
Web Server:
| flag(s) | description | |---|---| | -w, --web-port [number] | web port to sync from (default: false, preset: 8080, env: TURTLEDB_WEB_PORT) | | --web-fallback | project public key to use as fallback for web (env: TURTLEDB_WEB_FALLBACK) | | --web-certpath | path to self-cert for web (env: TURTLEDB_WEB_CERTPATH) | | --web-insecure | (local dev) allow unauthorized for web (env: TURTLEDB_WEB_INSECURE) |
TurtleDB Syncing:
| flag(s) | description | |---|---| | --remote-host | remote host to sync to (default: false, env: TURTLEDB_REMOTE_HOST) | | -r, --remote-port [number] | remote port to sync to (default: false, preset: 1024, env: TURTLEDB_REMOTE_PORT) | | -l, --local-port [number] | local port to sync from (default: false, preset: 1024, env: TURTLEDB_LOCAL_PORT) |
S3-like Service Syncing:
| flag(s) | description | |---|---| | --s3-end-point | endpoint for s3 (like "https://sfo3.digitaloceanspaces.com") (default: false, env: TURTLEDB_S3_END_POINT) | | --s3-region | region for s3 (like "sfo3") (env: TURTLEDB_S3_REGION) | | --s3-access-key-id | accessKeyId for s3 (env: TURTLEDB_S3_ACCESS_KEY_ID) | | --s3-secret-access-key | secretAccessKey for s3 (env: TURTLEDB_S3_SECRET_ACCESS_KEY) | | --s3-bucket | bucket for s3 (env: TURTLEDB_S3_BUCKET) | | -h, --help | display help for command |
--env-file <path>
[!IMPORTANT] Never put a file with secret information (like a password) in a folder that will sync it remotely
Lets you replace multiple other flags...
npx turtledb-com --username=jance --password=secret --turtlename=test -f -r...with one flag and a path to a file...
npx turtledb-com --env-file=../.env
...that's easy to understand.
../.envTURTLEDB_USERNAME=jance TURTLEDB_PASSWORD=secret TURTLEDB_TURTLENAME=test TURTLEDB_FS_MIRROR= TURTLEDB_REMOTE_PORT=
(blank values get set to the preset value)
-f, --fs-mirror [resolve]
Takes the current directory and syncs it with the TurtleDB instance.
Calling the flag with no value is the same as calling --fs-mirror=throw.
There are 3 options:
| Option | What to do in case of a conflict |
|---|---|
| ours | commit the version of the file in the folder |
| theirs | remove or replace files in folder to match last commit |
| throw | throw an error |
-r, --remote-port [number]
The flag with no value turns on the default syncing with turtledb.com.
If you want to sync with somewhere else you'll want to set --remote-host to the other instance.
