Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(auth): add OAuth2 login #276

Merged
merged 51 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
f0360a3
feat(auth): add OAuth2 login with GitHub and Google
zz5840 Oct 5, 2023
f15a8dc
chore(translations): add files for Japanese
stonith404 Oct 6, 2023
c85eaad
fix(auth): fix link function for GitHub
zz5840 Oct 6, 2023
85a9ba9
feat(oauth): basic oidc implementation
zz5840 Oct 7, 2023
87b52df
feat(oauth): oauth guard
zz5840 Oct 8, 2023
3891900
fix: disable image optimizations for logo to prevent caching issues w…
stonith404 Oct 9, 2023
97e7d71
fix: memory leak while downloading large files
stonith404 Oct 9, 2023
c502cd5
chore(translations): update translations via Crowdin (#278)
stonith404 Oct 9, 2023
b088a5e
release: 0.18.2
stonith404 Oct 9, 2023
2180984
doc(translations): Add Japanese README (#279)
fusengum Oct 10, 2023
db42d99
feat(oauth): unlink account
zz5840 Oct 11, 2023
ea42b4f
refactor(oauth): make providers extensible
zz5840 Oct 11, 2023
9b5ed76
fix(oauth): fix discoveryUri error when toggle google-enabled
zz5840 Oct 11, 2023
810aded
feat(oauth): add microsoft and discord as oauth provider
zz5840 Oct 12, 2023
0680bbf
docs(oauth): update README.md
zz5840 Oct 12, 2023
b1afdc1
docs(oauth): update oauth2-guide.md
zz5840 Oct 12, 2023
f3e180d
set password to null for new oauth users
stonith404 Oct 12, 2023
688ae6c
New translations en-us.ts (Japanese) (#281)
stonith404 Oct 12, 2023
1d8dc8f
chore(translations): add Polish files
stonith404 Oct 12, 2023
8827ab6
fix(oauth): fix random username and password
zz5840 Oct 12, 2023
28dbb4d
feat(oauth): add totp
zz5840 Oct 13, 2023
dbebd54
fix(oauth): fix totp throttle
zz5840 Oct 13, 2023
952eaaf
fix(oauth): fix qrcode and remove comment
zz5840 Oct 14, 2023
6c2b3c6
feat(oauth): add error page
zz5840 Oct 16, 2023
7691f0e
fix(oauth): i18n of error page
zz5840 Oct 16, 2023
0fbd546
feat(auth): add OAuth2 login
zz5840 Oct 5, 2023
402fcf8
fix(auth): fix link function for GitHub
zz5840 Oct 6, 2023
2385a26
feat(oauth): basic oidc implementation
zz5840 Oct 7, 2023
0c5498a
feat(oauth): oauth guard
zz5840 Oct 8, 2023
84a1c9d
feat(oauth): unlink account
zz5840 Oct 11, 2023
658ab14
refactor(oauth): make providers extensible
zz5840 Oct 11, 2023
a415bc4
fix(oauth): fix discoveryUri error when toggle google-enabled
zz5840 Oct 11, 2023
5c59756
feat(oauth): add microsoft and discord as oauth provider
zz5840 Oct 12, 2023
5348498
docs(oauth): update README.md
zz5840 Oct 12, 2023
3071912
docs(oauth): update oauth2-guide.md
zz5840 Oct 12, 2023
142a42e
set password to null for new oauth users
stonith404 Oct 12, 2023
f176244
fix(oauth): fix random username and password
zz5840 Oct 12, 2023
50428ac
feat(oauth): add totp
zz5840 Oct 13, 2023
a162064
fix(oauth): fix totp throttle
zz5840 Oct 13, 2023
231b183
fix(oauth): fix qrcode and remove comment
zz5840 Oct 14, 2023
569f933
feat(oauth): add error page
zz5840 Oct 16, 2023
97e220f
fix(oauth): i18n of error page
zz5840 Oct 16, 2023
95df2d2
Merge branch 'oauth' of github.com:zz5840/pingvin-share into oauth
zz5840 Oct 16, 2023
f9776de
refactor: return null instead of `false` in `getIdOfCurrentUser` func…
stonith404 Oct 16, 2023
8ddd8de
feat: show original oauth error if available
stonith404 Oct 16, 2023
0490e7d
refactor: run formatter
stonith404 Oct 16, 2023
c19251b
refactor(oauth): error message i18n
zz5840 Oct 17, 2023
08ffa54
refactor(oauth): make OAuth token available
zz5840 Oct 18, 2023
b289cfa
chore(oauth): remove unused import
zz5840 Oct 21, 2023
cfa0d3b
chore: add database migration
stonith404 Oct 21, 2023
71b8acc
fix: missing python installation for nanoid
stonith404 Oct 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [0.18.2](https://github.com/stonith404/pingvin-share/compare/v0.18.1...v0.18.2) (2023-10-09)


### Bug Fixes

* disable image optimizations for logo to prevent caching issues with custom logos ([3891900](https://github.com/stonith404/pingvin-share/commit/38919003e9091203b507d0f0b061f4a1835ff4f4))
* memory leak while downloading large files ([97e7d71](https://github.com/stonith404/pingvin-share/commit/97e7d7190dfe219caf441dffcd7830c304c3c939))

## [0.18.1](https://github.com/stonith404/pingvin-share/compare/v0.18.0...v0.18.1) (2023-09-22)


Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN npm run build

# Stage 3: Backend dependencies
FROM node:20-alpine AS backend-dependencies
RUN apk add --no-cache python3
WORKDIR /opt/app
COPY backend/package.json backend/package-lock.json ./
RUN npm ci
Expand All @@ -32,7 +33,9 @@ ENV NODE_ENV=docker
# Alpine specific dependencies
RUN apk update --no-cache
RUN apk upgrade --no-cache
RUN apk add --no-cache curl
RUN apk add --no-cache curl nginx

COPY ./nginx/nginx.conf /etc/nginx/nginx.conf

WORKDIR /opt/app/frontend
COPY --from=frontend-builder /opt/app/public ./public
Expand All @@ -55,4 +58,4 @@ HEALTHCHECK --interval=10s --timeout=3s CMD curl -f http://localhost:3000/api/he

# Application startup
# HOSTNAME=0.0.0.0 fixes https://github.com/vercel/next.js/issues/51684. It can be removed as soon as the issue is fixed
CMD cp -rn /tmp/img /opt/app/frontend/public && HOSTNAME=0.0.0.0 node frontend/server.js & cd backend && npm run prod
CMD cp -rn /tmp/img /opt/app/frontend/public && nginx && PORT=3333 HOSTNAME=0.0.0.0 node frontend/server.js & cd backend && npm run prod
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

---

_Read this in another language: [Spanish](/docs/README.es.md), [English](/README.md), [Simplified Chinese](/docs/README.zh-cn.md)_
_Read this in another language: [Spanish](/docs/README.es.md), [English](/README.md), [Simplified Chinese](/docs/README.zh-cn.md), [日本語](/docs/README.ja-jp.md)_

---

Expand Down Expand Up @@ -63,6 +63,8 @@ npm run build
pm2 start --name="pingvin-share-frontend" npm -- run start
```

**Uploading Large Files**: By default, Pingvin Share uses a built-in reverse proxy to reduce the installation steps. However, this reverse proxy is not optimized for uploading large files. If you wish to upload larger files, you can either use the Docker installation or set up your own reverse proxy. An example configuration for Nginx can be found in `/nginx/nginx.conf`.

The website is now listening on `http://localhost:3000`, have fun with Pingvin Share 🐧!

### Integrations
Expand All @@ -77,6 +79,10 @@ ClamAV is used to scan shares for malicious files and remove them if found.

Please note that ClamAV needs a lot of [ressources](https://docs.clamav.net/manual/Installing/Docker.html#memory-ram-requirements).

#### OAuth 2 Login

View the [OAuth 2 guide](/docs/oauth2-guide.md) for more information.

### Additional resources

- [Synology NAS installation](https://mariushosting.com/how-to-install-pingvin-share-on-your-synology-nas/)
Expand Down
130 changes: 116 additions & 14 deletions backend/package-lock.json

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

7 changes: 6 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pingvin-share-backend",
"version": "0.18.1",
"version": "0.18.2",
"scripts": {
"build": "nest build",
"dev": "cross-env NODE_ENV=development nest start --watch",
Expand All @@ -13,6 +13,7 @@
"seed": "ts-node prisma/seed/config.seed.ts"
},
"dependencies": {
"@nestjs/cache-manager": "^2.1.0",
"@nestjs/common": "^10.1.2",
"@nestjs/config": "^3.0.0",
"@nestjs/core": "^10.1.2",
Expand All @@ -26,13 +27,16 @@
"archiver": "^5.3.1",
"argon2": "^0.30.3",
"body-parser": "^1.20.2",
"cache-manager": "^5.2.4",
"clamscan": "^2.1.2",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"content-disposition": "^0.5.4",
"cookie-parser": "^1.4.6",
"mime-types": "^2.1.35",
"moment": "^2.29.4",
"nanoid": "^3.3.6",
"node-fetch": "^2.7.0",
"nodemailer": "^6.9.4",
"otplib": "^12.0.1",
"passport": "^0.6.0",
Expand All @@ -57,6 +61,7 @@
"@types/mime-types": "^2.1.1",
"@types/multer": "^1.4.7",
"@types/node": "^20.4.5",
"@types/node-fetch": "^2.6.6",
"@types/nodemailer": "^6.4.9",
"@types/passport-jwt": "^3.0.9",
"@types/qrcode-svg": "^1.1.1",
Expand Down
Loading