Web server per gestire la nuova macchina di backup e storage.
  • JavaScript 49.8%
  • Go 29.3%
  • SCSS 17.4%
  • Shell 1.6%
  • HTML 1.1%
  • Other 0.8%
Find a file
2022-07-09 19:26:08 +02:00
_frontend Updated js 2022-07-09 19:26:08 +02:00
config More docker and deploy updates 2022-07-07 15:58:04 +02:00
database Routes refactor and object removal 2022-07-07 18:21:17 +02:00
scripts Updated scripts 2022-07-07 16:25:30 +02:00
server Routes refactor and object removal 2022-07-07 18:21:17 +02:00
serverinfo Refactor: changed some names, the router was the server all along 2022-07-07 01:32:14 +02:00
store Routes refactor and object removal 2022-07-07 18:21:17 +02:00
utils Prototype of DirStore and some routes for working with buckets 2022-06-30 04:26:33 +02:00
.dockerignore Updated .dockerignore 2022-07-07 14:16:50 +02:00
.gitignore Fixed wrong gitignore 2022-07-07 14:02:35 +02:00
deploy Updated deploy script 2022-07-07 19:20:49 +02:00
Dockerfile Updated deploy script 2022-07-09 19:23:15 +02:00
go.mod Minor tweaks 2022-07-04 13:01:41 +02:00
go.sum Refactoring and dashboard state in DB 2022-07-01 01:43:11 +02:00
main.go Refactor: changed some names, the router was the server all along 2022-07-07 01:32:14 +02:00
README.md Added .env to volume bindings 2022-07-07 16:37:29 +02:00

PHC Storage

Web server per gestire la nuova macchina di backup e storage.

Architecture

  • _frontend/

    This is a Vite project for building all the static pages used by this app.

  • database/

    Module with a Database interface and two implementation: memDB is an in-memory database for testing purposes while sqliteDB is a wrapper for working with an SQLite database.

  • routes/

    Various functions for configuring all the server routes.

Usage

First install the required npm packages

$ cd _frontend
_frontend/ $ npm install

Development

# Development
$ MODE=dev go run -v .

# Development with watcher
$ fd -e go | MODE=dev entr -r go run -v .

Production

First build the _frontend/dist folder using

$ cd _frontend
$ npm run build

and then

# Production
$ go run -v .

Production with Docker

$ mkdir buckets.local/
$ cat <<EOF > database.local.json
{
    "prefixSize": 2,
    "dashboardState": {
        "widgets": []
    },
    "buckets": {},
    "api-keys": []
}
EOF
$ cat <<EOF > .env
MODE="production"
HOST=":4000"
ADMIN_PASSWORD="secret"
MONITOR_SCRIPTS_DIR="./scripts"
MONITOR_CACHE_TIMEOUT="10s"
EOF