Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
38 changes: 38 additions & 0 deletions .example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
NEXT_PUBLIC_DEFAULT_AVATAR_URL=https://avatars.githubusercontent.com/u/1024025?v=4
NEXT_PUBLIC_UPLOAD_LIMIT_BYTES=2147483648
NEXT_PUBLIC_GITHUB_AUTH_ENABLED=TRUE
NEXT_PUBLIC_DISCORD_AUTH_ENABLED=TRUE
NEXT_PUBLIC_GOOGLE_AUTH_ENABLED=TRUE
NEXT_PUBLIC_EMAIL_AUTH_ENABLED=TRUE
NEXT_PUBLIC_PAYMENTS_ENABLED=TRUE
TIERS_JSON='[
{"name":"Free","max_storage_bytes":2147483648,"stripe_price_id":null,"display_price": "$0.00", "description": "Perfect for trying out cloud sharing", "display_features": ["2GB cloud storage", "Unlimited local recordings", "Basic sharing links"]},
]'
NEXT_PUBLIC_APP_DESC="An open-source instant replay tool for modern Linux desktops. Built with ❤️ for the Linux community."
NEXT_PUBLIC_API_URL=https://wayclip.com
NEXT_PUBLIC_FOOTER_LINKS='{
"Product": [
{ "text": "Features", "href": "https://wayclip.com#Features" },
{ "text": "Pricing", "href": "https://wayclip.com#Pricing" },
{ "text": "Privacy Policy", "href": "https://wayclip.com/privacy" },
{ "text": "Terms Of Service", "href": "https://wayclip.com/terms" },
{ "text": "Return Policy", "href": "https://wayclip.com/return-policy" },
{ "text": "Support", "href": "https://wayclip.com/support" }
],
"Community": [
{ "text": "GitHub", "href": "https://github.com/wayclip", "external": true },
{ "text": "Contributing", "href": "https://wayclip.com/docs/contributing" },
{ "text": "Discord", "href": "https://discord.gg/BrXAHknFE6", "external": true },
{ "text": "Status", "href": "https://status.wayclip.com", "external": true },
{ "text": "Documentation", "href": "https://wayclip.com/docs" },
{ "text": "Download", "href": "https://wayclip.com/download" }
]
}'
NEXT_PUBLIC_NAVBAR_LINKS='[
{ "text": "Front Page", "href": "https://wayclip.com" },
{ "text": "Dashboard", "href": "https://dash.wayclip.com/dash" },
{ "text": "Download", "href": "https://wayclip.com/download" },
{ "text": "Docs", "href": "https://wayclip.com/docs" }
]'
NEXT_PUBLIC_FRONTEND_URL=https://dash.wayclip.com
NEXT_PUBLIC_APP_NAME=Wayclip
16 changes: 15 additions & 1 deletion .github/workflows/dash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- selfhosting

jobs:
build-and-push:
Expand All @@ -20,6 +21,19 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get short SHA
id: vars
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV

- name: Determine tags
id: tags
run: |
if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then
echo "TAGS=wayclip/dash:latest" >> $GITHUB_ENV
elif [[ "${GITHUB_REF}" == "refs/heads/selfhosting" ]]; then
echo "TAGS=wayclip/dash:selfhosting-${SHORT_SHA}" >> $GITHUB_ENV
fi

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand All @@ -32,5 +46,5 @@ jobs:
context: .
file: ./Dockerfile
push: true
tags: wayclip/dash:latest
platforms: linux/amd64,linux/arm64
tags: ${{ env.TAGS }}
11 changes: 3 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
FROM oven/bun:1-slim AS builder
WORKDIR /app

COPY package.json bun.lock ./
COPY next.config.ts components.json eslint.config.mjs postcss.config.mjs tsconfig.json ./

RUN bun install --immutable
COPY package.json bun.lock* ./
RUN bun install --frozen-lockfile

COPY . .

Expand All @@ -16,11 +14,8 @@ WORKDIR /app
ENV NODE_ENV=production
ENV PORT=0330
ENV HOST=0.0.0.0

COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static

EXPOSE 3003

EXPOSE 0330
CMD ["node", "server.js"]
34 changes: 34 additions & 0 deletions app/api/config/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { NextResponse } from 'next/server';
import { getServerConfig } from '@/lib/config';

export interface Tier {
name: string;
max_storage_bytes: number;
stripe_price_id: string | null;
display_price: string;
display_frequency?: string;
description: string;
display_features: string[];
is_popular?: boolean;
}

export interface AppConfig {
apiUrl: string;
appName: string;
appDesc: string;
defaultAvatarUrl: string;
uploadLimitBytes: number;
paymentsEnabled: boolean;
activeTiers: Tier[];
discordAuthEnabled: boolean;
githubAuthEnabled: boolean;
googleAuthEnabled: boolean;
emailAuthEnabled: boolean;
footerLinks: Record<string, { text: string; href: string; external?: boolean }[]>;
navbarLinks: { text: string; href: string }[];
}

export async function GET() {
const config = getServerConfig();
return NextResponse.json(config);
}
Loading