Compare commits

..

No commits in common. "drone" and "master" have entirely different histories.

8 changed files with 148 additions and 79 deletions

View File

@ -1,51 +0,0 @@
---
kind: pipeline
type: docker
name: build
steps:
- name: build and push noteshare
image: upagge/docker-buildx:latest
environment:
DOCKER_REGISTRY_TOKEN:
from_secret: DOCKER_REGISTRY_TOKEN
volumes:
- name: dockersock
path: /var/run
commands:
- sleep 10
- echo "$DOCKER_REGISTRY_TOKEN" | docker login docker.io --username upagge --password-stdin
- cd server/prisma
- docker build -t upagge/noteshare-migrations:latest .
- cd ..
- docker build -t upagge/noteshare-backend:latest .
- cd ../webapp
- docker build -t upagge/noteshare-frontend:latest .
- docker push upagge/noteshare-migrations:latest
- docker push upagge/noteshare-backend:latest
- docker push upagge/noteshare-frontend:latest
trigger:
branch:
- drone
services:
- name: docker
image: docker:20.10.22-dind-alpine3.17
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: dockersock
temp: {}
- name: node_modules
host:
path: /drone/volume/node_modules/mkdocs-material
---
kind: signature
hmac: 2bf36a2b13ddb6afa004f1d98cadafaa7fd4a234e65875bfdf0fce96d933d075
...

View File

@ -1,22 +1,39 @@
version: "3.7"
services:
noteshare-migrate:
image: upagge/noteshare-migrations:latest
# Reverse proxy
traefik:
image: "traefik:v2.8"
command:
- "--api.insecure=true" # allows accessing a Traefik dashboard, disable in production
- "--providers.docker=true" # enables the Docker configuration discovery
- "--providers.docker.exposedbydefault=false" # do not expose Docker services by default
- "--entrypoints.web.address=:5000" # create an entrypoint called web, listening on :5000
- "--entrypoints.admin.address=:3333" # create an entrypoint called web, listening on :5000
ports:
- "5000:5000"
- "3333:3333"
- "8765:8080"
volumes:
- ./noteshare/database:/database/
- "/var/run/docker.sock:/var/run/docker.sock:ro"
# Prisma sqlite migration utility
migrate:
build:
context: ./server/prisma
dockerfile: Dockerfile
volumes:
- sqlite:/database/
environment:
- DATABASE_URL=file:/database/db.sqlite
# Backend server for managing saved notes
noteshare-backend:
image: upagge/noteshare-backend:latest
restart: always
hostname: noteshare-backend
container_name: noteshare-backend
backend:
build:
context: ./server
dockerfile: Dockerfile
volumes:
- ./noteshare/database:/database/
- sqlite:/database/
environment:
- DATABASE_URL=file:/database/db.sqlite
- FRONTEND_URL=http://localhost:5000
@ -31,14 +48,45 @@ services:
depends_on:
migrate:
condition: service_completed_successfully
restart: unless-stopped
labels:
- "traefik.enable=true" # tell Traefik this is something we would like to expose
- "traefik.http.routers.backend.entrypoints=web" # what entrypoint should be used for the backend service.
- "traefik.http.routers.backend.rule=Host(`localhost`) && PathPrefix(`/api`) && (Method(`POST`) || Method(`DELETE`))" #
# Frontend for serving encrypted notes over HTML (SvelteKit)
frontend:
image: upagge/noteshare-backend:latest
restart: always
hostname: noteshare-backend
container_name: noteshare-backend
build:
context: ./webapp
dockerfile: Dockerfile
args:
- VITE_SERVER_INTERNAL=http://backend:8080
- VITE_BRANDING=Noteshare.space [preview]
environment:
- NODE_ENV=production
depends_on:
- noteshare-backend
- backend
restart: unless-stopped
labels:
- "traefik.enable=true" # tell Traefik this is something we would like to expose
- "traefik.http.routers.frontend.entrypoints=web" # what entrypoint should be used for the frontend service.
- "traefik.http.routers.frontend.rule=Host(`localhost`)" #
# grafana dashboard
grafana:
image: grafana/grafana:9.1.0
restart: unless-stopped
volumes:
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
- grafana-data:/var/lib/grafana
- sqlite:/database/
environment:
- GF_INSTALL_PLUGINS=frser-sqlite-datasource
labels:
- "traefik.enable=true" # tell Traefik this is something we would like to expose
- "traefik.http.routers.grafana.entrypoints=admin" # what entrypoint should be used for the frontend service.
- "traefik.http.routers.grafana.rule=Host(`localhost`)" #
volumes:
sqlite:
grafana-data:

View File

@ -1,4 +1,5 @@
FROM node:16 AS BUILD_IMAGE
FROM node:16-alpine AS BUILD_IMAGE
# install dependencies
WORKDIR /app
@ -15,7 +16,7 @@ RUN npm run build
# remove development dependencies
RUN npm prune --production
FROM node:16
FROM node:16-alpine
WORKDIR /app
COPY --from=0 /app .

View File

@ -1,7 +1,7 @@
FROM node:16-alpine AS BUILD_IMAGE
ARG VITE_SERVER_INTERNAL=http://noteshare-backend:8080
ARG VITE_BRANDING=Struchkov.Note
ARG VITE_SERVER_INTERNAL $VITE_SERVER_INTERNAL
ARG VITE_BRANDING $VITE_BRANDING
# install dependencies
WORKDIR /app

View File

@ -24,6 +24,16 @@
}
};
</script>
<!-- Privacy-friendly analytics for the production environment of Noteshare.space.
Please remove this if you are hosting yourself! -->
<script
async
defer
data-website-id="b2982b6e-7cd3-4ffd-b698-105bb33bd811"
src="https://umami.mcndt.dev/umami.js"
data-host-url="http://umami.mcndt.dev"
></script>
</head>
<body class="h-full">
<div class="h-full bg-white dark:dark:bg-background-dark">%sveltekit.body%</div>

View File

@ -1,5 +1,29 @@
<hr class="border-zinc-200 dark:border-zinc-700 transition-colors" />
<footer
class="px-3 py-6 md:p-8 text-center flex flex-wrap justify-center items-center gap-x-2 gap-y-1.5 text-zinc-500 dark:text-zinc-400"
>
<span>
Built with love by <a class="underline" href="https://mcndt.dev" alt="blog">mcndt</a>
</span>
<span>-</span>
<a class="underline" href="/about">About</a>
<span>-</span>
<a class="underline" href="/changelog">Changelog</a>
<span>-</span>
<a class="underline" href="/roadmap">Roadmap</a>
<span>-</span>
<a class="underline" href="/contact">Contact</a>
<span>-</span>
<a class="underline" href="https://discord.gg/y3HqyGeABK">Discord</a>
<span>-</span>
<a
class="underline"
href="https://github.com/mcndt/noteshare.space/issues/new?assignees=&labels=&template=bug_report.md&title=%5BBug%5D"
>🐛 Report bug</a
>
<span>-</span>
<a class="underline" href="/funding">Expenses & funding</a>
<span>-</span>
<a class="underline" href="https://www.buymeacoffee.com/mcndt">☕ Buy me a coffee</a>
</footer>

View File

@ -27,7 +27,7 @@
class="h-full px-4 6xl:px-0 max-w-6xl mx-auto flex items-center justify-between content-center whitespace-nowrap"
>
<div id="navbar-left" class="flex gap-4">
<a href="https://mark.struchkov.dev" class="self-center h-full pb-0.5">
<a href="/" class="self-center h-full pb-0.5">
<span id="name" class="self-center font-bold text-xl md:text-lg dark:text-white"
>📝 {import.meta.env.VITE_BRANDING}</span
>

View File

@ -29,7 +29,42 @@
</script>
<svelte:head>
<title>{import.meta.env.VITE_BRANDING}</title>
<title>{import.meta.env.VITE_BRANDING} — Securely share your Obsidian notes with one click.</title
>
<meta
name="title"
content="Noteshare.space — Securely share your Obsidian notes with one click."
/>
<meta
name="description"
content="Securely share your Obsidian notes with one click. Zero configuration. End-to-end encrypted. No account needed. Completely open source! Download the QuickShare extension in the Obsidian community plugin marketplace."
/>
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:url" content="https://noteshare.space/" />
<meta
property="og:title"
content="Noteshare.space — Securely share your Obsidian notes with one click."
/>
<meta
property="og:description"
content="Securely share your Obsidian notes with one click. Zero configuration. End-to-end encrypted. No account needed. Completely open source! Download the QuickShare extension in the Obsidian community plugin marketplace."
/>
<meta property="og:image" content="https://noteshare.space/meta.png" />
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://noteshare.space/" />
<meta
property="twitter:title"
content="Noteshare.space — Securely share your Obsidian notes with one click."
/>
<meta
property="twitter:description"
content="Securely share your Obsidian notes with one click. Zero configuration. End-to-end encrypted. No account needed. Completely open source! Download the QuickShare extension in the Obsidian community plugin marketplace."
/>
<meta property="twitter:image" content="https://noteshare.space/meta.png" />
</svelte:head>
<div class=" h-full {dark !== undefined ? '' : 'hidden'} {dark ? darkTheme : ''}">
@ -37,14 +72,16 @@
<div class="z-50 sticky top-0 w-full bg-white dark:bg-background-dark transition-colors">
<div class="top-0 left-0 right-0">
<NavBar>
<!-- <svelte:fragment slot="left">-->
<!-- <NavBarLink href="https://struchkov.dev/blog">B.log</NavBarLink>-->
<!-- </svelte:fragment>-->
<svelte:fragment slot="left">
<NavBarLink href="/about">About</NavBarLink>
<NavBarLink href="/install">Get plugin</NavBarLink>
<NavBarLink href="/contact">Contact</NavBarLink>
</svelte:fragment>
<svelte:fragment slot="right">
<NavBarLink href="https://struchkov.dev/blog"
><span class="text-[#2c678d] font-bold">Blog</span></NavBarLink
<NavBarLink href="https://obsidian.md"
><span class="text-[#705dcf] font-bold">Get Obsidian</span></NavBarLink
>
<NavBarLink href="https://github.com/uPagge">
<NavBarLink href="https://github.com/mcndt/noteshare.space">
<span class="flex gap-2 items-center justify-center">
<span class="text-black dark:text-zinc-200 md:hidden whitespace-nowrap">GitHub</span
>