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%
| _frontend | ||
| config | ||
| database | ||
| scripts | ||
| server | ||
| serverinfo | ||
| store | ||
| utils | ||
| .dockerignore | ||
| .gitignore | ||
| deploy | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| README.md | ||
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
Databaseinterface and two implementation:memDBis an in-memory database for testing purposes whilesqliteDBis 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