Skip to content
Merged

Dev #246

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
545 commits
Select commit Hold shift + click to select a range
a26744f
changed services_new to workers and made service for integration crea…
toasted226 Jan 27, 2026
cabb397
extracted integration update, delete and key generation into services
toasted226 Jan 27, 2026
b66b9ba
extracted bundle category updating into service
toasted226 Jan 27, 2026
b6235c4
extracted filtered feed updating into service
toasted226 Jan 27, 2026
3f02ff0
extracted update filtered posts into service
toasted226 Jan 27, 2026
18dab72
extracted services for feeds
toasted226 Jan 27, 2026
168c0d0
extracted services for feed categories
toasted226 Jan 27, 2026
3cb9101
extracted services for bundle categories
toasted226 Jan 27, 2026
ad4bfb2
extracted service for getting filtered feeds in bundle
toasted226 Jan 27, 2026
32db197
extracted bundle handler work into services
toasted226 Jan 27, 2026
ae0cabd
cleaned up some admin endpoints
toasted226 Jan 27, 2026
297e4df
added docstrings
toasted226 Jan 27, 2026
e2c8149
fixed requested changes in bundle services
toasted226 Jan 28, 2026
18670a2
removed more unnecessary service calls
toasted226 Jan 28, 2026
6e7760d
deleted unused services
toasted226 Jan 28, 2026
bb2f731
removed unnecessary service calls
toasted226 Jan 28, 2026
16b991d
removed more unnecessary service calls and deleted unused services
toasted226 Jan 28, 2026
a745fbd
deleted more unnecessary services
toasted226 Jan 28, 2026
7b42224
fixed bugs
toasted226 Jan 28, 2026
4b99eda
removed unnecessary :*
toasted226 Jan 29, 2026
2b8db15
cleaned up integration services
toasted226 Jan 29, 2026
128f4f3
Merge branch 'dev' of https://github.com/modulr-software/source-be in…
toasted226 Jan 29, 2026
abca315
Merge pull request #161 from modulr-software/refactor/handler-services
toasted226 Jan 29, 2026
17b099c
moved job registration to handlers to avoid cyclic dependencies
toasted226 Jan 29, 2026
488505a
implemented endpoint to schedule user deletion and endpoint to cancel…
toasted226 Jan 29, 2026
8b915c1
fixed deletion time to 30 days
toasted226 Jan 29, 2026
b5b2ade
added todos for extracting services
toasted226 Jan 29, 2026
90a6c1a
added soft user deletion
toasted226 Feb 2, 2026
893e3f9
created workers for user soft deletion and used the approach of redac…
toasted226 Feb 2, 2026
ecda03c
fixed handler bug for bundles
toasted226 Feb 2, 2026
142a89e
updated jobs to filter out removed user posts
toasted226 Feb 3, 2026
ab27ab8
Merge pull request #162 from modulr-software/feat/user-deletion
toasted226 Feb 3, 2026
c8027f5
initial postgres refactor work
toasted226 Feb 4, 2026
14b51fb
changes to connection setup
toasted226 Feb 6, 2026
59b6a5b
endpoint fixes and schema validation changes for postgres
toasted226 Feb 6, 2026
016ff3c
conn cleanup
toasted226 Feb 6, 2026
a510ac1
set up bundle migrations to create tenanted tables on master instead
toasted226 Feb 6, 2026
2590242
Merge pull request #164 from modulr-software/refactor/table-tenancy
toasted226 Feb 6, 2026
ea35c97
refactored more bundle-ds calls to use tables instead, fixed migrations
toasted226 Feb 9, 2026
bd1c685
fixed integration deletion to use tables instead of bundle ds
toasted226 Feb 9, 2026
2180860
refactored tname function to return {:tname tname} for threadability
toasted226 Feb 9, 2026
510c039
updated migrations to use refactored tname
toasted226 Feb 9, 2026
3faad00
removed unnecessary dependency
toasted226 Feb 9, 2026
0a0c4bc
Merge pull request #165 from modulr-software/refactor/tenancy-service…
toasted226 Feb 9, 2026
c6faf60
updated config to use database url instead of separate fields
toasted226 Feb 9, 2026
f5ae330
updated config
toasted226 Feb 9, 2026
d30101f
changed region from johannesburg to frankfurt
toasted226 Feb 10, 2026
7b28ccd
updated region
toasted226 Feb 10, 2026
3d2ebf2
removed extra pair of brackets
toasted226 Feb 11, 2026
ca7c8eb
optimised bundle job handler, staggered job executions
toasted226 Feb 11, 2026
f93c1db
Merge pull request #167 from modulr-software/bugfix/job-optimisation
toasted226 Feb 12, 2026
ee20890
Merge pull request #163 from modulr-software/refactor/postgres
toasted226 Feb 12, 2026
0007424
Merge branch 'dev' into hotfix/latest-filter-fix
toasted226 Feb 12, 2026
22d7963
Merge pull request #166 from modulr-software/hotfix/latest-filter-fix
toasted226 Feb 12, 2026
c66e976
added used categories endpoint for getting all categories for which f…
toasted226 Feb 12, 2026
9702451
fixed regression bug in bundle content types migration and readded po…
toasted226 Feb 12, 2026
003ab2e
removed services and middleware for api keys, including the endpoints…
toasted226 Feb 12, 2026
c87ca13
fixed bug in integrations updating
toasted226 Feb 13, 2026
81d5062
Merge pull request #171 from modulr-software/hotfix/integration-updat…
toasted226 Feb 13, 2026
fce5df8
updated post shuffling to be seeded using seeded-shuffle from prandom…
toasted226 Feb 13, 2026
3346d88
removed temporary fix to outgoing posts
toasted226 Feb 16, 2026
7b41432
Added thorough documentation for all bundle endpoints
toasted226 Feb 16, 2026
4802c3b
added source backend postman collection
toasted226 Feb 16, 2026
c4328df
referenced the postman collection in our docs
toasted226 Feb 16, 2026
55493cf
renamed feeds to RSS feeds in docs
toasted226 Feb 16, 2026
2e5c819
added fullstops to docs
toasted226 Feb 16, 2026
63dc108
Merge pull request #169 from modulr-software/deprecate/api-keys
toasted226 Feb 16, 2026
0b0dbea
Merge branch 'dev' of https://github.com/modulr-software/source-be in…
toasted226 Feb 16, 2026
a5dfd27
added optional seed query param
toasted226 Feb 16, 2026
1a6ae76
Merge pull request #168 from modulr-software/feat/used-categories
toasted226 Feb 16, 2026
2c0518c
added migration for postgres xml schemas and new xml schema services
toasted226 Feb 17, 2026
59fb7d5
removed old services and datahike utils
toasted226 Feb 17, 2026
055190e
removed db dir from config
toasted226 Feb 17, 2026
b17421a
removed datahike dependency
toasted226 Feb 17, 2026
3833354
updated all endpoints and handlers to use new services and removed ev…
toasted226 Feb 17, 2026
4fe5213
Merge branch 'dev' of https://github.com/modulr-software/source-be in…
toasted226 Feb 17, 2026
9272db3
switched from jdbc to pg2
toasted226 Feb 17, 2026
971208a
Merge pull request #173 from modulr-software/refactor/pg2-driver
merveillevaneck Feb 17, 2026
b621768
Merge pull request #172 from modulr-software/refactor/remove-datahike
merveillevaneck Feb 17, 2026
b592bf8
removed circ dependency
toasted226 Feb 17, 2026
0f85480
Merge pull request #174 from modulr-software/hotfix/removed-useless-i…
merveillevaneck Feb 17, 2026
330a960
fixed migration
toasted226 Feb 18, 2026
a016bcf
Merge pull request #175 from modulr-software/hotfix/fixed-bundle-cont…
toasted226 Feb 18, 2026
24c28e5
updated outgoing posts endpoint to use single query instead of multip…
toasted226 Feb 19, 2026
3be5ca1
Merge pull request #180 from modulr-software/refactor/bundle-endpoint…
toasted226 Feb 19, 2026
e520f5f
added deployment scripts
merveillevaneck Feb 19, 2026
6769118
Merge pull request #181 from modulr-software/feat/deployment-scripts
toasted226 Feb 19, 2026
59690e6
fixed start script
merveillevaneck Feb 19, 2026
b024779
Merge pull request #182 from modulr-software/hotfix/fixed-start-script
toasted226 Feb 19, 2026
ad161d8
optimised feeds and posts endpoints to both use a single SQL query
toasted226 Feb 20, 2026
598d743
Merge pull request #183 from modulr-software/refactor/posts-feeds-opt…
merveillevaneck Feb 20, 2026
11c3a93
added indices for a number of tables and foreign keys in migrations
toasted226 Feb 20, 2026
a98f0f4
Merge pull request #184 from modulr-software/feat/indices
merveillevaneck Feb 20, 2026
691cfbd
fixed business schema to allow optional fields
toasted226 Feb 23, 2026
28dc1e0
fixed event deletion in hard-delete-feed function
toasted226 Feb 23, 2026
65f5fda
added missing brackets in function call
toasted226 Feb 23, 2026
cdead2b
removed deprecated validation calls in analytics endpoints
toasted226 Feb 23, 2026
c2d433b
added function in analytics core to automatically convert all instanc…
toasted226 Feb 23, 2026
69a55e8
fixed bug in user type validation authorisation
toasted226 Feb 23, 2026
91ca6ff
updated postman collection to remove old local tokens and added analy…
toasted226 Feb 23, 2026
c1157d8
removed unnecessary let binding
toasted226 Feb 23, 2026
f821324
improved documentation and added descriptions for bundle and integrat…
toasted226 Feb 23, 2026
307dff6
Merge pull request #187 from modulr-software/fix/feed-deletion-and-sc…
toasted226 Feb 23, 2026
05eab25
Merge pull request #192 from modulr-software/feat/documentation-update
merveillevaneck Feb 23, 2026
1610695
Merge pull request #191 from modulr-software/fix/analytics-endpoints
merveillevaneck Feb 23, 2026
c2e240f
optimised bundle categories endpoint and allowed for content type fil…
toasted226 Feb 24, 2026
48b9207
added bundle exists endpoint
toasted226 Feb 24, 2026
4989faa
updated postman collection
toasted226 Feb 24, 2026
af0dcb8
updated dependencies and response schema in exists endpoint
toasted226 Feb 24, 2026
b998cbc
removed db.util as dependency from exists endpoint
toasted226 Feb 24, 2026
a27131f
Merge pull request #195 from modulr-software/feat/bundle-categories-f…
toasted226 Feb 24, 2026
ed999a2
updated bundle category filtering to force checking intersection of a…
toasted226 Feb 24, 2026
5c7e2fa
improved pagination for bundle posts endpoint
toasted226 Feb 24, 2026
5aefb4b
updated returned result to have a pagination field with the data and …
toasted226 Feb 25, 2026
6c31e6f
removed 404
toasted226 Feb 25, 2026
1bda97b
Merge pull request #196 from modulr-software/fix/bundle-category-filt…
toasted226 Feb 25, 2026
2bd7c78
updated response on bundle_posts endpoint to use constructed response…
toasted226 Feb 25, 2026
dcca91b
removed thread last in bundle posts endpoint
toasted226 Feb 25, 2026
1ccc216
Merge pull request #197 from modulr-software/feat/improved-pagination
toasted226 Feb 25, 2026
2f1904b
put all analytics writing functions into transaction blocks
toasted226 Feb 25, 2026
66b2268
Merge pull request #198 from modulr-software/feat/transactionalise-an…
toasted226 Feb 25, 2026
5da8fd7
fixed schema
toasted226 Feb 25, 2026
6d20ae7
Merge pull request #199 from modulr-software/hotfix/fix-bundle-posts-…
toasted226 Feb 25, 2026
d29ecde
added migration for descriptions on feeds
toasted226 Feb 25, 2026
4fd242b
updated extraction to pull descriptions
toasted226 Feb 25, 2026
a243e2a
updated schemas to use top level schemas in requests and added descri…
toasted226 Feb 25, 2026
2ddfd22
fixed nil exception when pagination is not used
toasted226 Feb 25, 2026
d8e6246
Merge pull request #201 from modulr-software/hotfix/fix-pagination
toasted226 Feb 25, 2026
7f08ffa
added support for regular youtube link as rss feed and fetching youtu…
toasted226 Feb 26, 2026
ff7166b
added feed title in posts endpoints
toasted226 Feb 26, 2026
ac991cf
Merge pull request #204 from modulr-software/feat/added-feed-title-in…
toasted226 Feb 26, 2026
5644333
Merge branch 'dev' of https://github.com/modulr-software/source-be in…
toasted226 Feb 26, 2026
b277afb
updated feed schemas and added a malli dissoc helper that accepts mul…
toasted226 Feb 26, 2026
6afa608
fixed sql query
toasted226 Feb 26, 2026
eb13b45
Merge pull request #205 from modulr-software/hotfix/fixed-content-typ…
toasted226 Feb 26, 2026
62af1c5
added query parameter to allow truncation
toasted226 Feb 26, 2026
e90d3bf
Merge pull request #200 from modulr-software/feat/feed-descriptions
toasted226 Feb 26, 2026
f12bdc8
Merge branch 'dev' into feat/improved-youtube-support
toasted226 Feb 26, 2026
5c997fa
refactored to use hickory instead of enlive
toasted226 Feb 27, 2026
45dfbc2
Merge branch 'feat/improved-youtube-support' of https://github.com/mo…
toasted226 Feb 27, 2026
bdcc8a5
tightened rss feed checking
toasted226 Feb 27, 2026
c145eb0
Merge pull request #203 from modulr-software/feat/improved-youtube-su…
toasted226 Feb 27, 2026
0b597a8
Merge branch 'dev' of https://github.com/modulr-software/source-be in…
toasted226 Feb 27, 2026
24499f1
extracted query parameters in bundle posts
toasted226 Feb 27, 2026
5e2b0b4
Merge pull request #206 from modulr-software/feat/allow-truncation
toasted226 Feb 27, 2026
986499f
added better error handling in important worker functions
toasted226 Mar 2, 2026
2bf9e6f
added better error logs in job handlers
toasted226 Mar 2, 2026
6eac469
added error logs in bundle authorisation and error handling middleware
toasted226 Mar 2, 2026
36ad591
wrapped various database writes in pg/with-transaction to transaction…
toasted226 Mar 2, 2026
75f3ee7
added logger utility and replaced println calls with logger calls
toasted226 Mar 2, 2026
db0c776
added schemas to job endpoints
toasted226 Mar 3, 2026
b1519f4
added missing response schemas
toasted226 Mar 3, 2026
ef018aa
use modified top level schemas instead of rewriting
toasted226 Mar 3, 2026
118b816
Merge pull request #211 from modulr-software/feat/job-endpoint-schemas
toasted226 Mar 3, 2026
9e9fc6f
added admin endpoints to manage categories
toasted226 Mar 3, 2026
d275146
actually delete the category itself
toasted226 Mar 3, 2026
4e618a2
Merge pull request #213 from modulr-software/feat/admin-category-endp…
merveillevaneck Mar 3, 2026
e2565f7
implemented email verification endpoints
toasted226 Mar 3, 2026
60515c4
fixed feed enum schema
toasted226 Mar 3, 2026
9d0f03c
Merge pull request #214 from modulr-software/hotfix/fix-feed-schema
toasted226 Mar 3, 2026
924c50d
fixed merge conflict in reitit
toasted226 Mar 4, 2026
bf85dd2
updated email hash migration to ensure all admins have verified emails
toasted226 Mar 4, 2026
f3260e0
updated swagger schemas in user route
toasted226 Mar 4, 2026
888bc82
Merge pull request #215 from modulr-software/feat/email-verification
toasted226 Mar 4, 2026
3ec856b
fixed schema in email verify endpoint
toasted226 Mar 4, 2026
781df5d
Merge pull request #217 from modulr-software/hotfix/fix-email-verify-…
toasted226 Mar 4, 2026
8159add
updated tnames to return only the table names, excluding the maps
toasted226 Mar 6, 2026
9359906
fixed job starter to have 0 as a base value for delays instead of nil
toasted226 Mar 6, 2026
a124513
fixed bug when deleting integrations
toasted226 Mar 6, 2026
294451b
fixed type issue in user deletion and function call in feed deletion
toasted226 Mar 6, 2026
a80cdbd
Merge branch 'dev' of https://github.com/modulr-software/source-be in…
toasted226 Mar 6, 2026
aee028b
Merge pull request #218 from modulr-software/bugfix/fixed-deletion
toasted226 Mar 6, 2026
dc9a411
made migration to insert business types
toasted226 Mar 6, 2026
ff00b17
Merge pull request #219 from modulr-software/feat/business-types
toasted226 Mar 6, 2026
af4ba24
added migration to add and seed integration types, and added integrat…
toasted226 Mar 6, 2026
6f86395
updated db schema
toasted226 Mar 6, 2026
8693313
added and updated endpoints to work with integration types and integr…
toasted226 Mar 6, 2026
525a2ad
replaced logger with a new dependency called telemere
toasted226 Mar 10, 2026
ddae9c4
Merge branch 'dev' of https://github.com/modulr-software/source-be in…
toasted226 Mar 10, 2026
6f1701d
Merge pull request #221 from modulr-software/feat/integration-types
toasted226 Mar 10, 2026
20e961a
Merge branch 'dev' of https://github.com/modulr-software/source-be in…
toasted226 Mar 10, 2026
4ba88cd
Merge pull request #207 from modulr-software/feat/error-logging
toasted226 Mar 10, 2026
c136041
fixed merge conflicts with dev latest
toasted226 Mar 10, 2026
61368bc
wrapped more writes in transactions
toasted226 Mar 10, 2026
8b2e22e
fixed formatting
toasted226 Mar 10, 2026
1cc3983
Merge pull request #208 from modulr-software/feat/transactionalise-wr…
toasted226 Mar 11, 2026
d9bfc96
updated server to start job service first before initiating jobs
toasted226 Mar 11, 2026
2cca203
updated prepare-congest-metadata everywhere to pass in the job servic…
toasted226 Mar 11, 2026
59ab069
Merge branch 'dev' of https://github.com/modulr-software/source-be in…
toasted226 Mar 11, 2026
45bdc8c
prevent soft-deleted users from using non-GET endpoints
toasted226 Mar 11, 2026
fa4a553
removed auth from /mail/report endpoint
toasted226 Mar 11, 2026
e4af562
updated job deregistration to be done in soft deletion instead, avoid…
toasted226 Mar 12, 2026
3ed560c
migration 15 was incorrect adding a column called integration_id inst…
toasted226 Mar 13, 2026
221a100
Merge pull request #225 from modulr-software/hotfix/fix-integration-t…
toasted226 Mar 13, 2026
369ef12
updated auth middleware such that it displays a different error messa…
toasted226 Mar 13, 2026
b4a25eb
updated auth middleware to return 403 if user has been archived, alwa…
toasted226 Mar 13, 2026
c4e55c9
Merge pull request #224 from modulr-software/feat/block-deleted-user-…
toasted226 Mar 13, 2026
dddbf57
Merge branch 'dev' of https://github.com/modulr-software/source-be in…
toasted226 Mar 13, 2026
390dc6c
Merge pull request #223 from modulr-software/bugfix/fixed-user-deleti…
toasted226 Mar 13, 2026
fa7d6ab
added config to allow changing the port number
toasted226 Mar 17, 2026
835f707
Merge pull request #227 from modulr-software/feat/port-config
toasted226 Mar 18, 2026
4c72362
updated deployment process
toasted226 Mar 18, 2026
b3b66d4
updated readme
toasted226 Mar 18, 2026
0d23b14
added logging info to readme
toasted226 Mar 18, 2026
2354f85
updated readme to change minimum java version to 16
toasted226 Mar 18, 2026
8acc6c0
updated according to requested changes, used System/getenv to get env…
toasted226 Mar 19, 2026
8775f63
Merge pull request #228 from modulr-software/feat/deployment-config
toasted226 Mar 19, 2026
2fc060f
updated check for rss feed url for youtube to allow for playlists as …
toasted226 Mar 19, 2026
8aa36fd
Merge pull request #229 from modulr-software/fix/allow-for-yt-playlists
toasted226 Mar 19, 2026
74f25ac
added macro for connecting to database depending on environment (dev …
toasted226 Mar 19, 2026
f37dc73
changed the default conn strings to be more generic
toasted226 Mar 20, 2026
f5917bb
added docstrings for util functions
toasted226 Mar 20, 2026
7728b5a
Merge pull request #230 from modulr-software/feat/db-conn-by-env
toasted226 Mar 20, 2026
87569dd
added migration for prod categories seeding
toasted226 Mar 24, 2026
c325061
Merge pull request #231 from modulr-software/feat/category-seeding
toasted226 Mar 24, 2026
be36d24
added migration to replace sectors list with those from categories
toasted226 Mar 26, 2026
215c5b0
added env to fly
toasted226 Mar 26, 2026
929a28a
Merge pull request #233 from modulr-software/hotfix/add-staging-env-t…
toasted226 Mar 26, 2026
9ca4f11
fixed fly java path
toasted226 Mar 26, 2026
c3cd778
Merge pull request #234 from modulr-software/hotfix/fly-java-path
toasted226 Mar 26, 2026
03a6ced
Merge pull request #232 from modulr-software/feat/sectors-migration
merveillevaneck Mar 27, 2026
38b2784
fixed endpoint schema for updating provider
toasted226 Mar 27, 2026
fd52dc7
Merge pull request #235 from modulr-software/hotfix/fix-update-provid…
toasted226 Mar 27, 2026
1ee22ed
delete user sectors before deleting sectors
toasted226 Mar 27, 2026
871f4eb
Merge pull request #236 from modulr-software/hotfix/delete-user-sectors
toasted226 Mar 27, 2026
2cff5f9
added github actions workflow for deploying to prod on merge to main
toasted226 Mar 27, 2026
fae1dea
updated path in workflow
toasted226 Mar 30, 2026
e957a13
added github workflow for deploying to tailscale staging server
toasted226 Mar 30, 2026
c7db4be
updated systemctl command to use sudo
toasted226 Mar 30, 2026
49e44f1
fixed typo
toasted226 Mar 30, 2026
5e4554d
updated tailscale workflow to use authkey instead of oauth2
toasted226 Mar 31, 2026
98051bf
Merge pull request #237 from modulr-software/feat/prod-github-workflow
merveillevaneck Mar 31, 2026
1a2bb9f
updated tailscale workflow to specify statedir according to docs
toasted226 Mar 31, 2026
5e41fc4
Merge pull request #238 from modulr-software/hotfix/fix-staging-workflow
toasted226 Mar 31, 2026
34fc5d9
updated staging workflow with tailscale
toasted226 Mar 31, 2026
aee34d1
Merge pull request #239 from modulr-software/hotfix/attempt-two-fix-s…
toasted226 Mar 31, 2026
83595c5
attempt 3 using oauth to fix staging workflow
toasted226 Apr 1, 2026
f7bfed3
Merge branch 'dev' into hotfix/attempt-three-fix-staging-workflow
toasted226 Apr 1, 2026
1a43769
Merge pull request #240 from modulr-software/hotfix/attempt-three-fix…
toasted226 Apr 1, 2026
81e4069
attempt 4 fixing staging workflow by providing password
toasted226 Apr 1, 2026
d130bce
Merge pull request #241 from modulr-software/hotfix/attempt-four-fix-…
toasted226 Apr 1, 2026
ef9a718
remove appleboy run ssh manually instead
toasted226 Apr 1, 2026
d62da06
Merge pull request #242 from modulr-software/hotfix/attempt-four-fix-…
toasted226 Apr 1, 2026
67fc17f
fixed category seeding to keep old categories
toasted226 Apr 7, 2026
4c5c646
Merge pull request #243 from modulr-software/fix/updated-category-mig…
toasted226 Apr 9, 2026
46e523a
concatenated ellipsis to truncated descriptions
toasted226 Apr 10, 2026
c60d72d
Merge pull request #244 from modulr-software/feat/truncation-ellipsis
toasted226 Apr 10, 2026
9f12742
Execute build script in staging deploy workflow
toasted226 Apr 10, 2026
211e92d
send verification email after google registration
toasted226 Apr 15, 2026
ffbd6c6
Merge pull request #245 from modulr-software/hotfix/fix-google-auth-e…
merveillevaneck Apr 15, 2026
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
18 changes: 0 additions & 18 deletions .github/workflows/fly-deploy.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/fly.staging.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/prod-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Prod Deploy
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy to Prod
runs-on: ubuntu-latest
concurrency: deploy-group # optional: ensure only one action runs at a time
steps:
- name: Execute remote SSH commands using password
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd /home/deploy/source-be
git checkout main
git pull
./build.sh
sudo /bin/systemctl restart source-be
29 changes: 29 additions & 0 deletions .github/workflows/staging-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Staging Deploy
on:
push:
branches:
- dev
jobs:
deploy:
name: Deploy to Staging
runs-on: ubuntu-latest
concurrency: deploy-group
steps:
- uses: actions/checkout@v4

- name: Connect to Tailscale
uses: tailscale/github-action@v4
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
ping: mervstation.tail4f070.ts.net

- name: Execute remote SSH commands
run: |
ssh -o StrictHostKeyChecking=no merv@mervstation.tail4f070.ts.net '
cd /home/merv/Developer/source-be
git pull
./build.sh
sudo /bin/systemctl restart source-be
'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ source-users
dev/dev.clj
.nrepl-port
target/
resources/admins_encrypted.json

.db
admins.json
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
21
48 changes: 45 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@

This is the backend for the Source platform. You can find documentation on setup for development below.

## Dependencies

- >= openjdk version 16.

## Development setup

- Pull the project from GitHub.
- Create a .env file containing the following required information:

```.env
SUPER_SECRET_KEY [string, minimum 32 characters]
EMAIL_USERNAME [string, email username used for sending emails]
EMAIL_PASSWORD [string, email password used for sending emails]
GOOGLE_CLIENT_ID [string, from Google Console]
GOOGLE_CLIENT_SECRET [string, from Google Console]
DATABASE_URL [string, connection URL to Postgres instance, excluding database name and trailing forward slash]
```

- Run the provided shell script with `./nrepl.sh` to start your nrepl server. For this, you will need the required nrepl alias in `.clojure/deps.edn`.
Expand All @@ -19,9 +26,9 @@ When you have made changes, you can restart the server by evaluating `server/res

## Database Migration

Database migration is handled using the provided migrate.sh shell script.
You should have a db directory and ensure your configuration is pointing to it. The default is `.db/` in the root,
this can be configured with the `DATABASE_DIR` variable in the environment.
Database migration is handled using the provided `migrate.sh` shell script.
You need to have a Postgresql connection string in order to run migrations,
this can be configured with the `DATABASE_URL` variable in the environment.

The migration system makes use of the kepler/mallard library, take a look at their [docs](https://github.com/kepler16/mallard) to find out more on how it works.
The datasource you will be operating on is passed in as context to the run-up and run-down functions.
Expand Down Expand Up @@ -56,3 +63,38 @@ We are making use of cognitect-labs/test-runner for running our tests. Run the p
Unit tests are written and placed in clj files in `tests/source-be/`. These files should have the `_test` postfix (e.g. google_auth_test.clj) and tests should be
written per namespace and cover all important functions.

## Production Setup

- Pull the project from GitHub and navigate to its directory.
- Ensure you have Java installed, minimum openjdk version 16.
- Create a .env file containing the following required information:

```.env
# These values are secrets, ensure they are not exposed anywhere else on your system
SUPER_SECRET_KEY [string, minimum 32 characters]
EMAIL_USERNAME [string, email username used for sending emails]
EMAIL_PASSWORD [string, email password used for sending emails]
GOOGLE_CLIENT_ID [string, from Google Console]
GOOGLE_CLIENT_SECRET [string, from Google Console]
DATABASE_URL [string, connection URL to Postgres instance, excluding database name and trailing forward slash]

# These values are required for config and compiling the project
ENV [string, "dev" | "staging" | "prod"] # This should match your config file, e.g. if ENV is "staging", your config file should be called staging_config.edn
JAVA_CMD [string, path pointing to your Java executable]
```

- If there isn't already a `config.edn` file for your target environment in the `resources/` directory, create a config file using the given `resources/dev_config.edn`
as a template as shown below:
```bash
cp resources/config.edn resources/{env_name}_config.edn
```
where `{env_name}` is the value of the `ENV` variable set in your `.env`.
You can configure everything for your machine inside your config.edn file, alternatively, you can configure everything marked with `#env` from `{env_name}_config.edn`
within your `.env` file.

- If everything before this point is set up correctly, you are ready to begin the next steps.

- Run `./build.sh` to the compile the project.
- Run `./start.sh` to start the server. The server will use the config according to the specified environment in `.env` and will run migrations before starting.

The logs will be displayed when the server is run. If you are running the server via a systemd service, you can find them by running `journalctl -u {servicename}.service`.
Loading
Loading