Compare commits

...

245 commits

Author SHA1 Message Date
Ravinou ea5d565567
Merge pull request #224 from Ravinou/dependabot/npm_and_yarn/chart.js-4.4.3
build(deps): bump chart.js from 4.4.2 to 4.4.3
2024-05-26 11:15:56 +02:00
Ravinou fa218b0522
Merge pull request #226 from Ravinou/dependabot/npm_and_yarn/react-hook-form-7.51.5
build(deps): bump react-hook-form from 7.51.4 to 7.51.5
2024-05-25 00:01:28 +02:00
dependabot[bot] 56098d3f8d
build(deps): bump chart.js from 4.4.2 to 4.4.3
Bumps [chart.js](https://github.com/chartjs/Chart.js) from 4.4.2 to 4.4.3.
- [Release notes](https://github.com/chartjs/Chart.js/releases)
- [Commits](https://github.com/chartjs/Chart.js/compare/v4.4.2...v4.4.3)

---
updated-dependencies:
- dependency-name: chart.js
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-24 21:25:28 +00:00
Ravinou 08e6b0e6a6
Merge pull request #227 from Ravinou/dependabot/npm_and_yarn/tabler/icons-react-3.5.0
build(deps): bump @tabler/icons-react from 3.3.0 to 3.5.0
2024-05-24 23:24:02 +02:00
dependabot[bot] a79a91ecb0
---
updated-dependencies:
- dependency-name: "@tabler/icons-react"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-21 19:57:00 +00:00
dependabot[bot] 779cceacf2
---
updated-dependencies:
- dependency-name: react-hook-form
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-21 19:56:46 +00:00
Ravinou 94fd0c6188
🥇 Thanking a new sponsor 🥇
Thank you very much @royalmoose for sponsoring ! This commit is dedicated to thanking you. You give me strength to continue the work!
2024-05-13 22:24:53 +02:00
Ravinou 09224e6f24
2.3.0 2024-05-12 18:10:12 +02:00
Ravinou 0ed03e9433
Merge pull request #220 from Ravinou/develop
feat: add borgbackup "append-only" mode as option to repo !
2024-05-12 18:03:29 +02:00
Ravinou 76d11d83f7
feat: add borgbackup "append-only" mode as option to repo ! #160 2024-05-12 17:52:38 +02:00
Ravinou 6b43c38cc2
Merge pull request #219 from Ravinou/develop
Update dep.
2024-05-10 20:44:28 +02:00
Ravinou 7687f10b7e
feat: notifications are now stacked 2024-05-10 18:54:01 +02:00
Ravinou 9c28a11320
chore: remove eslint and update react-toastify 2024-05-10 18:53:32 +02:00
Ravinou 5162000e25
Merge pull request #218 from Ravinou/dependabot/npm_and_yarn/react-dom-18.3.1
build(deps): bump react-dom from 18.2.0 to 18.3.1
2024-05-09 22:48:10 +02:00
Ravinou 3b5100acee
Merge pull request #217 from Ravinou/dependabot/npm_and_yarn/react-18.3.1
build(deps): bump react from 18.2.0 to 18.3.1
2024-05-09 22:47:56 +02:00
dependabot[bot] 3332d5ecf6
build(deps): bump react-dom from 18.2.0 to 18.3.1
Bumps [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom) from 18.2.0 to 18.3.1.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v18.3.1/packages/react-dom)

---
updated-dependencies:
- dependency-name: react-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-09 20:39:55 +00:00
dependabot[bot] e4ef267637
build(deps): bump react from 18.2.0 to 18.3.1
Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) from 18.2.0 to 18.3.1.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v18.3.1/packages/react)

---
updated-dependencies:
- dependency-name: react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-09 20:39:53 +00:00
Ravinou 97904d2cd4
Merge pull request #216 from Ravinou/dependabot/npm_and_yarn/react-hook-form-7.51.4
build(deps): bump react-hook-form from 7.51.2 to 7.51.4
2024-05-09 22:39:11 +02:00
dependabot[bot] d3e1c79a4b
build(deps): bump react-hook-form from 7.51.2 to 7.51.4
Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.51.2 to 7.51.4.
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.51.2...v7.51.4)

---
updated-dependencies:
- dependency-name: react-hook-form
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-09 19:26:55 +00:00
Ravinou 5ebd2ea881
Merge pull request #211 from Ravinou/dependabot/npm_and_yarn/next-14.2.3
build(deps): bump next from 14.1.4 to 14.2.3
2024-05-09 18:30:04 +02:00
dependabot[bot] f3f3789b87
build(deps): bump next from 14.1.4 to 14.2.3
Bumps [next](https://github.com/vercel/next.js) from 14.1.4 to 14.2.3.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v14.1.4...v14.2.3)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-09 16:18:07 +00:00
Ravinou ee244ff0d2
Merge pull request #212 from Ravinou/dependabot/npm_and_yarn/eslint-config-next-14.2.3
build(deps-dev): bump eslint-config-next from 14.1.4 to 14.2.3
2024-05-09 18:17:44 +02:00
Ravinou 9b3d2e8698
Merge pull request #214 from Ravinou/dependabot/npm_and_yarn/tabler/icons-react-3.3.0
build(deps): bump @tabler/icons-react from 3.1.0 to 3.3.0
2024-05-09 18:16:40 +02:00
dependabot[bot] 8b3969c26e
build(deps): bump @tabler/icons-react from 3.1.0 to 3.3.0
Bumps [@tabler/icons-react](https://github.com/tabler/tabler-icons/tree/HEAD/packages/icons-react) from 3.1.0 to 3.3.0.
- [Release notes](https://github.com/tabler/tabler-icons/releases)
- [Commits](https://github.com/tabler/tabler-icons/commits/v3.3.0/packages/icons-react)

---
updated-dependencies:
- dependency-name: "@tabler/icons-react"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-30 19:51:58 +00:00
dependabot[bot] e824bc815e
build(deps-dev): bump eslint-config-next from 14.1.4 to 14.2.3
Bumps [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) from 14.1.4 to 14.2.3.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/commits/v14.2.3/packages/eslint-config-next)

---
updated-dependencies:
- dependency-name: eslint-config-next
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-24 19:38:07 +00:00
Ravinou 938595f86a
2.2.1 2024-04-07 11:43:32 +02:00
Ravinou 26ba1538e9
Merge pull request #188 from Ravinou/dependabot/npm_and_yarn/tabler/icons-react-3.1.0
build(deps): bump @tabler/icons-react from 2.47.0 to 3.1.0
2024-04-07 10:42:36 +02:00
Ravinou 6380e94fb8
Update README.md
Thanks @dhenry123 for sponsoring this project !
2024-04-07 10:16:57 +02:00
dependabot[bot] 02595d6b0d
build(deps): bump @tabler/icons-react from 2.47.0 to 3.1.0
Bumps [@tabler/icons-react](https://github.com/tabler/tabler-icons/tree/HEAD/packages/icons-react) from 2.47.0 to 3.1.0.
- [Release notes](https://github.com/tabler/tabler-icons/releases)
- [Commits](https://github.com/tabler/tabler-icons/commits/v3.1.0/packages/icons-react)

---
updated-dependencies:
- dependency-name: "@tabler/icons-react"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 14:29:19 +00:00
Ravinou 732b9a5bdc
Merge pull request #194 from Ravinou/dependabot/npm_and_yarn/next-14.1.4
build(deps): bump next from 14.1.3 to 14.1.4
2024-04-01 16:28:39 +02:00
Ravinou 59246e7b70
Merge pull request #195 from Ravinou/dependabot/npm_and_yarn/react-hook-form-7.51.2
build(deps): bump react-hook-form from 7.51.1 to 7.51.2
2024-04-01 16:28:06 +02:00
dependabot[bot] 4e462de87a
build(deps): bump react-hook-form from 7.51.1 to 7.51.2
Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.51.1 to 7.51.2.
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.51.1...v7.51.2)

---
updated-dependencies:
- dependency-name: react-hook-form
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-27 19:46:01 +00:00
dependabot[bot] 24a917c28b
build(deps): bump next from 14.1.3 to 14.1.4
Bumps [next](https://github.com/vercel/next.js) from 14.1.3 to 14.1.4.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v14.1.3...v14.1.4)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-25 20:01:04 +00:00
Ravinou f46cd5f52c
Merge pull request #192 from Ravinou/dependabot/npm_and_yarn/eslint-config-next-14.1.4
build(deps-dev): bump eslint-config-next from 14.1.3 to 14.1.4
2024-03-24 19:48:45 +01:00
Ravinou 0544def9e5
Merge pull request #191 from Ravinou/dependabot/npm_and_yarn/nodemailer-6.9.13
build(deps): bump nodemailer from 6.9.12 to 6.9.13
2024-03-24 19:48:27 +01:00
Ravinou 4c97551ff9
Merge pull request #190 from Ravinou/dependabot/npm_and_yarn/react-hook-form-7.51.1
build(deps): bump react-hook-form from 7.51.0 to 7.51.1
2024-03-24 19:48:11 +01:00
dependabot[bot] 659cfde44d
build(deps-dev): bump eslint-config-next from 14.1.3 to 14.1.4
Bumps [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) from 14.1.3 to 14.1.4.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/commits/v14.1.4/packages/eslint-config-next)

---
updated-dependencies:
- dependency-name: eslint-config-next
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-20 19:54:52 +00:00
dependabot[bot] a47f339bf0
build(deps): bump nodemailer from 6.9.12 to 6.9.13
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.9.12 to 6.9.13.
- [Release notes](https://github.com/nodemailer/nodemailer/releases)
- [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodemailer/nodemailer/compare/v6.9.12...v6.9.13)

---
updated-dependencies:
- dependency-name: nodemailer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-20 19:54:38 +00:00
dependabot[bot] 69789283f6
build(deps): bump react-hook-form from 7.51.0 to 7.51.1
Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.51.0 to 7.51.1.
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.51.0...v7.51.1)

---
updated-dependencies:
- dependency-name: react-hook-form
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-18 19:53:11 +00:00
Ravinou 9ae6f21603
Merge pull request #189 from Ravinou/develop
fix: symbolic link
2024-03-17 21:01:48 +01:00
Ravinou 65cfa0f305
fix: follow symbolic link 2024-03-17 20:48:14 +01:00
Ravinou 63bbd5cfe8
Merge pull request #182 from Ravinou/dependabot/npm_and_yarn/nodemailer-6.9.12
build(deps): bump nodemailer from 6.9.11 to 6.9.12
2024-03-17 15:24:13 +01:00
dependabot[bot] 55195469d8
build(deps): bump nodemailer from 6.9.11 to 6.9.12
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.9.11 to 6.9.12.
- [Release notes](https://github.com/nodemailer/nodemailer/releases)
- [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodemailer/nodemailer/compare/v6.9.11...v6.9.12)

---
updated-dependencies:
- dependency-name: nodemailer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-11 19:07:17 +00:00
Ravinou 891dbb4db5
docker: message to confirm initialization success #155 2024-03-10 10:59:23 +01:00
Ravinou a3275adfd1
Merge pull request #176 from Ravinou/dependabot/npm_and_yarn/next-14.1.3
build(deps): bump next from 14.1.0 to 14.1.3
2024-03-10 10:58:07 +01:00
Ravinou 6030502288
Update README.md 2024-03-09 16:10:43 +01:00
Ravinou a2460e1225
Merge pull request #172 from Ravinou/dependabot/npm_and_yarn/react-hook-form-7.51.0
build(deps): bump react-hook-form from 7.50.1 to 7.51.0
2024-03-09 15:38:00 +01:00
dependabot[bot] e972c6d280
build(deps): bump next from 14.1.0 to 14.1.3
Bumps [next](https://github.com/vercel/next.js) from 14.1.0 to 14.1.3.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v14.1.0...v14.1.3)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-09 14:37:25 +00:00
Ravinou b9b6f667f9
Merge pull request #177 from Ravinou/dependabot/npm_and_yarn/next-auth-4.24.7
build(deps): bump next-auth from 4.24.6 to 4.24.7
2024-03-09 15:37:04 +01:00
Ravinou 77960edc2d
Merge pull request #178 from Ravinou/dependabot/npm_and_yarn/eslint-config-next-14.1.3
build(deps-dev): bump eslint-config-next from 14.1.0 to 14.1.3
2024-03-09 15:36:42 +01:00
dependabot[bot] 39abbfc540
build(deps-dev): bump eslint-config-next from 14.1.0 to 14.1.3
Bumps [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) from 14.1.0 to 14.1.3.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/commits/v14.1.3/packages/eslint-config-next)

---
updated-dependencies:
- dependency-name: eslint-config-next
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-07 20:03:17 +00:00
dependabot[bot] 986d33308d
build(deps): bump next-auth from 4.24.6 to 4.24.7
Bumps [next-auth](https://github.com/nextauthjs/next-auth) from 4.24.6 to 4.24.7.
- [Release notes](https://github.com/nextauthjs/next-auth/releases)
- [Commits](https://github.com/nextauthjs/next-auth/compare/next-auth@4.24.6...next-auth@4.24.7)

---
updated-dependencies:
- dependency-name: next-auth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-07 20:03:02 +00:00
dependabot[bot] d9a6b1072c
build(deps): bump react-hook-form from 7.50.1 to 7.51.0
Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.50.1 to 7.51.0.
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.50.1...v7.51.0)

---
updated-dependencies:
- dependency-name: react-hook-form
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-04 19:22:07 +00:00
Ravinou 042e1e1eba
Merge pull request #163 from Ravinou/dependabot/npm_and_yarn/eslint-8.57.0
build(deps-dev): bump eslint from 8.56.0 to 8.57.0
2024-03-03 19:38:34 +01:00
Ravinou 11dae87bc1
Merge pull request #166 from Ravinou/dependabot/npm_and_yarn/chart.js-4.4.2
build(deps): bump chart.js from 4.4.1 to 4.4.2
2024-03-03 19:38:18 +01:00
Ravinou 4265a040ec
Merge pull request #169 from Ravinou/dependabot/npm_and_yarn/nodemailer-6.9.11
build(deps): bump nodemailer from 6.9.10 to 6.9.11
2024-03-03 19:37:53 +01:00
dependabot[bot] 00667606d8
build(deps): bump nodemailer from 6.9.10 to 6.9.11
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.9.10 to 6.9.11.
- [Release notes](https://github.com/nodemailer/nodemailer/releases)
- [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodemailer/nodemailer/compare/v6.9.10...v6.9.11)

---
updated-dependencies:
- dependency-name: nodemailer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-29 19:54:59 +00:00
dependabot[bot] 712a67c555
build(deps): bump chart.js from 4.4.1 to 4.4.2
Bumps [chart.js](https://github.com/chartjs/Chart.js) from 4.4.1 to 4.4.2.
- [Release notes](https://github.com/chartjs/Chart.js/releases)
- [Commits](https://github.com/chartjs/Chart.js/compare/v4.4.1...v4.4.2)

---
updated-dependencies:
- dependency-name: chart.js
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-28 19:49:12 +00:00
dependabot[bot] b9bcde093b
build(deps-dev): bump eslint from 8.56.0 to 8.57.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.56.0 to 8.57.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.56.0...v8.57.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-26 19:36:24 +00:00
Ravinou aa8ada68d9
Merge pull request #161 from Ravinou/develop
v2.2.0
2024-02-25 19:10:16 +01:00
Ravinou 9f42245de1
v2.2.0 2024-02-25 18:52:17 +01:00
Ravinou 904207e48a
feat: add specific logs for success and failed login 2024-02-25 18:20:06 +01:00
Ravinou 204c7fc384
ui: capitalize username's first letter in header 2024-02-25 18:20:06 +01:00
Ravinou e4b8ab2d33
fix: login case insensitive 2024-02-25 18:20:06 +01:00
Ravinou c6f8f3cf7c
fix: space are not allowed on login form 2024-02-25 18:20:06 +01:00
Ravinou 65f3590a5a
feat: provide default sshd_config file for Docker 2024-02-25 18:20:06 +01:00
Ravinou dbbbc08d5a
Merge pull request #159 from Ravinou/dependabot/npm_and_yarn/nodemailer-6.9.10
build(deps): bump nodemailer from 6.9.9 to 6.9.10
2024-02-25 15:35:19 +01:00
dependabot[bot] 1ae58a7299
build(deps): bump nodemailer from 6.9.9 to 6.9.10
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.9.9 to 6.9.10.
- [Release notes](https://github.com/nodemailer/nodemailer/releases)
- [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodemailer/nodemailer/compare/v6.9.9...v6.9.10)

---
updated-dependencies:
- dependency-name: nodemailer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-22 19:35:43 +00:00
Ravinou b9ef00e6a0
Merge pull request #157 from Ravinou/dependabot/npm_and_yarn/next-auth-4.24.6
build(deps): bump next-auth from 4.24.5 to 4.24.6
2024-02-18 10:23:43 +01:00
Ravinou d6858ddbd8
Merge pull request #158 from Ravinou/dependabot/npm_and_yarn/swr-2.2.5
build(deps): bump swr from 2.2.4 to 2.2.5
2024-02-18 10:23:11 +01:00
dependabot[bot] 318e773df9
build(deps): bump swr from 2.2.4 to 2.2.5
Bumps [swr](https://github.com/vercel/swr) from 2.2.4 to 2.2.5.
- [Release notes](https://github.com/vercel/swr/releases)
- [Commits](https://github.com/vercel/swr/compare/v2.2.4...v2.2.5)

---
updated-dependencies:
- dependency-name: swr
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-16 19:44:18 +00:00
dependabot[bot] c4eb68a160
build(deps): bump next-auth from 4.24.5 to 4.24.6
Bumps [next-auth](https://github.com/nextauthjs/next-auth) from 4.24.5 to 4.24.6.
- [Release notes](https://github.com/nextauthjs/next-auth/releases)
- [Commits](https://github.com/nextauthjs/next-auth/compare/next-auth@4.24.5...next-auth@4.24.6)

---
updated-dependencies:
- dependency-name: next-auth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-14 19:43:52 +00:00
Ravinou eccddab276
Merge pull request #151 from Ravinou/dependabot/npm_and_yarn/prettier-3.2.5
build(deps-dev): bump prettier from 3.2.4 to 3.2.5
2024-02-09 20:37:40 +01:00
Ravinou 3d1275371d
Merge pull request #153 from Ravinou/dependabot/npm_and_yarn/react-hook-form-7.50.1
build(deps): bump react-hook-form from 7.50.0 to 7.50.1
2024-02-09 20:37:16 +01:00
dependabot[bot] 237b9d31a1
build(deps): bump react-hook-form from 7.50.0 to 7.50.1
Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.50.0 to 7.50.1.
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.50.0...v7.50.1)

---
updated-dependencies:
- dependency-name: react-hook-form
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-06 19:49:48 +00:00
dependabot[bot] 5bd3b79040
build(deps-dev): bump prettier from 3.2.4 to 3.2.5
Bumps [prettier](https://github.com/prettier/prettier) from 3.2.4 to 3.2.5.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.2.4...3.2.5)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-05 19:22:51 +00:00
Ravinou 795ce100de
Merge pull request #150 from Ravinou/develop
fix: arm ci/cd build with node20
2024-02-04 14:00:44 +01:00
Ravinou 45b211f397
fix: arm ci/cd build with node20
# linux/arm/v7 arm32 is not supported by node20 https://github.com/nodejs/docker-node/issues/1946
2024-02-04 13:34:40 +01:00
Ravinou 731be37845
Merge pull request #149 from Ravinou/develop
update dependencies
2024-02-03 10:17:53 +01:00
Ravinou bbd51f3c06
fix: use the latest borgbackup stable release in docker #141 2024-02-03 10:14:01 +01:00
Ravinou 660fa112e2
update dependencies 2024-02-03 09:40:11 +01:00
Ravinou 0c5e23b84c
Merge pull request #140 from Ravinou/dependabot/npm_and_yarn/prettier-3.2.4
build(deps-dev): bump prettier from 3.1.1 to 3.2.4
2024-02-03 09:14:57 +01:00
dependabot[bot] bdb5a3e711
build(deps-dev): bump prettier from 3.1.1 to 3.2.4
Bumps [prettier](https://github.com/prettier/prettier) from 3.1.1 to 3.2.4.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.1.1...3.2.4)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-03 07:59:33 +00:00
Ravinou a9c3d59b47
Merge pull request #143 from Ravinou/dependabot/npm_and_yarn/eslint-config-next-14.1.0
build(deps-dev): bump eslint-config-next from 13.5.6 to 14.1.0
2024-02-03 08:58:47 +01:00
Ravinou 643bf012d8
Merge pull request #148 from Ravinou/dependabot/npm_and_yarn/tabler/icons-react-2.47.0
build(deps): bump @tabler/icons-react from 2.45.0 to 2.47.0
2024-02-03 08:57:08 +01:00
dependabot[bot] fc4655a0c3
build(deps): bump @tabler/icons-react from 2.45.0 to 2.47.0
Bumps [@tabler/icons-react](https://github.com/tabler/tabler-icons/tree/HEAD/packages/icons-react) from 2.45.0 to 2.47.0.
- [Release notes](https://github.com/tabler/tabler-icons/releases)
- [Commits](https://github.com/tabler/tabler-icons/commits/v2.47.0/packages/icons-react)

---
updated-dependencies:
- dependency-name: "@tabler/icons-react"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-02 19:33:54 +00:00
dependabot[bot] 8cf753da8f
build(deps-dev): bump eslint-config-next from 13.5.6 to 14.1.0
Bumps [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) from 13.5.6 to 14.1.0.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/commits/v14.1.0/packages/eslint-config-next)

---
updated-dependencies:
- dependency-name: eslint-config-next
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-19 19:57:36 +00:00
Ravinou 2900455700
Update README.md
Thank you very much @Magneticdud for sponsoring ❤️
2024-01-14 20:41:29 +01:00
Ravinou b0a6108c93
Merge pull request #132 from Ravinou/dependabot/npm_and_yarn/react-hook-form-7.49.3
build(deps): bump react-hook-form from 7.49.2 to 7.49.3
2024-01-10 20:56:20 +01:00
dependabot[bot] 5c9e5584da
build(deps): bump react-hook-form from 7.49.2 to 7.49.3
Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.49.2 to 7.49.3.
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.49.2...v7.49.3)

---
updated-dependencies:
- dependency-name: react-hook-form
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-09 19:11:08 +00:00
Ravinou c3271c33e6
fix: typo for storage unit Go > GB #126 2024-01-07 15:38:11 +01:00
Ravinou 0c7d6f9290
fix: typo on password placeholder #127 2024-01-06 14:51:15 +01:00
Ravinou 22943577fc
Merge pull request #125 from Ravinou/dependabot/npm_and_yarn/tabler/icons-react-2.45.0
build(deps): bump @tabler/icons-react from 2.44.0 to 2.45.0
2024-01-06 14:47:10 +01:00
Ravinou 50277cf657
Merge pull request #123 from Ravinou/dependabot/npm_and_yarn/nodemailer-6.9.8
build(deps): bump nodemailer from 6.9.7 to 6.9.8
2024-01-06 14:46:54 +01:00
dependabot[bot] ba204ebfd7
build(deps): bump @tabler/icons-react from 2.44.0 to 2.45.0
Bumps [@tabler/icons-react](https://github.com/tabler/tabler-icons/tree/HEAD/packages/icons-react) from 2.44.0 to 2.45.0.
- [Release notes](https://github.com/tabler/tabler-icons/releases)
- [Commits](https://github.com/tabler/tabler-icons/commits/v2.45.0/packages/icons-react)

---
updated-dependencies:
- dependency-name: "@tabler/icons-react"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-02 19:29:22 +00:00
dependabot[bot] 331bd34cde
build(deps): bump nodemailer from 6.9.7 to 6.9.8
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.9.7 to 6.9.8.
- [Release notes](https://github.com/nodemailer/nodemailer/releases)
- [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodemailer/nodemailer/compare/v6.9.7...v6.9.8)

---
updated-dependencies:
- dependency-name: nodemailer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 19:51:46 +00:00
Ravinou 2143291075
2.1.0 2024-01-01 16:06:55 +01:00
Ravinou 8a771df290
Merge pull request #122 from Ravinou/develop
v2.1.0
2024-01-01 16:01:55 +01:00
Ravinou 006fa4862a
feat: ability to chose uid and gid on build 2024-01-01 13:07:19 +01:00
Ravinou 532d23973e
feat: rsyslog added for timestamping logs and fail2ban compatibility 2023-12-31 14:30:23 +01:00
Ravinou f90f690bba
fix: add tmp and logs path in sample env 2023-12-30 18:30:15 +01:00
Ravinou 9470957639
Merge branch 'container/environmental-variables' into develop 2023-12-30 18:19:05 +01:00
Ravinou 15e7859e66
feat: use supervisord to manage process #101 #98
ci: build for arm/v7 explicitly + action to build develop
2023-12-30 18:00:14 +01:00
Ravinou ac715e9173
fix: disable cronjob functionnality in docker 2023-12-30 18:00:14 +01:00
Ravinou 32e9e5a161
fix: init alert settings with account 2023-12-30 18:00:14 +01:00
Ravinou 3afb8c0805
feat: new API endpoint to check the version number 2023-12-30 18:00:14 +01:00
Ravinou 3638cd6d1d
feat: add a LAN badge next to the quicksettings button 2023-12-30 18:00:14 +01:00
Ravinou 10ad738755
feat: add a disabled option in repo alert settings 2023-12-30 18:00:14 +01:00
Ravinou 1f519c50fa
Merge pull request #114 from zionio/dev-fix-typo
Fix simple typo
2023-12-30 17:59:46 +01:00
Ravinou 3a3fe992ff
Merge pull request #115 from Ravinou/dependabot/npm_and_yarn/chart.js-4.4.1
build(deps): bump chart.js from 4.4.0 to 4.4.1
2023-12-30 15:04:13 +01:00
Ravinou 115b60325d
Merge pull request #117 from Ravinou/dependabot/npm_and_yarn/tabler/icons-react-2.44.0
build(deps): bump @tabler/icons-react from 2.42.0 to 2.44.0
2023-12-30 15:03:49 +01:00
Ravinou cc586965be
Merge pull request #118 from Ravinou/dependabot/npm_and_yarn/prettier-3.1.1
build(deps-dev): bump prettier from 3.1.0 to 3.1.1
2023-12-30 15:03:35 +01:00
Ravinou a04337ee2c
Merge pull request #119 from Ravinou/dependabot/npm_and_yarn/react-hook-form-7.49.2
build(deps): bump react-hook-form from 7.48.2 to 7.49.2
2023-12-30 15:03:23 +01:00
Ravinou fe23e9d874
Merge pull request #120 from Ravinou/dependabot/npm_and_yarn/eslint-8.56.0
build(deps-dev): bump eslint from 8.54.0 to 8.56.0
2023-12-30 15:03:12 +01:00
dependabot[bot] 90d0c7961d
build(deps-dev): bump eslint from 8.54.0 to 8.56.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.54.0 to 8.56.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.54.0...v8.56.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 19:15:47 +00:00
dependabot[bot] a188c5114b
build(deps): bump react-hook-form from 7.48.2 to 7.49.2
Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.48.2 to 7.49.2.
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.48.2...v7.49.2)

---
updated-dependencies:
- dependency-name: react-hook-form
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-13 20:02:54 +00:00
dependabot[bot] 900f1b41ea
build(deps-dev): bump prettier from 3.1.0 to 3.1.1
Bumps [prettier](https://github.com/prettier/prettier) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.1.0...3.1.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-11 19:51:27 +00:00
dependabot[bot] f4e4cdd4e7
build(deps): bump @tabler/icons-react from 2.42.0 to 2.44.0
Bumps [@tabler/icons-react](https://github.com/tabler/tabler-icons/tree/HEAD/packages/icons-react) from 2.42.0 to 2.44.0.
- [Release notes](https://github.com/tabler/tabler-icons/releases)
- [Commits](https://github.com/tabler/tabler-icons/commits/v2.44.0/packages/icons-react)

---
updated-dependencies:
- dependency-name: "@tabler/icons-react"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-11 19:51:11 +00:00
rugk 20b3504b94 Refactor to load whole .env file instead of single variables 2023-12-05 20:02:26 +00:00
dependabot[bot] 157ad23dd8
build(deps): bump chart.js from 4.4.0 to 4.4.1
Bumps [chart.js](https://github.com/chartjs/Chart.js) from 4.4.0 to 4.4.1.
- [Release notes](https://github.com/chartjs/Chart.js/releases)
- [Commits](https://github.com/chartjs/Chart.js/compare/v4.4.0...v4.4.1)

---
updated-dependencies:
- dependency-name: chart.js
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-05 20:00:46 +00:00
rugk f6929fa7de Use more and new environment variables 2023-12-05 19:58:34 +00:00
andrea 7b5744baf2
fix simple typo 2023-12-05 15:31:14 +01:00
Ravinou 8e49af85e0
ci: build test for PR on develop 2023-11-26 12:52:29 +01:00
Ravinou ffa56e0882
Merge pull request #104 from Ravinou/dependabot/npm_and_yarn/eslint-8.54.0
build(deps-dev): bump eslint from 8.53.0 to 8.54.0
2023-11-21 21:26:48 +01:00
Ravinou e05e478921
Merge pull request #105 from Ravinou/dependabot/npm_and_yarn/tabler/icons-react-2.42.0
build(deps): bump @tabler/icons-react from 2.40.0 to 2.42.0
2023-11-21 21:26:16 +01:00
dependabot[bot] d05a6dc07c
build(deps): bump @tabler/icons-react from 2.40.0 to 2.42.0
Bumps [@tabler/icons-react](https://github.com/tabler/tabler-icons/tree/HEAD/packages/icons-react) from 2.40.0 to 2.42.0.
- [Release notes](https://github.com/tabler/tabler-icons/releases)
- [Commits](https://github.com/tabler/tabler-icons/commits/v2.42.0/packages/icons-react)

---
updated-dependencies:
- dependency-name: "@tabler/icons-react"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-21 20:05:07 +00:00
dependabot[bot] 7860f187ae
build(deps-dev): bump eslint from 8.53.0 to 8.54.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.53.0 to 8.54.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.53.0...v8.54.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 19:50:17 +00:00
Ravinou 653c723d31
Update README.md
Thanks again for your support @shad-lp
2023-11-19 21:48:49 +01:00
Ravinou 81d43c131e
Create FUNDING.yml 2023-11-18 10:33:20 +01:00
Ravinou a0fa965527
Merge pull request #97 from Ravinou/dependabot/npm_and_yarn/prettier-3.1.0
build(deps-dev): bump prettier from 3.0.3 to 3.1.0
2023-11-14 21:17:49 +01:00
dependabot[bot] 93ac2714c3
build(deps-dev): bump prettier from 3.0.3 to 3.1.0
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.3 to 3.1.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.0.3...3.1.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-13 19:59:23 +00:00
Ravinou b84cf3638c
Merge pull request #93 from Ravinou/dependabot/npm_and_yarn/next-auth-4.24.5
build(deps): bump next-auth from 4.24.4 to 4.24.5
2023-11-11 11:10:45 +01:00
dependabot[bot] 19236a19fe
build(deps): bump next-auth from 4.24.4 to 4.24.5
Bumps [next-auth](https://github.com/nextauthjs/next-auth) from 4.24.4 to 4.24.5.
- [Release notes](https://github.com/nextauthjs/next-auth/releases)
- [Commits](https://github.com/nextauthjs/next-auth/compare/next-auth@4.24.4...next-auth@4.24.5)

---
updated-dependencies:
- dependency-name: next-auth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-10 19:41:08 +00:00
Ravinou 1e401484ce
Merge pull request #89 from Ravinou/dependabot/npm_and_yarn/react-hook-form-7.48.2
build(deps): bump react-hook-form from 7.47.0 to 7.48.2
2023-11-07 19:56:01 +01:00
dependabot[bot] 76f1a33817
build(deps): bump react-hook-form from 7.47.0 to 7.48.2
Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.47.0 to 7.48.2.
- [Release notes](https://github.com/react-hook-form/react-hook-form/releases)
- [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md)
- [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.47.0...v7.48.2)

---
updated-dependencies:
- dependency-name: react-hook-form
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-07 18:55:45 +00:00
Ravinou 468bb3325f
Merge pull request #88 from Ravinou/dependabot/npm_and_yarn/eslint-8.53.0
build(deps-dev): bump eslint from 8.52.0 to 8.53.0
2023-11-07 19:55:07 +01:00
Ravinou 4041f15f74
Merge pull request #90 from Ravinou/dependabot/npm_and_yarn/react-select-5.8.0
build(deps): bump react-select from 5.7.7 to 5.8.0
2023-11-07 19:54:51 +01:00
dependabot[bot] 193992a399
build(deps): bump react-select from 5.7.7 to 5.8.0
Bumps [react-select](https://github.com/JedWatson/react-select) from 5.7.7 to 5.8.0.
- [Release notes](https://github.com/JedWatson/react-select/releases)
- [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.7.7...react-select@5.8.0)

---
updated-dependencies:
- dependency-name: react-select
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 19:25:33 +00:00
dependabot[bot] 93a3d5207e
build(deps-dev): bump eslint from 8.52.0 to 8.53.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.52.0 to 8.53.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.52.0...v8.53.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 19:25:05 +00:00
Ravinou 51450dfdd3
Create docker-image-test.yml 2023-11-05 19:36:33 +01:00
Ravinou e48aafd458
Create docker-image-release.yml 2023-11-05 19:23:20 +01:00
Ravinou 016bdd3529
Rename docker-image.yml to docker-image-latest.yml 2023-11-05 19:17:52 +01:00
rugk fb77a975db Add .env file as sample for env variables 2023-11-03 17:32:26 +00:00
rugk b49bae58b5 Use environmental variables for docker-compose
* You can start it as usual, `.env` file is automatically used.
* IMHO easier and cleaner to configure.
* Also removed the `<host>` as it makes this not-runnable out-of-the-box. I need this for https://github.com/Ravinou/borgwarehouse/pull/69 and this was the initial idea of making this PR.
* The `${:?}` syntax is a bash-like thing to produce a proper error message if the variable is not provided.

I checked the setup should basically start (just got a permission error as the UID/GID is wrong).
2023-11-03 17:23:41 +00:00
Ravinou c5444b9d39
Update docker-image.yml
add linux/arm
2023-11-03 09:46:39 +01:00
Ravinou 99875a8c9d
Merge pull request #84 from Ravinou/develop
Shellcheck fix and updates dep
2023-11-02 22:53:42 +01:00
Ravinou 78e314d178
build(deps): switch Node version to latest LTS 20 2023-11-02 22:47:31 +01:00
Ravinou a37e5efb6d
update dev dependencies 2023-11-02 22:47:31 +01:00
Ravinou eb9625a542
fix: shellcheck's improvement 2023-11-02 22:47:31 +01:00
Ravinou 8a366d614e
Update shellcheck.yml
Exclude SC1091
2023-11-02 22:46:34 +01:00
Ravinou 0c8256b24d
Update shellcheck.yml
add develop branch
2023-11-02 22:15:10 +01:00
Ravinou dd4a406040
Merge pull request #68 from rugk/patch-2
Run shellcheck for shell scripts
2023-11-02 20:44:18 +01:00
Ravinou 390dec131f
Merge pull request #80 from Ravinou/dependabot/npm_and_yarn/next-13.5.6
build(deps): bump next from 13.5.4 to 13.5.6
2023-11-02 20:42:32 +01:00
dependabot[bot] 3e34e20e2c
build(deps): bump next from 13.5.4 to 13.5.6
Bumps [next](https://github.com/vercel/next.js) from 13.5.4 to 13.5.6.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v13.5.4...v13.5.6)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-02 19:42:20 +00:00
Ravinou 74dd8d07f6
Merge pull request #81 from Ravinou/dependabot/npm_and_yarn/next-auth-4.24.4
build(deps): bump next-auth from 4.23.2 to 4.24.4
2023-11-02 20:41:41 +01:00
Ravinou ed9086dbdc
Merge pull request #82 from Ravinou/dependabot/npm_and_yarn/eslint-config-next-13.5.6
build(deps-dev): bump eslint-config-next from 13.5.4 to 13.5.6
2023-11-02 20:41:25 +01:00
dependabot[bot] 4ad9374761
build(deps-dev): bump eslint-config-next from 13.5.4 to 13.5.6
Bumps [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) from 13.5.4 to 13.5.6.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/commits/v13.5.6/packages/eslint-config-next)

---
updated-dependencies:
- dependency-name: eslint-config-next
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-02 19:32:21 +00:00
dependabot[bot] 69b3954a4a
build(deps): bump next-auth from 4.23.2 to 4.24.4
Bumps [next-auth](https://github.com/nextauthjs/next-auth) from 4.23.2 to 4.24.4.
- [Release notes](https://github.com/nextauthjs/next-auth/releases)
- [Commits](https://github.com/nextauthjs/next-auth/commits)

---
updated-dependencies:
- dependency-name: next-auth
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-02 19:32:07 +00:00
Ravinou 3085c8a1ba
Merge pull request #78 from Ravinou/dependabot/github_actions/actions/checkout-4
build(deps): bump actions/checkout from 3 to 4
2023-11-02 20:15:08 +01:00
dependabot[bot] cf00132efc
build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-02 19:11:58 +00:00
Ravinou 2777978114
Merge pull request #73 from Ravinou/dependabot/npm_and_yarn/nodemailer-6.9.7
build(deps): bump nodemailer from 6.9.6 to 6.9.7
2023-11-02 19:50:03 +01:00
Ravinou 2c451d125f
Merge pull request #74 from Ravinou/dependabot/npm_and_yarn/eslint-8.52.0
build(deps-dev): bump eslint from 8.23.1 to 8.52.0
2023-11-02 19:49:42 +01:00
Ravinou a99f7945d9
Create docker-image.yml for github workflow 2023-11-02 19:46:44 +01:00
Ravinou c644253f40
Merge pull request #76 from Ravinou/dependabot/npm_and_yarn/tabler/icons-react-2.40.0
build(deps): bump @tabler/icons-react from 2.38.0 to 2.40.0
2023-11-02 17:47:37 +01:00
dependabot[bot] 467a200c6d
build(deps): bump @tabler/icons-react from 2.38.0 to 2.40.0
Bumps [@tabler/icons-react](https://github.com/tabler/tabler-icons/tree/HEAD/packages/icons-react) from 2.38.0 to 2.40.0.
- [Release notes](https://github.com/tabler/tabler-icons/releases)
- [Commits](https://github.com/tabler/tabler-icons/commits/v2.40.0/packages/icons-react)

---
updated-dependencies:
- dependency-name: "@tabler/icons-react"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-02 16:11:38 +00:00
dependabot[bot] 1652cb7ded
build(deps-dev): bump eslint from 8.23.1 to 8.52.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.23.1 to 8.52.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.23.1...v8.52.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-02 16:11:00 +00:00
dependabot[bot] 3c1f692bc1
build(deps): bump nodemailer from 6.9.6 to 6.9.7
Bumps [nodemailer](https://github.com/nodemailer/nodemailer) from 6.9.6 to 6.9.7.
- [Release notes](https://github.com/nodemailer/nodemailer/releases)
- [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodemailer/nodemailer/compare/v6.9.6...v6.9.7)

---
updated-dependencies:
- dependency-name: nodemailer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-02 16:10:49 +00:00
Ravinou 0377b162ed
Merge pull request #66 from rugk/patch-1
Enable Dependabot for Docker, NodeJS and GitHub Actions depencies
2023-11-02 17:10:22 +01:00
rugk 69671395ec
Run shellcheck for shell scripts
I always suggest running the awesome https://www.shellcheck.net/ for whatever shell scripts you have in here, and I think this is a good first automation step.

Adopted from https://github.com/PrivateBin/docker-nginx-fpm-alpine/blob/master/.github/workflows/shellcheck.yml

Note this PR **did not fix potential shellcheck issues**, I just wanted to introduce the linting and I hope not much is to be fixed.
2023-11-01 23:27:21 +01:00
rugk cd96e66c45
Enable Dependabot for Docker and GitHub Actions
AFAIK (and this was new to me) Dependabot is not active by default.

This enables it for all dependencies here, so it scans and suggests updates.

GitHub Actions is as far as I see not yet used, but well… easy enough to do that hehe soon…
2023-11-01 23:20:48 +01:00
Ravinou 6aed841b9f
fix: curl URL in cronjob needs hostname with PR #58 - #64 2023-10-29 10:36:27 +01:00
Ravinou 957bba58dc
Merge pull request #58 from dumbasPL/main
Rework Dockerfile to reduce image size
2023-10-22 13:00:11 +02:00
Ravinou 9fe80e4f29
Update README.md 2023-10-21 09:43:12 +02:00
nezu 6ea4c7f184 fix: rework Dockerfile to reduce image size 2023-10-17 12:27:12 +02:00
Ravinou d3b69fd97d
docs: update readme 2023-10-15 12:29:01 +02:00
Ravinou 0d6b5aaf12
2.0.0 2023-10-15 11:14:45 +02:00
Ravinou 70dbd64aff
Merge pull request #56 from Ravinou/v2.0
V2.0
2023-10-15 11:11:00 +02:00
Ravinou 1e6b53615f
feat: QuickCommand is now the repo URL only 2023-10-14 10:33:14 +02:00
Ravinou 3d409916be
fix: upgrade node image 2023-10-10 19:59:01 +02:00
Ravinou ddd2972b9c
Update dependencies 2023-10-10 19:52:01 +02:00
Ravinou 2642d15f4f
Update dependencies 2023-10-10 19:47:19 +02:00
Ravinou 1ef8703991
feat: add apprise to docker-compose 2023-10-08 18:41:13 +02:00
Ravinou bd4ff2f87e
fix: default Apprise mode on stateless 2023-10-08 18:25:43 +02:00
Ravinou ea68dea83f
fix: return a empty json if there are no repo to stat 2023-10-08 16:57:13 +02:00
Ravinou 3e63f187e8
feat: history in a log the repo list changes 2023-10-08 16:38:13 +02:00
Ravinou 5720ff906c
Update dependencies 2023-10-08 12:10:19 +02:00
Ravinou 55a33d627d
fix: uid/gid in docker 2023-10-05 21:21:55 +02:00
Ravinou 6db2364ca3
2.0.0-rc.3 2023-10-02 18:51:07 +02:00
Ravinou d55a9c17a0
fix: check if there are some repo before stat them 2023-10-02 17:59:03 +02:00
Ravinou 608a3b6bf5
feat: add docker-compose.yml file 2023-10-01 22:06:51 +02:00
Ravinou f217d922a1
fix: "hostname" env var is used by default in docker. Avoid conflict. 2023-10-01 21:15:18 +02:00
Ravinou 2ff969d3c1
fix: default account init 2023-10-01 19:04:42 +02:00
Ravinou 805253491d
feat: add default values for wizard 2023-10-01 18:48:58 +02:00
Ravinou 8df8c6a100
feat: add uid and gid options for build 2023-10-01 18:36:00 +02:00
Ravinou ed97e52c60
feat: get SSH fingerprints and env 2023-09-23 19:09:08 +02:00
Ravinou 9e55b47f77
feat: add cronjobs to docker 2023-09-23 18:09:10 +02:00
Ravinou f1cfe2459b
fix: better description in step 2 2023-09-17 22:16:01 +02:00
Ravinou 1baef885d2
fix: restart SSH service after docker init 2023-09-17 22:08:54 +02:00
Ravinou 88e351f18c
fix: step3 variable name in dataToCopy 2023-09-17 22:06:16 +02:00
Ravinou b5b4f1a766
fix: entrypoint init 2023-09-17 17:42:30 +02:00
Ravinou f4479bb2f8
feat: add ssh init 2023-09-17 11:21:22 +02:00
Ravinou 7e21c7b379
fix: stop container if init failed 2023-09-16 19:23:29 +02:00
Ravinou 22eabd165d
2.0.0-rc.2 2023-09-10 18:40:37 +02:00
Ravinou 941fd93653
fix: improve delete repo function 2023-09-10 18:36:31 +02:00
Ravinou 100c62f39b
docker testing 2023-09-10 17:52:52 +02:00
Ravinou ddc5229136
style: all files now match prettier conf 2023-09-10 15:58:08 +02:00
Ravinou 8198c5462b
Add prettier configuration 2023-09-10 15:54:21 +02:00
Ravinou 81682ac2a2
Merge remote-tracking branch 'origin/v2.0' into v2.0 2023-09-10 15:12:00 +02:00
Ravinou 1e7917041d
feat: hydrate wizard steps from API 2023-09-10 15:06:23 +02:00
Ravinou 28115f3506
fix: missing unix_user in quickcommand 2023-09-10 15:06:23 +02:00
Ravinou d4c62e8572
feat: hydrate QuickCommand from API 2023-09-10 15:06:23 +02:00
Ravinou 85f30d7ce7
feat: add API to get some env for wizard 2023-09-10 15:06:23 +02:00
Ravinou 1bd8f4c880
docs: update env vars 2023-09-10 15:06:23 +02:00
Ravinou 4e997fa794
docs: update README for single user unix in v2.0 2023-09-10 15:06:23 +02:00
Ravinou d083995b51
fix: reducing size of error msg 2023-09-10 15:06:23 +02:00
Ravinou 0e72f7a4cf
feat: display log from backend API to toast 2023-09-10 15:06:23 +02:00
Ravinou 1d1c4e01d6
fix: remove \n in end of the error msg 2023-09-10 15:06:23 +02:00
Ravinou ad46df61a3
fix: footer width create empty space on right 2023-09-10 15:06:23 +02:00
bsourisse 2df933dc95
2.0.0-rc.1 2023-09-10 15:06:23 +02:00
bsourisse 446efb8696
feat: check that SSH pubkey is unique 2023-09-10 15:06:23 +02:00
bsourisse 6eb1861d1b
fix: this script is only for v1.x 2023-09-10 15:06:23 +02:00
bsourisse 2700eab46b
fix: update permission on file 2023-09-10 15:06:23 +02:00
bsourisse 28dd40561f
fix: remove useless sudo 2023-09-10 15:06:23 +02:00
bsourisse 95126cfa57
fix: prevents creation with a pubkey already used 2023-09-10 15:06:23 +02:00
bsourisse eace07ed9a
feat: updateRepo with single Unix user and unique SSH pubkey 2023-09-10 15:06:23 +02:00
bsourisse a735144a55
feat: unixUser is now unique and retrieved by env 2023-09-10 15:06:23 +02:00
bsourisse a7beb7b37f
fix: change "repository" to "repositoryName" 2023-09-10 15:06:23 +02:00
bsourisse 695e360d07
feat: get storage with single unix user 2023-09-10 15:06:23 +02:00
bsourisse 04038b5b0d
feat: get last modif with single unix user 2023-09-10 15:06:23 +02:00
bsourisse 7b04e8dc4c
feat: delete repo with the same unix user 2023-09-10 15:06:23 +02:00
bsourisse 071e9733d2
feat: create repo with the same unix user 2023-09-10 15:06:23 +02:00
Ravinou d8e5542aa4
feat: add robots.txt and disallow by default 2023-09-10 15:05:17 +02:00
Ravinou adb90e2a08
feat: hydrate wizard steps from API 2023-09-05 22:53:23 +02:00
Ravinou f5e3262534
fix: missing unix_user in quickcommand 2023-09-05 22:07:17 +02:00
Ravinou b64843c6c2
feat: hydrate QuickCommand from API 2023-09-05 22:03:39 +02:00
Ravinou 13116f2334
feat: add API to get some env for wizard 2023-09-05 22:02:54 +02:00
Ravinou e84b0ec131
docs: update env vars 2023-09-05 20:45:12 +02:00
Ravinou 2b6e83c8fc
docs: update README for single user unix in v2.0 2023-09-03 16:11:06 +02:00
Ravinou b589bc9b15
fix: reducing size of error msg 2023-09-03 15:48:57 +02:00
Ravinou 0a1ef9140c
feat: display log from backend API to toast 2023-09-03 15:39:57 +02:00
Ravinou 67267961a1
fix: remove \n in end of the error msg 2023-09-03 15:31:15 +02:00
Ravinou 5ae03396e0
fix: footer width create empty space on right 2023-09-03 14:23:09 +02:00
Ravinou 38b2d25f87 Merge branch 'main' into v2.0 2023-09-03 13:58:42 +02:00
Ravinou f8d1d15afb
Merge pull request #52 from ngarafol/fix-wizard-step4
fix typo in wizard step 4 for Borgmatic config
2023-09-03 13:51:09 +02:00
nix c1d28331a4 fix typo in wizard step 4 2023-08-30 23:42:28 +02:00
61 changed files with 3298 additions and 1795 deletions

11
.dockerignore Normal file
View file

@ -0,0 +1,11 @@
node_modules
.git
.gitignore
.dockerignore
.pre-commit-config.yaml
.prettierrc.json
.env.local
.next
Dockerfile
docker-compose.yml
README.md

41
.env.sample Normal file
View file

@ -0,0 +1,41 @@
## Required variables section ##
# Host port mappings
WEB_SERVER_PORT=3000
SSH_SERVER_PORT=2222
# Hostname and URL
FQDN=your.domain.com
NEXTAUTH_URL=https://your.domain.com
# Secrects
NEXTAUTH_SECRET=your-secret
CRONJOB_KEY=your-other-secret
# UID:GID must match the user and group ID of the host folders and must be > 1000
# If you want to use a different user than 1001:1001, you must rebuild the image yourself.
UID=1001
GID=1001
# Config and data folders (volume mounts)
# The host folders must be owned by the user with UID and GID specified above
CONFIG_PATH=./config
SSH_PATH=./ssh
SSH_HOST=./ssh_host
BORG_REPOSITORY_PATH=./repos
TMP_PATH=./tmp
LOGS_PATH=./logs
## Optional variables section ##
# LAN feature
FQDN_LAN=
SSH_SERVER_PORT_LAN=
# SMTP server settings
MAIL_SMTP_FROM=
MAIL_SMTP_HOST=
MAIL_SMTP_PORT=
MAIL_SMTP_LOGIN=
MAIL_SMTP_PWD=
MAIL_REJECT_SELFSIGNED_TLS=

13
.github/FUNDING.yml vendored Normal file
View file

@ -0,0 +1,13 @@
# These are supported funding model platforms
github: [Ravinou]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: R4VEN
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

16
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
# Maintain dependencies for GitHub Actions
# src: https://github.com/marketplace/actions/build-and-push-docker-images#keep-up-to-date-with-github-dependabot
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

View file

@ -0,0 +1,29 @@
name: Build and Push Docker Image for Develop Branch
on:
push:
branches:
- 'develop'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64 # linux/arm/v7 arm32 is not supported by node20 https://github.com/nodejs/docker-node/issues/1946
tags: borgwarehouse/borgwarehouse:develop

View file

@ -0,0 +1,29 @@
name: Build and Push Docker Image
on:
push:
branches:
- 'main'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64 # linux/arm/v7 arm32 is not supported by node20 https://github.com/nodejs/docker-node/issues/1946
tags: borgwarehouse/borgwarehouse:latest

View file

@ -0,0 +1,32 @@
name: Build and Push Docker Image on Release
on:
release:
types:
- published
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get Release Tag
id: get_release_tag
run: echo "::set-output name=TAG::${{ github.event.release.tag_name }}"
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64 # linux/arm/v7 arm32 is not supported by node20 https://github.com/nodejs/docker-node/issues/1946
tags: borgwarehouse/borgwarehouse:${{ steps.get_release_tag.outputs.TAG }}

21
.github/workflows/docker-image-test.yml vendored Normal file
View file

@ -0,0 +1,21 @@
name: Test Docker Container Build on Pull Request
on:
pull_request:
branches:
- main
- develop
jobs:
build-container:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker Container
run: |
docker buildx build --platform linux/amd64,linux/arm64 -t borgwarehouse:pr-${{ github.event.pull_request.number }} .

23
.github/workflows/shellcheck.yml vendored Normal file
View file

@ -0,0 +1,23 @@
on:
push:
branches:
- main
- develop
pull_request:
branches: main
name: "Shellcheck"
permissions: {}
jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
env:
SHELLCHECK_OPTS: -e SC1091

5
.gitignore vendored
View file

@ -108,4 +108,7 @@ dist
# config file for BorgWarehouse
config/repo.json
config/users.json
config/users.json
# docker files
docker-compose.yml

View file

@ -1,5 +1,7 @@
# Run test against shells with "pre-commit run shellcheck --all-files"
repos:
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: shellcheck
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: shellcheck
files: helpers/shells/

21
.prettierrc.json Normal file
View file

@ -0,0 +1,21 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": true,
"arrowParens": "always",
"bracketSpacing": true,
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"singleAttributePerLine": false,
"bracketSameLine": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": true,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"useTabs": false,
"embeddedLanguageFormatting": "auto"
}

View file

@ -6,20 +6,20 @@ import { IconSettingsAutomation, IconCopy } from '@tabler/icons-react';
export default function QuickCommands(props) {
////Vars
const wizardEnv = props.wizardEnv;
//Needed to generate command for borg over LAN instead of WAN if env vars are set and option enabled.
let HOSTNAME;
let FQDN;
let SSH_SERVER_PORT;
let UNIX_USER = process.env.NEXT_PUBLIC_UNIX_USER;
if (
props.lanCommand &&
process.env.NEXT_PUBLIC_HOSTNAME_LAN &&
process.env.NEXT_PUBLIC_SSH_SERVER_PORT_LAN
wizardEnv.FQDN_LAN &&
wizardEnv.SSH_SERVER_PORT_LAN
) {
HOSTNAME = process.env.NEXT_PUBLIC_HOSTNAME_LAN;
SSH_SERVER_PORT = process.env.NEXT_PUBLIC_SSH_SERVER_PORT_LAN;
FQDN = wizardEnv.FQDN_LAN;
SSH_SERVER_PORT = wizardEnv.SSH_SERVER_PORT_LAN;
} else {
HOSTNAME = process.env.NEXT_PUBLIC_HOSTNAME;
SSH_SERVER_PORT = process.env.NEXT_PUBLIC_SSH_SERVER_PORT;
FQDN = wizardEnv.FQDN;
SSH_SERVER_PORT = wizardEnv.SSH_SERVER_PORT;
}
//State
@ -30,7 +30,7 @@ export default function QuickCommands(props) {
// Asynchronously call copy to clipboard
navigator.clipboard
.writeText(
`borg init -e repokey-blake2 ssh://${UNIX_USER}@${HOSTNAME}:${SSH_SERVER_PORT}/./${props.repositoryName}`
`ssh://${wizardEnv.UNIX_USER}@${FQDN}:${SSH_SERVER_PORT}/./${props.repositoryName}`
)
.then(() => {
// If successful, update the isCopied state value
@ -50,11 +50,13 @@ export default function QuickCommands(props) {
<div className={classes.copyValid}>Copied !</div>
) : (
<div className={classes.tooltip}>
borg init -e repokey-blake2 ssh://{UNIX_USER}@{HOSTNAME}:
{SSH_SERVER_PORT}/./
ssh://{wizardEnv.UNIX_USER}@{FQDN}:{SSH_SERVER_PORT}/./
{props.repositoryName}
</div>
)}
{props.lanCommand && <div className={classes.lanBadge}>LAN</div>}
<div className={classes.icons}>
<button onClick={handleCopy} className={classes.copyButton}>
<IconCopy color='#65748b' stroke={1.25} />

View file

@ -7,7 +7,7 @@
.icons {
position: relative;
bottom: 14px;
bottom: 13px;
}
.quickSetting {
@ -16,6 +16,15 @@
opacity: 1;
}
.lanBadge {
border-radius: 5px;
border: 1px solid #6d4aff;
color: #6d4aff;
font-size: 0.9em;
padding: 2px 5px;
margin-right: 8px;
}
.tooltip {
visibility: hidden;
opacity: 0;
@ -91,6 +100,15 @@
opacity: 0;
}
.container:hover .lanBadge {
visibility: hidden;
opacity: 0;
width: 0;
height: 0;
margin: 0;
padding: 0;
}
@media all and (max-width: 1000px) {
.container {
display: none;

View file

@ -6,6 +6,8 @@ import {
IconInfoCircle,
IconChevronDown,
IconChevronUp,
IconBellOff,
IconLockPlus,
} from '@tabler/icons-react';
import timestampConverter from '../../helpers/functions/timestampConverter';
import StorageBar from '../UI/StorageBar/StorageBar';
@ -53,22 +55,44 @@ export default function Repo(props) {
setDisplayDetails(boolean);
};
//Status indicator
const statusIndicator = () => {
return props.status
? classes.statusIndicatorGreen
: classes.statusIndicatorRed;
};
//Alert indicator
const alertIndicator = () => {
if (props.alert === 0) {
return (
<div className={classes.alertIcon}>
<IconBellOff size={16} color='grey' />
</div>
);
}
};
const appendOnlyModeIndicator = () => {
if (props.appendOnlyMode) {
return (
<div className={classes.appendOnlyModeIcon}>
<IconLockPlus size={16} color='grey' />
</div>
);
}
};
return (
<>
{displayDetails ? (
<>
<div className={classes.RepoOpen}>
<div className={classes.openFlex}>
{props.status ? (
<div
className={classes.statusIndicatorGreen}
></div>
) : (
<div
className={classes.statusIndicatorRed}
></div>
)}
<div className={statusIndicator()} />
<div className={classes.alias}>{props.alias}</div>
{appendOnlyModeIndicator()}
{alertIndicator()}
{props.comment && (
<div className={classes.comment}>
<IconInfoCircle size={16} color='grey' />
@ -80,6 +104,7 @@ export default function Repo(props) {
<QuickCommands
repositoryName={props.repositoryName}
lanCommand={props.lanCommand}
wizardEnv={props.wizardEnv}
/>
</div>
@ -103,7 +128,7 @@ export default function Repo(props) {
<tbody>
<tr>
<th>{props.repositoryName}</th>
<th>{props.storageSize}Go</th>
<th>{props.storageSize} GB</th>
<th style={{ padding: '0 4% 0 4%' }}>
<StorageBar
storageUsed={props.storageUsed}
@ -140,16 +165,10 @@ export default function Repo(props) {
<>
<div className={classes.RepoClose}>
<div className={classes.closeFlex}>
{props.status ? (
<div
className={classes.statusIndicatorGreen}
></div>
) : (
<div
className={classes.statusIndicatorRed}
></div>
)}
<div className={statusIndicator()} />
<div className={classes.alias}>{props.alias}</div>
{appendOnlyModeIndicator()}
{alertIndicator()}
{props.comment && (
<div className={classes.comment}>
<IconInfoCircle size={16} color='#637381' />

View file

@ -3,7 +3,9 @@
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
box-shadow:
0 1px 3px rgba(0, 0, 0, 0.12),
0 1px 2px rgba(0, 0, 0, 0.24);
width: auto;
max-height: 65px;
margin: 20px 0px 0px 0px;
@ -29,7 +31,9 @@
flex-direction: column;
justify-content: space-between;
align-items: center;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
box-shadow:
0 1px 3px rgba(0, 0, 0, 0.12),
0 1px 2px rgba(0, 0, 0, 0.24);
width: auto;
max-height: 200px;
margin: 20px 0px 0px 0px;
@ -144,6 +148,22 @@
}
}
/* Alert icon */
.alertIcon {
display: flex;
flex-direction: row;
align-items: center;
margin-left: 10px;
}
.appendOnlyModeIcon {
display: flex;
flex-direction: row;
align-items: center;
margin-left: 10px;
}
/* GENERAL */
.alias {
font-weight: bold;
@ -183,7 +203,9 @@
margin: 0px 0 0 20px;
opacity: 1;
transition: 0.5s opacity;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
box-shadow:
0 3px 6px rgba(0, 0, 0, 0.16),
0 3px 6px rgba(0, 0, 0, 0.23);
overflow: auto;
}

View file

@ -3,10 +3,14 @@
text-align: center;
position: absolute;
bottom: 0;
width: calc(100% + 70px);
width: 100%;
height: 50px;
}
.footer p {
padding-left: 70px;
}
a.site {
color: #6d4aff;
text-decoration: none;
@ -16,4 +20,7 @@ a.site {
.footer {
width: 100%;
}
.footer p {
padding-left: 0;
}
}

View file

@ -1,23 +1,21 @@
//Lib
import classes from "./Header.module.css";
import classes from './Header.module.css';
//Components
import Nav from "./Nav/Nav";
import Nav from './Nav/Nav';
function Header() {
return (
<header className={classes.Header}>
<div className={[classes.flex, 'container'].join(' ')}>
<div className={classes.logo}>
BorgWarehouse
</div>
<div className={classes.logo}>BorgWarehouse</div>
<nav>
<Nav />
</nav>
</nav>
</div>
</header>
)
);
}
export default Header;
export default Header;

View file

@ -1,7 +1,9 @@
.Header {
width: 100%;
background: #111827;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
box-shadow:
0 3px 6px rgba(0, 0, 0, 0.16),
0 3px 6px rgba(0, 0, 0, 0.23);
height: 50px;
color: white;
display: flex;

View file

@ -38,7 +38,7 @@ export default function Nav() {
<div>
<IconUser size={28} />
</div>
<div>
<div className={classes.username}>
{status === 'authenticated' && data.user.name}
</div>
</div>

View file

@ -10,6 +10,10 @@
align-items: center;
}
.username::first-letter {
text-transform: capitalize;
}
.account {
background: none;
border: none;

View file

@ -3,7 +3,7 @@ import classes from './StorageBar.module.css';
export default function StorageBar(props) {
//Var
//storageUsed is in octet, storageSize is in Go. Round to 1 decimal for %.
//storageUsed is in octet, storageSize is in GB. Round to 1 decimal for %.
const storageUsedPercent = (
((props.storageUsed / 1000000) * 100) /
props.storageSize
@ -23,8 +23,8 @@ export default function StorageBar(props) {
</div>
<div className={classes.tooltip}>
{storageUsedPercent}% (
{(props.storageUsed / 1000000).toFixed(1)}Go/
{props.storageSize}Go)
{(props.storageUsed / 1000000).toFixed(1)} GB /{' '}
{props.storageSize} GB)
</div>
</div>
</div>

View file

@ -51,7 +51,9 @@
opacity: 0;
transform: scale(1);
pointer-events: none;
transition: opacity 0.3s 0.1s, transform 0.2s 0.1s;
transition:
opacity 0.3s 0.1s,
transform 0.2s 0.1s;
}
/* Span */
@ -75,7 +77,9 @@
height: 14px;
background-color: rgba(var(--pure-material-onsurface-rgb, 0, 0, 0), 0.38);
vertical-align: top;
transition: background-color 0.2s, opacity 0.2s;
transition:
background-color 0.2s,
opacity 0.2s;
}
/* Thumb */
@ -88,9 +92,13 @@
width: 20px;
height: 20px;
background-color: rgb(var(--pure-material-onprimary-rgb, 255, 255, 255));
box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2),
0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
transition: background-color 0.2s, transform 0.2s;
box-shadow:
0 3px 1px -2px rgba(0, 0, 0, 0.2),
0 2px 2px 0 rgba(0, 0, 0, 0.14),
0 1px 5px 0 rgba(0, 0, 0, 0.12);
transition:
background-color 0.2s,
transform 0.2s;
}
/* Checked */
@ -112,7 +120,9 @@
.pureMaterialSwitch > input:active {
opacity: 1;
transform: scale(0);
transition: transform 0s, opacity 0s;
transition:
transform 0s,
opacity 0s;
}
.pureMaterialSwitch > input:active + span::before {

View file

@ -1,6 +1,8 @@
.container {
margin: 40px 20px 20px 5px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
box-shadow:
0 1px 3px rgba(0, 0, 0, 0.12),
0 1px 2px rgba(0, 0, 0, 0.24);
border-radius: 5px;
text-align: left;
padding: 30px 70px;
@ -54,8 +56,15 @@ h1 .icon {
.code {
background-color: #111827;
color: #f8f8f2;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
liberation mono, courier new, monospace;
font-family:
ui-monospace,
SFMono-Regular,
Menlo,
Monaco,
Consolas,
liberation mono,
courier new,
monospace;
padding: 5px 15px;
border-radius: 5px;
display: inline-block;
@ -91,8 +100,15 @@ h1 .icon {
.verifyOrange li .sshPublicKey {
background-color: #282a36;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
liberation mono, courier new, monospace;
font-family:
ui-monospace,
SFMono-Regular,
Menlo,
Monaco,
Consolas,
liberation mono,
courier new,
monospace;
border-radius: 5px;
padding: 5px;
}

View file

@ -3,24 +3,17 @@ import React from 'react';
import classes from '../WizardStep1/WizardStep1.module.css';
import { IconTool, IconAlertCircle } from '@tabler/icons-react';
import CopyButton from '../../UI/CopyButton/CopyButton';
import lanCommandOption from '../../../helpers/functions/lanCommandOption';
function WizardStep2(props) {
////Vars
const wizardEnv = props.wizardEnv;
const UNIX_USER = wizardEnv.UNIX_USER;
//Needed to generate command for borg over LAN instead of WAN if env vars are set and option enabled.
let HOSTNAME;
let SSH_SERVER_PORT;
let UNIX_USER = process.env.NEXT_PUBLIC_UNIX_USER;
if (
props.selectedOption.lanCommand &&
process.env.NEXT_PUBLIC_HOSTNAME_LAN &&
process.env.NEXT_PUBLIC_SSH_SERVER_PORT_LAN
) {
HOSTNAME = process.env.NEXT_PUBLIC_HOSTNAME_LAN;
SSH_SERVER_PORT = process.env.NEXT_PUBLIC_SSH_SERVER_PORT_LAN;
} else {
HOSTNAME = process.env.NEXT_PUBLIC_HOSTNAME;
SSH_SERVER_PORT = process.env.NEXT_PUBLIC_SSH_SERVER_PORT;
}
const { FQDN, SSH_SERVER_PORT } = lanCommandOption(
wizardEnv,
props.selectedOption.lanCommand
);
return (
<div className={classes.container}>
@ -40,11 +33,11 @@ function WizardStep2(props) {
>
<div className={classes.code}>
borg init -e repokey-blake2 ssh://
{UNIX_USER}@{HOSTNAME}:{SSH_SERVER_PORT}/./
{UNIX_USER}@{FQDN}:{SSH_SERVER_PORT}/./
{props.selectedOption.repositoryName}
</div>
<CopyButton
dataToCopy={`borg init -e repokey-blake2 ssh://${UNIX_USER}@${HOSTNAME}:${SSH_SERVER_PORT}/./${props.selectedOption.repositoryName}`}
dataToCopy={`borg init -e repokey-blake2 ssh://${UNIX_USER}@${FQDN}:${SSH_SERVER_PORT}/./${props.selectedOption.repositoryName}`}
/>
</div>
<div className={classes.note}>
@ -64,7 +57,7 @@ function WizardStep2(props) {
<div className={classes.separator}></div>
<h2>Borgmatic</h2>
<div className={classes.description}>
If you are using Borgmatic and have <b>already edited</b> the
If you are using Borgmatic and have <b>already edited</b> the configuration file
(find a sample on the step 4) :
<br />
<div
@ -75,9 +68,9 @@ function WizardStep2(props) {
}}
>
<div className={classes.code}>
borg init -e repokey-blake2
borgmatic init -e repokey-blake2
</div>
<CopyButton dataToCopy='borg init -e repokey-blake2' />
<CopyButton dataToCopy='borgmatic init -e repokey-blake2' />
</div>
</div>
@ -95,11 +88,11 @@ function WizardStep2(props) {
>
<div className={classes.code}>
ssh://
{UNIX_USER}@{HOSTNAME}:{SSH_SERVER_PORT}/./
{UNIX_USER}@{FQDN}:{SSH_SERVER_PORT}/./
{props.selectedOption.repositoryName}
</div>
<CopyButton
dataToCopy={`ssh://${UNIX_USER}@${HOSTNAME}:${SSH_SERVER_PORT}/./${props.selectedOption.repositoryName}`}
dataToCopy={`ssh://${UNIX_USER}@${FQDN}:${SSH_SERVER_PORT}/./${props.selectedOption.repositoryName}`}
/>
</div>
For more information about the Vorta graphical client, please
@ -121,24 +114,21 @@ function WizardStep2(props) {
<b>Check the fingerprint of server</b>
</div>
To check that you are talking to the right server, please make
sure to validate the following sshPublicKeys when you first
connect :
sure to validate one of the following key's fingerprint when you
first connect :
<li>
<span className={classes.sshPublicKey}>
ECDSA :{' '}
{process.env.NEXT_PUBLIC_SSH_SERVER_FINGERPRINT_ECDSA}
ECDSA : {wizardEnv.SSH_SERVER_FINGERPRINT_ECDSA}
</span>
</li>
<li>
<span className={classes.sshPublicKey}>
ED25519 :{' '}
{process.env.NEXT_PUBLIC_SSH_SERVER_FINGERPRINT_ED25519}
ED25519 : {wizardEnv.SSH_SERVER_FINGERPRINT_ED25519}
</span>
</li>
<li>
<span className={classes.sshPublicKey}>
RSA :{' '}
{process.env.NEXT_PUBLIC_SSH_SERVER_FINGERPRINT_RSA}
RSA : {wizardEnv.SSH_SERVER_FINGERPRINT_RSA}
</span>
</li>
</div>

View file

@ -3,24 +3,17 @@ import React from 'react';
import classes from '../WizardStep1/WizardStep1.module.css';
import { IconChecks, IconPlayerPlay } from '@tabler/icons-react';
import CopyButton from '../../UI/CopyButton/CopyButton';
import lanCommandOption from '../../../helpers/functions/lanCommandOption';
function WizardStep3(props) {
////Vars
const wizardEnv = props.wizardEnv;
const UNIX_USER = wizardEnv.UNIX_USER;
//Needed to generate command for borg over LAN instead of WAN if env vars are set and option enabled.
let HOSTNAME;
let SSH_SERVER_PORT;
let UNIX_USER = process.env.NEXT_PUBLIC_UNIX_USER;
if (
props.selectedOption.lanCommand &&
process.env.NEXT_PUBLIC_HOSTNAME_LAN &&
process.env.NEXT_PUBLIC_SSH_SERVER_PORT_LAN
) {
HOSTNAME = process.env.NEXT_PUBLIC_HOSTNAME_LAN;
SSH_SERVER_PORT = process.env.NEXT_PUBLIC_SSH_SERVER_PORT_LAN;
} else {
HOSTNAME = process.env.NEXT_PUBLIC_HOSTNAME;
SSH_SERVER_PORT = process.env.NEXT_PUBLIC_SSH_SERVER_PORT;
}
const { FQDN, SSH_SERVER_PORT } = lanCommandOption(
wizardEnv,
props.selectedOption.lanCommand
);
return (
<div className={classes.container}>
@ -39,12 +32,12 @@ function WizardStep3(props) {
>
<div className={classes.code}>
borg create ssh://
{UNIX_USER}@{HOSTNAME}:{SSH_SERVER_PORT}/./
{UNIX_USER}@{FQDN}:{SSH_SERVER_PORT}/./
{props.selectedOption.repositoryName}
::archive1 /your/pathToBackup
</div>
<CopyButton
dataToCopy={`borg create ssh://${UNIX_USER}@${HOSTNAME}:${SSH_SERVER_PORT}/./${props.selectedOption.repository}::archive1 /your/pathToBackup`}
dataToCopy={`borg create ssh://${UNIX_USER}@${FQDN}:${SSH_SERVER_PORT}/./${props.selectedOption.repositoryName}::archive1 /your/pathToBackup`}
/>
</div>
</div>
@ -85,11 +78,11 @@ function WizardStep3(props) {
>
<div className={classes.code}>
borg check -v --progress ssh://
{UNIX_USER}@{HOSTNAME}:{SSH_SERVER_PORT}/./
{UNIX_USER}@{FQDN}:{SSH_SERVER_PORT}/./
{props.selectedOption.repositoryName}
</div>
<CopyButton
dataToCopy={`borg check -v --progress ssh://${UNIX_USER}@${HOSTNAME}:${SSH_SERVER_PORT}/./${props.selectedOption.repositoryName}`}
dataToCopy={`borg check -v --progress ssh://${UNIX_USER}@${FQDN}:${SSH_SERVER_PORT}/./${props.selectedOption.repositoryName}`}
/>
</div>
<li>List the remote archives with :</li>
@ -102,11 +95,11 @@ function WizardStep3(props) {
>
<div className={classes.code}>
borg list ssh://
{UNIX_USER}@{HOSTNAME}:{SSH_SERVER_PORT}/./
{UNIX_USER}@{FQDN}:{SSH_SERVER_PORT}/./
{props.selectedOption.repositoryName}
</div>
<CopyButton
dataToCopy={`borg list ssh://${UNIX_USER}@${HOSTNAME}:${SSH_SERVER_PORT}/./${props.selectedOption.repositoryName}`}
dataToCopy={`borg list ssh://${UNIX_USER}@${FQDN}:${SSH_SERVER_PORT}/./${props.selectedOption.repositoryName}`}
/>
</div>
<li>Download a remote archive with the following command :</li>
@ -119,12 +112,12 @@ function WizardStep3(props) {
>
<div className={classes.code}>
borg export-tar --tar-filter="gzip -9" ssh://
{UNIX_USER}@{HOSTNAME}:{SSH_SERVER_PORT}/./
{UNIX_USER}@{FQDN}:{SSH_SERVER_PORT}/./
{props.selectedOption.repositoryName}
::archive1 archive1.tar.gz
</div>
<CopyButton
dataToCopy={`borg export-tar --tar-filter="gzip -9" ssh://${UNIX_USER}@${HOSTNAME}:${SSH_SERVER_PORT}/./${props.selectedOption.repositoryName}::archive1 archive1.tar.gz`}
dataToCopy={`borg export-tar --tar-filter="gzip -9" ssh://${UNIX_USER}@${FQDN}:${SSH_SERVER_PORT}/./${props.selectedOption.repositoryName}::archive1 archive1.tar.gz`}
/>
</div>
<li>
@ -140,12 +133,12 @@ function WizardStep3(props) {
>
<div className={classes.code}>
borg mount ssh://
{UNIX_USER}@{HOSTNAME}:{SSH_SERVER_PORT}/./
{UNIX_USER}@{FQDN}:{SSH_SERVER_PORT}/./
{props.selectedOption.repositoryName}
::archive1 /tmp/yourMountPoint
</div>
<CopyButton
dataToCopy={`borg mount ssh://${UNIX_USER}@${HOSTNAME}:${SSH_SERVER_PORT}/./${props.selectedOption.repositoryName}::archive1 /tmp/yourMountPoint`}
dataToCopy={`borg mount ssh://${UNIX_USER}@${FQDN}:${SSH_SERVER_PORT}/./${props.selectedOption.repositoryName}::archive1 /tmp/yourMountPoint`}
/>
</div>
<br />

View file

@ -3,24 +3,17 @@ import React from 'react';
import classes from '../WizardStep1/WizardStep1.module.css';
import { IconWand } from '@tabler/icons-react';
import CopyButton from '../../UI/CopyButton/CopyButton';
import lanCommandOption from '../../../helpers/functions/lanCommandOption';
function WizardStep4(props) {
////Vars
const wizardEnv = props.wizardEnv;
const UNIX_USER = wizardEnv.UNIX_USER;
//Needed to generate command for borg over LAN instead of WAN if env vars are set and option enabled.
let HOSTNAME;
let SSH_SERVER_PORT;
let UNIX_USER = process.env.NEXT_PUBLIC_UNIX_USER;
if (
props.selectedOption.lanCommand &&
process.env.NEXT_PUBLIC_HOSTNAME_LAN &&
process.env.NEXT_PUBLIC_SSH_SERVER_PORT_LAN
) {
HOSTNAME = process.env.NEXT_PUBLIC_HOSTNAME_LAN;
SSH_SERVER_PORT = process.env.NEXT_PUBLIC_SSH_SERVER_PORT_LAN;
} else {
HOSTNAME = process.env.NEXT_PUBLIC_HOSTNAME;
SSH_SERVER_PORT = process.env.NEXT_PUBLIC_SSH_SERVER_PORT;
}
const { FQDN, SSH_SERVER_PORT } = lanCommandOption(
wizardEnv,
props.selectedOption.lanCommand
);
const configBorgmatic = `location:
# List of source directories to backup.
@ -30,10 +23,10 @@ function WizardStep4(props) {
repositories:
# Paths of local or remote repositories to backup to.
- ssh://${UNIX_USER}@${HOSTNAME}:${SSH_SERVER_PORT}/./${props.selectedOption.repositoryName}
- ssh://${UNIX_USER}@${FQDN}:${SSH_SERVER_PORT}/./${props.selectedOption.repositoryName}
storage:
archive_name_format: '{HOSTNAME}-documents-{now}'
archive_name_format: '{FQDN}-documents-{now}'
encryption_passphrase: "YOUR PASSPHRASE"
retention:
@ -47,7 +40,7 @@ consistency:
checks:
- name: repository
- name: archives
- frequency: 2 weeks
frequency: 2 weeks
#hooks:
# Custom preparation scripts to run.

View file

@ -78,7 +78,7 @@ export default function StorageUsedChartBar() {
datasets: [
{
label: 'Storage used (%)',
//storageUsed is in octet, storageSize is in Go. Round to 1 decimal for %.
//storageUsed is in octet, storageSize is in GB. Round to 1 decimal for %.
data: data.map((repo) =>
(
((repo.storageUsed / 1000000) * 100) /

View file

@ -43,11 +43,27 @@ export default function RepoList() {
if (router.pathname.startsWith('/manage-repo/edit')) {
setDisplayRepoEdit(!displayRepoEdit);
}
//Fetch wizardEnv to hydrate Repo components
const fetchWizardEnv = async () => {
try {
const response = await fetch('/api/account/getWizardEnv', {
method: 'GET',
headers: {
'Content-type': 'application/json',
},
});
setWizardEnv((await response.json()).wizardEnv);
} catch (error) {
console.log('Fetching datas error');
}
};
fetchWizardEnv();
}, []);
////States
const [displayRepoAdd, setDisplayRepoAdd] = useState(false);
const [displayRepoEdit, setDisplayRepoEdit] = useState(false);
const [wizardEnv, setWizardEnv] = useState({});
////Functions
@ -100,13 +116,16 @@ export default function RepoList() {
alias={repo.alias}
status={repo.status}
lastSave={repo.lastSave}
alert={repo.alert}
repositoryName={repo.repositoryName}
storageSize={repo.storageSize}
storageUsed={repo.storageUsed}
sshPublicKey={repo.sshPublicKey}
comment={repo.comment}
lanCommand={repo.lanCommand}
appendOnlyMode={repo.appendOnlyMode}
repoManageEditHandler={() => repoManageEditHandler(repo.id)}
wizardEnv={wizardEnv}
></Repo>
</>
);

View file

@ -23,6 +23,7 @@ export default function RepoManage(props) {
} = useForm({ mode: 'onChange' });
//List of possible times for alerts
const alertOptions = [
{ value: 0, label: 'Disabled' },
{ value: 3600, label: '1 hour' },
{ value: 21600, label: '6 hours' },
{ value: 43200, label: '12 hours' },
@ -169,6 +170,7 @@ export default function RepoManage(props) {
comment: dataForm.comment,
alert: dataForm.alert.value,
lanCommand: dataForm.lanCommand,
appendOnlyMode: dataForm.appendOnlyMode,
};
//POST API to send new repo
await fetch('/api/repo/add', {
@ -178,7 +180,7 @@ export default function RepoManage(props) {
},
body: JSON.stringify(newRepo),
})
.then((response) => {
.then(async (response) => {
if (response.ok) {
toast.success(
'New repository added ! 🥳',
@ -186,9 +188,13 @@ export default function RepoManage(props) {
);
router.replace('/');
} else {
toast.error('An error has occurred', toastOptions);
const errorMessage = await response.json();
toast.error(
`An error has occurred : ${errorMessage.message}`,
toastOptions
);
router.replace('/');
console.log('Fail to post');
console.log(`Fail to ${props.mode}`);
}
})
.catch((error) => {
@ -205,6 +211,7 @@ export default function RepoManage(props) {
comment: dataForm.comment,
alert: dataForm.alert.value,
lanCommand: dataForm.lanCommand,
appendOnlyMode: dataForm.appendOnlyMode,
};
await fetch('/api/repo/id/' + router.query.slug + '/edit', {
method: 'PUT',
@ -213,7 +220,7 @@ export default function RepoManage(props) {
},
body: JSON.stringify(dataEdited),
})
.then((response) => {
.then(async (response) => {
if (response.ok) {
toast.success(
'The repository #' +
@ -223,9 +230,13 @@ export default function RepoManage(props) {
);
router.replace('/');
} else {
toast.error('An error has occurred', toastOptions);
const errorMessage = await response.json();
toast.error(
`An error has occurred : ${errorMessage.message}`,
toastOptions
);
router.replace('/');
console.log('Fail to PUT');
console.log(`Fail to ${props.mode}`);
}
})
.catch((error) => {
@ -375,7 +386,7 @@ export default function RepoManage(props) {
</span>
)}
{/* SIZE */}
<label htmlFor='size'>Storage Size (Go)</label>
<label htmlFor='size'>Storage Size (GB)</label>
<input
type='number'
min='1'
@ -417,7 +428,7 @@ export default function RepoManage(props) {
</span>
)}
{/* LAN COMMAND GENERATION */}
<div className={classes.lanCommandWrapper}>
<div className={classes.optionCommandWrapper}>
<input
type='checkbox'
name='lanCommand'
@ -446,6 +457,36 @@ export default function RepoManage(props) {
/>
</Link>
</div>
{/* APPEND-ONLY MODE */}
<div className={classes.optionCommandWrapper}>
<input
type='checkbox'
name='appendOnlyMode'
defaultChecked={
props.mode == 'edit'
? targetRepo.appendOnlyMode
: false
}
{...register('appendOnlyMode')}
/>
<label htmlFor='appendOnlyMode'>
Enable append-only mode.
</label>
<Link
style={{
alignSelf: 'baseline',
marginLeft: '5px',
}}
href='https://borgwarehouse.com/docs/user-manual/repositories/#append-only-mode'
rel='noreferrer'
target='_blank'
>
<IconExternalLink
size={16}
color='#6c737f'
/>
</Link>
</div>
{/* ALERT */}
<label
style={{ margin: '25px auto 10px auto' }}
@ -463,7 +504,7 @@ export default function RepoManage(props) {
x.value ===
targetRepo.alert
)
: alertOptions[3]
: alertOptions[4]
}
control={control}
render={({

View file

@ -1,268 +1,268 @@
.modaleWrapper {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 100%;
height: 100%;
margin: 50px 0px 0px 70px;
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 100%;
height: 100%;
margin: 50px 0px 0px 70px;
}
.modale {
position: fixed;
top: 10%;
width: 1000px;
height: auto;
max-width: 75%;
max-height: 85%;
background: #fff;
padding: 20px 20px 20px;
overflow: auto;
border-radius: 10px;
box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.4);
margin: 0 auto;
animation: append-animate 0.3s linear;
position: fixed;
top: 10%;
width: 1000px;
height: auto;
max-width: 75%;
max-height: 85%;
background: #fff;
padding: 20px 20px 20px;
overflow: auto;
border-radius: 10px;
box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.4);
margin: 0 auto;
animation: append-animate 0.3s linear;
}
@keyframes append-animate {
from {
transform: scale(0);
opacity: 0;
}
to {
transform: scale(1);
opacity: 1;
}
from {
transform: scale(0);
opacity: 0;
}
to {
transform: scale(1);
opacity: 1;
}
}
.close {
cursor: pointer;
margin-left: 95%;
color: #494b7a;
cursor: pointer;
margin-left: 95%;
color: #494b7a;
}
.close :hover {
color: #aa60ff;
color: #aa60ff;
}
.repoManageForm {
margin: auto;
width: 80%;
padding: 15px 30px 30px 30px;
border-radius: 5px;
text-align: left;
margin: auto;
width: 80%;
padding: 15px 30px 30px 30px;
border-radius: 5px;
text-align: left;
}
.formWrapper {
text-align: center;
margin: auto;
width: 100%;
height: auto;
color: #494b7a;
text-align: center;
margin: auto;
width: 100%;
height: auto;
color: #494b7a;
}
.repoManageForm label {
display: block;
margin-bottom: 8px;
text-align: center;
margin-top: 20px;
color: #494b7a;
display: block;
margin-bottom: 8px;
text-align: center;
margin-top: 20px;
color: #494b7a;
}
.repoManageForm input,
.repoManageForm textarea,
.repoManageForm select {
border: 1px solid #6d4aff21;
font-size: 16px;
height: auto;
margin: 0;
margin-bottom: 0px;
outline: 0;
padding: 15px;
width: 100%;
background-color: #f5f5f5;
border-radius: 5px;
/* color: #1b1340; */
color: #494b7a;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03) inset;
border: 1px solid #6d4aff21;
font-size: 16px;
height: auto;
margin: 0;
margin-bottom: 0px;
outline: 0;
padding: 15px;
width: 100%;
background-color: #f5f5f5;
border-radius: 5px;
/* color: #1b1340; */
color: #494b7a;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03) inset;
}
.repoManageForm textarea {
resize: vertical;
resize: vertical;
}
.repoManageForm textarea:focus,
.repoManageForm input:focus,
.repoManageForm select:focus {
outline: 1px solid #6d4aff;
box-shadow: 0 0 10px 3px rgba(110, 74, 255, 0.605);
outline: 1px solid #6d4aff;
box-shadow: 0 0 10px 3px rgba(110, 74, 255, 0.605);
}
.repoManageForm .invalid {
background: #f3c7c7;
border: 1px solid #e45454;
outline: 1px solid #ff4a4a;
background: #f3c7c7;
border: 1px solid #e45454;
outline: 1px solid #ff4a4a;
}
.repoManageForm .invalid:focus {
background: #f3c7c7;
border: 1px solid #e45454;
outline: 1px solid #ff4a4a;
box-shadow: 0 0 10px 3px rgba(255, 74, 74, 0.605);
background: #f3c7c7;
border: 1px solid #e45454;
outline: 1px solid #ff4a4a;
box-shadow: 0 0 10px 3px rgba(255, 74, 74, 0.605);
}
.repoManageForm button {
display: block;
margin: 15px auto;
display: block;
margin: 15px auto;
}
.repoManageForm button:hover {
display: block;
margin: 15px auto;
display: block;
margin: 15px auto;
}
.errorMessage {
color: red;
display: block;
margin-top: 3px;
color: red;
display: block;
margin-top: 3px;
}
.lanCommandWrapper {
display: flex;
margin-top: 20px;
color: #494b7a;
.optionCommandWrapper {
display: flex;
margin-top: 20px;
color: #494b7a;
}
.lanCommandWrapper label {
margin: 0;
.optionCommandWrapper label {
margin: 0;
}
.lanCommandWrapper input[type='checkbox'] {
width: auto;
margin-right: 8px;
cursor: pointer;
accent-color: #6d4aff;
.optionCommandWrapper input[type='checkbox'] {
width: auto;
margin-right: 8px;
cursor: pointer;
accent-color: #6d4aff;
}
.lanCommandWrapper input[type='checkbox']:focus {
outline: 0;
box-shadow: none;
accent-color: #6d4aff;
.optionCommandWrapper input[type='checkbox']:focus {
outline: 0;
box-shadow: none;
accent-color: #6d4aff;
}
/* DELETE DIALOG */
.deleteDialogWrapper {
text-align: center;
margin: auto;
width: 80%;
height: 100%;
max-height: 590px;
color: #111827;
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
margin: auto;
width: 80%;
height: 100%;
max-height: 590px;
color: #111827;
display: flex;
flex-direction: column;
justify-content: center;
}
.deleteDialogMessage {
background-color: #ea1313;
color: #fff;
font-weight: 500;
border-radius: 5px;
padding: 15px;
margin-top: 15px;
margin-bottom: 15px;
font-size: 1.1em;
background-color: #ea1313;
color: #fff;
font-weight: 500;
border-radius: 5px;
padding: 15px;
margin-top: 15px;
margin-bottom: 15px;
font-size: 1.1em;
}
.cancelButton {
border: 0;
padding: 10px 15px;
background-color: #c1c1c1;
color: white;
margin: 5px;
border-radius: 4px;
cursor: pointer;
text-decoration: none;
font-weight: bold;
font-size: 1em;
border: 0;
padding: 10px 15px;
background-color: #c1c1c1;
color: white;
margin: 5px;
border-radius: 4px;
cursor: pointer;
text-decoration: none;
font-weight: bold;
font-size: 1em;
}
.cancelButton:hover {
border: 0;
padding: 10px 15px;
background-color: #9a9a9a;
color: white;
margin: 5px;
border-radius: 4px;
cursor: pointer;
text-decoration: none;
font-weight: bold;
font-size: 1em;
border: 0;
padding: 10px 15px;
background-color: #9a9a9a;
color: white;
margin: 5px;
border-radius: 4px;
cursor: pointer;
text-decoration: none;
font-weight: bold;
font-size: 1em;
}
.cancelButton:active {
border: 0;
padding: 10px 15px;
background-color: #9a9a9a;
color: white;
margin: 5px;
border-radius: 4px;
cursor: pointer;
text-decoration: none;
font-weight: bold;
font-size: 1em;
transform: scale(0.9);
border: 0;
padding: 10px 15px;
background-color: #9a9a9a;
color: white;
margin: 5px;
border-radius: 4px;
cursor: pointer;
text-decoration: none;
font-weight: bold;
font-size: 1em;
transform: scale(0.9);
}
.deleteButton {
border: 0;
padding: 10px 15px;
background-color: #ff0000;
color: white;
margin: 5px;
border-radius: 4px;
cursor: pointer;
text-decoration: none;
font-weight: bold;
font-size: 1em;
border: 0;
padding: 10px 15px;
background-color: #ff0000;
color: white;
margin: 5px;
border-radius: 4px;
cursor: pointer;
text-decoration: none;
font-weight: bold;
font-size: 1em;
}
.deleteButton:hover {
border: 0;
padding: 10px 15px;
background-color: #ff4b4b;
color: white;
margin: 5px;
border-radius: 4px;
cursor: pointer;
text-decoration: none;
font-weight: bold;
font-size: 1em;
border: 0;
padding: 10px 15px;
background-color: #ff4b4b;
color: white;
margin: 5px;
border-radius: 4px;
cursor: pointer;
text-decoration: none;
font-weight: bold;
font-size: 1em;
}
.deleteButton:active {
border: 0;
padding: 10px 15px;
background-color: #ff4b4b;
color: white;
margin: 5px;
border-radius: 4px;
cursor: pointer;
text-decoration: none;
font-weight: bold;
font-size: 1em;
transform: scale(0.9);
border: 0;
padding: 10px 15px;
background-color: #ff4b4b;
color: white;
margin: 5px;
border-radius: 4px;
cursor: pointer;
text-decoration: none;
font-weight: bold;
font-size: 1em;
transform: scale(0.9);
}
.littleDeleteButton {
border: none;
font-weight: 300;
color: red;
text-decoration: underline;
background: none;
cursor: pointer;
border: none;
font-weight: 300;
color: red;
text-decoration: underline;
background: none;
cursor: pointer;
}
.selectAlert {
margin: auto auto 35px auto;
max-width: 160px;
margin: auto auto 35px auto;
max-width: 160px;
}

View file

@ -20,6 +20,7 @@ function SetupWizard(props) {
const [list, setList] = useState([]);
const [listIsLoading, setListIsLoading] = useState(true);
const [step, setStep] = useState();
const [wizardEnv, setWizardEnv] = useState({});
const [selectedOption, setSelectedOption] = useState({
id: '#id',
repository: 'repo',
@ -44,6 +45,21 @@ function SetupWizard(props) {
}
};
repoList();
//Fetch wizardEnv to hydrate Wizard' steps
const fetchWizardEnv = async () => {
try {
const response = await fetch('/api/account/getWizardEnv', {
method: 'GET',
headers: {
'Content-type': 'application/json',
},
});
setWizardEnv((await response.json()).wizardEnv);
} catch (error) {
console.log('Fetching datas error');
}
};
fetchWizardEnv();
}, []);
//Component did update
useEffect(() => {
@ -84,11 +100,26 @@ function SetupWizard(props) {
if (step == 1) {
return <WizardStep1 />;
} else if (step == 2) {
return <WizardStep2 selectedOption={selectedOption} />;
return (
<WizardStep2
selectedOption={selectedOption}
wizardEnv={wizardEnv}
/>
);
} else if (step == 3) {
return <WizardStep3 selectedOption={selectedOption} />;
return (
<WizardStep3
selectedOption={selectedOption}
wizardEnv={wizardEnv}
/>
);
} else {
return <WizardStep4 selectedOption={selectedOption} />;
return (
<WizardStep4
selectedOption={selectedOption}
wizardEnv={wizardEnv}
/>
);
}
};

View file

@ -21,7 +21,7 @@ export default function AppriseMode() {
const [modeFormIsSaved, setModeFormIsSaved] = useState(false);
const [error, setError] = useState(false);
const [displayStatelessURL, setDisplayStatelessURL] = useState(false);
const [appriseMode, setAppriseMode] = useState('');
const [appriseMode, setAppriseMode] = useState('stateless');
const [appriseStatelessURL, setAppriseStatelessURL] = useState();
////LifeCycle

View file

@ -86,7 +86,7 @@ export default function PasswordSettings(props) {
<p>
<input
type='password'
placeholder='Actual password'
placeholder='Current password'
{...register('oldPassword', {
required: true,
})}

56
Dockerfile Normal file
View file

@ -0,0 +1,56 @@
FROM node:20-bookworm-slim as base
ARG UID=1001
ARG GID=1001
# build stage
FROM base AS deps
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --only=production
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN sed -i "s/images:/output: 'standalone',images:/" next.config.js
RUN npm run build
# run stage
FROM base AS runner
ENV NODE_ENV production
RUN echo 'deb http://deb.debian.org/debian bookworm-backports main' >> /etc/apt/sources.list
RUN apt-get update && apt-get install -y \
supervisor curl jq jc borgbackup/bookworm-backports openssh-server rsyslog && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN groupadd -g ${GID} borgwarehouse && useradd -m -u ${UID} -g ${GID} borgwarehouse
RUN cp /etc/ssh/moduli /home/borgwarehouse/
WORKDIR /home/borgwarehouse/app
COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/docker/docker-bw-init.sh /app/LICENSE ./
COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/helpers/shells ./helpers/shells
COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/.next/standalone ./
COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/public ./public
COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/.next/static ./.next/static
COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/docker/supervisord.conf ./
COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/docker/rsyslog.conf /etc/rsyslog.conf
COPY --from=builder --chown=borgwarehouse:borgwarehouse /app/docker/sshd_config ./
USER borgwarehouse
EXPOSE 3000 22
ENTRYPOINT ["./docker-bw-init.sh"]

View file

@ -1,7 +1,12 @@
<div align="center">
[![Next][Next.js]][Next-url]
[![React][React.js]][React-url]
[![Next][Next.js]][Next-url]
[![React][React.js]][React-url]
</div>
<div align="center">
[![Docker](https://img.shields.io/badge/Docker-borgwarehouse-blue?style=for-the-badge&logo=docker)](https://hub.docker.com/r/borgwarehouse/borgwarehouse)
</div>
@ -19,7 +24,16 @@
</a>
</div>
## What is BorgWarehouse ?
## ⭐ Support the Project
<div align="center">
<a href="https://github.com/sponsors/Ravinou"><img alt="GitHub Sponsors" src="https://img.shields.io/github/sponsors/Ravinou?style=for-the-badge&logo=github&label=Github%20Sponsors&link=https%3A%2F%2Fgithub.com%2Fsponsors%2FRavinou"></a>
<a href="https://liberapay.com/R4VEN/"><img alt="Liberapay patrons" src="https://img.shields.io/liberapay/patrons/R4VEN?style=for-the-badge&logo=liberapay&label=Liberapay%20Sponsors&link=https%3A%2F%2Fliberapay.com%2FR4VEN"></a>
</div>
If you find BorgWarehouse helpful or interesting, please consider **giving it a star on GitHub** and **[sponsoring](https://github.com/sponsors/Ravinou)**. Your support is greatly appreciated!
## ✨ What is BorgWarehouse ?
**BorgWarehouse is a graphical interface to manage a central [BorgBackup](https://borgbackup.readthedocs.io/en/stable/#what-is-borgbackup) repository server.**
@ -37,59 +51,33 @@ With BorgWarehouse, you have an interface that allows you to do all this simply
The whole system part is automatically managed by BorgWarehouse and **you don't have to touch your terminal anymore** while enjoying a visual feedback on the status of your repositories.
## Get started
## 📖 Get started
You can find the documentation here : <a href="https://borgwarehouse.com/docs/prologue/introduction/">https://borgwarehouse.com/</a>
You can find the documentation here : [borgwarehouse.com](https://borgwarehouse.com/docs/prologue/introduction/)
## :key: Environment Variables
## 🔑 Environment Variables
To run this project, you will need to add the following environment variables to your `.env.local` file.
To run this project, you will need to add some environment variables.
Required variables :
You will find a complete documentation for this [here](https://borgwarehouse.com/docs/admin-manual/env-vars/).
- `NEXTAUTH_URL` : The url of your application as **https://borgwarehouse.com**.
- `NEXTAUTH_SECRET` : A secret random key.
- `CRONJOB_KEY` : A secret API key for cronjob.
- `NEXT_PUBLIC_HOSTNAME` : FQDN as **borgwarehouse.com**
- `NEXT_PUBLIC_SSH_SERVER_PORT` : SSH port of your server as **22**.
- `NEXT_PUBLIC_SSH_SERVER_FINGERPRINT_RSA` : Your server SSH fingerprint for RSA.
- `NEXT_PUBLIC_SSH_SERVER_FINGERPRINT_ED25519` : Your server SSH fingerprint for ED25519.
- `NEXT_PUBLIC_SSH_SERVER_FINGERPRINT_ECDSA` : Your server SSH fingerprint for ECDSA.
Example for a valid `.env.local` file :
```bash
# Private variable
NEXTAUTH_URL=https://yourbwdomain.com
NEXTAUTH_SECRET=YOURFIRSTSECRET
CRONJOB_KEY=YOURSECONDSECRET
MAIL_SMTP_FROM=
MAIL_SMTP_HOST=
MAIL_SMTP_PORT=
MAIL_SMTP_LOGIN=
MAIL_SMTP_PWD=
MAIL_REJECT_SELFSIGNED_TLS=true
# Public variable (Any change need a rebuild of app)
NEXT_PUBLIC_HOSTNAME=yourbwdomain.com
NEXT_PUBLIC_SSH_SERVER_PORT=22
NEXT_PUBLIC_SSH_SERVER_FINGERPRINT_RSA=SHA256:36mfYNRrm1aconVt6cBpi8LhAoPP4kB8QsVW4n8eGHQ
NEXT_PUBLIC_SSH_SERVER_FINGERPRINT_ED25519=SHA256:tYQuzrZZMqaw0Bzvn/sMoDs1CVEitZ9IrRyUg02yTPA
NEXT_PUBLIC_SSH_SERVER_FINGERPRINT_ECDSA=SHA256:nTpxui1oEmH9konPau17qBVIzBQVOsD1BIbBFU5IL04
# Disable NextJS telemetry
NEXT_TELEMETRY_DISABLED=1
```
You can find more details about generating your secrets or retrieving your SSH fingerprint. You can find more details about generating your secrets or retrieving your SSH fingerprint <a href="https://borgwarehouse.com/docs/admin-manual/debian-installation/#configure-application-environment-variables">in the documentation</a>.
## How to update ?
## ⏬ How to update ?
Check the online documentation [just here](https://borgwarehouse.com/docs/admin-manual/how-to-update/) !
<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
## ❤️ Special thanks to sponsors ❤️
### 🥇 Current sponsors 🥇
<a href="https://github.com/royalmoose"><img src="https://avatars.githubusercontent.com/royalmoose" style="width:50px; border-radius:50%;"/></a>
<a href="https://github.com/Magneticdud"><img src="https://avatars.githubusercontent.com/Magneticdud" style="width:50px; border-radius:50%;"/></a>
<a href="https://github.com/dhenry123"><img src="https://avatars.githubusercontent.com/dhenry123" style="width:50px; border-radius:50%;"/></a>
#### Past sponsors
<a href="https://github.com/shad-lp"><img src="https://avatars.githubusercontent.com/shad-lp" style="width:25px; border-radius:50%;"/></a>
[next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white
[next-url]: https://nextjs.org/
[react.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB

30
docker-compose.yml Normal file
View file

@ -0,0 +1,30 @@
version: '3'
services:
borgwarehouse:
container_name: borgwarehouse
# If you want to build the image yourself, uncomment the following lines and comment the image line
#build:
# context: .
# dockerfile: Dockerfile
# args:
# - UID=${UID}
# - GID=${GID}
image: borgwarehouse/borgwarehouse
user: '${UID:?UID variable missing}:${GID:?GID variable missing}'
ports:
- '${WEB_SERVER_PORT:?WEB_SERVER_PORT variable missing}:3000'
- '${SSH_SERVER_PORT:?SSH_SERVER_PORT variable missing}:22'
env_file:
- .env
volumes:
- ${CONFIG_PATH:?CONFIG_PATH variable missing}:/home/borgwarehouse/app/config
- ${SSH_PATH:?SSH_PATH variable missing}:/home/borgwarehouse/.ssh
- ${SSH_HOST:?SSH_HOST variable missing}:/etc/ssh
- ${BORG_REPOSITORY_PATH:?BORG_REPOSITORY_PATH variable missing}:/home/borgwarehouse/repos
- ${TMP_PATH:?TMP_PATH variable missing}:/home/borgwarehouse/tmp
- ${LOGS_PATH:?LOGS_PATH variable missing}:/home/borgwarehouse/logs
# Apprise is used to send notifications, it's optional. http://apprise:8000 is the URL to use in BorgWarehouse.
apprise:
container_name: apprise
image: caronc/apprise
user: 'www-data:www-data'

86
docker/docker-bw-init.sh Executable file
View file

@ -0,0 +1,86 @@
#!/bin/bash
set -e
SSH_DIR="/home/borgwarehouse/.ssh"
AUTHORIZED_KEYS_FILE="$SSH_DIR/authorized_keys"
REPOS_DIR="/home/borgwarehouse/repos"
print_green() {
echo -e "\e[92m$1\e[0m";
}
print_red() {
echo -e "\e[91m$1\e[0m";
}
init_ssh_server() {
if [ -z "$(ls -A /etc/ssh)" ]; then
print_green "/etc/ssh is empty, generating SSH host keys..."
ssh-keygen -A
cp /home/borgwarehouse/moduli /etc/ssh/
fi
if [ ! -f "/etc/ssh/sshd_config" ]; then
print_green "sshd_config not found in your volume, copying the default one..."
cp /home/borgwarehouse/app/sshd_config /etc/ssh/
fi
}
check_ssh_directory() {
if [ ! -d "$SSH_DIR" ]; then
print_red "The .ssh directory does not exist, you need to mount it as docker volume."
exit 1
else
chmod 700 "$SSH_DIR"
fi
}
create_authorized_keys_file() {
if [ ! -f "$AUTHORIZED_KEYS_FILE" ]; then
print_green "The authorized_keys file does not exist, creating..."
touch "$AUTHORIZED_KEYS_FILE"
fi
chmod 600 "$AUTHORIZED_KEYS_FILE"
}
check_repos_directory() {
if [ ! -d "$REPOS_DIR" ]; then
print_red "The repos directory does not exist, you need to mount it as docker volume."
exit 2
else
chmod 700 "$REPOS_DIR"
fi
}
get_SSH_fingerprints() {
print_green "Getting SSH fingerprints..."
RSA_FINGERPRINT=$(ssh-keygen -lf /etc/ssh/ssh_host_rsa_key | awk '{print $2}')
ED25519_FINGERPRINT=$(ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key | awk '{print $2}')
ECDSA_FINGERPRINT=$(ssh-keygen -lf /etc/ssh/ssh_host_ecdsa_key | awk '{print $2}')
export SSH_SERVER_FINGERPRINT_RSA="$RSA_FINGERPRINT"
export SSH_SERVER_FINGERPRINT_ED25519="$ED25519_FINGERPRINT"
export SSH_SERVER_FINGERPRINT_ECDSA="$ECDSA_FINGERPRINT"
}
check_env() {
if [ -z "$CRONJOB_KEY" ]; then
CRONJOB_KEY=$(openssl rand -base64 32)
print_green "CRONJOB_KEY not found or empty. Generating a random key..."
export CRONJOB_KEY
fi
if [ -z "$NEXTAUTH_SECRET" ]; then
NEXTAUTH_SECRET=$(openssl rand -base64 32)
print_green "NEXTAUTH_SECRET not found or empty. Generating a random key..."
export NEXTAUTH_SECRET
fi
}
check_env
init_ssh_server
check_ssh_directory
create_authorized_keys_file
check_repos_directory
get_SSH_fingerprints
print_green "Successful initialization. BorgWarehouse is ready !"
exec supervisord -c /home/borgwarehouse/app/supervisord.conf

40
docker/rsyslog.conf Normal file
View file

@ -0,0 +1,40 @@
# rsyslog configuration file
$WorkDirectory /home/borgwarehouse/tmp
$FileOwner borgwarehouse
$FileGroup borgwarehouse
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
$RepeatedMsgReduction on
module(load="imfile" PollingInterval="10")
input(type="imfile"
File="/home/borgwarehouse/tmp/borgwarehouse.log"
Tag="BorgWarehouse"
Severity="info"
Facility="local7"
ruleset="bwLogs")
input(type="imfile"
File="/home/borgwarehouse/tmp/sshd.log"
Tag="sshd"
Severity="info"
Facility="local7"
ruleset="sshdLogs")
$template myFormat,"%timegenerated:::date-rfc3339% %syslogtag% %msg%\n"
ruleset(name="bwLogs") {
action(type="omfile"
File="/home/borgwarehouse/logs/borgwarehouse.log"
Template="myFormat")
}
ruleset(name="sshdLogs") {
action(type="omfile"
File="/home/borgwarehouse/logs/sshd.log"
Template="myFormat")
}

32
docker/sshd_config Normal file
View file

@ -0,0 +1,32 @@
Port 22
PidFile /home/borgwarehouse/tmp/sshd.pid
AllowUsers borgwarehouse
LogLevel INFO
SyslogFacility AUTH
# Security
Protocol 2
PermitRootLogin no
PasswordAuthentication no
ChallengeResponseAuthentication no
AuthenticationMethods publickey
MaxAuthTries 2
MaxStartups 2:30:10
LoginGraceTime 30
UsePAM no
# Useless options for BorgWarehouse
PrintMotd no
UseDNS no
AllowTcpForwarding no
X11Forwarding no
PermitTTY no
# Ciphers
Ciphers aes256-ctr,aes192-ctr,aes128-ctr
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com
# With low bandwidth or huge backup, uncomment the following lines to avoid SSH timeout (Broken pipe).
#ClientAliveInterval 600
#ClientAliveCountMax 0

24
docker/supervisord.conf Normal file
View file

@ -0,0 +1,24 @@
[supervisord]
nodaemon=true
logfile=/home/borgwarehouse/logs/supervisord.log
loglevel=error
pidfile=/home/borgwarehouse/tmp/supervisord.pid
logfile_maxbytes=10MB
logfile_backups=5
[program:sshd]
command=/usr/sbin/sshd -D -e -f /etc/ssh/sshd_config
stdout_logfile=/home/borgwarehouse/tmp/sshd.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=5
redirect_stderr=true
[program:borgwarehouse]
command=/usr/local/bin/node server.js
stdout_logfile=/home/borgwarehouse/tmp/borgwarehouse.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=5
redirect_stderr=true
[program:rsyslogd]
command=rsyslogd -n -i /home/borgwarehouse/tmp/rsyslogd.pid -f /etc/rsyslog.conf

View file

@ -1,9 +0,0 @@
borgwarehouse ALL=(ALL) NOPASSWD: /usr/sbin/userdel -rf [[\:xdigit\:]]*
borgwarehouse ALL=(ALL) NOPASSWD: /usr/sbin/useradd -d /var/borgwarehouse/[[\:xdigit\:]]* -s /bin/bash -m --badname [[\:xdigit\:]]*
borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/mkdir -p /var/borgwarehouse/[[\:xdigit\:]]*/repos/repo[[\:digit\:]]*, /usr/bin/mkdir -p /var/borgwarehouse/[[\:xdigit\:]]*/.ssh
borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/touch /var/borgwarehouse/[[\:xdigit\:]]*/.ssh/authorized_keys
borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/chmod -R 750 /var/borgwarehouse/[[\:xdigit\:]]*, /usr/bin/chmod 600 /var/borgwarehouse/[[\:xdigit\:]]*/.ssh/authorized_keys
borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/chown -R [[\:xdigit\:]]*\:borgwarehouse /var/borgwarehouse/[[\:xdigit\:]]*
borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/tee /var/borgwarehouse/[[\:xdigit\:]]*/.ssh/authorized_keys
borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/sed -ri s|*|g /var/borgwarehouse/[[\:xdigit\:]]*/.ssh/authorized_keys
borgwarehouse ALL=(ALL) NOPASSWD: /usr/bin/du -s -- [[\:xdigit\:]]*

View file

@ -0,0 +1,13 @@
export default function lanCommandOption(wizardEnv, lanCommand) {
let FQDN;
let SSH_SERVER_PORT;
if (lanCommand && wizardEnv.FQDN_LAN && wizardEnv.SSH_SERVER_PORT_LAN) {
FQDN = wizardEnv.FQDN_LAN;
SSH_SERVER_PORT = wizardEnv.SSH_SERVER_PORT_LAN;
} else {
FQDN = wizardEnv.FQDN;
SSH_SERVER_PORT = wizardEnv.SSH_SERVER_PORT;
}
return { FQDN, SSH_SERVER_PORT };
}

View file

@ -0,0 +1,45 @@
import { promises as fs } from 'fs';
import path from 'path';
export default async function repoHistory(data) {
try {
const repoHistoryDir = path.join(process.cwd(), '/config/versions');
const maxBackupCount = parseInt(process.env.MAX_REPO_BACKUP_COUNT) || 8;
const timestamp = new Date().toISOString();
const backupDate = timestamp.split('T')[0];
//Create the directory if it does not exist
await fs.mkdir(repoHistoryDir, { recursive: true });
const existingBackups = await fs.readdir(repoHistoryDir);
if (existingBackups.length >= maxBackupCount) {
existingBackups.sort();
const backupsToDelete = existingBackups.slice(
0,
existingBackups.length - maxBackupCount + 1
);
for (const backupToDelete of backupsToDelete) {
const backupFilePathToDelete = path.join(
repoHistoryDir,
backupToDelete
);
await fs.unlink(backupFilePathToDelete);
}
}
const backupFileName = `${backupDate}.log`;
const backupFilePath = path.join(repoHistoryDir, backupFileName);
const jsonData = JSON.stringify(data, null, 2);
const logData = `\n>>>> History of file repo.json at "${timestamp}" <<<<\n${jsonData}\n`;
// Écrire ou réécrire le fichier avec le contenu mis à jour
await fs.appendFile(backupFilePath, logData);
} catch (error) {
console.error(
'An error occurred while saving the repo history :',
error.message
);
}
}

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Shell created by Raven for BorgWarehouse.
# This shell takes 2 arguments : [SSH pub key] X [quota]
# This shell takes 2 arguments : [SSH pub key] X [quota] x [append only mode (boolean)]
# Main steps are :
# - check if args are present
# - check the ssh pub key format
@ -31,8 +31,8 @@ pool="${home}/repos"
authorized_keys="${home}/.ssh/authorized_keys"
# Check args
if [ "$1" == "" ] || [ "$2" == "" ];then
echo "This shell takes 2 arguments : SSH Public Key, Quota in Go [e.g. : 10] "
if [ "$1" == "" ] || [ "$2" == "" ] || [ "$3" != "true" ] && [ "$3" != "false" ];then
echo -n "This shell takes 3 arguments : SSH Public Key, Quota in Go [e.g. : 10], Append only mode [true|false]"
exit 1
fi
@ -41,19 +41,25 @@ fi
pattern='(ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29t|ssh-rsa AAAAB3NzaC1yc2)[0-9A-Za-z+/]+[=]{0,3}(\s.*)?'
if [[ ! "$1" =~ $pattern ]]
then
echo "Invalid public SSH KEY format. Provide a key in OpenSSH format (rsa, ed25519, ed25519-sk)"
echo -n "Invalid public SSH KEY format. Provide a key in OpenSSH format (rsa, ed25519, ed25519-sk)"
exit 2
fi
## Check if authorized_keys exists
if [ ! -f "${authorized_keys}" ];then
echo -n "${authorized_keys} must be present"
exit 5
fi
# Check if SSH pub key is already present in authorized_keys
if grep -q "$1" "$authorized_keys"; then
echo "SSH pub key already present in authorized_keys"
echo -n "SSH pub key already present in authorized_keys"
exit 3
fi
# Check if borgbackup is installed
if ! [ -x "$(command -v borg)" ]; then
echo "You must install borgbackup package."
echo -n "You must install borgbackup package."
exit 4
fi
@ -63,14 +69,15 @@ randRepositoryName () {
}
repositoryName=$(randRepositoryName)
## Check if authorized_keys exists
if [ ! -f "${authorized_keys}" ];then
echo "${authorized_keys} must be present"
exit 5
# Append only mode
if [ "$3" == "true" ]; then
appendOnlyMode=" --append-only"
else
appendOnlyMode=""
fi
## Add ssh public key in authorized_keys with borg restriction for only 1 repository and storage quota
restricted_authkeys="command=\"cd ${pool};borg serve --restrict-to-path ${pool}/${repositoryName} --storage-quota $2G\",restrict $1"
restricted_authkeys="command=\"cd ${pool};borg serve${appendOnlyMode} --restrict-to-path ${pool}/${repositoryName} --storage-quota $2G\",restrict $1"
echo "$restricted_authkeys" | tee -a "${authorized_keys}" >/dev/null
## Return the repositoryName

View file

@ -21,7 +21,7 @@ authorized_keys="${home}/.ssh/authorized_keys"
# Check arg
if [[ $# -ne 1 || $1 = "" ]]; then
echo "You must provide a repositoryName in argument."
echo -n "You must provide a repositoryName in argument."
exit 1
fi
@ -29,21 +29,19 @@ fi
# If we receive another length there is necessarily a problem.
repositoryName=$1
if [ ${#repositoryName} != 8 ]; then
echo "Error with the length of the repositoryName."
echo -n "Error with the length of the repositoryName."
exit 2
fi
# Delete the repository and the line associated in the authorized_keys file
if [ -d "$1" ]; then
if [ -d "${pool}/${repositoryName}" ]; then
# Delete the repository
rm -rf "${pool}/${repositoryName}"
rm -rf """${pool}""/""${repositoryName:?}"""
# Delete the line in the authorized_keys file
sed -i "/${repositoryName}/d" "${authorized_keys}"
echo "The folder "${pool}/${repositoryName}" and all its data have been deleted. The line associated in the authorized_keys file has been deleted."
exit 3
echo -n "The folder ""${pool}"/"${repositoryName}"" and all its data have been deleted. The line associated in the authorized_keys file has been deleted."
else
# Delete the line in the authorized_keys file
sed -i "/${repositoryName}/d" "${authorized_keys}"
echo "The folder "${pool}/${repositoryName}" did not exist (repository never initialized or used). The line associated in the authorized_keys file has been deleted."
exit 3
echo -n "The folder ""${pool}"/"${repositoryName}"" did not exist (repository never initialized or used). The line associated in the authorized_keys file has been deleted."
fi

View file

@ -26,6 +26,10 @@ fi
# Default value if .env not exists
: "${home:=/home/borgwarehouse}"
stat --format='{"repositoryName":"%n","lastSave":%Y}' \
${home}/repos/*/integrity* |
jq --slurp '[.[] | .repositoryName = (.repositoryName | split("/")[-2])]'
if [ -n "$(find -L "${home}"/repos -mindepth 1 -maxdepth 1 -type d)" ]; then
stat --format='{"repositoryName":"%n","lastSave":%Y}' \
"${home}"/repos/*/integrity* |
jq --slurp '[.[] | .repositoryName = (.repositoryName | split("/")[-2])]'
else
echo "[]"
fi

View file

@ -23,5 +23,5 @@ fi
: "${home:=/home/borgwarehouse}"
# Use jc to output a JSON format with du command
cd ${home}/repos
cd "${home}"/repos
du -s -- * | jc --du

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Shell created by Raven for BorgWarehouse.
# This shell takes 3 args: [repositoryName] [new SSH pub key] [quota]
# This shell takes 4 args: [repositoryName] [new SSH pub key] [quota] [append-only mode (boolean)]
# This shell updates the SSH key and the quota for a repository.
# Exit when any command fails
@ -16,8 +16,8 @@ fi
: "${home:=/home/borgwarehouse}"
# Check args
if [ "$1" == "" ] || [ "$2" == "" ] || [ "$3" == "" ]; then
echo "This shell takes 3 args: [repositoryName] [new SSH pub key] [quota]"
if [ "$1" == "" ] || [ "$2" == "" ] || [ "$3" == "" ] || [ "$4" != "true" ] && [ "$4" != "false" ]; then
echo -n "This shell takes 4 args: [repositoryName] [new SSH pub key] [quota] [Append only mode [true|false]]"
exit 1
fi
@ -26,7 +26,7 @@ fi
pattern='(ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29t|ssh-rsa AAAAB3NzaC1yc2)[0-9A-Za-z+/]+[=]{0,3}(\s.*)?'
if [[ ! "$2" =~ $pattern ]]
then
echo "Invalid public SSH KEY format. Provide a key in OpenSSH format (rsa, ed25519, ed25519-sk)"
echo -n "Invalid public SSH KEY format. Provide a key in OpenSSH format (rsa, ed25519, ed25519-sk)"
exit 2
fi
@ -34,13 +34,13 @@ fi
# If we receive another length, there is necessarily a problem.
repositoryName=$1
if [ ${#repositoryName} != 8 ]; then
echo "Error with the length of the repositoryName."
echo -n "Error with the length of the repositoryName."
exit 3
fi
# Check if a line in authorized_keys contains repository_name
if ! grep -q "command=\".*${repositoryName}.*\",restrict" "$home/.ssh/authorized_keys"; then
echo "No line containing $repositoryName found in authorized_keys"
echo -n "No line containing $repositoryName found in authorized_keys"
exit 4
fi
@ -50,7 +50,7 @@ regex="command=\".*${repositoryName}.*\",restrict"
while IFS= read -r line; do
if [[ $line =~ $pattern ]]; then
# Get the SSH pub key of the line (ignore the comment)
key1=$(echo ${BASH_REMATCH[0]} | awk '{print $1 " " $2}')
key1=$(echo "${BASH_REMATCH[0]}" | awk '{print $1 " " $2}')
# Get the SSH pub key of the new SSH pub key (ignore the comment)
key2=$(echo "$2" | awk '{print $1 " " $2}')
@ -64,9 +64,16 @@ while IFS= read -r line; do
fi
done < "$home/.ssh/authorized_keys"
if [ "$found" = true ]; then
echo "The new SSH pub key $2 is already present in authorized_keys on a different line."
echo -n "This SSH pub key is already present in authorized_keys on a different line."
exit 5
fi
# Append only mode
if [ "$4" == "true" ]; then
sed -ri "/command=\".*${repositoryName}.*\",restrict/ {/borg serve .*--append-only /! s|(borg serve )|\1--append-only |}" "$home/.ssh/authorized_keys"
elif [ "$4" == "false" ]; then
sed -ri "/command=\".*${repositoryName}.*\",restrict/ s|(--append-only )||g" "$home/.ssh/authorized_keys"
fi
# Modify authorized_keys for the repositoryName: update the line with the quota and the SSH pub key
sed -ri "s|(command=\".*${repositoryName}.*--storage-quota ).*G\",restrict .*|\\1$3G\",restrict $2|g" "$home/.ssh/authorized_keys"
sed -ri "s|(command=\".*${repositoryName}.*--storage-quota ).*G\",restrict .*|\\1$3G\",restrict $2|g" "$home/.ssh/authorized_keys"

3254
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "borgwarehouse",
"version": "2.0.0-rc.1",
"version": "2.3.0",
"private": true,
"scripts": {
"dev": "next dev",
@ -9,23 +9,23 @@
"lint": "next lint"
},
"dependencies": {
"@tabler/icons-react": "^2.24.0",
"@tabler/icons-react": "^3.5.0",
"bcryptjs": "^2.4.3",
"chart.js": "^4.3.0",
"next": "^13.4.9",
"next-auth": "^4.22.1",
"nodemailer": "^6.9.3",
"react": "^18.2.0",
"chart.js": "^4.4.3",
"next": "^14.2.3",
"next-auth": "^4.24.7",
"nodemailer": "^6.9.13",
"react": "^18.3.1",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.36.1",
"react-select": "^5.6.0",
"react-toastify": "^9.0.8",
"react-dom": "^18.3.1",
"react-hook-form": "^7.51.5",
"react-select": "^5.8.0",
"react-toastify": "^10.0.5",
"spinners-react": "^1.0.7",
"swr": "^2.2.0"
"swr": "^2.2.5"
},
"devDependencies": {
"eslint": "8.23.1",
"eslint-config-next": "^13.4.9"
"eslint-config-next": "^14.2.3",
"prettier": "^3.2.5"
}
}

View file

@ -20,7 +20,7 @@ export default function MyApp({ Component, pageProps }) {
<link rel='shortcut icon' href='/favicon.ico' />
<title>BorgWarehouse</title>
</Head>
<ToastContainer />
<ToastContainer stacked />
<Component {...pageProps} />
</Layout>
</SessionProvider>

View file

@ -0,0 +1,49 @@
//Lib
import { authOptions } from '../auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
export default async function handler(req, res) {
if (req.method == 'GET') {
//Verify that the user is logged in.
const session = await getServerSession(req, res, authOptions);
if (!session) {
res.status(401).json({ message: 'You must be logged in.' });
return;
}
try {
function getEnvVariable(envName, defaultValue = '') {
return process.env[envName] || defaultValue;
}
const wizardEnv = {
UNIX_USER: getEnvVariable('UNIX_USER', 'borgwarehouse'),
FQDN: getEnvVariable('FQDN', 'localhost'),
SSH_SERVER_PORT: getEnvVariable('SSH_SERVER_PORT', '22'),
FQDN_LAN: getEnvVariable('FQDN_LAN'),
SSH_SERVER_PORT_LAN: getEnvVariable('SSH_SERVER_PORT_LAN'),
SSH_SERVER_FINGERPRINT_RSA: getEnvVariable(
'SSH_SERVER_FINGERPRINT_RSA'
),
SSH_SERVER_FINGERPRINT_ED25519: getEnvVariable(
'SSH_SERVER_FINGERPRINT_ED25519'
),
SSH_SERVER_FINGERPRINT_ECDSA: getEnvVariable(
'SSH_SERVER_FINGERPRINT_ECDSA'
),
};
res.status(200).json({ wizardEnv });
return;
} catch (error) {
//Log for backend
console.log(error);
//Log for frontend
res.status(500).json({
status: 500,
message: 'API error, contact the administrator',
});
return;
}
} else {
res.status(405).json({ message: 'Bad request on API' });
}
}

View file

@ -5,11 +5,20 @@ import { verifyPassword } from '../../../helpers/functions/auth';
import fs from 'fs';
import path from 'path';
const logLogin = async (message, req, success = false) => {
const ipAddress = req.headers['x-forwarded-for'] || 'unknown';
if (success) {
console.log(`Login success from ${ipAddress} with user ${message}`);
} else {
console.log(`Login failed from ${ipAddress} : ${message}`);
}
};
////Use if need getServerSideProps and therefore getServerSession
export const authOptions = {
providers: [
CredentialsProvider({
async authorize(credentials) {
async authorize(credentials, req) {
const { username, password } = credentials;
//Read the users file
//Find the absolute path of the json directory
@ -21,12 +30,13 @@ export const authOptions = {
JSON.stringify([
{
id: 0,
email: 'admin@demo',
email: '',
username: 'admin',
password:
'$2a$12$20yqRnuaDBH6AE0EvIUcEOzqkuBtn1wDzJdw2Beg8w9S.vEqdso0a',
roles: ['admin'],
emailAlert: 'false',
emailAlert: false,
appriseAlert: false,
},
])
);
@ -41,8 +51,9 @@ export const authOptions = {
//Step 1 : does the user exist ?
const userIndex = usersList
.map((user) => user.username)
.indexOf(username);
.indexOf(username.toLowerCase());
if (userIndex === -1) {
await logLogin(`Bad username ${req.body.username}`, req);
throw new Error('Incorrect credentials.');
}
const user = usersList[userIndex];
@ -50,6 +61,10 @@ export const authOptions = {
//Step 2 : Is the password correct ?
const isValid = await verifyPassword(password, user.password);
if (!isValid) {
await logLogin(
`Wrong password for ${req.body.username}`,
req
);
throw new Error('Incorrect credentials.');
}
@ -61,6 +76,7 @@ export const authOptions = {
roles: user.roles,
};
await logLogin(req.body.username, req, true);
return account;
},
}),

View file

@ -31,6 +31,20 @@ export default async function handler(req, res) {
////PART 1 : Status
try {
//Check if there are some repositories
let repoList = await fs.readFile(
jsonDirectory + '/repo.json',
'utf8'
);
repoList = JSON.parse(repoList);
if (repoList.length === 0) {
res.status(200).json({
success:
'Status cron has been executed. No repository to check.',
});
return;
}
//Call the shell : getLastSave.sh
//Find the absolute path of the shells directory
const shellsDirectory = path.join(process.cwd(), '/helpers');
@ -50,14 +64,6 @@ export default async function handler(req, res) {
//Parse the JSON output of getLastSave.sh to use it
const lastSave = JSON.parse(stdout);
//Find the absolute path of the json directory
let repoList = await fs.readFile(
jsonDirectory + '/repo.json',
'utf8'
);
//Parse the repoList
repoList = JSON.parse(repoList);
//Rebuild a newRepoList with the lastSave timestamp updated and the status updated.
newRepoList = repoList;
for (let index in newRepoList) {
@ -96,6 +102,7 @@ export default async function handler(req, res) {
for (let index in newRepoList) {
if (
!newRepoList[index].status &&
newRepoList[index].alert !== 0 &&
(!newRepoList[index].lastStatusAlertSend ||
date - newRepoList[index].lastStatusAlertSend > 90000)
) {
@ -164,12 +171,6 @@ export default async function handler(req, res) {
transporter.sendMail(mailData, function (err, info) {
if (err) {
console.log(err);
res.status(400).json({
message:
'An error occured while sending the email : ' +
err,
});
return;
} else {
console.log(info);
}

View file

@ -2,6 +2,7 @@ import { promises as fs } from 'fs';
import path from 'path';
import { authOptions } from '../../../pages/api/auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
import repoHistory from '../../../helpers/functions/repoHistory';
const util = require('node:util');
const exec = util.promisify(require('node:child_process').exec);
@ -15,10 +16,23 @@ export default async function handler(req, res) {
}
//The data we expect to receive
const { alias, sshPublicKey, size, comment, alert, lanCommand } =
req.body;
const {
alias,
sshPublicKey,
size,
comment,
alert,
lanCommand,
appendOnlyMode,
} = req.body;
//We check that we receive data for each variable. Only "comment" and "lanCommand" are optional in the form.
if (!alias || !sshPublicKey || !size || !alert) {
if (
!alias ||
!sshPublicKey ||
!size ||
typeof appendOnlyMode !== 'boolean' ||
(!alert && alert !== 0)
) {
//If a variable is empty.
res.status(422).json({
message: 'Unexpected data',
@ -59,28 +73,25 @@ export default async function handler(req, res) {
comment: comment,
displayDetails: true,
lanCommand: lanCommand,
appendOnlyMode: appendOnlyMode,
};
////Call the shell : createRepo.sh
//Find the absolute path of the shells directory
const shellsDirectory = path.join(process.cwd(), '/helpers');
//Exec the shell
const { stdout, stderr } = await exec(
`${shellsDirectory}/shells/createRepo.sh "${newRepo.sshPublicKey}" ${newRepo.storageSize}`
const { stdout } = await exec(
`${shellsDirectory}/shells/createRepo.sh "${newRepo.sshPublicKey}" ${newRepo.storageSize} ${newRepo.appendOnlyMode}`
);
if (stderr) {
console.log('stderr:', stderr);
res.status(500).json({
status: 500,
message: 'Error on creation, contact the administrator.',
});
return;
}
newRepo.repositoryName = stdout.trim();
//Create the new repoList with the new repo
let newRepoList = [newRepo, ...repoList];
//History the new repoList
await repoHistory(newRepoList);
//Stringify the newRepoList to write it into the json file.
newRepoList = JSON.stringify(newRepoList);
@ -105,7 +116,7 @@ export default async function handler(req, res) {
} else {
res.status(500).json({
status: 500,
message: 'API error, contact the administrator',
message: error.stdout,
});
}
return;

View file

@ -2,6 +2,7 @@ import { promises as fs } from 'fs';
import path from 'path';
import { authOptions } from '../../../auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
import repoHistory from '../../../../../helpers/functions/repoHistory';
const util = require('node:util');
const exec = util.promisify(require('node:child_process').exec);
@ -46,7 +47,7 @@ export default async function handler(req, res) {
//Find the absolute path of the shells directory
const shellsDirectory = path.join(process.cwd(), '/helpers');
//Exec the shell
const { stderr } = await exec(
const { stdout, stderr } = await exec(
`${shellsDirectory}/shells/deleteRepo.sh ${repoList[indexToDelete].repositoryName}`
);
if (stderr) {
@ -69,7 +70,8 @@ export default async function handler(req, res) {
});
return;
}
//History the repoList
await repoHistory(repoList);
//Stringify the repoList to write it into the json file.
repoList = JSON.stringify(repoList);
//Write the new json
@ -80,6 +82,7 @@ export default async function handler(req, res) {
if (err) console.log(err);
}
);
res.status(200).json({ message: 'Envoi API réussi' });
} catch (error) {
//Log for backend

View file

@ -2,6 +2,7 @@ import { promises as fs } from 'fs';
import path from 'path';
import { authOptions } from '../../../auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
import repoHistory from '../../../../../helpers/functions/repoHistory';
const util = require('node:util');
const exec = util.promisify(require('node:child_process').exec);
@ -15,20 +16,30 @@ export default async function handler(req, res) {
}
//The data we expect to receive
const { alias, sshPublicKey, size, comment, alert, lanCommand } =
req.body;
//We check that we receive data for each variable. Only "comment" and "lanCommand" are optional in the form.
if (!alias || !sshPublicKey || !size || !alert) {
//If a variable is empty.
const {
alias,
sshPublicKey,
size,
comment,
alert,
lanCommand,
appendOnlyMode,
} = req.body;
//Only "comment" and "lanCommand" are optional in the form.
if (
!alias ||
!sshPublicKey ||
!size ||
typeof appendOnlyMode !== 'boolean' ||
(!alert && alert !== 0)
) {
res.status(422).json({
message: 'Unexpected data',
});
//A return to make sure we don't go any further if data are incorrect.
return;
}
try {
//console.log('API call (PUT)');
//Find the absolute path of the json directory
const jsonDirectory = path.join(process.cwd(), '/config');
let repoList = await fs.readFile(
@ -48,17 +59,9 @@ export default async function handler(req, res) {
//Find the absolute path of the shells directory
const shellsDirectory = path.join(process.cwd(), '/helpers');
// //Exec the shell
const { stderr } = await exec(
`${shellsDirectory}/shells/updateRepo.sh ${repoList[repoIndex].repositoryName} "${sshPublicKey}" ${size}`
await exec(
`${shellsDirectory}/shells/updateRepo.sh ${repoList[repoIndex].repositoryName} "${sshPublicKey}" ${size} ${appendOnlyMode}`
);
if (stderr) {
console.log('stderr:', stderr);
res.status(500).json({
status: 500,
message: 'Error on update, contact the administrator.',
});
return;
}
//Find the ID in the data and change the values transmitted by the form
let newRepoList = repoList.map((repo) =>
@ -71,9 +74,12 @@ export default async function handler(req, res) {
comment: comment,
alert: alert,
lanCommand: lanCommand,
appendOnlyMode: appendOnlyMode,
}
: repo
);
//History the new repoList
await repoHistory(newRepoList);
//Stringify the newRepoList to write it into the json file.
newRepoList = JSON.stringify(newRepoList);
//Write the new json
@ -84,6 +90,7 @@ export default async function handler(req, res) {
if (err) console.log(err);
}
);
res.status(200).json({ message: 'Envoi API réussi' });
} catch (error) {
//Log for backend
@ -97,7 +104,7 @@ export default async function handler(req, res) {
} else {
res.status(500).json({
status: 500,
message: 'API error, contact the administrator',
message: error.stdout,
});
}
return;

View file

@ -0,0 +1,16 @@
import packageInfo from '../../../package.json';
export default async function handler(req, res) {
if (req.method === 'GET') {
try {
res.status(200).json({ version: packageInfo.version });
return;
} catch (error) {
res.status(500).json({
status: 500,
message: 'API error, contact the administrator !',
});
return;
}
}
}

View file

@ -99,33 +99,24 @@ export default function Login() {
placeholder='Username'
className='signInInput'
{...register('username', {
required: true,
required: 'This field is required.',
pattern: {
value: /^[^\s]+$/g,
message: 'No space allowed.',
},
})}
/>
{errors.email &&
errors.email.type === 'required' && (
<small
style={{
color: 'red',
display: 'block',
marginTop: '3px',
}}
>
This field is required.
</small>
)}
{errors.email &&
errors.email.type === 'pattern' && (
<small
style={{
color: 'red',
display: 'block',
marginTop: '3px',
}}
>
Incorrect email address format.
</small>
)}
{errors.username && (
<small
style={{
color: 'red',
display: 'block',
marginTop: '3px',
}}
>
{errors.username.message}
</small>
)}
</p>
<p>
<input
@ -133,7 +124,7 @@ export default function Login() {
placeholder='Password'
className='signInInput'
{...register('password', {
required: true,
required: 'This field is required.',
})}
/>
{errors.password && (
@ -144,7 +135,7 @@ export default function Login() {
marginTop: '3px',
}}
>
This field is required.
{errors.password.message}
</small>
)}
</p>

2
public/robots.txt Normal file
View file

@ -0,0 +1,2 @@
User-agent: *
Disallow: /