Skip to content

Commit

Permalink
Merge pull request 'feature/fix-woodstock-v1' (#8) from feature/fix-w…
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix741 committed Sep 13, 2020
2 parents a38fa71 + f5df7e3 commit 7f2d856
Show file tree
Hide file tree
Showing 28 changed files with 223 additions and 133 deletions.
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:12-buster as dependencies
FROM node:14-buster as dependencies
LABEL MAINTAINER="Ulrich Van Den Hekke <ulrich.vdh@shadoware.org>"

WORKDIR /src/server
Expand Down Expand Up @@ -32,21 +32,22 @@ RUN npm run build

#
# -------- Dist -----------
FROM node:12-buster AS dist
FROM node:14-buster AS dist

RUN apt update && apt install -y btrfs-compsize btrfs-progs coreutils samba-common-bin rsync && rm -rf /var/lib/apt/lists/*

WORKDIR /server
COPY --from=build /src/server/dist/ /server/
COPY --from=build /src/server/config/ /server/config/
COPY --from=build /src/client/dist /server/client/
COPY --from=dependencies /src/server/node_modules /server/node_modules

RUN mkdir -p /root/.ssh && chmod 700 /root/.ssh
RUN echo "IdentityFile /backups/.ssh/id_rsa" >> /root/.ssh/config
RUN echo "StrictHostKeyChecking=no" >> /root/.ssh/config
RUN mkdir -p /backups/.ssh && chmod 700 /backups/.ssh

COPY --from=dependencies /src/server/node_modules /server/node_modules
COPY --from=build /src/server/config/ /server/config/
COPY --from=build /src/server/dist/ /server/
COPY --from=build /src/client/dist /server/client/

ENV STATIC_PATH=/server/client/
ENV NODE_ENV=production
ENV BACKUP_PATH=/backups
Expand Down
4 changes: 2 additions & 2 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 31 additions & 32 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,55 @@
"generate": "graphql-codegen --config codegen.yml"
},
"dependencies": {
"@mdi/font": "^5.4.55",
"axios": "^0.19.2",
"@mdi/font": "^5.5.55",
"chart.js": "^2.9.3",
"core-js": "^3.6.4",
"date-fns": "^2.15.0",
"date-fns": "^2.16.1",
"filesize.js": "^2.0.0",
"numeral": "^2.0.6",
"roboto-fontface": "*",
"rxjs": "^6.6.2",
"vue": "^2.6.11",
"rxjs": "^6.6.3",
"vue": "^2.6.12",
"vue-apollo": "^3.0.4",
"vue-chartjs": "^3.5.0",
"vue-chartjs": "^3.5.1",
"vue-class-component": "^7.2.5",
"vue-property-decorator": "^9.0.0",
"vue-router": "^3.4.2",
"vuetify": "^2.3.8"
"vue-router": "^3.4.3",
"vuetify": "^2.3.10"
},
"devDependencies": {
"@graphql-codegen/cli": "^1.17.7",
"@graphql-codegen/introspection": "^1.17.7",
"@graphql-codegen/typescript": "^1.17.7",
"@graphql-codegen/typescript-graphql-files-modules": "^1.17.7",
"@graphql-codegen/typescript-operations": "^1.17.7",
"@types/chart.js": "^2.9.23",
"@types/jest": "^26.0.9",
"@types/node": "^14.0.27",
"@graphql-codegen/cli": "^1.17.8",
"@graphql-codegen/introspection": "^1.17.8",
"@graphql-codegen/typescript": "^1.17.9",
"@graphql-codegen/typescript-graphql-files-modules": "^1.17.8",
"@graphql-codegen/typescript-operations": "^1.17.8",
"@types/chart.js": "^2.9.24",
"@types/jest": "^26.0.13",
"@types/node": "^14.10.1",
"@types/numeral": "^0.0.28",
"@typescript-eslint/eslint-plugin": "^3.8.0",
"@typescript-eslint/parser": "^3.8.0",
"@vue/cli-plugin-babel": "~4.4.6",
"@vue/cli-plugin-eslint": "~4.4.6",
"@vue/cli-plugin-router": "~4.4.6",
"@vue/cli-plugin-typescript": "~4.4.6",
"@vue/cli-plugin-unit-jest": "^4.4.6",
"@vue/cli-service": "~4.4.6",
"@typescript-eslint/eslint-plugin": "^4.1.0",
"@typescript-eslint/parser": "^4.1.0",
"@vue/cli-plugin-babel": "~4.5.6",
"@vue/cli-plugin-eslint": "~4.5.6",
"@vue/cli-plugin-router": "~4.5.6",
"@vue/cli-plugin-typescript": "~4.5.6",
"@vue/cli-plugin-unit-jest": "^4.5.6",
"@vue/cli-service": "~4.5.6",
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/eslint-config-typescript": "^5.0.2",
"@vue/test-utils": "^1.0.3",
"eslint": "^7.6.0",
"@vue/eslint-config-typescript": "^5.1.0",
"@vue/test-utils": "^1.1.0",
"eslint": "^7.9.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-vue": "^6.2.2",
"graphql-tag": "^2.11.0",
"lint-staged": "^10.2.11",
"prettier": "^2.0.5",
"lint-staged": "^10.3.0",
"prettier": "^2.1.1",
"sass": "^1.26.10",
"sass-loader": "^9.0.3",
"typescript": "~3.9.7",
"sass-loader": "^10.0.2",
"typescript": "~4.0.2",
"vue-cli-plugin-apollo": "^0.22.2",
"vue-cli-plugin-vuetify": "^2.0.7",
"vue-template-compiler": "^2.6.11",
"vue-template-compiler": "^2.6.12",
"vuetify-loader": "^1.6.0"
},
"gitHooks": {
Expand Down
4 changes: 1 addition & 3 deletions client/src/components/QueueInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@

<v-divider></v-divider>
<v-card-text>
<v-icon class="mr-2" small>
mdi-clock-outline
</v-icon>
<v-icon class="mr-2" small> mdi-clock-outline </v-icon>
<span class="caption grey--text font-weight-light"><slot></slot></span>
</v-card-text>
</v-card>
Expand Down
4 changes: 1 addition & 3 deletions client/src/components/SpaceUsageCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

<v-divider></v-divider>
<v-card-text>
<v-icon class="mr-2" small>
mdi-folder-outline
</v-icon>
<v-icon class="mr-2" small> mdi-folder-outline </v-icon>
<span class="caption grey--text font-weight-light"> Shared space: {{ shared | filesize }}</span>
</v-card-text>
</v-card>
Expand Down
14 changes: 4 additions & 10 deletions client/src/views/Backups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{ props.item.startDate | date }}
</template>
<template slot="item.duration" slot-scope="props">
{{ (props.item.duration / 3600) | formatNumber }}
{{ (props.item.duration / (1000 * 60)) | formatNumber }}
</template>
<template slot="item.fileSize" slot-scope="props">
{{ props.item.fileSize | filesize }}
Expand Down Expand Up @@ -53,9 +53,7 @@
<v-btn-toggle borderless multiple>
<v-menu offset-y>
<template v-slot:activator="{ on }">
<v-btn text v-on="on">
Show Log
</v-btn>
<v-btn text v-on="on"> Show Log </v-btn>
</template>
<v-list>
<v-list-item :to="`/backups/${hostname}/${item.number}/logs/backup.log`">
Expand All @@ -81,17 +79,13 @@
<template v-for="(job, key) in jobCreated">
<v-snackbar v-model="jobCreated[key]" color="info" :timeout="5000" :key="key">
Launch a backup with job id {{ key }}.
<v-btn color="secondary" text @click="jobCreated[key] = false">
Close
</v-btn>
<v-btn color="secondary" text @click="jobCreated[key] = false"> Close </v-btn>
</v-snackbar>
</template>
<template v-for="(job, key) in jobRemoved">
<v-snackbar v-model="jobRemoved[key]" color="error" :timeout="5000" :key="key">
Remove the backup with job id {{ key }}.
<v-btn color="primary" text @click="jobRemoved[key] = false">
Close
</v-btn>
<v-btn color="primary" text @click="jobRemoved[key] = false"> Close </v-btn>
</v-snackbar>
</template>
</v-container>
Expand Down
10 changes: 7 additions & 3 deletions client/src/views/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,20 @@
</v-row>

<v-row>
<v-col cols="12" sm="6" v-if="diskUsageStats && diskUsageStats.quotas">
<v-col cols="12" sm="6" v-if="diskUsageStats && diskUsageStats.quotas && diskUsageStats.quotas.length">
<SpaceUsageGraphCard :quotas="diskUsageStats.quotas"></SpaceUsageGraphCard>
</v-col>
<v-col cols="12" sm="6" v-if="diskUsageStats && diskUsageStats.compressionStats">
<v-col
cols="12"
sm="6"
v-if="diskUsageStats && diskUsageStats.compressionStats && diskUsageStats.compressionStats.length"
>
<CompressionGraphCard :compressionStats="diskUsageStats.compressionStats"></CompressionGraphCard>
</v-col>
</v-row>

<v-row>
<v-col cols="12" sm="12" v-if="diskUsageStats && diskUsageStats.quotas">
<v-col cols="12" sm="12" v-if="diskUsageStats && diskUsageStats.quotas && diskUsageStats.quotas.length">
<RepartitionChartCard :currentRepartition="diskUsageStats.currentRepartition"></RepartitionChartCard>
</v-col>
</v-row>
Expand Down
5 changes: 0 additions & 5 deletions client/src/views/QueueTasks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ import runningTasksSub from './QueueTasksSubscription.graphql';
import { QueueTasksQuery, QueueTasksJobUpdatedSubscription } from '../generated/graphql';
import { QueueComponent } from '../components/QueueComponent';
type QueueQuery = QueueTasksQuery['queue'];
type RunningTaskQueue = {
[key in string]: QueueQuery;
};
@Component({
components: { Task },
})
Expand Down
1 change: 1 addition & 0 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"importHelpers": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ volumes:
driver: local
driver_opts:
type: none
device: /var/lib/woodstock/woodstock
device: /var/lib/woodstock
o: bind
2 changes: 1 addition & 1 deletion server/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BACKUP_PATH=/var/lib/woodstock/woodstock
BACKUP_PATH=/var/lib/woodstock
REDIS_HOST=localhost
REDIS_PORT=6379
APOLLO_KEY=service:woodstock-backup:iqaZyc66gS4JhesQlqnXvw
Expand Down
5 changes: 4 additions & 1 deletion server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ lerna-debug.log*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/extensions.json

# Environment
.env
1 change: 1 addition & 0 deletions server/config/tools.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

---
tools:
df: /bin/df
Expand Down
4 changes: 2 additions & 2 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 29 additions & 29 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,72 +40,72 @@
},
"dependencies": {
"@nestjs/bull": "^0.1.2",
"@nestjs/common": "^7.4.2",
"@nestjs/common": "^7.4.4",
"@nestjs/config": "^0.5.0",
"@nestjs/core": "^7.4.2",
"@nestjs/core": "^7.4.4",
"@nestjs/graphql": "^7.6.0",
"@nestjs/platform-express": "^7.4.2",
"@nestjs/platform-express": "^7.4.4",
"@nestjs/serve-static": "^2.1.3",
"@nestjs/swagger": "^4.5.12",
"apollo-server-express": "^2.16.1",
"archiver": "^5.0.0",
"bull": "^3.16.0",
"@nestjs/swagger": "^4.6.0",
"apollo-server-express": "^2.17.0",
"archiver": "^5.0.2",
"bull": "^3.18.0",
"bull-board": "^0.9.0",
"class-transformer": "^0.3.1",
"class-validator": "^0.12.2",
"commander": "^6.0.0",
"cron-parser": "^2.15.0",
"file-type": "^14.7.1",
"commander": "^6.1.0",
"cron-parser": "^2.16.3",
"file-type": "^15.0.0",
"graphql": "^15.3.0",
"graphql-tools": "^6.0.16",
"graphql-tools": "^6.2.2",
"js-yaml": "^3.14.0",
"logform": "^2.2.0",
"mkdirp": "^1.0.4",
"nestjs-console": "^3.1.1",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rsync": "^0.6.1",
"rxjs": "^6.6.2",
"rxjs": "^6.6.3",
"shelljs": "^0.8.4",
"swagger-ui-express": "^4.1.4",
"tmp": "^0.2.1",
"winston": "^3.3.3",
"winston-daily-rotate-file": "^4.5.0"
},
"devDependencies": {
"@nestjs/cli": "^7.4.1",
"@nestjs/schematics": "^7.0.1",
"@nestjs/testing": "^7.4.2",
"@nestjs/cli": "^7.5.1",
"@nestjs/schematics": "^7.1.2",
"@nestjs/testing": "^7.4.4",
"@types/archiver": "^3.1.0",
"@types/better-queue": "^3.8.2",
"@types/bull": "^3.14.0",
"@types/bull": "^3.14.2",
"@types/bull-board": "^0.6.0",
"@types/express": "^4.17.7",
"@types/jest": "26.0.9",
"@types/express": "^4.17.8",
"@types/jest": "26.0.13",
"@types/js-yaml": "^3.12.5",
"@types/logform": "^1.10.1",
"@types/mkdirp": "^1.0.1",
"@types/mock-fs": "^4.10.0",
"@types/node": "^14.0.27",
"@types/node": "^14.10.1",
"@types/rsync": "^0.4.30",
"@types/shelljs": "^0.8.8",
"@types/supertest": "^2.0.10",
"@types/tmp": "^0.2.0",
"@typescript-eslint/eslint-plugin": "^3.8.0",
"@typescript-eslint/parser": "^3.8.0",
"eslint": "^7.6.0",
"@typescript-eslint/eslint-plugin": "^4.1.0",
"@typescript-eslint/parser": "^4.1.0",
"eslint": "^7.9.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"jest": "^26.2.2",
"mock-fs": "^4.12.0",
"jest": "^26.4.2",
"mock-fs": "^4.13.0",
"node-deb": "^0.10.7",
"prettier": "^2.0.5",
"prettier": "^2.1.1",
"supertest": "^4.0.2",
"ts-jest": "26.1.4",
"ts-loader": "^8.0.2",
"ts-node": "^8.10.2",
"ts-jest": "26.3.0",
"ts-loader": "^8.0.3",
"ts-node": "^9.0.0",
"tsconfig-paths": "^3.9.0",
"typescript": "^3.9.7"
"typescript": "^4.0.2"
},
"jest": {
"moduleFileExtensions": [
Expand Down
1 change: 0 additions & 1 deletion server/src/app-command.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import { YamlService } from './utils/yaml.service';
HostConsumerUtilService,
HostsService,
LockService,
StatsConsumer,
StatsService,
StatsCommand,
ToolsService,
Expand Down
Loading

0 comments on commit 7f2d856

Please sign in to comment.