0
0
Fork 0
mirror of https://git.verdigado.com/NB-Public/simple-wkd.git synced 2024-12-04 19:52:50 +01:00

Merge pull request 'umbau-auf-shell' (#1) from umbau-auf-shell into main

Reviewed-on: NB-Public/simple-wkd#1
This commit is contained in:
Willi Junga 2024-10-26 22:50:45 +02:00
commit e141e742b9
9 changed files with 3813 additions and 4657 deletions

View file

@ -1,11 +0,0 @@
*config.toml
Dockerfile
README.md
.github/workflows/*
backend/data/*
backend/logs/*
backend/target/*
website/README.md
website/dist/*
website/node_modules/*
website/.vscode/*

View file

@ -1,42 +0,0 @@
ARG base="alpine:3.18"
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM ${base} AS bin-builder
ARG TARGETPLATFORM
COPY --from=xx / /
# Enable cargo sparse index for faster update times, see: https://blog.rust-lang.org/inside-rust/2023/01/30/cargo-sparse-protocol.html
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN apk add clang lld musl-dev cargo
COPY backend .
RUN xx-cargo build --release --target-dir ./build && \
xx-verify ./build/$(xx-cargo --print-target-triple)/release/simple-wkd
RUN mv ./build/$(xx-cargo --print-target-triple)/release/simple-wkd simple-wkd-executable
FROM --platform=$BUILDPLATFORM ${base} AS webpage-builder
RUN apk add npm
COPY website .
RUN npm install -g pnpm && \
pnpm install && \
pnpm run build
COPY assets assets
# Move website in templates folder
RUN mv dist assets/webpage
FROM ${base}
WORKDIR /wkd
COPY entrypoint.sh entrypoint.sh
COPY --from=webpage-builder assets assets
COPY --from=bin-builder simple-wkd-executable wkd
RUN apk add --no-cache libgcc && \
adduser --no-create-home --disabled-password wkd && \
chown -R wkd:wkd /wkd
ENTRYPOINT [ "sh", "/wkd/entrypoint.sh" ]

15
build-debian.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/sh
apt install -y clang lld cargo
cp -R backend/* .
cargo build --release --target-dir ./build
mv ./build/release/simple-wkd simple-wkd-executable
apt install -y npm
cp -R website/* .
npm install -g pnpm && \
pnpm install && \
pnpm astro telemetry disable && \
pnpm run build
mv dist assets/webpage

View file

@ -1,17 +0,0 @@
version: '3'
services:
keyserver:
image: "delta1925/simple-wkd"
restart: always
ports:
- 8080:8080
environment:
- RUST_LOG=debug
volumes:
- ./config.toml:/wkd/config.toml
- wkd-data:/wkd/data
- wkd-logs:/wkd/logs
volumes:
wkd-data:
wkd-logs:

View file

@ -1,3 +0,0 @@
#!/bin/bash
chown -R wkd:wkd /wkd
su wkd -c /wkd/wkd

6
package-debian.sh Normal file
View file

@ -0,0 +1,6 @@
#!/bin/sh
cp -R assets /srv/wkd/assets
cp simple-wkd-executable /srv/wkd/wkd
cp wkd.service /etc/systemd/system/wkd.service
useradd --no-create-home wkd
chown -R wkd:wkd /srv/wkd

View file

@ -10,15 +10,15 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/tailwind": "^3.1.1",
"@tailwindcss/forms": "^0.5.3",
"astro": "^2.3.0",
"astro-critters": "^1.1.31",
"tailwindcss": "^3.0.24"
"@astrojs/tailwind": "^5.1.2",
"@tailwindcss/forms": "^0.5.9",
"astro": "^4.16.7",
"astro-critters": "^2.2.0",
"tailwindcss": "^3.4.14"
},
"devDependencies": {
"prettier": "^2.8.7",
"prettier-plugin-astro": "^0.8.0",
"prettier-plugin-tailwindcss": "^0.2.7"
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-tailwindcss": "^0.6.8"
}
}

File diff suppressed because it is too large Load diff

12
wkd.service Normal file
View file

@ -0,0 +1,12 @@
[Unit]
Description=WKD Service
After=network.target
[Service]
User=wkd
ExecStart=/srv/wkd/wkd
Restart=always
WorkingDirectory=/srv/wkd
[Install]
WantedBy=multi-user.target