Anyone using Firebase?

I spent some time this morning trying to get this up and running as the feature list shown is pretty darn impressive. It’s listed in the main “saver chooser” area tw-com on the home page so thought there might be others here that have had success with it.

My focus was on multi-device or small-team collaboration:

  • Basic authorization (bags have an access policy determining who can read / write them).
  • Multiple wikis can be hosted under a single firebase account.
  • It uses Firebase’s built-in social auth to log in users.
  • Tiddlers are written individually with locking, preventing users overwriting each others’ updates.

Unfortunately I got all the way to the deploy script part and it failed. I’ve put in an ‘issue’ but not sure if the project is still maintained or if Peter Neumark is still engaged.

I’m assuming you mean https://tiddlywiki.com/#TW5-firebase%3A%20TiddlyWiki5%20for%20Google%20Firebase%20by%20Peter%20Neumark

Walkthrough here https://neumark.github.io/tw5-firebase/

Looks very interesting, would be great if someone tried it / got it working.

Agreed. In order to get as far as I have I had to (as I’m a non-developer and Windows user) install Node.js, npm, yarn etc. so I have no idea if my troubles has to do with any of those things or Firebase or Peter’s script. Knowing if others have got it to work would narrow down things at least a bit!

But, but – it’s Google! And this time they don’t want to know generic information about you or your shopping habits – they want your credit card!

If I thought it could use the Google Play card, which is how I pay for Google Services, then maybe …

But what is the advantage of all this? You read through the whole thing but you don’t get to see what the result is. This must be one of the most complicated save mechanisms to set up, so there should be a big pay-off.

Great question @Mark_S - similar to my ongoing quest to have a wiki for my small team (6 of them). I do a LOT in TiddlyWiki for work (project management) already, but I can’t extend it to my team. That means I use extensive and customized workflows for my own projects, but for my team I have to fall back to OneNote or PowerApps or other 3rd party stuff I dislike. I can’t tell what kind of experience it is on the back end, but the writeup uses the terms “small-team collaboration”, “auth to log in users”, “individual tiddler locking to prevent overwriting” etc.

The closest to this I’ve found is BOB, but that’s LAN only so nobody can use it from their phones easily or from home. I discussed this a bit in Saver options and combinations - Discussion - Talk TW (tiddlywiki.org), but didn’t find something else yet that would work. @saqimtiaz mentioned Tailscale which I was excited about until I tried to implement it and I had to install software on each machine. At work we don’t have admin access, so it has to be just point to url essentially.

So you got as far as

yarn run deploy

?

Maybe if you could post the output from your script it might provoke some ideas.

Unfortunately it seems not that helpful, but maybe it means something else to somebody who knows that they’re looking for :slight_smile:

PS C:\Users\stobot\tw5-firebase> yarn run deploy
yarn run v1.22.17
$ ./scripts/build.sh && ./scripts/deploy.sh
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

It looks like you could start by trying to run ./scripts/build.sh and ./scripts/deploy.sh by hand separately to see which script causes the error.

Then if that works, you can insert echo commands to tell you what part of whichever script breaks.

Back. So I couldn’t figure out how to just “run” a .sh file and it sounded like maybe I had to figure out “installing bash”, so I installed wlm or something… Looks like it installed Ubuntu, unfortunately I’m out of my depth… running “bash” from command line actually does something now anyways.

When I try to use bash and the build.sh (which is what I think you’re suggesting) I get the below. Is that helpful? It looks like stuff is missing, but it’s possible that stuff is done before this script is actually run? No idea what yarn run deploy actually does…

PS C:\Users\stobot> cd tw5-firebase
PS C:\Users\stobot\tw5-firebase> bash ./scripts/build.sh
: invalid optionsh: line 2: set: -
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
: No such file or directory /mnt/c/Users/stobb/tw5-firebase/scripts
./scripts/build.sh: line 6: $'\r': command not found
./scripts/build.sh: line 7: pushd: $'/mnt/c/Users/stobb/tw5-firebase/scripts\r/..\r': No such file or directory
./scripts/build.sh: line 8: $'\r': command not found
: No such file or directory /mnt/c/Users/stobb/tw5-firebase/scripts
./scripts/build.sh: line 10: $'\r': command not found
: No such file or directory: /mnt/c/Users/stobb/tw5-firebase/scripts
./scripts/build.sh: line 12: $'\r': command not found
: No such file or directory: /mnt/c/Users/stobb/tw5-firebase/scripts
./scripts/build.sh: line 14: $'\r': command not found
: No such file or directory: /mnt/c/Users/stobb/tw5-firebase/scripts
./scripts/build.sh: line 16: $'\r': command not found
./scripts/build.sh: line 17: $'popd\r': command not found

We must solve this. As far as I can see you could use bob if it can be hosted on the internet safely in a docker container or VM but these are not available to us all.

Alternatively a LAN resource can be accessed securely if the team has a VPN into the LAN. The harder part is when a team member is outside the LAN without a VPN etc…

Oh! I didn’t catch that you were using PS. All that speed reading.

I think you just need to go to your firebase directory and

yarn ./scripts/build.sh

PS C:\Users\stobot\tw5-firebase\scripts> yarn build.sh
yarn run v1.22.17
error Command "build.sh" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

makes it seem like the file is not there… but

PS C:\Users\stobot\tw5-firebase\scripts> dir


    Directory: C:\Users\stobot\tw5-firebase\scripts


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        11/10/2021   9:15 AM            552 backup2.sh
-a----        11/10/2021   9:15 AM            452 build-backend.sh
-a----        11/10/2021   9:15 AM            269 build-cli.sh
-a----        11/10/2021   9:15 AM            881 build-frontend.sh
-a----        11/10/2021   9:15 AM            148 build-jsonschema.sh
-a----        11/10/2021   9:15 AM            452 build-prerequisites.sh
-a----        11/10/2021   9:15 AM            278 build-tests.sh
-a----        11/10/2021   9:15 AM            268 build.sh
-a----        11/10/2021   9:15 AM            483 cli.sh
-a----        11/10/2021   9:15 AM            308 deploy.sh
-a----        11/10/2021   9:15 AM           1515 env.sh
-a----        11/10/2021   9:15 AM            312 export.sh
-a----        11/10/2021   9:15 AM            146 firebase.sh
-a----        11/10/2021   9:15 AM            652 gcloud-shell.sh
-a----        11/10/2021   9:15 AM            530 gettoken.sh
-a----        11/10/2021   9:15 AM            157 logs.sh
-a----        11/10/2021   9:15 AM           1262 renderdoc.sh
-a----        11/10/2021   9:15 AM            397 repl.sh
-a----        11/10/2021   9:15 AM            230 run-local-backend.sh
-a----        11/10/2021   9:15 AM            528 run-local-frontend.sh
-a----        11/10/2021   9:15 AM            308 stripnewline.sh
-a----        11/10/2021   9:15 AM            318 test.sh
-a----        11/10/2021   9:15 AM            334 tiddlers-to-firestore.sh
-a----        11/10/2021   9:15 AM            257 tiddlers-to-fs.sh
-a----        11/10/2021   9:15 AM            265 update-supported-browsers.sh

I can see it’s clearly there… I’m sure I’m missing something embarassingly simple. Also, if using something other than PS, happy to try that.

Thanks @TW_Tones , yes have used BOB in the past but about once a day someone did something that crashed it. PLUS nobody could easily access it via phone being local IP.

I have to admit that I’m sitting here considering normal Node.js with host=0.0.0.0 despite the warnings just to try it… doesn’t solve phone, but probably more stable than BOB for me…

1 Like

Sounds like you set up the Windows Subsystem for Linux… which is good. I think there is an above average chance your problems might be related to needing to execute the scripts from bash.

I am not a Windows expert but I think it might be worth adding Ubuntu’s bash to the terminal in Windows and then running the scripts.

Terminal app from Microsoft

Once you have that, I am not sure if the option below to open a tab with the Ubuntu bash shell comes up as default or if you need to configure it:

This is almost hilarious. Yes I’d installed Ubuntu and was using Terminal already. Got in there (see screenshot) and then it looks like yarn was no longer installed so tried to install it via npm, but that wasn’t in there and googling said to try installing nodejs in there, but got stuck again…

Different approach. Yarn probably sets up dependencies and variables. So edit the bottom of build.sh with something like

echo “At bottom of build.sh”

And then run yarn deploy again. If it gets to the message, then you know to move to deploy.sh. Put in marker echo messages until you narrow down what line is causing the problem.

Alternatively, you can edit package.json and change what ‘deploy’ runs so it just runs ‘build.sh’ .

You’ve replied to @stobot 3 times, did you know you could send them a personal message instead?

Did you know that Discourse is not human? Did you? Hm? Hm? Grr.

Strangely even with the echo something opens for a second and then goes away…

The build.sh file now looks like:

#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# set up env
. "$DIR/env.sh"

pushd "$DIR/.."

"$DIR/build-jsonschema.sh"

"$DIR/build-frontend.sh"

"$DIR/build-backend.sh"

"$DIR/build-cli.sh"

popd

echo "at bottom of build.sh"

but when I do the yarn run deploy bit (in PowerShell) it acts the same

PS C:\Users\stobb\tw5-firebase> yarn run deploy
yarn run v1.22.17
$ ./scripts/build.sh && ./scripts/deploy.sh
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

thanks @Mark_S - I’m going to have to give up for the night now, appreciate you taking the time - I’ll try a bit more tomorrow.

So now you’re running everything in the bash shell (which means under the covers in the Ubuntu install), so you need to install things in Ubuntu. I suspect the install scripts for the project you are trying to use assume a *nix OS and therefore are having issues.

In the bash shell try this:

sudo apt update
sudo apt upgrade
sudo apt install build-essential
sudo apt install nodejs npm
sudo apt install jq
npm install --global yarn
yarn install #in the project dir

That probably means the error is occurring in one of these:

"$DIR/build-jsonschema.sh"

"$DIR/build-frontend.sh"

"$DIR/build-backend.sh"

"$DIR/build-cli.sh"

You can put echos before each of these to see how far it gets.

2021 and developers are still giving us single digit error codes!

It’s Google Cloud, a service provider. Unlike many other things – you’re directly paying Google for a service, just like you might buy hosting from Amazon Web Services or Microsoft’s Azure cloud.

What I’m working on with Fission I hope to eventually be a competitor to the all-in-one Firebase stack, which is the entire backend that many custom apps use. Which, of course, locks them into Google’s cloud, since it’s proprietary to them.

But I don’t have any Google-is-tracking-me concerns in this case, they’re just a service provider.