fission-codes / fission

Fission CLI & server
https://runfission.com/docs
119 stars 14 forks source link

Update fission-server README with complete instructions #609

Closed walkah closed 2 years ago

walkah commented 2 years ago

Need to detail configuration requirements, build and run.

justindotpub commented 2 years ago

Quick notes for you in case they save you some time.

# Clone fission repo
gh repo clone fission-suite/fission
cd fission

# If already had clone, clean all files if needed
git clean -dffx

# Open in vscode
# Replace all `--nix` with `--no-nix` in project
# Open terminal
# Start nix shell
nix-shell --arg rosetta true

# See all commands
helpme

# Build everything
build

# Errors while building
     fission-cli       > /Users/justin/Code/justincjohnson/fission/fission-cli/<built-in>:16:10: error:
     fission-cli       >      warning: non-portable path to file '".stack-work/dist/x86_64-osx-nix/Cabal-3.2.1.0/build/Fission/autogen/cabal_macros.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
     fission-cli       > #include ".stack-work/dist/x86_64-osx-nix/Cabal-3.2.1.0/build/fission/autogen/cabal_macros.h"
     fission-cli       >          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     fission-cli       >          ".stack-work/dist/x86_64-osx-nix/Cabal-3.2.1.0/build/Fission/autogen/cabal_macros.h"
     fission-cli       > 1 warning generated. 
     fission-cli       >                          
     fission-cli       > /Users/justin/Code/justincjohnson/fission/fission-cli/<built-in>:16:10: error:
     fission-cli       >      warning: non-portable path to file '".stack-work/dist/x86_64-osx-nix/Cabal-3.2.1.0/build/Fission/autogen/cabal_macros.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
     fission-cli       > #include ".stack-work/dist/x86_64-osx-nix/Cabal-3.2.1.0/build/fission/autogen/cabal_macros.h"
     fission-cli       >          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     fission-cli       >          ".stack-work/dist/x86_64-osx-nix/Cabal-3.2.1.0/build/Fission/autogen/cabal_macros.h"
     fission-cli       > 1 warning generated.     
     fission-cli       > Linking .stack-work/dist/x86_64-osx-nix/Cabal-3.2.1.0/build/fission/fission ...

# Install cli and server
cli-install
server-install

# Copy .env file in place, since used by docker compose
cd fission-web-server
cp env.example .env

# Start up docker containers
docker compose up -d
    [+] Running 4/4
        ⠿ Container fission-web-server-ipfs-1          Started                                                                              0.8s
        ⠿ Container fission-web-server-dns-auth-1      Started                                                                              0.8s
        ⠿ Container fission-web-server-postgres-1      Started                                                                              0.7s
        ⠿ Container fission-web-server-dns-recursor-1  Started                                                                              0.8s
docker compose exec dns-auth pdnsutil create-zone runfission.test
docker compose exec dns-auth pdnsutil create-zone fissionuser.test
docker compose exec dns-auth pdnsutil create-zone fissionapp.test

# System Preferences > Network > Wifi > Advanced > DNS
# Add 127.0.0.1
# Apply

# Validate DNS
dig runfission.test @127.0.0.1
# should be same as
dig runfission.test

# Create postgres db
psql
create database web_api
\q

# Copy remaining example files
cp ./fission-web-server/addon-manifest.json.example ./fission-web-server/addon-manifest.json
sed -i "s+CHANGE_ME_TO_NUMBER+42+" addon-manifest.json
cp ./fission-web-server/server.yaml.example ./fission-web-server/server.yaml
# Per README.md, defaults to docker setup, so no mod needed

# Start server
server-start
# Make sure it's running.  Looks hung on resend?
tail nohup.out
│  ├─ email/
│  │  ├─ recover/
│  │  │  └─ <capture>/
│  │  │     └─•
│  │  ├─ resend/
│  │  │  └─

# Set up pointing to local server
rm -rf ~/.config/fission
fission -R runfission.test setup
🌱 Setting up environment
🪐 Downloading managed IPFS for macOS
🕓🎛️  Configuring managed IPFS
🔑 Setting up keys
🏠 Do you have an existing account? [Y/n] n
Username: justin
Email: justin@justinjohnson.io
🚫 Trouble contacting the server. Please try again or contact Fission support at https://fission.codes

# Tried localhost and 127.0.0.1 as well, but error related to DNS record and missing DID
walkah commented 2 years ago

@justincjohnson have a look at my PR and see if I've filled in enough of the missing pieces in the instructions... but I kinda remember why I left this in the state it's in: there are a lot of sharp edges to running this still. e.g. most of our code doesn't assume/account for alternate ports (so, you need to specify -R runfission.test:1337 on all of your CLI commands - and if you register / publish apps they'll actually be on 8080. I can throw nginx into the docker compose to alleviate some of that.. (maybe with self-signed certs?).

Anyway, suggestions welcome!

justindotpub commented 2 years ago

Thanks @walkah. I added some comments. Not quite working for me yet but getting closer.