From 7cdd371284f62715cb30ead6a530f22636019ab6 Mon Sep 17 00:00:00 2001 From: Elias Schneider Date: Fri, 18 Oct 2024 20:56:43 +0200 Subject: [PATCH] Deploy website - based on 6444a9d553a929443b70e7f5f73019df0234e2f7 --- 404.html | 2 +- assets/js/3205bd6d.c114a06a.js | 1 - assets/js/3205bd6d.ecb21caf.js | 1 + assets/js/3f2e6990.282c7570.js | 1 + assets/js/3f2e6990.8d1f4d5e.js | 1 - assets/js/a8c31fc1.0a96fc42.js | 1 - assets/js/a8c31fc1.c26fc8a4.js | 1 + assets/js/runtime~main.1662c97b.js | 1 - assets/js/runtime~main.41e47575.js | 1 + help-out/contribute/index.html | 2 +- help-out/translate/index.html | 2 +- index.html | 2 +- introduction/index.html | 2 +- setup/configuration/index.html | 2 +- setup/installation/index.html | 13 +++++++++++-- setup/integrations/index.html | 2 +- setup/oauth2login/index.html | 7 ++++--- setup/upgrading/index.html | 10 ++++++++-- 18 files changed, 34 insertions(+), 18 deletions(-) delete mode 100644 assets/js/3205bd6d.c114a06a.js create mode 100644 assets/js/3205bd6d.ecb21caf.js create mode 100644 assets/js/3f2e6990.282c7570.js delete mode 100644 assets/js/3f2e6990.8d1f4d5e.js delete mode 100644 assets/js/a8c31fc1.0a96fc42.js create mode 100644 assets/js/a8c31fc1.c26fc8a4.js delete mode 100644 assets/js/runtime~main.1662c97b.js create mode 100644 assets/js/runtime~main.41e47575.js diff --git a/404.html b/404.html index 0486ed7..bfad235 100644 --- a/404.html +++ b/404.html @@ -4,7 +4,7 @@ Pingvin Share - + diff --git a/assets/js/3205bd6d.c114a06a.js b/assets/js/3205bd6d.c114a06a.js deleted file mode 100644 index 8b814d0..0000000 --- a/assets/js/3205bd6d.c114a06a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkpingvindocs=self.webpackChunkpingvindocs||[]).push([[361],{2744:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>a,default:()=>p,frontMatter:()=>s,metadata:()=>o,toc:()=>c});var r=t(4848),i=t(8453);const s={id:"upgrading"},a="Upgrading",o={id:"setup/upgrading",title:"Upgrading",description:"Upgrade to a new version",source:"@site/docs/setup/upgrading.md",sourceDirName:"setup",slug:"/setup/upgrading",permalink:"/pingvin-share/setup/upgrading",draft:!1,unlisted:!1,editUrl:"https://github.com/stonith404/pingvin-share/edit/main/docs/docs/setup/upgrading.md",tags:[],version:"current",frontMatter:{id:"upgrading"},sidebar:"docsSidebar",previous:{title:"OAuth 2 Login Guide",permalink:"/pingvin-share/setup/oauth2login"},next:{title:"Translating",permalink:"/pingvin-share/help-out/translate"}},d={},c=[{value:"Upgrade to a new version",id:"upgrade-to-a-new-version",level:3},{value:"Docker",id:"docker",level:4},{value:"Stand-alone",id:"stand-alone",level:4}];function l(e){const n={a:"a",code:"code",h1:"h1",h3:"h3",h4:"h4",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"upgrading",children:"Upgrading"})}),"\n",(0,r.jsx)(n.h3,{id:"upgrade-to-a-new-version",children:"Upgrade to a new version"}),"\n",(0,r.jsx)(n.p,{children:"As Pingvin Share is in early stage, see the release notes for breaking changes before upgrading."}),"\n",(0,r.jsx)(n.h4,{id:"docker",children:"Docker"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"docker compose pull\ndocker compose up -d\n"})}),"\n",(0,r.jsx)(n.h4,{id:"stand-alone",children:"Stand-alone"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Stop the running app"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pm2 stop pingvin-share-backend pingvin-share-frontend\n"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Repeat the steps from the ",(0,r.jsx)(n.a,{href:"#stand-alone-installation",children:"installation guide"})," except the ",(0,r.jsx)(n.code,{children:"git clone"})," step."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"cd pingvin-share\n\n# Checkout the latest version\ngit fetch --tags && git checkout $(git describe --tags `git rev-list --tags --max-count=1`)\n\n# Start the backend\ncd backend\nnpm install\nnpm run build\npm2 restart pingvin-share-backend\n\n# Start the frontend\ncd ../frontend\nnpm install\nnpm run build\npm2 restart pingvin-share-frontend\n"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Note that environemnt variables are not picked up when using pm2 restart, if you actually want to change configs, you need to run ",(0,r.jsx)(n.code,{children:"pm2 --update-env restart"})]})]})}function p(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>o});var r=t(6540);const i={},s=r.createContext(i);function a(e){const n=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),r.createElement(s.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3205bd6d.ecb21caf.js b/assets/js/3205bd6d.ecb21caf.js new file mode 100644 index 0000000..c033d84 --- /dev/null +++ b/assets/js/3205bd6d.ecb21caf.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkpingvindocs=self.webpackChunkpingvindocs||[]).push([[361],{2744:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>p,frontMatter:()=>a,metadata:()=>o,toc:()=>c});var r=t(4848),i=t(8453);const a={id:"upgrading"},s="Upgrading",o={id:"setup/upgrading",title:"Upgrading",description:"Upgrade to a new version",source:"@site/docs/setup/upgrading.md",sourceDirName:"setup",slug:"/setup/upgrading",permalink:"/pingvin-share/setup/upgrading",draft:!1,unlisted:!1,editUrl:"https://github.com/stonith404/pingvin-share/edit/main/docs/docs/setup/upgrading.md",tags:[],version:"current",frontMatter:{id:"upgrading"},sidebar:"docsSidebar",previous:{title:"OAuth 2 Login Guide",permalink:"/pingvin-share/setup/oauth2login"},next:{title:"Translating",permalink:"/pingvin-share/help-out/translate"}},d={},c=[{value:"Upgrade to a new version",id:"upgrade-to-a-new-version",level:3},{value:"Docker",id:"docker",level:4},{value:"Portainer",id:"portainer",level:3},{value:"Stand-alone",id:"stand-alone",level:4}];function l(e){const n={a:"a",code:"code",h1:"h1",h3:"h3",h4:"h4",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"upgrading",children:"Upgrading"})}),"\n",(0,r.jsx)(n.h3,{id:"upgrade-to-a-new-version",children:"Upgrade to a new version"}),"\n",(0,r.jsx)(n.p,{children:"As Pingvin Share is in early stage, see the release notes for breaking changes before upgrading."}),"\n",(0,r.jsx)(n.h4,{id:"docker",children:"Docker"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"docker compose pull\ndocker compose up -d\n"})}),"\n",(0,r.jsx)(n.h3,{id:"portainer",children:"Portainer"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsx)(n.li,{children:"In your container page, click on Recreate."}),"\n",(0,r.jsx)(n.li,{children:"Check the Re-Pull image toggle."}),"\n",(0,r.jsx)(n.li,{children:"Click on Recreate."}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"stand-alone",children:"Stand-alone"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsx)(n.p,{children:"Stop the running app"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"pm2 stop pingvin-share-backend pingvin-share-frontend\n"})}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["\n",(0,r.jsxs)(n.p,{children:["Repeat the steps from the ",(0,r.jsx)(n.a,{href:"#stand-alone-installation",children:"installation guide"})," except the ",(0,r.jsx)(n.code,{children:"git clone"})," step."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"cd pingvin-share\n\n# Checkout the latest version\ngit fetch --tags && git checkout $(git describe --tags `git rev-list --tags --max-count=1`)\n\n# Start the backend\ncd backend\nnpm install\nnpm run build\npm2 restart pingvin-share-backend\n\n# Start the frontend\ncd ../frontend\nnpm install\nnpm run build\npm2 restart pingvin-share-frontend\n"})}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Note that environemnt variables are not picked up when using pm2 restart, if you actually want to change configs, you need to run ",(0,r.jsx)(n.code,{children:"pm2 --update-env restart"})]})]})}function p(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>o});var r=t(6540);const i={},a=r.createContext(i);function s(e){const n=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),r.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3f2e6990.282c7570.js b/assets/js/3f2e6990.282c7570.js new file mode 100644 index 0000000..e273d4a --- /dev/null +++ b/assets/js/3f2e6990.282c7570.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkpingvindocs=self.webpackChunkpingvindocs||[]).push([[819],{3403:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>t,metadata:()=>s,toc:()=>l});var o=i(4848),r=i(8453);const t={id:"oauth2login"},d="OAuth 2 Login Guide",s={id:"setup/oauth2login",title:"OAuth 2 Login Guide",description:"Config Built-in OAuth 2 Providers",source:"@site/docs/setup/oauth2login.md",sourceDirName:"setup",slug:"/setup/oauth2login",permalink:"/pingvin-share/setup/oauth2login",draft:!1,unlisted:!1,editUrl:"https://github.com/stonith404/pingvin-share/edit/main/docs/docs/setup/oauth2login.md",tags:[],version:"current",frontMatter:{id:"oauth2login"},sidebar:"docsSidebar",previous:{title:"Integrations",permalink:"/pingvin-share/setup/integrations"},next:{title:"Upgrading",permalink:"/pingvin-share/setup/upgrading"}},c={},l=[{value:"Config Built-in OAuth 2 Providers",id:"config-built-in-oauth-2-providers",level:2},{value:"GitHub",id:"github",level:3},{value:"Google",id:"google",level:3},{value:"Microsoft",id:"microsoft",level:3},{value:"Discord",id:"discord",level:3},{value:"OpenID Connect",id:"openid-connect",level:3},{value:"Custom your OAuth 2 Provider",id:"custom-your-oauth-2-provider",level:2},{value:"1. Create config",id:"1-create-config",level:3},{value:"2. Create provider class",id:"2-create-provider-class",level:3},{value:"Generic OpenID Connect",id:"generic-openid-connect",level:4},{value:"OAuth 2",id:"oauth-2",level:4},{value:"3. Register provider",id:"3-register-provider",level:3},{value:"4. Add frontend icon",id:"4-add-frontend-icon",level:3},{value:"5. Add i18n text",id:"5-add-i18n-text",level:3}];function a(e){const n={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"oauth-2-login-guide",children:"OAuth 2 Login Guide"})}),"\n",(0,o.jsx)(n.h2,{id:"config-built-in-oauth-2-providers",children:"Config Built-in OAuth 2 Providers"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"#github",children:"GitHub"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"#google",children:"Google"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"#microsoft",children:"Microsoft"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"#discord",children:"Discord"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"#openid-connect",children:"OpenID Connect"})}),"\n"]}),"\n",(0,o.jsx)(n.h3,{id:"github",children:"GitHub"}),"\n",(0,o.jsxs)(n.p,{children:["Please follow the ",(0,o.jsx)(n.a,{href:"https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app",children:"official guide"})," to create an OAuth app."]}),"\n",(0,o.jsxs)(n.p,{children:["Redirect URL: ",(0,o.jsx)(n.code,{children:"https:///api/oauth/callback/github"})]}),"\n",(0,o.jsx)(n.h3,{id:"google",children:"Google"}),"\n",(0,o.jsxs)(n.p,{children:["Please follow the ",(0,o.jsx)(n.a,{href:"https://developers.google.com/identity/protocols/oauth2/web-server#prerequisites",children:"official guide"})," to create an OAuth 2.0 App."]}),"\n",(0,o.jsxs)(n.p,{children:["Redirect URL: ",(0,o.jsx)(n.code,{children:"https:///api/oauth/callback/google"})]}),"\n",(0,o.jsx)(n.h3,{id:"microsoft",children:"Microsoft"}),"\n",(0,o.jsxs)(n.p,{children:["Please follow the ",(0,o.jsx)(n.a,{href:"https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app",children:"official guide"})," to register an application."]}),"\n",(0,o.jsxs)(n.blockquote,{children:["\n",(0,o.jsxs)(n.p,{children:["[!IMPORTANT] > ",(0,o.jsx)(n.strong,{children:"Microsoft Tenant"})," you set in the admin panel must match the ",(0,o.jsx)(n.strong,{children:"supported account types"})," you set in the Microsoft Entra admin center, otherwise the OAuth login will not work. Refer to the ",(0,o.jsx)(n.a,{href:"https://learn.microsoft.com/en-us/entra/identity-platform/v2-protocols-oidc#find-your-apps-openid-configuration-document-uri",children:"official documentation"})," for more details."]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["Redirect URL: ",(0,o.jsx)(n.code,{children:"https:///api/oauth/callback/microsoft"})]}),"\n",(0,o.jsx)(n.h3,{id:"discord",children:"Discord"}),"\n",(0,o.jsxs)(n.p,{children:["Create an application on ",(0,o.jsx)(n.a,{href:"https://discord.com/developers/applications",children:"Discord Developer Portal"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["Redirect URL: ",(0,o.jsx)(n.code,{children:"https:///api/oauth/callback/discord"})]}),"\n",(0,o.jsx)(n.h3,{id:"openid-connect",children:"OpenID Connect"}),"\n",(0,o.jsxs)(n.p,{children:["Generic OpenID Connect provider is also supported, we have tested it on Keycloak, Authentik, Casdoor and ",(0,o.jsx)(n.a,{href:"https://github.com/stonith404/pocket-id",children:"Pocket ID"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["Redirect URI: ",(0,o.jsx)(n.code,{children:"https:///api/oauth/callback/oidc"})]}),"\n",(0,o.jsxs)(n.p,{children:["Post Logout Redirect URI: ",(0,o.jsx)(n.code,{children:"https://"})]}),"\n",(0,o.jsx)(n.h2,{id:"custom-your-oauth-2-provider",children:"Custom your OAuth 2 Provider"}),"\n",(0,o.jsx)(n.p,{children:"If our built-in providers don't meet your needs, you can create your own OAuth 2 provider."}),"\n",(0,o.jsx)(n.h3,{id:"1-create-config",children:"1. Create config"}),"\n",(0,o.jsxs)(n.p,{children:["Add your config (client id, client secret, etc.) in ",(0,o.jsx)(n.a,{href:"../backend/prisma/seed/config.seed.ts",children:(0,o.jsx)(n.code,{children:"config.seed.ts"})}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-ts",children:'const configVariables: ConfigVariables = {\n // ...\n oauth: {\n // ...\n "YOUR_PROVIDER_NAME-enabled": {\n type: "boolean",\n defaultValue: "false",\n },\n "YOUR_PROVIDER_NAME-clientId": {\n type: "string",\n defaultValue: "",\n },\n "YOUR_PROVIDER_NAME-clientSecret": {\n type: "string",\n defaultValue: "",\n obscured: true,\n },\n },\n};\n'})}),"\n",(0,o.jsx)(n.h3,{id:"2-create-provider-class",children:"2. Create provider class"}),"\n",(0,o.jsx)(n.h4,{id:"generic-openid-connect",children:"Generic OpenID Connect"}),"\n",(0,o.jsxs)(n.p,{children:["If your provider supports OpenID connect, it's extremely easy to extend ",(0,o.jsx)(n.a,{href:"../backend/src/oauth/provider/genericOidc.provider.ts",children:(0,o.jsx)(n.code,{children:"GenericOidcProvider"})})," to add a new OpenID Connect provider."]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.a,{href:"../backend/src/oauth/provider/google.provider.ts",children:"Google provider"})," and ",(0,o.jsx)(n.a,{href:"../backend/src/oauth/provider/microsoft.provider.ts",children:"Microsoft provider"})," are good examples."]}),"\n",(0,o.jsx)(n.p,{children:"Here are some discovery URIs for popular providers:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["Microsoft: ",(0,o.jsx)(n.code,{children:"https://login.microsoftonline.com/{tenant}/v2.0/.well-known/openid-configuration"})]}),"\n",(0,o.jsxs)(n.li,{children:["Google: ",(0,o.jsx)(n.code,{children:"https://accounts.google.com/.well-known/openid-configuration"})]}),"\n",(0,o.jsxs)(n.li,{children:["Apple: ",(0,o.jsx)(n.code,{children:"https://appleid.apple.com/.well-known/openid-configuration"})]}),"\n",(0,o.jsxs)(n.li,{children:["Gitlab: ",(0,o.jsx)(n.code,{children:"https://gitlab.com/.well-known/openid-configuration"})]}),"\n",(0,o.jsxs)(n.li,{children:["Huawei: ",(0,o.jsx)(n.code,{children:"https://oauth-login.cloud.huawei.com/.well-known/openid-configuration"})]}),"\n",(0,o.jsxs)(n.li,{children:["Paypal: ",(0,o.jsx)(n.code,{children:"https://www.paypal.com/.well-known/openid-configuration"})]}),"\n",(0,o.jsxs)(n.li,{children:["Yahoo: ",(0,o.jsx)(n.code,{children:"https://api.login.yahoo.com/.well-known/openid-configuration"})]}),"\n"]}),"\n",(0,o.jsx)(n.h4,{id:"oauth-2",children:"OAuth 2"}),"\n",(0,o.jsxs)(n.p,{children:["If your provider only supports OAuth 2, you can implement ",(0,o.jsx)(n.a,{href:"../backend/src/oauth/provider/oauthProvider.interface.ts",children:(0,o.jsx)(n.code,{children:"OAuthProvider"})})," interface to add a new OAuth 2 provider."]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.a,{href:"../backend/src/oauth/provider/github.provider.ts",children:"GitHub provider"})," and ",(0,o.jsx)(n.a,{href:"../backend/src/oauth/provider/discord.provider.ts",children:"Discord provider"})," are good examples."]}),"\n",(0,o.jsx)(n.h3,{id:"3-register-provider",children:"3. Register provider"}),"\n",(0,o.jsxs)(n.p,{children:["Register your provider in ",(0,o.jsx)(n.a,{href:"../backend/src/oauth/oauth.module.ts",children:(0,o.jsx)(n.code,{children:"OAuthModule"})})," and ",(0,o.jsx)(n.a,{href:"../backend/src/oauth/dto/oauthSignIn.dto.ts",children:(0,o.jsx)(n.code,{children:"OAuthSignInDto"})}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-ts",children:'@Module({\n providers: [\n GitHubProvider,\n // your provider\n {\n provide: "OAUTH_PROVIDERS",\n useFactory(\n github: GitHubProvider /* your provider */\n ): Record> {\n return {\n github,\n /* your provider */\n };\n },\n inject: [GitHubProvider /* your provider */],\n },\n ],\n})\nexport class OAuthModule {}\n'})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-ts",children:'export interface OAuthSignInDto {\n provider:\n | "github"\n | "google"\n | "microsoft"\n | "discord"\n | "oidc" /* your provider*/;\n providerId: string;\n providerUsername: string;\n email: string;\n}\n'})}),"\n",(0,o.jsx)(n.h3,{id:"4-add-frontend-icon",children:"4. Add frontend icon"}),"\n",(0,o.jsxs)(n.p,{children:["Add an icon in ",(0,o.jsx)(n.a,{href:"../frontend/src/utils/oauth.util.tsx",children:(0,o.jsx)(n.code,{children:"oauth.util.tsx"})}),"."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-tsx",children:"const getOAuthIcon = (provider: string) => {\n return {\n github: ,\n /* your provider */\n }[provider];\n};\n"})}),"\n",(0,o.jsx)(n.h3,{id:"5-add-i18n-text",children:"5. Add i18n text"}),"\n",(0,o.jsxs)(n.p,{children:["Add keys below to your i18n text in ",(0,o.jsx)(n.a,{href:"../frontend/src/i18n/translations/en-US.ts",children:"locale file"}),"."]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.code,{children:"signIn.oauth.YOUR_PROVIDER_NAME"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.code,{children:"account.card.oauth.YOUR_PROVIDER_NAME"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.code,{children:"admin.config.oauth.YOUR_PROVIDER_NAME-enabled"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.code,{children:"admin.config.oauth.YOUR_PROVIDER_NAME-client-id"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.code,{children:"admin.config.oauth.YOUR_PROVIDER_NAME-client-secret"})}),"\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.code,{children:"error.param.provider_YOUR_PROVIDER_NAME"})}),"\n",(0,o.jsx)(n.li,{children:"Other config keys you defined in step 1"}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:"Congratulations! \ud83c\udf89 You have successfully added a new OAuth 2 provider! Pull requests are welcome if you want to share your provider with others."})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(a,{...e})}):a(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>d,x:()=>s});var o=i(6540);const r={},t=o.createContext(r);function d(e){const n=o.useContext(t);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:d(e.components),o.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3f2e6990.8d1f4d5e.js b/assets/js/3f2e6990.8d1f4d5e.js deleted file mode 100644 index 0910f44..0000000 --- a/assets/js/3f2e6990.8d1f4d5e.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkpingvindocs=self.webpackChunkpingvindocs||[]).push([[819],{3403:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>t,metadata:()=>s,toc:()=>l});var r=i(4848),o=i(8453);const t={id:"oauth2login"},d="OAuth 2 Login Guide",s={id:"setup/oauth2login",title:"OAuth 2 Login Guide",description:"Config Built-in OAuth 2 Providers",source:"@site/docs/setup/oauth2login.md",sourceDirName:"setup",slug:"/setup/oauth2login",permalink:"/pingvin-share/setup/oauth2login",draft:!1,unlisted:!1,editUrl:"https://github.com/stonith404/pingvin-share/edit/main/docs/docs/setup/oauth2login.md",tags:[],version:"current",frontMatter:{id:"oauth2login"},sidebar:"docsSidebar",previous:{title:"Integrations",permalink:"/pingvin-share/setup/integrations"},next:{title:"Upgrading",permalink:"/pingvin-share/setup/upgrading"}},c={},l=[{value:"Config Built-in OAuth 2 Providers",id:"config-built-in-oauth-2-providers",level:2},{value:"GitHub",id:"github",level:3},{value:"Google",id:"google",level:3},{value:"Microsoft",id:"microsoft",level:3},{value:"Discord",id:"discord",level:3},{value:"OpenID Connect",id:"openid-connect",level:3},{value:"Custom your OAuth 2 Provider",id:"custom-your-oauth-2-provider",level:2},{value:"1. Create config",id:"1-create-config",level:3},{value:"2. Create provider class",id:"2-create-provider-class",level:3},{value:"Generic OpenID Connect",id:"generic-openid-connect",level:4},{value:"OAuth 2",id:"oauth-2",level:4},{value:"3. Register provider",id:"3-register-provider",level:3},{value:"4. Add frontend icon",id:"4-add-frontend-icon",level:3},{value:"5. Add i18n text",id:"5-add-i18n-text",level:3}];function a(e){const n={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"oauth-2-login-guide",children:"OAuth 2 Login Guide"})}),"\n",(0,r.jsx)(n.h2,{id:"config-built-in-oauth-2-providers",children:"Config Built-in OAuth 2 Providers"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#github",children:"GitHub"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#google",children:"Google"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#microsoft",children:"Microsoft"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#discord",children:"Discord"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"#openid-connect",children:"OpenID Connect"})}),"\n"]}),"\n",(0,r.jsx)(n.h3,{id:"github",children:"GitHub"}),"\n",(0,r.jsxs)(n.p,{children:["Please follow the ",(0,r.jsx)(n.a,{href:"https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app",children:"official guide"})," to create an OAuth app."]}),"\n",(0,r.jsxs)(n.p,{children:["Redirect URL: ",(0,r.jsx)(n.code,{children:"https:///api/oauth/callback/github"})]}),"\n",(0,r.jsx)(n.h3,{id:"google",children:"Google"}),"\n",(0,r.jsxs)(n.p,{children:["Please follow the ",(0,r.jsx)(n.a,{href:"https://developers.google.com/identity/protocols/oauth2/web-server#prerequisites",children:"official guide"})," to create an OAuth 2.0 App."]}),"\n",(0,r.jsxs)(n.p,{children:["Redirect URL: ",(0,r.jsx)(n.code,{children:"https:///api/oauth/callback/google"})]}),"\n",(0,r.jsx)(n.h3,{id:"microsoft",children:"Microsoft"}),"\n",(0,r.jsxs)(n.p,{children:["Please follow the ",(0,r.jsx)(n.a,{href:"https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app",children:"official guide"})," to register an application."]}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:["[!IMPORTANT] > ",(0,r.jsx)(n.strong,{children:"Microsoft Tenant"})," you set in the admin panel must match the ",(0,r.jsx)(n.strong,{children:"supported account types"})," you set in the Microsoft Entra admin center, otherwise the OAuth login will not work. Refer to the ",(0,r.jsx)(n.a,{href:"https://learn.microsoft.com/en-us/entra/identity-platform/v2-protocols-oidc#find-your-apps-openid-configuration-document-uri",children:"official documentation"})," for more details."]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Redirect URL: ",(0,r.jsx)(n.code,{children:"https:///api/oauth/callback/microsoft"})]}),"\n",(0,r.jsx)(n.h3,{id:"discord",children:"Discord"}),"\n",(0,r.jsxs)(n.p,{children:["Create an application on ",(0,r.jsx)(n.a,{href:"https://discord.com/developers/applications",children:"Discord Developer Portal"}),"."]}),"\n",(0,r.jsxs)(n.p,{children:["Redirect URL: ",(0,r.jsx)(n.code,{children:"https:///api/oauth/callback/discord"})]}),"\n",(0,r.jsx)(n.h3,{id:"openid-connect",children:"OpenID Connect"}),"\n",(0,r.jsx)(n.p,{children:"Generic OpenID Connect provider is also supported, we have tested it on Keycloak, Authentik and Casdoor."}),"\n",(0,r.jsxs)(n.p,{children:["Redirect URL: ",(0,r.jsx)(n.code,{children:"https:///api/oauth/callback/oidc"})]}),"\n",(0,r.jsx)(n.h2,{id:"custom-your-oauth-2-provider",children:"Custom your OAuth 2 Provider"}),"\n",(0,r.jsx)(n.p,{children:"If our built-in providers don't meet your needs, you can create your own OAuth 2 provider."}),"\n",(0,r.jsx)(n.h3,{id:"1-create-config",children:"1. Create config"}),"\n",(0,r.jsxs)(n.p,{children:["Add your config (client id, client secret, etc.) in ",(0,r.jsx)(n.a,{href:"../backend/prisma/seed/config.seed.ts",children:(0,r.jsx)(n.code,{children:"config.seed.ts"})}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:'const configVariables: ConfigVariables = {\n // ...\n oauth: {\n // ...\n "YOUR_PROVIDER_NAME-enabled": {\n type: "boolean",\n defaultValue: "false",\n },\n "YOUR_PROVIDER_NAME-clientId": {\n type: "string",\n defaultValue: "",\n },\n "YOUR_PROVIDER_NAME-clientSecret": {\n type: "string",\n defaultValue: "",\n obscured: true,\n },\n },\n};\n'})}),"\n",(0,r.jsx)(n.h3,{id:"2-create-provider-class",children:"2. Create provider class"}),"\n",(0,r.jsx)(n.h4,{id:"generic-openid-connect",children:"Generic OpenID Connect"}),"\n",(0,r.jsxs)(n.p,{children:["If your provider supports OpenID connect, it's extremely easy to extend ",(0,r.jsx)(n.a,{href:"../backend/src/oauth/provider/genericOidc.provider.ts",children:(0,r.jsx)(n.code,{children:"GenericOidcProvider"})})," to add a new OpenID Connect provider."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.a,{href:"../backend/src/oauth/provider/google.provider.ts",children:"Google provider"})," and ",(0,r.jsx)(n.a,{href:"../backend/src/oauth/provider/microsoft.provider.ts",children:"Microsoft provider"})," are good examples."]}),"\n",(0,r.jsx)(n.p,{children:"Here are some discovery URIs for popular providers:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Microsoft: ",(0,r.jsx)(n.code,{children:"https://login.microsoftonline.com/{tenant}/v2.0/.well-known/openid-configuration"})]}),"\n",(0,r.jsxs)(n.li,{children:["Google: ",(0,r.jsx)(n.code,{children:"https://accounts.google.com/.well-known/openid-configuration"})]}),"\n",(0,r.jsxs)(n.li,{children:["Apple: ",(0,r.jsx)(n.code,{children:"https://appleid.apple.com/.well-known/openid-configuration"})]}),"\n",(0,r.jsxs)(n.li,{children:["Gitlab: ",(0,r.jsx)(n.code,{children:"https://gitlab.com/.well-known/openid-configuration"})]}),"\n",(0,r.jsxs)(n.li,{children:["Huawei: ",(0,r.jsx)(n.code,{children:"https://oauth-login.cloud.huawei.com/.well-known/openid-configuration"})]}),"\n",(0,r.jsxs)(n.li,{children:["Paypal: ",(0,r.jsx)(n.code,{children:"https://www.paypal.com/.well-known/openid-configuration"})]}),"\n",(0,r.jsxs)(n.li,{children:["Yahoo: ",(0,r.jsx)(n.code,{children:"https://api.login.yahoo.com/.well-known/openid-configuration"})]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"oauth-2",children:"OAuth 2"}),"\n",(0,r.jsxs)(n.p,{children:["If your provider only supports OAuth 2, you can implement ",(0,r.jsx)(n.a,{href:"../backend/src/oauth/provider/oauthProvider.interface.ts",children:(0,r.jsx)(n.code,{children:"OAuthProvider"})})," interface to add a new OAuth 2 provider."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.a,{href:"../backend/src/oauth/provider/github.provider.ts",children:"GitHub provider"})," and ",(0,r.jsx)(n.a,{href:"../backend/src/oauth/provider/discord.provider.ts",children:"Discord provider"})," are good examples."]}),"\n",(0,r.jsx)(n.h3,{id:"3-register-provider",children:"3. Register provider"}),"\n",(0,r.jsxs)(n.p,{children:["Register your provider in ",(0,r.jsx)(n.a,{href:"../backend/src/oauth/oauth.module.ts",children:(0,r.jsx)(n.code,{children:"OAuthModule"})})," and ",(0,r.jsx)(n.a,{href:"../backend/src/oauth/dto/oauthSignIn.dto.ts",children:(0,r.jsx)(n.code,{children:"OAuthSignInDto"})}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:'@Module({\n providers: [\n GitHubProvider,\n // your provider\n {\n provide: "OAUTH_PROVIDERS",\n useFactory(\n github: GitHubProvider /* your provider */\n ): Record> {\n return {\n github,\n /* your provider */\n };\n },\n inject: [GitHubProvider /* your provider */],\n },\n ],\n})\nexport class OAuthModule {}\n'})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",children:'export interface OAuthSignInDto {\n provider:\n | "github"\n | "google"\n | "microsoft"\n | "discord"\n | "oidc" /* your provider*/;\n providerId: string;\n providerUsername: string;\n email: string;\n}\n'})}),"\n",(0,r.jsx)(n.h3,{id:"4-add-frontend-icon",children:"4. Add frontend icon"}),"\n",(0,r.jsxs)(n.p,{children:["Add an icon in ",(0,r.jsx)(n.a,{href:"../frontend/src/utils/oauth.util.tsx",children:(0,r.jsx)(n.code,{children:"oauth.util.tsx"})}),"."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-tsx",children:"const getOAuthIcon = (provider: string) => {\n return {\n github: ,\n /* your provider */\n }[provider];\n};\n"})}),"\n",(0,r.jsx)(n.h3,{id:"5-add-i18n-text",children:"5. Add i18n text"}),"\n",(0,r.jsxs)(n.p,{children:["Add keys below to your i18n text in ",(0,r.jsx)(n.a,{href:"../frontend/src/i18n/translations/en-US.ts",children:"locale file"}),"."]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"signIn.oauth.YOUR_PROVIDER_NAME"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"account.card.oauth.YOUR_PROVIDER_NAME"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"admin.config.oauth.YOUR_PROVIDER_NAME-enabled"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"admin.config.oauth.YOUR_PROVIDER_NAME-client-id"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"admin.config.oauth.YOUR_PROVIDER_NAME-client-secret"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.code,{children:"error.param.provider_YOUR_PROVIDER_NAME"})}),"\n",(0,r.jsx)(n.li,{children:"Other config keys you defined in step 1"}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"Congratulations! \ud83c\udf89 You have successfully added a new OAuth 2 provider! Pull requests are welcome if you want to share your provider with others."})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>d,x:()=>s});var r=i(6540);const o={},t=r.createContext(o);function d(e){const n=r.useContext(t);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:d(e.components),r.createElement(t.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/a8c31fc1.0a96fc42.js b/assets/js/a8c31fc1.0a96fc42.js deleted file mode 100644 index bcf7aa1..0000000 --- a/assets/js/a8c31fc1.0a96fc42.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkpingvindocs=self.webpackChunkpingvindocs||[]).push([[99],{3279:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>l,toc:()=>d});var i=t(4848),s=t(8453);const o={id:"installation"},r="Installation",l={id:"setup/installation",title:"Installation",description:"Installation with Docker (recommended)",source:"@site/docs/setup/installation.md",sourceDirName:"setup",slug:"/setup/installation",permalink:"/pingvin-share/setup/installation",draft:!1,unlisted:!1,editUrl:"https://github.com/stonith404/pingvin-share/edit/main/docs/docs/setup/installation.md",tags:[],version:"current",frontMatter:{id:"installation"},sidebar:"docsSidebar",previous:{title:"Introduction",permalink:"/pingvin-share/introduction"},next:{title:"Configuration",permalink:"/pingvin-share/setup/configuration"}},a={},d=[{value:"Installation with Docker (recommended)",id:"installation-with-docker-recommended",level:3},{value:"Stand-alone Installation",id:"stand-alone-installation",level:3}];function c(n){const e={a:"a",code:"code",h1:"h1",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.header,{children:(0,i.jsx)(e.h1,{id:"installation",children:"Installation"})}),"\n",(0,i.jsx)(e.h3,{id:"installation-with-docker-recommended",children:"Installation with Docker (recommended)"}),"\n",(0,i.jsxs)(e.ol,{children:["\n",(0,i.jsxs)(e.li,{children:["Download the ",(0,i.jsx)(e.code,{children:"docker-compose.yml"})," file"]}),"\n",(0,i.jsxs)(e.li,{children:["Run ",(0,i.jsx)(e.code,{children:"docker compose up -d"})]}),"\n"]}),"\n",(0,i.jsxs)(e.p,{children:["The website is now listening on ",(0,i.jsx)(e.code,{children:"http://localhost:3000"}),", have fun with Pingvin Share \ud83d\udc27!"]}),"\n",(0,i.jsx)(e.h3,{id:"stand-alone-installation",children:"Stand-alone Installation"}),"\n",(0,i.jsx)(e.p,{children:"Required tools:"}),"\n",(0,i.jsxs)(e.ul,{children:["\n",(0,i.jsxs)(e.li,{children:[(0,i.jsx)(e.a,{href:"https://nodejs.org/en/download/",children:"Node.js"})," >= 16"]}),"\n",(0,i.jsx)(e.li,{children:(0,i.jsx)(e.a,{href:"https://git-scm.com/downloads",children:"Git"})}),"\n",(0,i.jsxs)(e.li,{children:[(0,i.jsx)(e.a,{href:"https://pm2.keymetrics.io/",children:"pm2"})," for running Pingvin Share in the background"]}),"\n"]}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-bash",children:'git clone https://github.com/stonith404/pingvin-share\ncd pingvin-share\n\n# Checkout the latest version\ngit fetch --tags && git checkout $(git describe --tags `git rev-list --tags --max-count=1`)\n\n# Start the backend\ncd backend\nnpm install\nnpm run build\npm2 start --name="pingvin-share-backend" npm -- run prod\n\n# Start the frontend\ncd ../frontend\nnpm install\nnpm run build\nAPI_URL=http://localhost:8080 # Set the URL of the backend, default: http://localhost:8080\npm2 start npm --name "pingvin-share-frontend" -- run start\n'})}),"\n",(0,i.jsxs)(e.p,{children:[(0,i.jsx)(e.strong,{children:"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 Caddy can be found in ",(0,i.jsx)(e.code,{children:"./reverse-proxy/Caddyfile"}),"."]}),"\n",(0,i.jsxs)(e.p,{children:["The website is now listening on ",(0,i.jsx)(e.code,{children:"http://localhost:3000"}),", have fun with Pingvin Share \ud83d\udc27!"]})]})}function h(n={}){const{wrapper:e}={...(0,s.R)(),...n.components};return e?(0,i.jsx)(e,{...n,children:(0,i.jsx)(c,{...n})}):c(n)}},8453:(n,e,t)=>{t.d(e,{R:()=>r,x:()=>l});var i=t(6540);const s={},o=i.createContext(s);function r(n){const e=i.useContext(o);return i.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function l(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(s):n.components||s:r(n.components),i.createElement(o.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/a8c31fc1.c26fc8a4.js b/assets/js/a8c31fc1.c26fc8a4.js new file mode 100644 index 0000000..c208770 --- /dev/null +++ b/assets/js/a8c31fc1.c26fc8a4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkpingvindocs=self.webpackChunkpingvindocs||[]).push([[99],{3279:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>a,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>r,toc:()=>c});var i=t(4848),s=t(8453);const o={id:"installation"},l="Installation",r={id:"setup/installation",title:"Installation",description:"Installation with Docker (recommended)",source:"@site/docs/setup/installation.md",sourceDirName:"setup",slug:"/setup/installation",permalink:"/pingvin-share/setup/installation",draft:!1,unlisted:!1,editUrl:"https://github.com/stonith404/pingvin-share/edit/main/docs/docs/setup/installation.md",tags:[],version:"current",frontMatter:{id:"installation"},sidebar:"docsSidebar",previous:{title:"Introduction",permalink:"/pingvin-share/introduction"},next:{title:"Configuration",permalink:"/pingvin-share/setup/configuration"}},a={},c=[{value:"Installation with Docker (recommended)",id:"installation-with-docker-recommended",level:3},{value:"Installation with Portainer",id:"installation-with-portainer",level:3},{value:"Stand-alone Installation",id:"stand-alone-installation",level:3}];function d(n){const e={a:"a",code:"code",h1:"h1",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.header,{children:(0,i.jsx)(e.h1,{id:"installation",children:"Installation"})}),"\n",(0,i.jsx)(e.h3,{id:"installation-with-docker-recommended",children:"Installation with Docker (recommended)"}),"\n",(0,i.jsxs)(e.ol,{children:["\n",(0,i.jsxs)(e.li,{children:["Download the ",(0,i.jsx)(e.code,{children:"docker-compose.yml"})," file"]}),"\n",(0,i.jsxs)(e.li,{children:["Run ",(0,i.jsx)(e.code,{children:"docker compose up -d"})]}),"\n"]}),"\n",(0,i.jsxs)(e.p,{children:["The website is now listening on ",(0,i.jsx)(e.code,{children:"http://localhost:3000"}),", have fun with Pingvin Share \ud83d\udc27!"]}),"\n",(0,i.jsx)(e.h3,{id:"installation-with-portainer",children:"Installation with Portainer"}),"\n",(0,i.jsxs)(e.ol,{children:["\n",(0,i.jsxs)(e.li,{children:["In the ",(0,i.jsx)(e.strong,{children:"Stacks"})," menu, click the ",(0,i.jsx)(e.strong,{children:"Add stack"})," button"]}),"\n",(0,i.jsx)(e.li,{children:"Give you stack a name (ex. pingvinshare)"}),"\n",(0,i.jsxs)(e.li,{children:["In the web editor, paste the content of the ",(0,i.jsx)(e.a,{href:"https://github.com/stonith404/pingvin-share/blob/main/docker-compose.yml",children:"docker-compose"})," file."]}),"\n",(0,i.jsx)(e.li,{children:"Edit the external port and the environment variables (optional)."}),"\n",(0,i.jsxs)(e.li,{children:["Click on ",(0,i.jsx)(e.strong,{children:"Deploy the stack"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(e.p,{children:["Your container is now listening on ",(0,i.jsx)(e.code,{children:"http://localhost:"}),", have fun with Pingvin Share \ud83d\udc27!"]}),"\n",(0,i.jsx)(e.h3,{id:"stand-alone-installation",children:"Stand-alone Installation"}),"\n",(0,i.jsx)(e.p,{children:"Required tools:"}),"\n",(0,i.jsxs)(e.ul,{children:["\n",(0,i.jsxs)(e.li,{children:[(0,i.jsx)(e.a,{href:"https://nodejs.org/en/download/",children:"Node.js"})," >= 16"]}),"\n",(0,i.jsx)(e.li,{children:(0,i.jsx)(e.a,{href:"https://git-scm.com/downloads",children:"Git"})}),"\n",(0,i.jsxs)(e.li,{children:[(0,i.jsx)(e.a,{href:"https://pm2.keymetrics.io/",children:"pm2"})," for running Pingvin Share in the background"]}),"\n"]}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-bash",children:'git clone https://github.com/stonith404/pingvin-share\ncd pingvin-share\n\n# Checkout the latest version\ngit fetch --tags && git checkout $(git describe --tags `git rev-list --tags --max-count=1`)\n\n# Start the backend\ncd backend\nnpm install\nnpm run build\npm2 start --name="pingvin-share-backend" npm -- run prod\n\n# Start the frontend\ncd ../frontend\nnpm install\nnpm run build\nAPI_URL=http://localhost:8080 # Set the URL of the backend, default: http://localhost:8080\npm2 start npm --name "pingvin-share-frontend" -- run start\n'})}),"\n",(0,i.jsxs)(e.p,{children:[(0,i.jsx)(e.strong,{children:"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 Caddy can be found in ",(0,i.jsx)(e.code,{children:"./reverse-proxy/Caddyfile"}),"."]}),"\n",(0,i.jsxs)(e.p,{children:["The website is now listening on ",(0,i.jsx)(e.code,{children:"http://localhost:3000"}),", have fun with Pingvin Share \ud83d\udc27!"]})]})}function h(n={}){const{wrapper:e}={...(0,s.R)(),...n.components};return e?(0,i.jsx)(e,{...n,children:(0,i.jsx)(d,{...n})}):d(n)}},8453:(n,e,t)=>{t.d(e,{R:()=>l,x:()=>r});var i=t(6540);const s={},o=i.createContext(s);function l(n){const e=i.useContext(o);return i.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function r(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(s):n.components||s:l(n.components),i.createElement(o.Provider,{value:e},n.children)}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.1662c97b.js b/assets/js/runtime~main.1662c97b.js deleted file mode 100644 index 10403f5..0000000 --- a/assets/js/runtime~main.1662c97b.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,t,r,a,o,n={},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={id:e,loaded:!1,exports:{}};return n[e].call(r.exports,r,r.exports,c),r.loaded=!0,r.exports}c.m=n,c.c=i,e=[],c.O=(t,r,a,o)=>{if(!r){var n=1/0;for(u=0;u=o)&&Object.keys(c.O).every((e=>c.O[e](r[d])))?r.splice(d--,1):(i=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[r,a,o]},c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var o=Object.create(null);c.r(o);var n={};t=t||[null,r({}),r([]),r(r)];for(var i=2&a&&e;"object"==typeof i&&!~t.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,c.d(o,n),o},c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce(((t,r)=>(c.f[r](e,t),t)),[])),c.u=e=>"assets/js/"+({48:"a94703ab",98:"a7bd4aaa",99:"a8c31fc1",126:"d131c913",235:"a7456010",361:"3205bd6d",401:"17896441",537:"a0d20388",583:"1df93b7f",647:"5e95c892",723:"91b3cb8d",742:"aba21aa0",819:"3f2e6990",862:"7cbc9cee",863:"63b14240",899:"a09c2993"}[e]||e)+"."+{48:"78fc18a9",98:"3d51fbb4",99:"0a96fc42",126:"815d9a2f",235:"91f0b3e9",237:"f947e7e3",361:"c114a06a",401:"402e11f1",537:"9147194f",583:"2d1029fa",647:"59168106",723:"073a48e1",742:"ad2b3c84",819:"8d1f4d5e",862:"af2bf09d",863:"e94c1db4",899:"e0cc7812"}[e]+".js",c.miniCssF=e=>{},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},o="pingvindocs:",c.l=(e,t,r,n)=>{if(a[e])a[e].push(t);else{var i,d;if(void 0!==r)for(var f=document.getElementsByTagName("script"),u=0;u{i.onerror=i.onload=null,clearTimeout(s);var o=a[e];if(delete a[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(r))),t)return t(r)},s=setTimeout(b.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=b.bind(null,i.onerror),i.onload=b.bind(null,i.onload),d&&document.head.appendChild(i)}},c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.p="/pingvin-share/",c.gca=function(e){return e={17896441:"401",a94703ab:"48",a7bd4aaa:"98",a8c31fc1:"99",d131c913:"126",a7456010:"235","3205bd6d":"361",a0d20388:"537","1df93b7f":"583","5e95c892":"647","91b3cb8d":"723",aba21aa0:"742","3f2e6990":"819","7cbc9cee":"862","63b14240":"863",a09c2993:"899"}[e]||e,c.p+c.u(e)},(()=>{var e={354:0,869:0};c.f.j=(t,r)=>{var a=c.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(354|869)$/.test(t))e[t]=0;else{var o=new Promise(((r,o)=>a=e[t]=[r,o]));r.push(a[2]=o);var n=c.p+c.u(t),i=new Error;c.l(n,(r=>{if(c.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;i.message="Loading chunk "+t+" failed.\n("+o+": "+n+")",i.name="ChunkLoadError",i.type=o,i.request=n,a[1](i)}}),"chunk-"+t,t)}},c.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,n=r[0],i=r[1],d=r[2],f=0;if(n.some((t=>0!==e[t]))){for(a in i)c.o(i,a)&&(c.m[a]=i[a]);if(d)var u=d(c)}for(t&&t(r);f{"use strict";var e,t,r,a,o,n={},i={};function d(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={id:e,loaded:!1,exports:{}};return n[e].call(r.exports,r,r.exports,d),r.loaded=!0,r.exports}d.m=n,d.c=i,e=[],d.O=(t,r,a,o)=>{if(!r){var n=1/0;for(u=0;u=o)&&Object.keys(d.O).every((e=>d.O[e](r[c])))?r.splice(c--,1):(i=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[r,a,o]},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,a){if(1&a&&(e=this(e)),8&a)return e;if("object"==typeof e&&e){if(4&a&&e.__esModule)return e;if(16&a&&"function"==typeof e.then)return e}var o=Object.create(null);d.r(o);var n={};t=t||[null,r({}),r([]),r(r)];for(var i=2&a&&e;"object"==typeof i&&!~t.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,d.d(o,n),o},d.d=(e,t)=>{for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((t,r)=>(d.f[r](e,t),t)),[])),d.u=e=>"assets/js/"+({48:"a94703ab",98:"a7bd4aaa",99:"a8c31fc1",126:"d131c913",235:"a7456010",361:"3205bd6d",401:"17896441",537:"a0d20388",583:"1df93b7f",647:"5e95c892",723:"91b3cb8d",742:"aba21aa0",819:"3f2e6990",862:"7cbc9cee",863:"63b14240",899:"a09c2993"}[e]||e)+"."+{48:"78fc18a9",98:"3d51fbb4",99:"c26fc8a4",126:"815d9a2f",235:"91f0b3e9",237:"f947e7e3",361:"ecb21caf",401:"402e11f1",537:"9147194f",583:"2d1029fa",647:"59168106",723:"073a48e1",742:"ad2b3c84",819:"282c7570",862:"af2bf09d",863:"e94c1db4",899:"e0cc7812"}[e]+".js",d.miniCssF=e=>{},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a={},o="pingvindocs:",d.l=(e,t,r,n)=>{if(a[e])a[e].push(t);else{var i,c;if(void 0!==r)for(var f=document.getElementsByTagName("script"),u=0;u{i.onerror=i.onload=null,clearTimeout(s);var o=a[e];if(delete a[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(r))),t)return t(r)},s=setTimeout(b.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=b.bind(null,i.onerror),i.onload=b.bind(null,i.onload),c&&document.head.appendChild(i)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.p="/pingvin-share/",d.gca=function(e){return e={17896441:"401",a94703ab:"48",a7bd4aaa:"98",a8c31fc1:"99",d131c913:"126",a7456010:"235","3205bd6d":"361",a0d20388:"537","1df93b7f":"583","5e95c892":"647","91b3cb8d":"723",aba21aa0:"742","3f2e6990":"819","7cbc9cee":"862","63b14240":"863",a09c2993:"899"}[e]||e,d.p+d.u(e)},(()=>{var e={354:0,869:0};d.f.j=(t,r)=>{var a=d.o(e,t)?e[t]:void 0;if(0!==a)if(a)r.push(a[2]);else if(/^(354|869)$/.test(t))e[t]=0;else{var o=new Promise(((r,o)=>a=e[t]=[r,o]));r.push(a[2]=o);var n=d.p+d.u(t),i=new Error;d.l(n,(r=>{if(d.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;i.message="Loading chunk "+t+" failed.\n("+o+": "+n+")",i.name="ChunkLoadError",i.type=o,i.request=n,a[1](i)}}),"chunk-"+t,t)}},d.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,n=r[0],i=r[1],c=r[2],f=0;if(n.some((t=>0!==e[t]))){for(a in i)d.o(i,a)&&(d.m[a]=i[a]);if(c)var u=c(d)}for(t&&t(r);f Contributing | Pingvin Share - + diff --git a/help-out/translate/index.html b/help-out/translate/index.html index deb6b7b..e31af78 100644 --- a/help-out/translate/index.html +++ b/help-out/translate/index.html @@ -4,7 +4,7 @@ Translating | Pingvin Share - + diff --git a/index.html b/index.html index 06f701c..70b5f7b 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ Pingvin Share - + diff --git a/introduction/index.html b/introduction/index.html index 249990c..96b3764 100644 --- a/introduction/index.html +++ b/introduction/index.html @@ -4,7 +4,7 @@ Introduction | Pingvin Share - + diff --git a/setup/configuration/index.html b/setup/configuration/index.html index 075d89f..e119318 100644 --- a/setup/configuration/index.html +++ b/setup/configuration/index.html @@ -4,7 +4,7 @@ Configuration | Pingvin Share - + diff --git a/setup/installation/index.html b/setup/installation/index.html index dd068e1..3bd8177 100644 --- a/setup/installation/index.html +++ b/setup/installation/index.html @@ -4,7 +4,7 @@ Installation | Pingvin Share - + @@ -15,6 +15,15 @@
  • Run docker compose up -d
  • The website is now listening on http://localhost:3000, have fun with Pingvin Share 🐧!

    +

    Installation with Portainer

    +
      +
    1. In the Stacks menu, click the Add stack button
    2. +
    3. Give you stack a name (ex. pingvinshare)
    4. +
    5. In the web editor, paste the content of the docker-compose file.
    6. +
    7. Edit the external port and the environment variables (optional).
    8. +
    9. Click on Deploy the stack.
    10. +
    +

    Your container is now listening on http://localhost:<externalport>, have fun with Pingvin Share 🐧!

    Stand-alone Installation

    Required tools:

      @@ -24,6 +33,6 @@
    git clone https://github.com/stonith404/pingvin-share
    cd pingvin-share

    # Checkout the latest version
    git fetch --tags && git checkout $(git describe --tags `git rev-list --tags --max-count=1`)

    # Start the backend
    cd backend
    npm install
    npm run build
    pm2 start --name="pingvin-share-backend" npm -- run prod

    # Start the frontend
    cd ../frontend
    npm install
    npm run build
    API_URL=http://localhost:8080 # Set the URL of the backend, default: http://localhost:8080
    pm2 start npm --name "pingvin-share-frontend" -- 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 Caddy can be found in ./reverse-proxy/Caddyfile.

    -

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

    +

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

    \ No newline at end of file diff --git a/setup/integrations/index.html b/setup/integrations/index.html index 212016f..d3bcc66 100644 --- a/setup/integrations/index.html +++ b/setup/integrations/index.html @@ -4,7 +4,7 @@ Integrations | Pingvin Share - + diff --git a/setup/oauth2login/index.html b/setup/oauth2login/index.html index 15e9ac7..8d02eea 100644 --- a/setup/oauth2login/index.html +++ b/setup/oauth2login/index.html @@ -4,7 +4,7 @@ OAuth 2 Login Guide | Pingvin Share - + @@ -33,8 +33,9 @@

    Create an application on Discord Developer Portal.

    Redirect URL: https://<your-domain>/api/oauth/callback/discord

    OpenID Connect

    -

    Generic OpenID Connect provider is also supported, we have tested it on Keycloak, Authentik and Casdoor.

    -

    Redirect URL: https://<your-domain>/api/oauth/callback/oidc

    +

    Generic OpenID Connect provider is also supported, we have tested it on Keycloak, Authentik, Casdoor and Pocket ID.

    +

    Redirect URI: https://<your-domain>/api/oauth/callback/oidc

    +

    Post Logout Redirect URI: https://<your-domain>

    Custom your OAuth 2 Provider

    If our built-in providers don't meet your needs, you can create your own OAuth 2 provider.

    1. Create config

    diff --git a/setup/upgrading/index.html b/setup/upgrading/index.html index 146f85d..2baf09b 100644 --- a/setup/upgrading/index.html +++ b/setup/upgrading/index.html @@ -4,7 +4,7 @@ Upgrading | Pingvin Share - + @@ -13,6 +13,12 @@

    As Pingvin Share is in early stage, see the release notes for breaking changes before upgrading.

    Docker

    docker compose pull
    docker compose up -d
    +

    Portainer

    +
      +
    1. In your container page, click on Recreate.
    2. +
    3. Check the Re-Pull image toggle.
    4. +
    5. Click on Recreate.
    6. +

    Stand-alone

    1. @@ -24,6 +30,6 @@
      cd pingvin-share

      # Checkout the latest version
      git fetch --tags && git checkout $(git describe --tags `git rev-list --tags --max-count=1`)

      # Start the backend
      cd backend
      npm install
      npm run build
      pm2 restart pingvin-share-backend

      # Start the frontend
      cd ../frontend
      npm install
      npm run build
      pm2 restart pingvin-share-frontend
    -

    Note that environemnt variables are not picked up when using pm2 restart, if you actually want to change configs, you need to run pm2 --update-env restart

    +

    Note that environemnt variables are not picked up when using pm2 restart, if you actually want to change configs, you need to run pm2 --update-env restart

    \ No newline at end of file