Commit Graph

623 Commits

Author SHA1 Message Date
sua yoo
5258149a34
Fix password autocomplete and suggestions (#73)
closes #72
2022-01-08 14:28:54 -08:00
sua yoo
82ee1ed1e4
Remove unused files (#69) 2021-12-26 18:01:10 -08:00
Ilya Kreymer
684f112c85 dockerfile hotfix: remove unused 'scripts' directory 2021-12-07 11:22:30 -08:00
sua yoo
83be07bdcf
remove extra word in readme 2021-12-07 09:42:52 -08:00
sua yoo
2c3debfec6
Show invite info to user (#68) 2021-12-07 09:36:03 -08:00
sua yoo
3324bd960f
Refactor to remove sign up and JWT env variables (#65)
closes #63
closes #66
2021-12-06 19:39:04 -08:00
sua yoo
e787e751d9
update alert import (#64) 2021-12-06 18:49:42 -08:00
sua yoo
ddf1b63313
fix invite token logic 2021-12-05 19:01:21 -08:00
Ilya Kreymer
efaaece842
Optimizing Frontend Dockerfile (#60)
* optimizing frontend dockerfile:
- run install first to cache node_modules
- don't pass node_modules to image
- add only needed files before build

* remove language file generation from build step

Co-authored-by: sua yoo <sua@suayoo.com>
2021-12-05 18:39:45 -08:00
sua yoo
d5c665be8e
Fix archive invite flow (#61)
closes #49
2021-12-05 18:23:24 -08:00
sua yoo
ba69ac02bc
Update superadmin invite URL (#62) 2021-12-05 18:22:59 -08:00
sua yoo
5531c3c33c
hotfix: fix auth persist
Switch lifecycle event to update
2021-12-05 16:52:58 -08:00
sua yoo
9c4bec1411
Add admin page for inviting users (#56)
closes #37
2021-12-05 15:23:28 -08:00
Ilya Kreymer
53beb84c01
Config superuser (#59)
* backend: automatically create super user, fixes #57
- if SUPERUSER_EMAIL is set, superuser is created with `is_superuser` and `is_verified` settings, if user doesn't already exist.
- if SUPERUSER_PASSWORD if set, the password for superuser is set, otherwise a random password is generated
update sample SUPERUSER_EMAIL and SUPERUSER_PASSWORD in config file and chart.
- ensure verification email is not sent if user already verified
2021-12-05 14:12:42 -08:00
Ilya Kreymer
eaf8055063
Support unified docker + k8s deployment (#58)
- adapt nginx config to work both in docker and k8s, using env vars to set urls

backend: additional fixes:
- use env vars with nginx config
- fix settings api route
- when sending e-mail, use the Host header for verification urls when available
- prepare Dockerfile with full build from scratch in image, (disabled 'yarn install' for faster builds for now)
- fix accept invite api for existing user to /archives/accept-invite/{token}
2021-12-05 13:02:26 -08:00
Ilya Kreymer
87c5505c43
Backend Invite System Refactor (#53)
* backend:
- refactor invite system, move to separate InviteOps object, used by archives and user
- supporting three invite use cases:
1) superuser invites any user not registered, not added to any archive
2) archive admin invites any user not registered, add to one of their archives
3) archive admin invites existing registered user, add to one of their archives

- support superadmin invite via /users/invite (fixes #37)
- superadmin invite has no archive set and does not add user to archive

- don't send verification email when accepting from invite, fixes #50
- use different email template / accept url for existing user invite, eg, `/invite/accept/`

- fix default token value in chart
2021-12-04 12:14:28 -08:00
sua yoo
9673794711
Frontend prod build optimizations (#54)
- Leverage webpack chunk splitting to creating more, smaller JS files rather than one large main file (import(file) syntax)
- Enable long-term caching by adding content hash to output file names
- Copy entire /dist folder contents in Dockerfile
- Changed yarn start-dev -> yarn start since there is no prod server
- Reenable locale picker
2021-12-03 18:00:14 -08:00
sua yoo
1d114c682e
hotfix: prevent session from expiring 2021-12-03 17:40:03 -08:00
Ilya Kreymer
11b797d535
Add global settings endpoint (#52)
* backend:
- add /api/settings endpoint for misc system-wide settings
- setting 'registrationEnabled' if open registration should be enabled, set via REGISTRATION_ENABLED=1 env var
- setting 'jwtTokenLifetimeMinutes' returns the jwt token expiry in seconds, configured in minutes via JWT_TOKEN_LIFETIME_MINUTES env var (default: 60)
2021-12-03 10:56:57 -08:00
Ilya Kreymer
05c1129fb8
Frontend + Backend Integrated Deployment (K8s only) (#45)
* support running backend + frontend together on k8s
* split nginx container into separate frontend service, which uses nignx-base image and the static frontend files
* add nginx-based frontend image to docker-compose build (for building only, docker-based combined deployment not yet supported)

* backend:
- fix paths for email templates
- chart: support '--set backend_only=1' and '--set frontend_only=1' to only force deploy one or the other
- run backend from root /api in uvicorn
2021-12-03 10:17:22 -08:00
sua yoo
87bef6d967
Use settings to determine if sign up route is enabled (#51) 2021-12-03 10:05:55 -08:00
sua yoo
30e40adddd
Refresh access token in background (#48)
closes #22
2021-12-03 10:00:13 -08:00
sua yoo
c48e870ffe
Refactor frontend auth service (#47) 2021-12-02 16:31:12 -08:00
sua yoo
2396ab9851
Invite user to an archive (#36)
known issue: invalid invitation error shows even when invite is successfully accepted

closes #31
2021-12-02 11:31:03 -08:00
sua yoo
9d7596589b
Show sign up confirmation message (#42)
closes #41
2021-12-02 10:28:22 -08:00
Ilya Kreymer
081d6f8519
User Display Name Support + Token Refresh Support (#44)
* backend api/data model improvements:
- add 'name' property to user, can be set on registration, fixes #43
- in archive user list, include 'name' and 'role' for each user
- don't include is_* property in user create/register and update
- add /auth/jwt/refresh endpoint for refreshing token, fixes #34, support for #22

* allow jwt token lifetime to be settable via JWT_LIFETIME env var (default 3600)
2021-12-01 18:55:10 -08:00
sua yoo
8bcdc8877f
Frontend verification UX fixes (#40)
- Show toast alert when user is verified
- Redirect to correct page on verified
- Update already-logged in user info on verify
- Adds new toast component

closes #39
2021-12-01 11:56:09 -08:00
sua yoo
6e193b1157
redirect to log in on reset password 2021-12-01 11:04:38 -08:00
Ilya Kreymer
d0b54dd752 Enable sending emails in K8S, trigger verification e-mail on registration. (#38)
* k8s: support email configuration
support sending reset password email
fix for #32

* fastapi users: update to latest (8.1.2)
send verification email upon registration

* update to latest fastapi-users(8.1.2), refactor to use UserManager class
ensure verification e-mail sent upon registration, w/o requiring separate apicall
fixes #32

* add email options to default chart/values.yaml

* separate usermanager init from fastapi users init, fix for sending invite emails
2021-11-30 23:50:38 -08:00
sua yoo
3fa85c83f2
Allow users to sign up through UI (#30)
closes #28
2021-11-30 08:57:53 -08:00
sua yoo
50e93724fc
Allow users to reset password from UI (#27)
closes #21
2021-11-30 08:53:39 -08:00
sua yoo
911dc64025
Enable query param routing (#29)
* enable params in url

* rename view state
2021-11-25 12:00:24 -08:00
Ilya Kreymer
3d4d7049a2
Misc backend fixes for cloud deployment (#26)
* misc backend fixes:
- fix running w/o local minio
- ensure crawler image pull policy is configurable, loaded via chart value
- use digitalocean repo for main backend image (for now)
- add bucket_name to config only if using default bucket

* enable all behaviors, support 'access_endpoint_url' for default storages

* debugging: add 'no_delete_jobs' setting for k8s and docker to disable deletion of completed jobs
2021-11-25 11:58:26 -08:00
sua yoo
58eba70c68
Allow users to change password (#25)
wip #21
2021-11-23 17:01:08 -08:00
sua yoo
04fbe6fc4d
Adjust frontend auth behavior (#24) 2021-11-23 16:57:28 -08:00
sua yoo
5b8440f295
Fix frontend test mocks (#23) 2021-11-22 16:31:35 -08:00
sua yoo
5722909157
Frontend responsive UI tweaks (#20) 2021-11-22 10:25:34 -08:00
sua yoo
14f2d13a73
Add frontend localization support (#18)
closes #17
2021-11-20 07:44:21 -08:00
sua yoo
76e5ceb864
Replace daisy UI with shoelace (#16)
closes #15
2021-11-19 19:38:58 -08:00
sua yoo
316a91f612
Switch frontend to use Typescript (#12)
closes #11
2021-11-19 14:07:13 -08:00
sua yoo
29a3c29b2c
Configure API base URL in frontend (#14)
closes #13
2021-11-19 13:30:51 -08:00
sua yoo
0f97724ad0
Set up frontend dev tooling (#6)
* Add eslint for linting js (https://github.com/ikreymer/browsertrix-cloud/pull/7)
* Add prettier for formatting frontend files (https://github.com/ikreymer/browsertrix-cloud/pull/9)
* Add frontend testing framework (https://github.com/ikreymer/browsertrix-cloud/pull/10)

closes #4, closes #5
2021-11-18 17:26:10 -08:00
Ilya Kreymer
57a4b6b46f add collections api:
- collections defined by name per archive
- can update collections with additional metadata (currently just description)
- crawl config api accepts a list of collections by name, resolved to collection uids and stored in config
- finished crawls also associated with collection list
- /archives/{aid}/collections/{name} can list all crawl artifacts (wacz files) from a named collection (in frictionless data package-ish format)
- /archives/{aid}/collections/$all lists all crawled artifacts for the archive

readiness check: add /healthz endpoints for app and nginx
ingress: add /data/ route to local bucket

storage improvements:
- for default storages, store path only, and prepend default storage access endpoint
- collections api returns the paths using the storage access endpoint
- define default storages as secrets in k8s (can support multiple), hard-coded in docker (only one for now)
2021-10-27 09:39:14 -07:00
Ilya Kreymer
666becdb65 initial pass on frontend: using tailwindcss + daisyui + litelement with webpack build + dev server 2021-10-10 12:22:36 -07:00
Ilya Kreymer
c38e0b7bf7 use redis based queue instead of url for crawl done webhook
update docker setup to support redis webhook, add consistent CRAWL_ARGS, additional fixes
2021-10-10 12:18:28 -07:00
Ilya Kreymer
4ae4005d74 add ingress + nginx container for better routing
support screencasting to dynamically created service via nginx (k8s only thus far)
add crawl /watch endpoint to enable watching, creates service if doesn't exist
add crawl /running endpoint to check if crawl is running
nginx auth check in place, but not yet enabled
add k8s nginx.conf
add missing chart files
file reorg: move docker config to configs/
k8s: add readiness check for nginx and api containers for smoother reloading
ensure service deleted along with job
todo: update dockerman with screencast support
2021-10-09 23:47:29 -07:00
Ilya Kreymer
19879fe349 Storage + Data Model Refactor (fixes #3):
- Add default vs custom (s3) storage
 - K8S: All storages correspond to secrets
 - K8S: Default storages inited via helm
 - K8S: Custom storage results in custom secret (per archive)
 - K8S: Don't add secret per crawl config
 - API for changing storage per archive
 - Docker: default storage just hard-coded from env vars (only one for now)
 - Validate custom storage via aiobotocore before confirming
 - Data Model: remove usage from users
 - Data Model: support adding multiple files per crawl for parallel crawls
 - Data Model: track completions for parallel crawls
 - Data Model: initial support for tags per crawl, add collection as 'coll' tag

README fixes
2021-10-09 18:58:40 -07:00
Ilya Kreymer
b6d1e492d7 add redis for storing crawl state data!
- supported in both docker and k8s
- additional pods with same job id automatically use same crawl state in redis
- support dynamic scaling (#2) via /scale endpoint - k8s job parallelism adjusted dynamically for running job (only supported in k8s so far)
2021-09-17 15:02:11 -07:00
Ilya Kreymer
223658cfa2 misc tweaks:
- better error handling for not found resources, ensure 404
- typo in k8smanager
- add pylintrc
- ensure manual job ares deleted when complete
- fix typos, reformat
2021-08-25 18:34:49 -07:00
Ilya Kreymer
f1a816be48 README + docker-restart.sh add 2021-08-25 16:27:22 -07:00