Compare commits

...

4 Commits

Author SHA1 Message Date
a3b0d96c39
Убрал копирайтинг
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-29 22:44:14 +03:00
1d918a19d0
Исправление бага
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-29 21:50:21 +03:00
fe14e119f5
Настроил сборку drone
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-28 18:38:35 +03:00
18d2de7805
Настроил сборку drone
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-28 18:33:13 +03:00
8 changed files with 78 additions and 147 deletions

51
.drone.yml Normal file
View File

@ -0,0 +1,51 @@
---
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,39 +1,22 @@
version: "3.7" version: "3.7"
services: services:
# 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:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
# Prisma sqlite migration utility noteshare-migrate:
migrate: image: upagge/noteshare-migrations:latest
build:
context: ./server/prisma
dockerfile: Dockerfile
volumes: volumes:
- sqlite:/database/ - ./noteshare/database:/database/
environment: environment:
- DATABASE_URL=file:/database/db.sqlite - DATABASE_URL=file:/database/db.sqlite
# Backend server for managing saved notes # Backend server for managing saved notes
backend: noteshare-backend:
build: image: upagge/noteshare-backend:latest
context: ./server restart: always
dockerfile: Dockerfile hostname: noteshare-backend
container_name: noteshare-backend
volumes: volumes:
- sqlite:/database/ - ./noteshare/database:/database/
environment: environment:
- DATABASE_URL=file:/database/db.sqlite - DATABASE_URL=file:/database/db.sqlite
- FRONTEND_URL=http://localhost:5000 - FRONTEND_URL=http://localhost:5000
@ -48,45 +31,14 @@ services:
depends_on: depends_on:
migrate: migrate:
condition: service_completed_successfully 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 for serving encrypted notes over HTML (SvelteKit)
frontend: frontend:
build: image: upagge/noteshare-backend:latest
context: ./webapp restart: always
dockerfile: Dockerfile hostname: noteshare-backend
args: container_name: noteshare-backend
- VITE_SERVER_INTERNAL=http://backend:8080
- VITE_BRANDING=Noteshare.space [preview]
environment: environment:
- NODE_ENV=production - NODE_ENV=production
depends_on: depends_on:
- backend - noteshare-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,5 +1,4 @@
FROM node:16-alpine AS BUILD_IMAGE FROM node:16 AS BUILD_IMAGE
# install dependencies # install dependencies
WORKDIR /app WORKDIR /app
@ -16,7 +15,7 @@ RUN npm run build
# remove development dependencies # remove development dependencies
RUN npm prune --production RUN npm prune --production
FROM node:16-alpine FROM node:16
WORKDIR /app WORKDIR /app
COPY --from=0 /app . COPY --from=0 /app .

View File

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

View File

@ -24,16 +24,6 @@
} }
}; };
</script> </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> </head>
<body class="h-full"> <body class="h-full">
<div class="h-full bg-white dark:dark:bg-background-dark">%sveltekit.body%</div> <div class="h-full bg-white dark:dark:bg-background-dark">%sveltekit.body%</div>

View File

@ -1,29 +1,5 @@
<hr class="border-zinc-200 dark:border-zinc-700 transition-colors" />
<footer <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" 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> </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" 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"> <div id="navbar-left" class="flex gap-4">
<a href="/" class="self-center h-full pb-0.5"> <a href="https://mark.struchkov.dev" class="self-center h-full pb-0.5">
<span id="name" class="self-center font-bold text-xl md:text-lg dark:text-white" <span id="name" class="self-center font-bold text-xl md:text-lg dark:text-white"
>📝 {import.meta.env.VITE_BRANDING}</span >📝 {import.meta.env.VITE_BRANDING}</span
> >

View File

@ -29,42 +29,7 @@
</script> </script>
<svelte:head> <svelte:head>
<title>{import.meta.env.VITE_BRANDING} — Securely share your Obsidian notes with one click.</title <title>{import.meta.env.VITE_BRANDING}</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> </svelte:head>
<div class=" h-full {dark !== undefined ? '' : 'hidden'} {dark ? darkTheme : ''}"> <div class=" h-full {dark !== undefined ? '' : 'hidden'} {dark ? darkTheme : ''}">
@ -72,16 +37,14 @@
<div class="z-50 sticky top-0 w-full bg-white dark:bg-background-dark transition-colors"> <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"> <div class="top-0 left-0 right-0">
<NavBar> <NavBar>
<svelte:fragment slot="left"> <!-- <svelte:fragment slot="left">-->
<NavBarLink href="/about">About</NavBarLink> <!-- <NavBarLink href="https://struchkov.dev/blog">B.log</NavBarLink>-->
<NavBarLink href="/install">Get plugin</NavBarLink> <!-- </svelte:fragment>-->
<NavBarLink href="/contact">Contact</NavBarLink>
</svelte:fragment>
<svelte:fragment slot="right"> <svelte:fragment slot="right">
<NavBarLink href="https://obsidian.md" <NavBarLink href="https://struchkov.dev/blog"
><span class="text-[#705dcf] font-bold">Get Obsidian</span></NavBarLink ><span class="text-[#2c678d] font-bold">Blog</span></NavBarLink
> >
<NavBarLink href="https://github.com/mcndt/noteshare.space"> <NavBarLink href="https://github.com/uPagge">
<span class="flex gap-2 items-center justify-center"> <span class="flex gap-2 items-center justify-center">
<span class="text-black dark:text-zinc-200 md:hidden whitespace-nowrap">GitHub</span <span class="text-black dark:text-zinc-200 md:hidden whitespace-nowrap">GitHub</span
> >