server

command module
Version: v0.0.0-...-0bc30a8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2021 License: GPL-3.0 Imports: 27 Imported by: 0

README

Fengg

A More Secure Internet Connection for Your Home A Malicious Traffic Detection System For Small Hardware

Checkout fen.gg/crowdfunding and support us with a small donation.

Development

Compile assets and go binary
# build go binary
VERSION=$(git rev-parse --short HEAD) && \
  go build -o fengg -ldflags "-X tea.fen.gg/fengg/server/config.VERSION=$VERSION"

# set linux capabilities
sudo setcap 'cap_net_admin=+ep' fengg

# compile assets
yarn install
# use either dev or build
yarn [dev|build]
Run server application
./fengg
Cross-Compilation
VERSION=$(git rev-parse --short HEAD) \
CARCH="armv7h" \
CHOST="armv7l-unknown-linux-gnueabihf" \
GOARM="7" \
GOARCH="arm" \
go build \
  -o fengg \
  -ldflags "-s -w" \
  -gcflags=all=-trimpath=$(pwd) \
  -asmflags=all=-trimpath=$(pwd) \
  -ldflags "-X tea.fen.gg/fengg/server/config.VERSION=$VERSION"
Merge database migration files

Drop the database and create a new one. Afterwards remember the highest schema version and delete all files in db/migrations.

Then run the following command (replace XXX with the mentioned version):

pg_dump \
  -T public.schema_migrations \
  -O -s -U postgres -d fengg \
    | sed -e '/^--/d' \
    | sed -e '/^$/d' \
    | grep -v '^SELECT pg_catalog\.set_config.*search_path' \
  > db/migrations/000XXX_merged_initial_database.up.sql

Commit and test your changes!

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL