feat(virtualcam): add Google OAuth, enable Shkeeper payments, update Caddy rules
- Update virtualcam website and API to latest repository revisions. - Add Google OAuth client ID and secrets decryption for Google auth. - Enable Shkeeper BTC/USD payment processing (`BYPASS_PAYMENTS=false`) and add service dependencies. - Update Caddy `admin_gate` IP access rules and remove redundant `admin_gate` import from app proxy. - Configure weekly automatic Nix garbage collection (`--delete-older-than 14d`) and nix store optimization.
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
unstablePkgs,
|
||||
...
|
||||
}: let
|
||||
rev = "3b45cc1233f11a40a756b371c9e2813c78a1ca82";
|
||||
apiRev = "a73f4c4be840444072b0a7f5458438a34b470ea9";
|
||||
rev = "6e351ddc732421eb775eb9843ccd2389d6525edd";
|
||||
apiRev = "390878d126185b21a14479f85c70134a155c61c6";
|
||||
|
||||
# Private repositories are fetched over SSH (port 2222). nix-daemon runs as
|
||||
# root and uses /root/.ssh (identity materialized by the git-ssh-key unit),
|
||||
@@ -31,7 +31,7 @@
|
||||
pname = "virtualcam-website";
|
||||
version = "0.1.0";
|
||||
src = srcPatched;
|
||||
npmDepsHash = "sha256-0g98Jh/RwoicjrfiSbfqNo331k3ab8hINjV6dHHN0y4=";
|
||||
npmDepsHash = "sha256-GodWQKtOtsLOjjiwzxun+wTPhtvjR2uCV91n+wiZHw4=";
|
||||
nodejs = unstablePkgs.nodejs;
|
||||
|
||||
buildPhase = ''
|
||||
@@ -50,6 +50,7 @@
|
||||
'';
|
||||
|
||||
APP_URL = "https://virtualcam.severijnse.eu";
|
||||
GOOGLE_CLIENT_ID = "754775011707-c699m092tv3icmovhk5qa106v3q6eh7c.apps.googleusercontent.com";
|
||||
# Only used to satisfy prisma generate / next build metadata resolution.
|
||||
DATABASE_URL = "postgresql://virtualcam@localhost/virtualcam?host=/run/postgresql&schema=public";
|
||||
# Use the nixpkgs-bundled Prisma engine so the sandboxed offline build does
|
||||
@@ -94,7 +95,7 @@
|
||||
chmod 0600 "${envFile}"
|
||||
${pkgs.sops}/bin/sops --decrypt --input-type yaml --output-type yaml ${secretsFile} |
|
||||
${pkgs.gnused}/bin/sed -nE \
|
||||
's/^virtualcam_license_signing_key: (.*)/LICENSE_SIGNING_KEY=\1/p; s/^virtualcam_admin_token: (.*)/ADMIN_TOKEN=\1/p; s/^virtualcam_smtp_pass: (.*)/SMTP_PASS=\1/p' \
|
||||
's/^virtualcam_license_signing_key: (.*)/LICENSE_SIGNING_KEY=\1/p; s/^virtualcam_admin_token: (.*)/ADMIN_TOKEN=\1/p; s/^virtualcam_smtp_pass: (.*)/SMTP_PASS=\1/p; s/^virtualcam_google_OAuth_secret: (.*)/GOOGLE_CLIENT_SECRET=\1/p; s/^shkeeper_api_key: (.*)/SHKEEPER_API_KEY=\1/p' \
|
||||
>> "${envFile}"
|
||||
'';
|
||||
|
||||
@@ -220,8 +221,8 @@ in {
|
||||
|
||||
virtualcam = {
|
||||
description = "Virtualcamera website (Next.js)";
|
||||
after = ["postgresql.service" "virtualcam-migrate.service" "virtualcam-seed.service" "virtualcam-secrets.service"];
|
||||
requires = ["postgresql.service" "virtualcam-migrate.service" "virtualcam-seed.service" "virtualcam-secrets.service"];
|
||||
after = ["postgresql.service" "podman-shkeeper.service" "virtualcam-migrate.service" "virtualcam-seed.service" "virtualcam-secrets.service"];
|
||||
requires = ["postgresql.service" "podman-shkeeper.service" "virtualcam-migrate.service" "virtualcam-seed.service" "virtualcam-secrets.service"];
|
||||
wantedBy = ["multi-user.target"];
|
||||
path = [unstablePkgs.nodejs];
|
||||
serviceConfig = {
|
||||
@@ -237,8 +238,12 @@ in {
|
||||
Environment = [
|
||||
"DATABASE_URL=${dbUrl}"
|
||||
"APP_URL=https://virtualcam.severijnse.eu"
|
||||
"GOOGLE_CLIENT_ID=754775011707-c699m092tv3icmovhk5qa106v3q6eh7c.apps.googleusercontent.com"
|
||||
"PAYMENTS_MODE=shkeeper"
|
||||
"BYPASS_PAYMENTS=true"
|
||||
"BYPASS_PAYMENTS=false"
|
||||
"SHKEEPER_URL=https://pay.severijnse.eu"
|
||||
"SHKEEPER_CRYPTO=BTC"
|
||||
"SHKEEPER_FIAT=USD"
|
||||
"ADMIN_EMAILS=jory@severijnse.eu"
|
||||
"SMTP_HOST=mail.severijnse.eu"
|
||||
"SMTP_PORT=587"
|
||||
@@ -253,8 +258,8 @@ in {
|
||||
|
||||
virtualcam-api = {
|
||||
description = "Virtualcamera license API (Go/Fiber)";
|
||||
after = ["postgresql.service" "virtualcam-migrate.service" "virtualcam-secrets.service"];
|
||||
requires = ["postgresql.service" "virtualcam-migrate.service" "virtualcam-secrets.service"];
|
||||
after = ["postgresql.service" "podman-shkeeper.service" "virtualcam-migrate.service" "virtualcam-secrets.service"];
|
||||
requires = ["postgresql.service" "podman-shkeeper.service" "virtualcam-migrate.service" "virtualcam-secrets.service"];
|
||||
wantedBy = ["multi-user.target"];
|
||||
serviceConfig = {
|
||||
User = "virtualcam";
|
||||
|
||||
Reference in New Issue
Block a user