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

[WJ-1293] Add "WWS" to support wjfiles routes, add Caddy for reverse proxying and HTTPS #2283

Draft
wants to merge 306 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
306 commits
Select commit Hold shift + click to select a range
c479bbe
Specify return type to address warnings.
emmiegit Jan 15, 2025
ecd5187
Change return type to optional.
emmiegit Jan 15, 2025
fd75f8a
Create error wrapper type.
emmiegit Jan 16, 2025
47a3c5c
Add state to router.
emmiegit Jan 16, 2025
af3813b
Move out host-processing logic to separate module.
emmiegit Jan 16, 2025
fc9cc19
Fix match arm formatting.
emmiegit Jan 16, 2025
f959a4a
Remove unused variable.
emmiegit Jan 16, 2025
c032818
Add logic to handle errors and missing sites.
emmiegit Jan 16, 2025
79587a0
Add special headers for site metadata.
emmiegit Jan 16, 2025
ddd9754
Address lint.
emmiegit Jan 16, 2025
1b735b3
Resolve some warnings.
emmiegit Jan 16, 2025
f944002
Mark temporary handler as deprecated.
emmiegit Jan 16, 2025
c6374ef
Add more explanatory comments.
emmiegit Jan 16, 2025
4d8b7df
Fix assertion message.
emmiegit Jan 16, 2025
73d71b0
Add some handler stubs for files router.
emmiegit Jan 16, 2025
3329e35
Use fallback for routing.
emmiegit Jan 16, 2025
49c8c6c
Move main domain route logic to its own file.
emmiegit Jan 16, 2025
7764217
Address a few warnings.
emmiegit Jan 16, 2025
e4f55ce
Add more handlers for files routes.
emmiegit Jan 16, 2025
644bec1
Remove TODO for finished router.
emmiegit Jan 16, 2025
9f21bdb
Add redirect for files router.
emmiegit Jan 16, 2025
56ab01b
Add more header processing.
emmiegit Jan 16, 2025
29a6fef
Fix URL construction for redirect handlers.
emmiegit Jan 16, 2025
08b9b8e
Remove todo!, return redirect for handlers.
emmiegit Jan 16, 2025
337184f
Remove to-do/stub handler.
emmiegit Jan 16, 2025
79ae814
Add default site handling for redirect URL building.
emmiegit Jan 16, 2025
3f34521
Change handling of redirect URL construction.
emmiegit Jan 16, 2025
5683e7c
Fix redirect path.
emmiegit Jan 16, 2025
0d54482
Add logging for handlers.
emmiegit Jan 16, 2025
95db602
Run rustfmt.
emmiegit Jan 16, 2025
8b140ac
Fix get_site_from_slug().
emmiegit Jan 16, 2025
1188ddd
Switch redis to async.
emmiegit Jan 16, 2025
b6f593b
Return s3_hash in GetFileOutput.
emmiegit Jan 17, 2025
11662d1
Move files redirects to top of module.
emmiegit Jan 17, 2025
2ed7d8e
Add module comment about Redis.
emmiegit Jan 19, 2025
7981bec
Use header constant from http crate.
emmiegit Jan 19, 2025
c73d61f
Add initial fetch for files.
emmiegit Jan 19, 2025
5941b8d
Remove some fields in PageData.
emmiegit Jan 19, 2025
0ee4fcc
Add page and file methods.
emmiegit Jan 19, 2025
3a06067
Use macros to avoid Redis boilerplate.
emmiegit Jan 19, 2025
2f44065
Rename fetch methods for name clarity.
emmiegit Jan 19, 2025
568cfda
Get hexadecimal hash for s3_hash.
emmiegit Jan 19, 2025
ba227b6
Modify Redis return type to optional.
emmiegit Jan 19, 2025
f643950
Add mime and size fields to redis/deepwell.
emmiegit Jan 19, 2025
579d917
Fix redis retrieval.
emmiegit Jan 19, 2025
82dbef1
Add warning if invalid cache code path is hit.
emmiegit Jan 19, 2025
f8a1f45
Add file redirect routes.
emmiegit Jan 21, 2025
1f4d81d
Download files via stream.
emmiegit Jan 21, 2025
620e9eb
Use struct-deconstruct syntax.
emmiegit Jan 21, 2025
353c5c6
Add incomplete file code for development.
emmiegit Jan 21, 2025
99a5286
Move helper function to top.
emmiegit Jan 21, 2025
925e680
Convert the helper function to a macro.
emmiegit Jan 21, 2025
1ef67ef
Remove debug hardcoded host.
emmiegit Jan 21, 2025
420b49c
Use local variable in macro.
emmiegit Jan 21, 2025
ca8b387
Add note about error code for S3 fetch.
emmiegit Jan 21, 2025
451cd90
Add note about HEAD in axum.
emmiegit Jan 21, 2025
c6df36d
Add stubs for .well-known and robots.txt
emmiegit Jan 23, 2025
0662ca3
Add TODOs for new stub routes.
emmiegit Jan 23, 2025
7541a74
Use common utility for site header info.
emmiegit Jan 23, 2025
a3ac868
Add redirect handlers for main site page convenience routes.
emmiegit Jan 23, 2025
72dcb34
Use codegen macro to produce the three new handlers.
emmiegit Jan 23, 2025
c67d7dd
Add download convenience redirect too.
emmiegit Jan 23, 2025
414c6e4
Add deepwell error cases for wws use.
emmiegit Feb 6, 2025
96b30d0
Set up plain HTML (with codes) for wjfiles errors.
emmiegit Feb 6, 2025
1b0ece7
Fix html header.
emmiegit Feb 6, 2025
91b2c98
Fix error code formatting.
emmiegit Feb 6, 2025
4ea5ee1
Print slugs in monospace.
emmiegit Feb 6, 2025
4b7c5e3
Run rustfmt.
emmiegit Feb 6, 2025
45cde49
Remove unused import.
emmiegit Feb 6, 2025
9345af3
Remove extra newlines.
emmiegit Feb 7, 2025
9ad23cb
Add rustdoc for SiteAndHost enum.
emmiegit Feb 7, 2025
95f389f
Forward MainCustomMissing host request.
emmiegit Feb 7, 2025
03ab4ab
Add web errors for missing site.
emmiegit Feb 7, 2025
fe90c13
Remove unused macro case.
emmiegit Feb 7, 2025
a45f6ea
Change formatting for error HTML.
emmiegit Feb 7, 2025
aea06f7
Add pound sign for error code.
emmiegit Feb 7, 2025
0ed7a90
Fix redis null typing issue.
emmiegit Feb 7, 2025
5ea5e23
Create helper function for clearing inconsistent nulls.
emmiegit Feb 7, 2025
60f7b22
Fix error message.
emmiegit Feb 7, 2025
ce12f5c
Update deepwell dependencies.
emmiegit Feb 7, 2025
1a64e57
Change framerail proxy setup logic.
emmiegit Feb 7, 2025
9c3d4bb
Log proxied path.
emmiegit Feb 7, 2025
1541f80
Add http client to ServerState.
emmiegit Feb 7, 2025
017c59d
Implement proxy step within framerail handler.
emmiegit Feb 7, 2025
795c59b
Add FRAMERAIL_HOST to env.
emmiegit Feb 8, 2025
e993c1b
Abstract framerail reverse proxy URI construction.
emmiegit Feb 8, 2025
83a8852
Add HTML error case for site lookup failure.
emmiegit Feb 8, 2025
b765dc3
Remove some unused imports.
emmiegit Feb 8, 2025
da6109c
Bump deepwell version to v2025.2.6
emmiegit Feb 7, 2025
de76f4f
Bump wws version to v2025.2.6
emmiegit Feb 7, 2025
d624720
Address clippy lints.
emmiegit Feb 8, 2025
c480ba5
Remove unused fields.
emmiegit Feb 8, 2025
fb936de
Suppress unused imports and variables.
emmiegit Feb 8, 2025
801598d
Fetch site information from headers for view requests.
emmiegit Feb 9, 2025
b55fcf4
Remove extra newline.
emmiegit Feb 9, 2025
8501cd0
Move should_redirect_site to domain endpoint.
emmiegit Feb 9, 2025
954e762
Add constant for 'www'.
emmiegit Feb 9, 2025
2cc13c5
Add DomainService TODO.
emmiegit Feb 9, 2025
508ea65
Add custom domain list API call.
emmiegit Feb 10, 2025
c027f2a
Return SiteDomainResult from domain API call.
emmiegit Feb 10, 2025
b17fc41
Change output of SiteDomainResult.
emmiegit Feb 10, 2025
55118bb
Add TODO comments for cache items in DEEPWELL.
emmiegit Feb 10, 2025
02c0b87
Update return value for site_from_domain API call.
emmiegit Feb 10, 2025
9638c09
Intake SiteDomainResult from deepwell and store in cache.
emmiegit Feb 10, 2025
4b089b0
Remove unused struct.
emmiegit Feb 10, 2025
2473459
Rename SiteDomainResult -> SiteDomainInfo.
emmiegit Feb 10, 2025
1f649a4
Fix deepwell compilation with SiteDomainInfo field changes.
emmiegit Feb 10, 2025
ef432ab
Address some unused value warnings.
emmiegit Feb 11, 2025
3add813
Convert lookup_host() to fetch site from deepwell/cache.
emmiegit Feb 11, 2025
96dc5a6
Rename SiteDomainInfo -> SiteAndHost in DEEPWELL.
emmiegit Feb 11, 2025
9fc3b91
Merge SiteAndHost, same enum in deepwell and wws.
emmiegit Feb 11, 2025
3cd9215
Add rustdoc for SiteAndHost struct in deepwell.
emmiegit Feb 11, 2025
d20ffd3
Remove unused field.
emmiegit Feb 11, 2025
f23e1ea
Combine match arms.
emmiegit Feb 11, 2025
ae07531
Remove ViewerResult.
emmiegit Feb 11, 2025
8633eae
Interpolate variables in the string.
emmiegit Feb 11, 2025
ec0a33d
Create SpecialErrorService for routes like the missing site.
emmiegit Feb 11, 2025
0ed1fd2
Split site slug and custom domain special errors.
emmiegit Feb 11, 2025
359b403
Create special-error fluent directory.
emmiegit Feb 11, 2025
70ab1a5
Add stubs for special error methods.
emmiegit Feb 11, 2025
831a479
Move parse_locales() to utils.
emmiegit Feb 11, 2025
2806325
Add rustdoc for locales module.
emmiegit Feb 11, 2025
2dd0032
Augment rustdoc for locale parse.
emmiegit Feb 11, 2025
4ad713f
Add handling for locale extraction in special error routes.
emmiegit Feb 11, 2025
fab634a
Start Accept-Language parsing, add special errors.
emmiegit Feb 13, 2025
4232dd1
Add assertions for locales.
emmiegit Feb 13, 2025
9c9982c
Move parse_accept_language() helper function.
emmiegit Feb 13, 2025
f9c2d26
Set up special_error() helper function.
emmiegit Feb 13, 2025
e980bcf
Add deepwell DeepwellFailure error case.
emmiegit Feb 13, 2025
37cdf4c
Add error case for severe issues.
emmiegit Feb 14, 2025
26ea1a5
Use new error in special_error.
emmiegit Feb 14, 2025
cf47e18
Remove unused error cases, now using SpecialErrorService.
emmiegit Feb 14, 2025
baa02fd
Move arg order for special error case.
emmiegit Feb 14, 2025
c26d605
Add new special error for issues with site/host fetch.
emmiegit Feb 14, 2025
0adbb64
Use new special error for SiteAndHost failure.
emmiegit Feb 14, 2025
198f662
Add note about future use of ServerErrorCode.
emmiegit Feb 14, 2025
1061c69
Register new special error method.
emmiegit Feb 14, 2025
5bfcfec
Fix runRedirect for no domain in framerail.
emmiegit Feb 14, 2025
0b144c6
Remove header X-Wikijump-Domain.
emmiegit Feb 14, 2025
ab577ab
Change --sudo short flag.
emmiegit Feb 14, 2025
55c3c6d
Change teapot content-type to text/plain.
emmiegit Feb 14, 2025
261f3b0
Add /-/health-check route.
emmiegit Feb 14, 2025
17c5726
Remove extra newline.
emmiegit Feb 14, 2025
40413b0
Create local wws Docker image.
emmiegit Feb 14, 2025
e8be8b5
Add TODO for proxy IP headers.
emmiegit Feb 14, 2025
1b7191e
Replace nginx container with wws.
emmiegit Feb 14, 2025
462ab46
Don't use debug logger level in deepwell.toml
emmiegit Feb 14, 2025
481441b
Add secrets for wws.
emmiegit Feb 14, 2025
13b166c
Add explicit docker dependencies for wws.
emmiegit Feb 14, 2025
6501b72
Add internal headers to framerail healthcheck.
emmiegit Feb 14, 2025
29ed6fb
Add -f (fail on error) to deepwell health check.
emmiegit Feb 14, 2025
69cda07
Add file for framerail health check.
emmiegit Feb 14, 2025
85f14cf
Fix port forwarding.
emmiegit Feb 14, 2025
2f42ff7
Add TODO for special error HTML.
emmiegit Feb 14, 2025
7c27b3d
Run rustfmt.
emmiegit Feb 14, 2025
67ecf4d
Handle partial field setting in redis.
emmiegit Feb 15, 2025
435a7e4
Catch miss variant.
emmiegit Feb 15, 2025
976993c
Prefer Self to service name.
emmiegit Feb 15, 2025
49dde46
Set allowedHosts in vite config.
emmiegit Feb 18, 2025
5b025df
Remove missing local variable.
emmiegit Feb 22, 2025
c400c7e
Add client_ip_source to configuration.
emmiegit Feb 23, 2025
006df5c
Fix ConnectInfo retrieval.
emmiegit Feb 23, 2025
8a48ec2
Use SecureClientIp to add internal header.
emmiegit Feb 24, 2025
0fa60a2
Add DEEPWELL_PORT env variable to dev deployment.
emmiegit Feb 24, 2025
cd15d2b
Reorder env keys.
emmiegit Feb 24, 2025
b5dbb1c
Add wws image to app platform config.
emmiegit Feb 24, 2025
074675b
Create dev router Dockerfile.
emmiegit Feb 24, 2025
295bf6c
Create GitHub workflow files for router.
emmiegit Feb 24, 2025
8397e7f
Use symlink for health-check.sh script.
emmiegit Feb 24, 2025
186a099
Create prod router image and workflow.
emmiegit Feb 24, 2025
20f8d66
Run rustfmt for deepwell.
emmiegit Feb 24, 2025
d0f9c96
Address deepwell clippy lint.
emmiegit Feb 24, 2025
7d85a84
Add optional dependency for TLS.
emmiegit Feb 25, 2025
818bb69
Add code for tls feature.
emmiegit Feb 25, 2025
0866097
Move import to avoid warning in tls feature.
emmiegit Feb 25, 2025
a3177d8
Add TLS fields to .env
emmiegit Mar 5, 2025
2e061c4
Pass in TLS paths to server builder.
emmiegit Mar 5, 2025
e1866d2
Fix runtime TLS errors.
emmiegit Mar 5, 2025
9a6c4d5
Add note about HTTP -> HTTPS.
emmiegit Mar 5, 2025
fcce0fe
Use TLS feature for local router deployment.
emmiegit Mar 5, 2025
59d9fe4
Replace quay.io with Dockerhub.
emmiegit Mar 22, 2025
88a80ae
Include wws artifacts in dockerignore.
emmiegit Mar 24, 2025
4a2d313
Install wikijump-health-check helper into web.
emmiegit Mar 24, 2025
129ec09
Fix health check scripts.
emmiegit Mar 24, 2025
ba24e16
Use new health script for router image.
emmiegit Mar 24, 2025
5a87340
Specify host port for wws.
emmiegit Mar 24, 2025
fdc2913
Update local container for use of snake-oil SSL.
emmiegit Mar 24, 2025
688f72f
Rename api -> deepwell, web -> framerail, router -> wws.
emmiegit Mar 26, 2025
81743ba
Update GitHub workflow for local deepwell.
emmiegit Mar 26, 2025
0bd18d5
Update GitHub workflow for local framerail.
emmiegit Mar 26, 2025
8c816c3
Update GitHub workflow for local wws.
emmiegit Mar 26, 2025
8a3e5ea
Update GitHub workflow for dev deepwell.
emmiegit Mar 26, 2025
dd249d5
Update GitHub workflow for dev framerail.
emmiegit Mar 26, 2025
29aa7c7
Update GitHub workflow for dev wws.
emmiegit Mar 26, 2025
5b5bf77
Update GitHub workflow for prod deepwell.
emmiegit Mar 26, 2025
57eb0f5
Update GitHub workflow for prod framerail.
emmiegit Mar 26, 2025
92f1d22
Update GitHub workflow for prod wws.
emmiegit Mar 26, 2025
662ebed
Change default port for wws.
emmiegit Mar 26, 2025
cd83853
Add initial Caddyfile.
emmiegit Mar 26, 2025
fa14ba8
Add newlines in docker-compose.dev.yaml
emmiegit Mar 26, 2025
d6a2df1
Enhance initial Caddyfile.
emmiegit Mar 26, 2025
88e9871
Run caddy fmt --overwrite.
emmiegit Mar 26, 2025
7a7192f
Add handler for missing sites.
emmiegit Mar 26, 2025
4265c02
Update Caddyfile template.
emmiegit Mar 27, 2025
f56ee84
Add initial Caddyfile generation implementation.
emmiegit Mar 27, 2025
7eec5e4
Add CHECK constraint for www preferred domain.
emmiegit Mar 27, 2025
9539745
Add comment explaining the custom_domain column.
emmiegit Mar 27, 2025
6ac9171
Substitute both reverse proxy hosts.
emmiegit Mar 27, 2025
1ba3a9b
Separate Caddyfile generation to pure function.
emmiegit Mar 27, 2025
b5ccd13
Implement wjfiles section of the Caddyfile.
emmiegit Mar 27, 2025
26d7613
Add test stub to add before PR finalization.
emmiegit Mar 27, 2025
a3a27d2
Rename column custom_domain -> preferred_domain.
emmiegit Mar 27, 2025
bf5ca6a
Implement site bodies in Caddyfile.
emmiegit Mar 28, 2025
b206b7f
Add www redirects.
emmiegit Mar 28, 2025
829b789
Run rustfmt.
emmiegit Mar 28, 2025
ca7e74e
Combine two formatted writes into one.
emmiegit Mar 28, 2025
1bebb7f
Modify case of site info headers in framerail.
emmiegit Mar 28, 2025
637aebb
Merge in www redirect for cleaner output.
emmiegit Mar 28, 2025
74e680a
Improve spacing in Caddyfile generation.
emmiegit Mar 28, 2025
b525a12
Add comment in serve_main.
emmiegit Mar 28, 2025
7eb0c68
Fix typo in comment.
emmiegit Mar 28, 2025
bfedb52
Update stock Caddyfile in local.
emmiegit Mar 28, 2025
ee326db
Move Caddyfile generation logic to a new service.
emmiegit Mar 28, 2025
c32595d
Reduce input data, don't require models.
emmiegit Mar 28, 2025
6d72bc7
Address clippy lints.
emmiegit Mar 28, 2025
21e53cc
Use direct query to remove need for full model.
emmiegit Mar 28, 2025
d47d193
Run rustfmt on CaddyService file.
emmiegit Mar 28, 2025
57820cb
Add helper method to generate local Config struct.
emmiegit Mar 28, 2025
f4a96ef
Add Default to SiteDomainData.
emmiegit Mar 28, 2025
6c63ab8
Add Clone to caddy service structs.
emmiegit Mar 28, 2025
232c933
Use Cow for CaddyfileOptions.
emmiegit Mar 28, 2025
fc73333
Add initial code setup for Caddyfile generation unit tests.
emmiegit Mar 28, 2025
3ab95f7
Improve Caddyfile test output on failure.
emmiegit Mar 28, 2025
065d402
Add first unit test data.
emmiegit Mar 28, 2025
0da6eb9
Allow varying the main and files domains in tests.
emmiegit Mar 28, 2025
e035e3e
Trim newlines off end of Caddyfile.
emmiegit Mar 28, 2025
4608ab5
Print which output this is at top and bottom.
emmiegit Mar 28, 2025
b886643
Add error to catch stray end newlines in test cases.
emmiegit Mar 28, 2025
3db4fea
Use pretty-assertions to show diffs for generated Caddyfiles.
emmiegit Mar 28, 2025
8cdb740
Add Caddyfile test data.
emmiegit Mar 28, 2025
abf4bea
Add note about hard tabs.
emmiegit Mar 28, 2025
d232365
Add sorting to DB queries.
emmiegit Mar 28, 2025
7548fec
Get rid of tls feature, set appropriate real IP source.
emmiegit Mar 28, 2025
3a93cd2
Add compression settings to Caddyfile generation.
emmiegit Mar 28, 2025
c6197b4
Always strip all X-Wikijump-* headers before reverse_proxy.
emmiegit Mar 28, 2025
14a2d8c
Move output Caddyfiles to new directory.
emmiegit Mar 29, 2025
bc0344c
Remove version headers from wws.
emmiegit Mar 29, 2025
ce356d1
Add handler for files domain with no site slug.
emmiegit Mar 29, 2025
1b73bc3
Initial deletion of host work within wws.
emmiegit Mar 29, 2025
1f3cb62
Add teapot route to Caddyfile.
emmiegit Mar 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reorder env keys.
Put the S3 entries together.
emmiegit committed Feb 24, 2025
commit cd15d2b0b3e78e6645de363ce0bcb59f78dad0b9
12 changes: 6 additions & 6 deletions .do/app.yaml
Original file line number Diff line number Diff line change
@@ -45,6 +45,12 @@ services:
instance_size_slug: basic-xxs
internal_ports: [2747]
envs:
- key: DATABASE_URL
value: '${database.DATABASE_URL}'
scope: RUN_TIME
- key: REDIS_URL
value: '${cache.REDIS_URL}'
scope: RUN_TIME
- key: S3_BUCKET
value: wikijump-files-dev
scope: RUN_TIME
@@ -57,12 +63,6 @@ services:
- key: S3_PATH_STYLE
value: 'false'
scope: RUN_TIME
- key: DATABASE_URL
value: '${database.DATABASE_URL}'
scope: RUN_TIME
- key: REDIS_URL
value: '${cache.REDIS_URL}'
scope: RUN_TIME
- key: S3_ACCESS_KEY_ID
type: SECRET
scope: RUN_TIME