Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New updates detected with Cruft #917

Closed
wants to merge 1 commit into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"template": "https://github.com/dyne/starters",
"checkout": "main",
"commit": "81ce066c443209cefebaea185d1a4ce0c36c9f75",
"checkout": null,
"commit": "27524c1406134c804df20bfc7c4b6d73dc16278a",
"context": {
"cookiecutter": {
"project_name": "signroom",
"project_description": "Advanced electronic signature service based on Zenroom",
"full_name": "Puria Nafisi Azizi",
"email": "puria@dyne.org",
"author_full_name": "Luther Hacker",
"author_email": "luther@dyne.org",
"project_slug": "signroom",
"repo": "https://github.com/forkbombeu/signroom",
"_copy_without_render": [
Expand Down
11 changes: 11 additions & 0 deletions .gitmodules.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff a/.gitmodules b/.gitmodules (rejected hunks)
@@ -1,9 +1,6 @@
[submodule "admin/zencode/zenflows-crypto"]
path = admin/zencode/zenflows-crypto
url = https://github.com/interfacerproject/zenflows-crypto
-[submodule "webapp/zenflows-crypto"]
- path = webapp/zenflows-crypto
- url = https://github.com/interfacerproject/zenflows-crypto
[submodule "webapp/client_zencode"]
path = webapp/client_zencode
url = https://github.com/ForkbombEu/client_zencode
57 changes: 7 additions & 50 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ PB = $(ADMIN)/pb
DATA = $(ADMIN)/pb_data

WEBAPP = $(ROOT_DIR)/webapp
WZC = $(WEBAPP)/zenflows-crypto
WCZ = $(WEBAPP)/client_zencode

BIN = $(ROOT_DIR)/.bin
ZENROOM = $(BIN)/zenroom
ZENCODE = $(BIN)/zencode-exec
SLANGROOM = $(BIN)/slangroom-exec

export PATH := $(BIN):$(PATH)

Expand All @@ -33,53 +31,16 @@ DEPS = pnpm git wget go npx
K := $(foreach exec,$(DEPS),\
$(if $(shell which $(exec)),some string,$(error "🥶 `$(exec)` not found in PATH please install it")))

# - Operating system detection - #

ifneq ($(OS),Windows_NT)
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)
ifeq ($(UNAME_S),Linux)
OSFLAG := LINUX
ZENROOM_URL = https://github.com/dyne/zenroom/releases/latest/download/zenroom
ZENCODE_URL = https://github.com/dyne/zenroom/releases/latest/download/zencode-exec
endif
ifeq ($(UNAME_S),Darwin)
ifeq ($(UNAME_M),arm64)
OSFLAG := arm64
else
OSFLAG := OSX
ZENROOM_URL = https://github.com/dyne/zenroom/releases/latest/download/zenroom.command
ZENCODE_URL = https://github.com/dyne/zenroom/releases/latest/download/zencode-exec.command
endif
endif
endif

# - Setup: Zenroom - #
# - Setup: SLANGROOM - #

$(BIN):
@mkdir $(BIN)

ifneq ($(OSFLAG),arm64)

$(ZENROOM): | $(BIN)
@wget -q -O $@ $(ZENROOM_URL)
@chmod +x $@
@echo "zenroom 😎 installed"

$(ZENCODE): | $(BIN)
@wget -q -O $@ $(ZENCODE_URL)
@chmod +x $@
@echo "zencode-exec 🤭 installed"

else

$(ZENROOM):
@echo "For usage on Apple ARM processors, please compile [zenroom] manually"

$(ZENCODE):
@echo "For usage on Apple ARM processors, please compile [zencode-exec] manually"

endif
$(SLANGROOM): | $(BIN)
@wget https://github.com/dyne/slangroom-exec/releases/latest/download/slangroom-exec-$(shell uname)-$(shell uname -m) -O $(SLANGROOM)
@chmod +x $(SLANGROOM)
@@echo "slangroom-exec 😎 installed"

# - Setup: GIT - #

Expand All @@ -106,10 +67,6 @@ $(AZC): .git
@rm -rf $@
@cd $(ADMIN) && git submodule --quiet add -f https://github.com/interfacerproject/zenflows-crypto zencode/zenflows-crypto && git submodule update --remote --init

$(WZC): .git
@rm -rf $@
@cd $(WEBAPP) && git submodule --quiet add -f https://github.com/interfacerproject/zenflows-crypto zenflows-crypto && git submodule update --remote --init

$(WCZ): .git
@rm -rf $@
@cd $(WEBAPP) && git submodule --quiet add -f https://github.com/ForkbombEu/client_zencode client_zencode && git submodule update --remote --init
Expand All @@ -130,7 +87,7 @@ setup_frontend: $(WEBAPP)/.env
@echo "📦 Setup the frontend"
cd $(WEBAPP) && pnpm i

setup: $(AZC) $(WZC) $(WCZ) $(ZENROOM) $(ZENCODE) $(PB) setup_frontend ## 📦 Setup the project
setup: $(AZC) $(WCZ) $(SLANGROOM) $(ZENCODE) $(PB) setup_frontend ## 📦 Setup the project

# - Running - #

Expand Down
23 changes: 23 additions & 0 deletions Makefile.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff a/Makefile b/Makefile (rejected hunks)
@@ -159,17 +116,15 @@ doc: ## 📚 Serve documentation on localhost
npx -p docsify-cli docsify serve ./docs

definitions: ## ⚙️ Generate type definitions and schema
- cd webapp && pnpm definitions
+ cd webapp && pnpm generate:definitions

# - Cleaning - #

clean: ## 🧹 Clean the project
- @rm -rf $(AZC) $(WZC) $(WCZ) $(BIN) $(PB)
+ @rm -rf $(AZC) $(WCZ) $(BIN) $(PB)
@rm -fr webapp/node_modules
- @rm -f webapp/src/lib/pocketbase/types.ts
- @rm -f webapp/src/lib/pocketbase/schema/db_schema.json
- @rm -f webapp/src/lib/rbac/roles.ts
- @rm -f webapp/src/lib/features/list.ts
+ @rm -fr webapp/.svelte-kit
+ @find . -type f -name "*.generated.*" -delete
@echo "The project is ✨ cleaned"

purge: ## ⛔ Purge the database
5 changes: 3 additions & 2 deletions admin/go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module pb

go 1.21
go 1.22

toolchain go1.22.0
toolchain go1.23.2

require (
github.com/dyne/Zenroom/bindings/golang/zenroom v0.0.0-20240527092907-44ad880421d5
github.com/dyne/slangroom-exec/bindings/go v0.0.0-20241017085658-fb538b02efa3
github.com/go-webauthn/webauthn v0.10.2
github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61
github.com/pocketbase/dbx v1.10.1
Expand Down
2 changes: 2 additions & 0 deletions admin/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/dyne/Zenroom/bindings/golang/zenroom v0.0.0-20240527092907-44ad880421d5 h1:J5cDSHZvSfDIOfTplVZPRmGmrBU/fwNRUQdeKhH30dI=
github.com/dyne/Zenroom/bindings/golang/zenroom v0.0.0-20240527092907-44ad880421d5/go.mod h1:ysQV5vx0OYClaDG0gK2yH/m2h4iGy+0ow+7nVdGXago=
github.com/dyne/slangroom-exec/bindings/go v0.0.0-20241017085658-fb538b02efa3 h1:NpCugAf9qm8A8X1qle9+jYlamF6ATGDrsMzWfDOuGW0=
github.com/dyne/slangroom-exec/bindings/go v0.0.0-20241017085658-fb538b02efa3/go.mod h1:OXlCZWI8XQ8suaNik1N6xmjoH0P6fJ9MH9AK1hxw/sw=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
Expand Down
4 changes: 0 additions & 4 deletions admin/pb_hooks/ambient.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// SPDX-FileCopyrightText: 2024 The Forkbomb Company
//
// SPDX-License-Identifier: AGPL-3.0-or-later

/// <reference path="../pb_data/types.d.ts" />

interface RecordModel<R extends Record<string, unknown>> extends models.Record {
Expand Down
18 changes: 16 additions & 2 deletions admin/pb_hooks/organizations_authorizations.pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
/// <reference path="../pb_data/types.d.ts" />
/** @typedef {import('./utils.js')} Utils */
/** @typedef {import('./auditLogger.js')} AuditLogger */
/** @typedef {import("../../webapp/src/lib/pocketbase/types.js").OrgAuthorizationsRecord} OrgAuthorization */
/** @typedef {import("../../webapp/src/lib/pocketbase/types.js").OrgRolesResponse} OrgRole */
/** @typedef {import("../../webapp/src/modules/pocketbase/types").OrgAuthorizationsRecord} OrgAuthorization */
/** @typedef {import("../../webapp/src/modules/pocketbase/types").OrgRolesResponse} OrgRole */

/**
* INDEX
Expand Down Expand Up @@ -50,6 +50,20 @@ onRecordBeforeCreateRequest((e) => {
}
}, "orgAuthorizations");

// [UPDATE] Removing fields not needed

onRecordBeforeUpdateRequest((e) => {
/** @type {Utils} */
const utils = require(`${__hooks}/utils.js`);

const originalCopy = e.record?.originalCopy();
if (!e.record || !originalCopy)
throw utils.createMissingDataError("orgAuth");

e.record.set("user", originalCopy.get("user"));
e.record.set("organization", originalCopy.get("organization"));
}, "orgAuthorizations");

// [UPDATE] Cannot update to/from a role higher than the user

onRecordBeforeUpdateRequest((e) => {
Expand Down
4 changes: 0 additions & 4 deletions admin/pb_hooks/organizations_invites.pb.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// SPDX-FileCopyrightText: 2024 The Forkbomb Company
//
// SPDX-License-Identifier: AGPL-3.0-or-later

// @ts-check

/// <reference path="../pb_data/types.d.ts" />
Expand Down
4 changes: 0 additions & 4 deletions admin/pb_hooks/organizations_request_membership.pb.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// SPDX-FileCopyrightText: 2024 The Forkbomb Company
//
// SPDX-License-Identifier: AGPL-3.0-or-later

// @ts-check

/// <reference path="../pb_data/types.d.ts" />
Expand Down
10 changes: 3 additions & 7 deletions admin/pb_hooks/utils.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
// SPDX-FileCopyrightText: 2024 The Forkbomb Company
//
// SPDX-License-Identifier: AGPL-3.0-or-later

// @ts-check

/// <reference path="../pb_data/types.d.ts" />
/// <reference path="./ambient.d.ts" />
/** @typedef {import("../../webapp/src/lib/pocketbase/types").OrgRolesRecord} OrgRole */
/** @typedef {import("../../webapp/src/lib/pocketbase/types").OrgAuthorizationsRecord} OrgAuthorization */
/** @typedef {import("../../webapp/src/lib/pocketbase/types").UsersRecord} User */
/** @typedef {import("../../webapp/src/modules/pocketbase/types").OrgRolesRecord} OrgRole */
/** @typedef {import("../../webapp/src/modules/pocketbase/types").OrgAuthorizationsRecord} OrgAuthorization */
/** @typedef {import("../../webapp/src/modules/pocketbase/types").UsersRecord} User */

/** @typedef {Omit<mail.Address, "string">} Address */

Expand Down
Loading