@striae-org/striae 5.2.1 → 5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +2 -10
- package/README.md +5 -46
- package/app/components/actions/case-export/core-export.ts +5 -174
- package/app/components/actions/case-export/download-handlers.ts +84 -751
- package/app/components/actions/case-export/index.ts +6 -30
- package/app/components/actions/case-export/metadata-helpers.ts +0 -78
- package/app/components/actions/case-export/types-constants.ts +0 -43
- package/app/components/actions/case-import/confirmation-import.ts +75 -36
- package/app/components/actions/case-import/confirmation-package.ts +68 -1
- package/app/components/actions/case-import/index.ts +1 -1
- package/app/components/actions/case-import/orchestrator.ts +78 -53
- package/app/components/actions/case-import/zip-processing.ts +160 -330
- package/app/components/actions/generate-pdf.ts +3 -2
- package/app/components/audit/user-audit-viewer.tsx +0 -19
- package/app/components/audit/viewer/audit-viewer-header.tsx +0 -33
- package/app/components/navbar/case-modals/archive-case-modal.tsx +1 -1
- package/app/components/navbar/case-modals/export-case-modal.module.css +27 -0
- package/app/components/navbar/case-modals/export-case-modal.tsx +132 -0
- package/app/components/navbar/case-modals/export-confirmations-modal.module.css +24 -0
- package/app/components/navbar/case-modals/export-confirmations-modal.tsx +108 -0
- package/app/components/navbar/navbar.tsx +1 -1
- package/app/components/sidebar/case-import/case-import.module.css +35 -0
- package/app/components/sidebar/case-import/components/CasePreviewSection.tsx +51 -3
- package/app/components/sidebar/case-import/components/ConfirmationDialog.tsx +2 -4
- package/app/components/sidebar/case-import/components/ConfirmationPreviewSection.tsx +36 -5
- package/app/components/sidebar/case-import/hooks/useFilePreview.ts +5 -9
- package/app/components/sidebar/case-import/index.ts +1 -4
- package/app/components/sidebar/notes/class-details-shared.ts +2 -2
- package/app/components/toast/toast.module.css +36 -0
- package/app/components/toast/toast.tsx +6 -2
- package/app/components/user/manage-profile.tsx +4 -3
- package/app/config-example/config.json +1 -2
- package/app/root.tsx +0 -7
- package/app/routes/_index.tsx +1 -1
- package/app/routes/auth/login.example.tsx +22 -103
- package/app/routes/auth/login.tsx +22 -103
- package/app/routes/auth/route.ts +1 -1
- package/app/routes/striae/striae.tsx +117 -59
- package/app/services/firebase/index.ts +0 -3
- package/app/types/case.ts +1 -0
- package/app/types/export.ts +2 -2
- package/app/types/import.ts +10 -0
- package/app/utils/auth/index.ts +0 -1
- package/app/utils/data/permissions.ts +3 -2
- package/package.json +9 -16
- package/public/_headers +0 -4
- package/public/_routes.json +0 -1
- package/worker-configuration.d.ts +20 -17
- package/workers/audit-worker/src/audit-worker.example.ts +9 -806
- package/workers/audit-worker/src/config.ts +7 -0
- package/workers/audit-worker/src/crypto/data-at-rest.ts +410 -0
- package/workers/audit-worker/src/handlers/audit-routes.ts +125 -0
- package/workers/audit-worker/src/storage/audit-storage.ts +99 -0
- package/workers/audit-worker/src/types.ts +56 -0
- package/workers/audit-worker/worker-configuration.d.ts +1 -1
- package/workers/audit-worker/wrangler.jsonc.example +1 -1
- package/workers/data-worker/src/config.ts +11 -0
- package/workers/data-worker/src/data-worker.example.ts +21 -942
- package/workers/data-worker/src/handlers/decrypt-export.ts +118 -0
- package/workers/data-worker/src/handlers/signing.ts +174 -0
- package/workers/data-worker/src/handlers/storage-routes.ts +129 -0
- package/workers/data-worker/src/registry/key-registry.ts +368 -0
- package/workers/data-worker/src/types.ts +46 -0
- package/workers/data-worker/worker-configuration.d.ts +1 -1
- package/workers/data-worker/wrangler.jsonc.example +1 -1
- package/workers/image-worker/worker-configuration.d.ts +1 -1
- package/workers/image-worker/wrangler.jsonc.example +1 -1
- package/workers/pdf-worker/worker-configuration.d.ts +2 -3
- package/workers/pdf-worker/wrangler.jsonc.example +1 -1
- package/workers/user-worker/src/auth.ts +30 -0
- package/workers/user-worker/src/cleanup/account-deletion.ts +337 -0
- package/workers/user-worker/src/config.ts +4 -0
- package/workers/user-worker/src/encryption-utils.ts +25 -0
- package/workers/user-worker/src/firebase/admin.ts +152 -0
- package/workers/user-worker/src/handlers/user-routes.ts +242 -0
- package/workers/user-worker/src/registry/user-kv.ts +172 -0
- package/workers/user-worker/src/storage/user-records.ts +34 -0
- package/workers/user-worker/src/types.ts +106 -0
- package/workers/user-worker/src/user-worker.example.ts +18 -964
- package/workers/user-worker/worker-configuration.d.ts +4 -2
- package/workers/user-worker/wrangler.jsonc.example +12 -1
- package/wrangler.toml.example +1 -1
- package/app/components/actions/case-export/data-processing.ts +0 -223
- package/app/components/sidebar/case-export/case-export.module.css +0 -418
- package/app/components/sidebar/case-export/case-export.tsx +0 -310
- package/app/types/exceljs-bare.d.ts +0 -9
- package/app/utils/auth/auth.ts +0 -11
- package/public/.well-known/security.txt +0 -6
- package/public/favicon.ico +0 -0
- package/public/icon-256.png +0 -0
- package/public/icon-512.png +0 -0
- package/public/manifest.json +0 -39
- package/public/shortcut.png +0 -0
- package/public/social-image.png +0 -0
- package/public/vendor/exceljs.LICENSE +0 -22
- package/public/vendor/exceljs.bare.min.js +0 -45
- package/scripts/deploy-all.sh +0 -166
- package/scripts/deploy-config/modules/env-utils.sh +0 -322
- package/scripts/deploy-config/modules/keys.sh +0 -404
- package/scripts/deploy-config/modules/prompt.sh +0 -372
- package/scripts/deploy-config/modules/scaffolding.sh +0 -344
- package/scripts/deploy-config/modules/validation.sh +0 -365
- package/scripts/deploy-config.sh +0 -236
- package/scripts/deploy-pages-secrets.sh +0 -231
- package/scripts/deploy-pages.sh +0 -34
- package/scripts/deploy-primershear-emails.sh +0 -167
- package/scripts/deploy-worker-secrets.sh +0 -374
- package/scripts/dev.cjs +0 -23
- package/scripts/install-workers.sh +0 -88
- package/scripts/run-eslint.cjs +0 -43
- package/scripts/update-compatibility-dates.cjs +0 -124
- package/scripts/update-markdown-versions.cjs +0 -43
- package/workers/keys-worker/package.json +0 -18
- package/workers/keys-worker/src/keys.example.ts +0 -67
- package/workers/keys-worker/src/keys.ts +0 -67
- package/workers/keys-worker/worker-configuration.d.ts +0 -7447
- package/workers/keys-worker/wrangler.jsonc.example +0 -15
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
copy_example_configs() {
|
|
4
|
-
echo -e "\n${BLUE}📋 Copying example configuration files...${NC}"
|
|
5
|
-
|
|
6
|
-
# Copy app configuration files
|
|
7
|
-
echo -e "${YELLOW} Copying app configuration files...${NC}"
|
|
8
|
-
|
|
9
|
-
# Copy app config-example directory to config (always sync non-admin files)
|
|
10
|
-
if [ -d "app/config-example" ]; then
|
|
11
|
-
local admin_service_backup=""
|
|
12
|
-
local copied_config_files=0
|
|
13
|
-
local skipped_existing_files=0
|
|
14
|
-
|
|
15
|
-
if [ -f "app/config/admin-service.json" ]; then
|
|
16
|
-
admin_service_backup=$(mktemp)
|
|
17
|
-
cp "app/config/admin-service.json" "$admin_service_backup"
|
|
18
|
-
fi
|
|
19
|
-
|
|
20
|
-
if [ "$update_env" = "true" ]; then
|
|
21
|
-
rm -rf app/config
|
|
22
|
-
fi
|
|
23
|
-
|
|
24
|
-
mkdir -p app/config
|
|
25
|
-
|
|
26
|
-
while IFS= read -r source_file; do
|
|
27
|
-
local relative_path
|
|
28
|
-
local destination_file
|
|
29
|
-
relative_path="${source_file#app/config-example/}"
|
|
30
|
-
destination_file="app/config/$relative_path"
|
|
31
|
-
|
|
32
|
-
mkdir -p "$(dirname "$destination_file")"
|
|
33
|
-
|
|
34
|
-
if [ "$update_env" = "true" ] || [ ! -f "$destination_file" ]; then
|
|
35
|
-
cp "$source_file" "$destination_file"
|
|
36
|
-
copied_config_files=$((copied_config_files + 1))
|
|
37
|
-
else
|
|
38
|
-
skipped_existing_files=$((skipped_existing_files + 1))
|
|
39
|
-
fi
|
|
40
|
-
done < <(find app/config-example -type f ! -name "admin-service.json")
|
|
41
|
-
|
|
42
|
-
# Ensure example credentials are never copied from config-example.
|
|
43
|
-
rm -f app/config/admin-service.json
|
|
44
|
-
|
|
45
|
-
if [ -n "$admin_service_backup" ] && [ -f "$admin_service_backup" ]; then
|
|
46
|
-
cp "$admin_service_backup" "app/config/admin-service.json"
|
|
47
|
-
rm -f "$admin_service_backup"
|
|
48
|
-
echo -e "${GREEN} ✅ app: preserved existing admin-service.json${NC}"
|
|
49
|
-
else
|
|
50
|
-
echo -e "${YELLOW} ⚠️ app: skipped copying admin-service.json (provide your own credentials file)${NC}"
|
|
51
|
-
fi
|
|
52
|
-
|
|
53
|
-
if [ "$update_env" = "true" ]; then
|
|
54
|
-
echo -e "${GREEN} ✅ app: config directory reset from config-example (excluding admin-service.json)${NC}"
|
|
55
|
-
else
|
|
56
|
-
echo -e "${GREEN} ✅ app: synced missing files from config-example (excluding admin-service.json)${NC}"
|
|
57
|
-
fi
|
|
58
|
-
|
|
59
|
-
if [ "$skipped_existing_files" -gt 0 ]; then
|
|
60
|
-
echo -e "${YELLOW} ℹ️ app: kept $skipped_existing_files existing config file(s)${NC}"
|
|
61
|
-
fi
|
|
62
|
-
|
|
63
|
-
echo -e "${GREEN} ✅ app: copied $copied_config_files config file(s) from config-example${NC}"
|
|
64
|
-
fi
|
|
65
|
-
|
|
66
|
-
# Copy auth route template files
|
|
67
|
-
echo -e "${YELLOW} Copying auth route template files...${NC}"
|
|
68
|
-
|
|
69
|
-
if [ -f "app/routes/auth/login.example.tsx" ] && { [ "$update_env" = "true" ] || [ ! -f "app/routes/auth/login.tsx" ]; }; then
|
|
70
|
-
cp app/routes/auth/login.example.tsx app/routes/auth/login.tsx
|
|
71
|
-
echo -e "${GREEN} ✅ auth: login.tsx created from example${NC}"
|
|
72
|
-
elif [ -f "app/routes/auth/login.tsx" ]; then
|
|
73
|
-
echo -e "${YELLOW} ⚠️ auth: login.tsx already exists, skipping copy${NC}"
|
|
74
|
-
fi
|
|
75
|
-
|
|
76
|
-
if [ -f "app/routes/auth/login.module.example.css" ] && { [ "$update_env" = "true" ] || [ ! -f "app/routes/auth/login.module.css" ]; }; then
|
|
77
|
-
cp app/routes/auth/login.module.example.css app/routes/auth/login.module.css
|
|
78
|
-
echo -e "${GREEN} ✅ auth: login.module.css created from example${NC}"
|
|
79
|
-
elif [ -f "app/routes/auth/login.module.css" ]; then
|
|
80
|
-
echo -e "${YELLOW} ⚠️ auth: login.module.css already exists, skipping copy${NC}"
|
|
81
|
-
fi
|
|
82
|
-
|
|
83
|
-
# Navigate to each worker directory and copy the example file
|
|
84
|
-
echo -e "${YELLOW} Copying worker configuration files...${NC}"
|
|
85
|
-
|
|
86
|
-
cd workers/keys-worker
|
|
87
|
-
if [ -f "wrangler.jsonc.example" ] && { [ "$update_env" = "true" ] || [ ! -f "wrangler.jsonc" ]; }; then
|
|
88
|
-
cp wrangler.jsonc.example wrangler.jsonc
|
|
89
|
-
echo -e "${GREEN} ✅ keys-worker: wrangler.jsonc created from example${NC}"
|
|
90
|
-
elif [ -f "wrangler.jsonc" ]; then
|
|
91
|
-
echo -e "${YELLOW} ⚠️ keys-worker: wrangler.jsonc already exists, skipping copy${NC}"
|
|
92
|
-
fi
|
|
93
|
-
|
|
94
|
-
cd ../user-worker
|
|
95
|
-
if [ -f "wrangler.jsonc.example" ] && { [ "$update_env" = "true" ] || [ ! -f "wrangler.jsonc" ]; }; then
|
|
96
|
-
cp wrangler.jsonc.example wrangler.jsonc
|
|
97
|
-
echo -e "${GREEN} ✅ user-worker: wrangler.jsonc created from example${NC}"
|
|
98
|
-
elif [ -f "wrangler.jsonc" ]; then
|
|
99
|
-
echo -e "${YELLOW} ⚠️ user-worker: wrangler.jsonc already exists, skipping copy${NC}"
|
|
100
|
-
fi
|
|
101
|
-
|
|
102
|
-
cd ../data-worker
|
|
103
|
-
if [ -f "wrangler.jsonc.example" ] && { [ "$update_env" = "true" ] || [ ! -f "wrangler.jsonc" ]; }; then
|
|
104
|
-
cp wrangler.jsonc.example wrangler.jsonc
|
|
105
|
-
echo -e "${GREEN} ✅ data-worker: wrangler.jsonc created from example${NC}"
|
|
106
|
-
elif [ -f "wrangler.jsonc" ]; then
|
|
107
|
-
echo -e "${YELLOW} ⚠️ data-worker: wrangler.jsonc already exists, skipping copy${NC}"
|
|
108
|
-
fi
|
|
109
|
-
|
|
110
|
-
cd ../audit-worker
|
|
111
|
-
if [ -f "wrangler.jsonc.example" ] && { [ "$update_env" = "true" ] || [ ! -f "wrangler.jsonc" ]; }; then
|
|
112
|
-
cp wrangler.jsonc.example wrangler.jsonc
|
|
113
|
-
echo -e "${GREEN} ✅ audit-worker: wrangler.jsonc created from example${NC}"
|
|
114
|
-
elif [ -f "wrangler.jsonc" ]; then
|
|
115
|
-
echo -e "${YELLOW} ⚠️ audit-worker: wrangler.jsonc already exists, skipping copy${NC}"
|
|
116
|
-
fi
|
|
117
|
-
|
|
118
|
-
cd ../image-worker
|
|
119
|
-
if [ -f "wrangler.jsonc.example" ] && { [ "$update_env" = "true" ] || [ ! -f "wrangler.jsonc" ]; }; then
|
|
120
|
-
cp wrangler.jsonc.example wrangler.jsonc
|
|
121
|
-
echo -e "${GREEN} ✅ image-worker: wrangler.jsonc created from example${NC}"
|
|
122
|
-
elif [ -f "wrangler.jsonc" ]; then
|
|
123
|
-
echo -e "${YELLOW} ⚠️ image-worker: wrangler.jsonc already exists, skipping copy${NC}"
|
|
124
|
-
fi
|
|
125
|
-
|
|
126
|
-
cd ../pdf-worker
|
|
127
|
-
if [ -f "wrangler.jsonc.example" ] && { [ "$update_env" = "true" ] || [ ! -f "wrangler.jsonc" ]; }; then
|
|
128
|
-
cp wrangler.jsonc.example wrangler.jsonc
|
|
129
|
-
echo -e "${GREEN} ✅ pdf-worker: wrangler.jsonc created from example${NC}"
|
|
130
|
-
elif [ -f "wrangler.jsonc" ]; then
|
|
131
|
-
echo -e "${YELLOW} ⚠️ pdf-worker: wrangler.jsonc already exists, skipping copy${NC}"
|
|
132
|
-
fi
|
|
133
|
-
|
|
134
|
-
# Return to project root
|
|
135
|
-
cd ../..
|
|
136
|
-
|
|
137
|
-
# Copy worker source template files
|
|
138
|
-
echo -e "${YELLOW} Copying worker source template files...${NC}"
|
|
139
|
-
|
|
140
|
-
if [ -f "workers/keys-worker/src/keys.example.ts" ] && { [ "$update_env" = "true" ] || [ ! -f "workers/keys-worker/src/keys.ts" ]; }; then
|
|
141
|
-
cp workers/keys-worker/src/keys.example.ts workers/keys-worker/src/keys.ts
|
|
142
|
-
echo -e "${GREEN} ✅ keys-worker: keys.ts created from example${NC}"
|
|
143
|
-
elif [ -f "workers/keys-worker/src/keys.ts" ]; then
|
|
144
|
-
echo -e "${YELLOW} ⚠️ keys-worker: keys.ts already exists, skipping copy${NC}"
|
|
145
|
-
fi
|
|
146
|
-
|
|
147
|
-
if [ -f "workers/user-worker/src/user-worker.example.ts" ] && { [ "$update_env" = "true" ] || [ ! -f "workers/user-worker/src/user-worker.ts" ]; }; then
|
|
148
|
-
cp workers/user-worker/src/user-worker.example.ts workers/user-worker/src/user-worker.ts
|
|
149
|
-
echo -e "${GREEN} ✅ user-worker: user-worker.ts created from example${NC}"
|
|
150
|
-
elif [ -f "workers/user-worker/src/user-worker.ts" ]; then
|
|
151
|
-
echo -e "${YELLOW} ⚠️ user-worker: user-worker.ts already exists, skipping copy${NC}"
|
|
152
|
-
fi
|
|
153
|
-
|
|
154
|
-
if [ -f "workers/data-worker/src/data-worker.example.ts" ] && { [ "$update_env" = "true" ] || [ ! -f "workers/data-worker/src/data-worker.ts" ]; }; then
|
|
155
|
-
cp workers/data-worker/src/data-worker.example.ts workers/data-worker/src/data-worker.ts
|
|
156
|
-
echo -e "${GREEN} ✅ data-worker: data-worker.ts created from example${NC}"
|
|
157
|
-
elif [ -f "workers/data-worker/src/data-worker.ts" ]; then
|
|
158
|
-
echo -e "${YELLOW} ⚠️ data-worker: data-worker.ts already exists, skipping copy${NC}"
|
|
159
|
-
fi
|
|
160
|
-
|
|
161
|
-
if [ -f "workers/audit-worker/src/audit-worker.example.ts" ] && { [ "$update_env" = "true" ] || [ ! -f "workers/audit-worker/src/audit-worker.ts" ]; }; then
|
|
162
|
-
cp workers/audit-worker/src/audit-worker.example.ts workers/audit-worker/src/audit-worker.ts
|
|
163
|
-
echo -e "${GREEN} ✅ audit-worker: audit-worker.ts created from example${NC}"
|
|
164
|
-
elif [ -f "workers/audit-worker/src/audit-worker.ts" ]; then
|
|
165
|
-
echo -e "${YELLOW} ⚠️ audit-worker: audit-worker.ts already exists, skipping copy${NC}"
|
|
166
|
-
fi
|
|
167
|
-
|
|
168
|
-
if [ -f "workers/image-worker/src/image-worker.example.ts" ] && { [ "$update_env" = "true" ] || [ ! -f "workers/image-worker/src/image-worker.ts" ]; }; then
|
|
169
|
-
cp workers/image-worker/src/image-worker.example.ts workers/image-worker/src/image-worker.ts
|
|
170
|
-
echo -e "${GREEN} ✅ image-worker: image-worker.ts created from example${NC}"
|
|
171
|
-
elif [ -f "workers/image-worker/src/image-worker.ts" ]; then
|
|
172
|
-
echo -e "${YELLOW} ⚠️ image-worker: image-worker.ts already exists, skipping copy${NC}"
|
|
173
|
-
fi
|
|
174
|
-
|
|
175
|
-
if [ -f "workers/pdf-worker/src/pdf-worker.example.ts" ] && { [ "$update_env" = "true" ] || [ ! -f "workers/pdf-worker/src/pdf-worker.ts" ]; }; then
|
|
176
|
-
cp workers/pdf-worker/src/pdf-worker.example.ts workers/pdf-worker/src/pdf-worker.ts
|
|
177
|
-
echo -e "${GREEN} ✅ pdf-worker: pdf-worker.ts created from example${NC}"
|
|
178
|
-
elif [ -f "workers/pdf-worker/src/pdf-worker.ts" ]; then
|
|
179
|
-
echo -e "${YELLOW} ⚠️ pdf-worker: pdf-worker.ts already exists, skipping copy${NC}"
|
|
180
|
-
fi
|
|
181
|
-
|
|
182
|
-
# Copy main wrangler.toml from example
|
|
183
|
-
if [ -f "wrangler.toml.example" ] && { [ "$update_env" = "true" ] || [ ! -f "wrangler.toml" ]; }; then
|
|
184
|
-
cp wrangler.toml.example wrangler.toml
|
|
185
|
-
echo -e "${GREEN} ✅ root: wrangler.toml created from example${NC}"
|
|
186
|
-
elif [ -f "wrangler.toml" ]; then
|
|
187
|
-
echo -e "${YELLOW} ⚠️ root: wrangler.toml already exists, skipping copy${NC}"
|
|
188
|
-
fi
|
|
189
|
-
|
|
190
|
-
echo -e "${GREEN}✅ Configuration file copying completed${NC}"
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
update_wrangler_configs() {
|
|
194
|
-
echo -e "\n${BLUE}🔧 Updating wrangler configuration files...${NC}"
|
|
195
|
-
|
|
196
|
-
local normalized_account_id
|
|
197
|
-
local escaped_account_id
|
|
198
|
-
local normalized_pages_custom_domain
|
|
199
|
-
local escaped_pages_custom_domain
|
|
200
|
-
|
|
201
|
-
normalized_account_id=$(printf '%s' "$ACCOUNT_ID" | tr -d '\r' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
|
202
|
-
ACCOUNT_ID="$normalized_account_id"
|
|
203
|
-
export ACCOUNT_ID
|
|
204
|
-
write_env_var "ACCOUNT_ID" "$ACCOUNT_ID"
|
|
205
|
-
escaped_account_id=$(escape_for_sed_replacement "$ACCOUNT_ID")
|
|
206
|
-
|
|
207
|
-
normalized_pages_custom_domain=$(normalize_domain_value "$PAGES_CUSTOM_DOMAIN")
|
|
208
|
-
PAGES_CUSTOM_DOMAIN="$normalized_pages_custom_domain"
|
|
209
|
-
export PAGES_CUSTOM_DOMAIN
|
|
210
|
-
write_env_var "PAGES_CUSTOM_DOMAIN" "$PAGES_CUSTOM_DOMAIN"
|
|
211
|
-
escaped_pages_custom_domain=$(escape_for_sed_replacement "$PAGES_CUSTOM_DOMAIN")
|
|
212
|
-
|
|
213
|
-
# Audit Worker
|
|
214
|
-
if [ -f "workers/audit-worker/wrangler.jsonc" ]; then
|
|
215
|
-
echo -e "${YELLOW} Updating audit-worker/wrangler.jsonc...${NC}"
|
|
216
|
-
sed -i "s/\"AUDIT_WORKER_NAME\"/\"$AUDIT_WORKER_NAME\"/g" workers/audit-worker/wrangler.jsonc
|
|
217
|
-
sed -i "s/\"ACCOUNT_ID\"/\"$escaped_account_id\"/g" workers/audit-worker/wrangler.jsonc
|
|
218
|
-
sed -i "s/\"AUDIT_BUCKET_NAME\"/\"$AUDIT_BUCKET_NAME\"/g" workers/audit-worker/wrangler.jsonc
|
|
219
|
-
echo -e "${GREEN} ✅ audit-worker configuration updated${NC}"
|
|
220
|
-
fi
|
|
221
|
-
|
|
222
|
-
if [ -f "workers/audit-worker/src/audit-worker.ts" ]; then
|
|
223
|
-
echo -e "${YELLOW} Updating audit-worker source placeholders...${NC}"
|
|
224
|
-
sed -i "s|'Access-Control-Allow-Origin': '[^']*'|'Access-Control-Allow-Origin': 'https://$escaped_pages_custom_domain'|g" workers/audit-worker/src/audit-worker.ts
|
|
225
|
-
echo -e "${GREEN} ✅ audit-worker source placeholders updated${NC}"
|
|
226
|
-
fi
|
|
227
|
-
|
|
228
|
-
if [ -f "workers/data-worker/wrangler.jsonc" ]; then
|
|
229
|
-
echo -e "${YELLOW} Updating data-worker/wrangler.jsonc...${NC}"
|
|
230
|
-
sed -i "s/\"DATA_WORKER_NAME\"/\"$DATA_WORKER_NAME\"/g" workers/data-worker/wrangler.jsonc
|
|
231
|
-
sed -i "s/\"ACCOUNT_ID\"/\"$escaped_account_id\"/g" workers/data-worker/wrangler.jsonc
|
|
232
|
-
sed -i "s/\"DATA_BUCKET_NAME\"/\"$DATA_BUCKET_NAME\"/g" workers/data-worker/wrangler.jsonc
|
|
233
|
-
echo -e "${GREEN} ✅ data-worker configuration updated${NC}"
|
|
234
|
-
fi
|
|
235
|
-
|
|
236
|
-
if [ -f "workers/data-worker/src/data-worker.ts" ]; then
|
|
237
|
-
echo -e "${YELLOW} Updating data-worker source placeholders...${NC}"
|
|
238
|
-
sed -i "s|'Access-Control-Allow-Origin': '[^']*'|'Access-Control-Allow-Origin': 'https://$escaped_pages_custom_domain'|g" workers/data-worker/src/data-worker.ts
|
|
239
|
-
echo -e "${GREEN} ✅ data-worker source placeholders updated${NC}"
|
|
240
|
-
fi
|
|
241
|
-
|
|
242
|
-
if [ -f "workers/image-worker/wrangler.jsonc" ]; then
|
|
243
|
-
echo -e "${YELLOW} Updating image-worker/wrangler.jsonc...${NC}"
|
|
244
|
-
sed -i "s/\"IMAGES_WORKER_NAME\"/\"$IMAGES_WORKER_NAME\"/g" workers/image-worker/wrangler.jsonc
|
|
245
|
-
sed -i "s/\"ACCOUNT_ID\"/\"$escaped_account_id\"/g" workers/image-worker/wrangler.jsonc
|
|
246
|
-
sed -i "s/\"FILES_BUCKET_NAME\"/\"$FILES_BUCKET_NAME\"/g" workers/image-worker/wrangler.jsonc
|
|
247
|
-
echo -e "${GREEN} ✅ image-worker configuration updated${NC}"
|
|
248
|
-
fi
|
|
249
|
-
|
|
250
|
-
if [ -f "workers/image-worker/src/image-worker.ts" ]; then
|
|
251
|
-
echo -e "${YELLOW} Updating image-worker source placeholders...${NC}"
|
|
252
|
-
sed -i "s|'Access-Control-Allow-Origin': '[^']*'|'Access-Control-Allow-Origin': 'https://$escaped_pages_custom_domain'|g" workers/image-worker/src/image-worker.ts
|
|
253
|
-
echo -e "${GREEN} ✅ image-worker source placeholders updated${NC}"
|
|
254
|
-
fi
|
|
255
|
-
|
|
256
|
-
if [ -f "workers/keys-worker/wrangler.jsonc" ]; then
|
|
257
|
-
echo -e "${YELLOW} Updating keys-worker/wrangler.jsonc...${NC}"
|
|
258
|
-
sed -i "s/\"KEYS_WORKER_NAME\"/\"$KEYS_WORKER_NAME\"/g" workers/keys-worker/wrangler.jsonc
|
|
259
|
-
sed -i "s/\"ACCOUNT_ID\"/\"$escaped_account_id\"/g" workers/keys-worker/wrangler.jsonc
|
|
260
|
-
echo -e "${GREEN} ✅ keys-worker configuration updated${NC}"
|
|
261
|
-
fi
|
|
262
|
-
|
|
263
|
-
if [ -f "workers/keys-worker/src/keys.ts" ]; then
|
|
264
|
-
echo -e "${YELLOW} Updating keys-worker source placeholders...${NC}"
|
|
265
|
-
sed -i "s|'Access-Control-Allow-Origin': '[^']*'|'Access-Control-Allow-Origin': 'https://$escaped_pages_custom_domain'|g" workers/keys-worker/src/keys.ts
|
|
266
|
-
echo -e "${GREEN} ✅ keys-worker source placeholders updated${NC}"
|
|
267
|
-
fi
|
|
268
|
-
|
|
269
|
-
if [ -f "workers/pdf-worker/wrangler.jsonc" ]; then
|
|
270
|
-
echo -e "${YELLOW} Updating pdf-worker/wrangler.jsonc...${NC}"
|
|
271
|
-
sed -i "s/\"PDF_WORKER_NAME\"/\"$PDF_WORKER_NAME\"/g" workers/pdf-worker/wrangler.jsonc
|
|
272
|
-
sed -i "s/\"ACCOUNT_ID\"/\"$escaped_account_id\"/g" workers/pdf-worker/wrangler.jsonc
|
|
273
|
-
echo -e "${GREEN} ✅ pdf-worker configuration updated${NC}"
|
|
274
|
-
fi
|
|
275
|
-
|
|
276
|
-
if [ -f "workers/pdf-worker/src/pdf-worker.ts" ]; then
|
|
277
|
-
echo -e "${YELLOW} Updating pdf-worker source placeholders...${NC}"
|
|
278
|
-
sed -i "s|'Access-Control-Allow-Origin': '[^']*'|'Access-Control-Allow-Origin': 'https://$escaped_pages_custom_domain'|g" workers/pdf-worker/src/pdf-worker.ts
|
|
279
|
-
echo -e "${GREEN} ✅ pdf-worker source placeholders updated${NC}"
|
|
280
|
-
fi
|
|
281
|
-
|
|
282
|
-
if [ -f "workers/user-worker/wrangler.jsonc" ]; then
|
|
283
|
-
echo -e "${YELLOW} Updating user-worker/wrangler.jsonc...${NC}"
|
|
284
|
-
sed -i "s/\"USER_WORKER_NAME\"/\"$USER_WORKER_NAME\"/g" workers/user-worker/wrangler.jsonc
|
|
285
|
-
sed -i "s/\"ACCOUNT_ID\"/\"$escaped_account_id\"/g" workers/user-worker/wrangler.jsonc
|
|
286
|
-
sed -i "s/\"KV_STORE_ID\"/\"$KV_STORE_ID\"/g" workers/user-worker/wrangler.jsonc
|
|
287
|
-
echo -e "${GREEN} ✅ user-worker configuration updated${NC}"
|
|
288
|
-
fi
|
|
289
|
-
|
|
290
|
-
if [ -f "workers/user-worker/src/user-worker.ts" ]; then
|
|
291
|
-
echo -e "${YELLOW} Updating user-worker source placeholders...${NC}"
|
|
292
|
-
sed -i "s|'Access-Control-Allow-Origin': '[^']*'|'Access-Control-Allow-Origin': 'https://$escaped_pages_custom_domain'|g" workers/user-worker/src/user-worker.ts
|
|
293
|
-
sed -i "s|'DATA_WORKER_DOMAIN'|'https://$DATA_WORKER_DOMAIN'|g" workers/user-worker/src/user-worker.ts
|
|
294
|
-
sed -i "s|'IMAGES_WORKER_DOMAIN'|'https://$IMAGES_WORKER_DOMAIN'|g" workers/user-worker/src/user-worker.ts
|
|
295
|
-
echo -e "${GREEN} ✅ user-worker source placeholders updated${NC}"
|
|
296
|
-
fi
|
|
297
|
-
|
|
298
|
-
if [ -f "wrangler.toml" ]; then
|
|
299
|
-
echo -e "${YELLOW} Updating wrangler.toml...${NC}"
|
|
300
|
-
sed -i "s/\"PAGES_PROJECT_NAME\"/\"$PAGES_PROJECT_NAME\"/g" wrangler.toml
|
|
301
|
-
echo -e "${GREEN} ✅ main wrangler.toml configuration updated${NC}"
|
|
302
|
-
fi
|
|
303
|
-
|
|
304
|
-
echo -e "${YELLOW} Updating app configuration files...${NC}"
|
|
305
|
-
|
|
306
|
-
if [ -f "app/config/config.json" ]; then
|
|
307
|
-
echo -e "${YELLOW} Updating app/config/config.json...${NC}"
|
|
308
|
-
local escaped_manifest_signing_key_id
|
|
309
|
-
local escaped_manifest_signing_public_key
|
|
310
|
-
local escaped_export_encryption_key_id
|
|
311
|
-
local escaped_export_encryption_public_key
|
|
312
|
-
escaped_manifest_signing_key_id=$(escape_for_sed_replacement "$MANIFEST_SIGNING_KEY_ID")
|
|
313
|
-
escaped_manifest_signing_public_key=$(escape_for_sed_replacement "$MANIFEST_SIGNING_PUBLIC_KEY")
|
|
314
|
-
escaped_export_encryption_key_id=$(escape_for_sed_replacement "$EXPORT_ENCRYPTION_KEY_ID")
|
|
315
|
-
escaped_export_encryption_public_key=$(escape_for_sed_replacement "$EXPORT_ENCRYPTION_PUBLIC_KEY")
|
|
316
|
-
|
|
317
|
-
sed -i "s|\"url\": \"[^\"]*\"|\"url\": \"https://$escaped_pages_custom_domain\"|g" app/config/config.json
|
|
318
|
-
sed -i "s|\"MANIFEST_SIGNING_KEY_ID\"|\"$escaped_manifest_signing_key_id\"|g" app/config/config.json
|
|
319
|
-
sed -i "s|\"MANIFEST_SIGNING_PUBLIC_KEY\"|\"$escaped_manifest_signing_public_key\"|g" app/config/config.json
|
|
320
|
-
sed -i "s|\"EXPORT_ENCRYPTION_KEY_ID\"|\"$escaped_export_encryption_key_id\"|g" app/config/config.json
|
|
321
|
-
sed -i "s|\"EXPORT_ENCRYPTION_PUBLIC_KEY\"|\"$escaped_export_encryption_public_key\"|g" app/config/config.json
|
|
322
|
-
echo -e "${GREEN} ✅ app config.json updated${NC}"
|
|
323
|
-
fi
|
|
324
|
-
|
|
325
|
-
if [ -f "app/config/firebase.ts" ]; then
|
|
326
|
-
echo -e "${YELLOW} Updating app/config/firebase.ts...${NC}"
|
|
327
|
-
sed -i "s|\"YOUR_FIREBASE_API_KEY\"|\"$API_KEY\"|g" app/config/firebase.ts
|
|
328
|
-
sed -i "s|\"YOUR_FIREBASE_AUTH_DOMAIN\"|\"$AUTH_DOMAIN\"|g" app/config/firebase.ts
|
|
329
|
-
sed -i "s|\"YOUR_FIREBASE_PROJECT_ID\"|\"$PROJECT_ID\"|g" app/config/firebase.ts
|
|
330
|
-
sed -i "s|\"YOUR_FIREBASE_STORAGE_BUCKET\"|\"$STORAGE_BUCKET\"|g" app/config/firebase.ts
|
|
331
|
-
sed -i "s|\"YOUR_FIREBASE_MESSAGING_SENDER_ID\"|\"$MESSAGING_SENDER_ID\"|g" app/config/firebase.ts
|
|
332
|
-
sed -i "s|\"YOUR_FIREBASE_APP_ID\"|\"$APP_ID\"|g" app/config/firebase.ts
|
|
333
|
-
sed -i "s|\"YOUR_FIREBASE_MEASUREMENT_ID\"|\"$MEASUREMENT_ID\"|g" app/config/firebase.ts
|
|
334
|
-
echo -e "${GREEN} ✅ app firebase.ts updated${NC}"
|
|
335
|
-
fi
|
|
336
|
-
|
|
337
|
-
if [ -f "app/routes/auth/login.tsx" ]; then
|
|
338
|
-
echo -e "${YELLOW} Updating app/routes/auth/login.tsx...${NC}"
|
|
339
|
-
sed -i "s|^const APP_CANONICAL_ORIGIN = .*;|const APP_CANONICAL_ORIGIN = 'https://$escaped_pages_custom_domain';|g" app/routes/auth/login.tsx
|
|
340
|
-
echo -e "${GREEN} ✅ app login.tsx canonical origin updated${NC}"
|
|
341
|
-
fi
|
|
342
|
-
|
|
343
|
-
echo -e "${GREEN}✅ All configuration files updated${NC}"
|
|
344
|
-
}
|