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

Limit fix #119

Closed
wants to merge 302 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
302 commits
Select commit Hold shift + click to select a range
d9e8712
Merge branch 'query-performance'
unenglishable Feb 20, 2024
4cf4024
ci(config/runtime): allow logger level definition in env
unenglishable Feb 21, 2024
e11dc8b
fix(helpers/proxy_conversion): use return_tuple in by_thread
unenglishable Feb 23, 2024
931797e
Merge branch 'query-performance'
unenglishable Feb 23, 2024
395041e
feat(porcelain): add porcelain as dependency to run external command …
akinsey May 16, 2024
3c830a7
feat(bbcode-parse-route): add skeleton route for bbcode parser
akinsey May 17, 2024
9b000f9
refactor(bbcode-parser): wip test porcelain shell attempting to run p…
akinsey May 17, 2024
5f647fa
feat(bbcode-parser): add skeleton to run php script for bbcode parser…
akinsey May 21, 2024
4ec5927
refactor(bbcode-parser): wip port bbcode parser
akinsey May 22, 2024
5088ca0
refactor(bbcode-parser): wip comment out code until parser runs
akinsey May 24, 2024
65a9ecb
refactor(wip-bbcode): partially working bbcode parser
akinsey May 28, 2024
d13c167
Merge remote-tracking branch 'origin/main' into legacy-bbcode-parser
akinsey May 28, 2024
f6ef7c9
refactor(wip-bbcode): escape single quote for php bbcode script input
akinsey May 28, 2024
9eb8e30
fix(bbcode): no auth for bbcode parser
akinsey May 29, 2024
60829c6
Merge remote-tracking branch 'real/main'
unenglishable May 30, 2024
2ed644f
Merge remote-tracking branch 'real/legacy-bbcode-parser'
unenglishable May 30, 2024
af54a8e
refactor(wip-parser): wip implement parser for legacy bbcode
akinsey Jun 11, 2024
d7a3a69
Merge remote-tracking branch 'real/legacy-bbcode-parser'
unenglishable Jun 11, 2024
2c381e7
ci(dockerfile): install php
unenglishable Jun 11, 2024
6b82b5f
Merge remote-tracking branch 'real/legacy-bbcode-parser'
unenglishable Jun 11, 2024
9018fd2
ci(dockerfile): -y tho
unenglishable Jun 11, 2024
d62e949
Merge remote-tracking branch 'real/legacy-bbcode-parser'
unenglishable Jun 11, 2024
9f6f4d8
fix(json/post:by_thread_proxy): convert singular post to list
unenglishable Jun 12, 2024
c89b329
fix(json/post:by_thread_proxy): remove !
unenglishable Jun 12, 2024
b5dbccb
fix(bbcode-parser): use smileys and increase max input length
akinsey Jun 13, 2024
b00dbe7
Merge remote-tracking branch 'real/legacy-bbcode-parser'
unenglishable Jun 13, 2024
0b40270
fix(json/post:by_thread_proxy): add else case for post list conversion
unenglishable Jun 13, 2024
33d37ee
refactor(parser): move parsing code out of controller/route and direc…
akinsey Jun 17, 2024
247a3c3
Merge pull request #15 from slickage/parser
unenglishable Jun 26, 2024
b489577
fix(config/runtime): cast system env values to bool
unenglishable Jul 18, 2024
a1cf2ec
Merge remote-tracking branch 'real/main'
unenglishable Aug 16, 2024
1da71dd
yolo(config/runtime): add issuer to prod config
unenglishable Aug 16, 2024
e3453e9
Merge remote-tracking branch 'real/main'
unenglishable Aug 26, 2024
4184009
Merge branch 'epochtalk:main' into main
unenglishable Sep 10, 2024
24a061c
Merge pull request #17 from epochtalk/main
unenglishable Sep 24, 2024
2240cb1
feat(smf_loader): add smf_loader
unenglishable Sep 18, 2024
029e7cd
refactor(smf_loader): trim lines before splitting them
unenglishable Sep 18, 2024
f590b8f
feat(smf_loader): map boards from smf to epochtalk format
unenglishable Sep 24, 2024
ad1c071
feat(smf_loader): implement tabulate_boards_map
unenglishable Sep 24, 2024
4c917be
feat(smf_loader): write data to tsv file
unenglishable Sep 24, 2024
b719af7
feat(smf_loader): use tsv file parser/converter/writer in convert_smf…
unenglishable Sep 24, 2024
c615bdd
feat(mix): add recase to deps
unenglishable Sep 24, 2024
180fd2b
feat(smf_loader): process board mappings with boards and return
unenglishable Sep 24, 2024
6de12cf
fix(smf_loader): switch file import mode for boards from Stream to Fi…
unenglishable Sep 25, 2024
7b24ef8
fix(smf_loader): decode html entities in board name and description
unenglishable Sep 25, 2024
431bc7a
feat(smf_loader): implement categories mappings
unenglishable Sep 25, 2024
7e94c0b
refactor(smf_loader): remove recase as dependency
unenglishable Sep 25, 2024
bd595d8
Merge remote-tracking branch 'boka/smf'
unenglishable Sep 25, 2024
80d48a8
feat(recent-thread-proxy): implement proxy for recent threads
akinsey Sep 27, 2024
120605d
fix(config): Fix error with missing id_board_blacklist
crod951 Sep 27, 2024
ef30629
refactor(dev): Refactored port and pool_size function
crod951 Sep 27, 2024
564b290
feat(user-avatars): Added functionality to pull user-avatars from pro…
crod951 Sep 27, 2024
40f42a2
Merge pull request #18 from slickage/user-avatars
akinsey Sep 27, 2024
69d28f7
fix(recent-threads): add json for recent threads, remove unneeded params
akinsey Sep 27, 2024
507571f
Merge pull request #19 from slickage/recent-threads
crod951 Sep 27, 2024
73dac84
feat(smf_loader): replace "/" in board slug with "-"
unenglishable Oct 2, 2024
85e1e6d
feat(smf-polls): query poll data from smf with threads
akinsey Oct 3, 2024
b134fd7
fix(long-post-query): order by id_msg instead of poster time to speed…
akinsey Oct 3, 2024
14fa2e2
fix(parser-variables): add missing brower check variables for bbcode …
akinsey Oct 3, 2024
974bcec
refactor(polls): update variable name
akinsey Oct 3, 2024
be491f0
Merge remote-tracking branch 'origin/polls' into signatures
akinsey Oct 3, 2024
2c98405
feat(helpers/proxy_conversion): build board counts from smf data
unenglishable Oct 4, 2024
7fcbce7
feat(controllers/board): implement proxy_by_category and use board_co…
unenglishable Oct 4, 2024
d19ac53
feat(json/board): stitch in board thread/post counts on render in pro…
unenglishable Oct 4, 2024
6c8e768
style(json/thread): lastest -> latest
unenglishable Oct 4, 2024
6698019
feat(helpers/proxy_conversion): build board_last_post_info from smf q…
unenglishable Oct 4, 2024
d59639c
feat(controllers/board): load board_last_post_info
unenglishable Oct 4, 2024
8cb3eda
refactor(json/board): extract functionality to map query return to mo…
unenglishable Oct 4, 2024
2cf1d78
refactor(json/board): use map merge instead of loading by key
unenglishable Oct 4, 2024
7c2feb1
feat(json/board): append smf proxy last post info to boards
unenglishable Oct 4, 2024
93e8fb7
feat(signatures): implement signatures and merit and activity
akinsey Oct 4, 2024
57abab3
Merge pull request #20 from slickage/polls
unenglishable Oct 4, 2024
7ecf630
Merge pull request #21 from slickage/typo-fix
akinsey Oct 4, 2024
2058c98
Merge remote-tracking branch 'origin/main' into signatures
akinsey Oct 4, 2024
9678119
Merge pull request #24 from slickage/signatures
unenglishable Oct 4, 2024
b504365
Merge pull request #22 from slickage/smf
akinsey Oct 4, 2024
56e07a2
Merge pull request #23 from slickage/board-metadata
akinsey Oct 4, 2024
d41750c
fix(post-avatars): Fixed avatars not loading for last post on thread …
crod951 Oct 10, 2024
f18e58d
refactor(breadcrumbs): use proxy to build breadcrumbs for threads
crod951 Oct 10, 2024
23f0cc8
refactor(proxy-conversion): refactored some proxy_conversion function…
crod951 Oct 11, 2024
13ee899
refactor(child-boards): refactored proxy_by_board() and proxy_by_thre…
crod951 Oct 11, 2024
8a91cf3
Merge pull request #25 from slickage/avatars
akinsey Oct 11, 2024
255b0f8
Merge pull request #26 from slickage/breadcrumbs
akinsey Oct 11, 2024
1f7b491
Merge pull request #27 from slickage/child-boards
akinsey Oct 11, 2024
ebad48b
fix(breadcrumbs): fixing errors with breadcrumbs after child-boards m…
crod951 Oct 11, 2024
a7524a0
fix(breadcrumbs): refactor thread breadcrumbs
crod951 Oct 11, 2024
594e029
Merge remote-tracking branch 'real/main'
unenglishable Oct 15, 2024
7241ee4
ci(github/workflows/main): remove test and release tasks
unenglishable Oct 17, 2024
7b73724
style(): mix format
unenglishable Oct 17, 2024
1b23033
refactor(smf_loader): add module doc
unenglishable Oct 17, 2024
6f6c3c2
refactor(controllers/thread): split check_proxy, match on action
unenglishable Oct 17, 2024
d2e7ce7
style(controllers/thread): mix format
unenglishable Oct 17, 2024
1bce199
refactor(config): re-consolidate proxy configs
unenglishable Oct 17, 2024
ec3eb15
refactor(application): remove smf repo from supervisor tree in :test env
unenglishable Oct 17, 2024
0a6fe89
style(): mix format
unenglishable Oct 17, 2024
327bb1b
Merge branch 'refactor-configs' into ci
unenglishable Oct 18, 2024
9392713
refactor(config/dev): remove config for smf repo
unenglishable Oct 18, 2024
dec9e3a
Merge branch 'refactor-configs' into ci
unenglishable Oct 18, 2024
8d82eb4
refactor(config/runtime): use convenience methods for loading env var…
unenglishable Oct 18, 2024
41633e7
Merge branch 'refactor-configs' into ci
unenglishable Oct 18, 2024
a969a71
refactor(config/runtime): modify board/thread seq to start at -10 for…
unenglishable Oct 18, 2024
ff97c47
refactor(controllers/board): check boards seq in proxy :by_category
unenglishable Oct 18, 2024
b5a6d91
fix(json/board_json): remove proxy options from non proxy :by_category
unenglishable Oct 18, 2024
645a364
Merge remote-tracking branch 'real/main'
akinsey Oct 18, 2024
6cea787
Merge remote-tracking branch 'real/main'
akinsey Oct 21, 2024
1a8bfe7
fix(static-testing): resolve issues with credo and formatting for tes…
akinsey Oct 22, 2024
fa6bfe5
feat(user-find): initial db query for user find, updated to query by …
akinsey Oct 22, 2024
f11ff6e
feat(user-find-route): implement initial route for user find proxy
akinsey Oct 23, 2024
d698369
ci(github/workflows/main): add build and push image step
unenglishable Oct 23, 2024
96a165e
ci(github/workflows/main): depend on static analysis before pushing t…
unenglishable Oct 23, 2024
fe66fd8
ci(github/workflows/main): update action versions (add v)
unenglishable Oct 23, 2024
a1ff657
fix(helpers/breadcrumbs): return correctly for nonexistant thread
unenglishable Oct 24, 2024
31da5bd
style(helpers/breadcrumbs): mix format
unenglishable Oct 24, 2024
12d4d06
ci(github/workflows/main): re-enable test job
unenglishable Oct 24, 2024
18cd1bc
Merge commit '6cea787' into ci
unenglishable Oct 24, 2024
718cca8
Revert "fix(static-testing): resolve issues with credo and formatting…
unenglishable Oct 24, 2024
ffd6975
ci(github/workflows/main): depend on test before build and push
unenglishable Oct 24, 2024
30a4e19
feat(profile): bring back user id in last post info for linking to pr…
akinsey Oct 24, 2024
ebdb77c
feat(posts-by-username): implement db query for posts by username proxy
akinsey Oct 25, 2024
727bf89
Merge pull request #28 from slickage/ci
akinsey Oct 25, 2024
9c4a64a
Merge remote-tracking branch 'origin/main' into profile
akinsey Oct 28, 2024
bd247d8
feat(post-by-username): route for post by username
akinsey Oct 28, 2024
e9a3a74
Revert "fix(json/board_json): remove proxy options from non proxy :by…
unenglishable Oct 29, 2024
aa16630
fix(json/board): handle base case for test
unenglishable Oct 29, 2024
f141bdf
refactor(post-by-username): remove unneeded error check
akinsey Oct 29, 2024
6f414bc
feat(thread-by-username): initial implementation of thread by usernam…
akinsey Oct 29, 2024
3dd381d
Merge pull request #29 from slickage/boards-last-post-fix
akinsey Oct 29, 2024
e48300b
Merge remote-tracking branch 'origin/main' into profile
akinsey Oct 29, 2024
bf3d726
yolo(parser): poolboy parser implementation wip
akinsey Oct 31, 2024
b043e7a
fix(bbcode_parser): check for empty string before running bbcode parser
unenglishable Oct 31, 2024
e271bf8
feat(upgrade-elixir): upgrade to latest elixir
akinsey Nov 1, 2024
b3de482
refactor(bbc-parser): clean up bbcode parser gen server
akinsey Nov 1, 2024
e8bddb4
refactor(general): update code syntax for latest elixir updatE
akinsey Nov 1, 2024
163ad43
style(format): run mix format
akinsey Nov 1, 2024
3d18378
fix(user-find): bring back missing user avatar
akinsey Nov 4, 2024
9f94b85
fix(last-post-user-id): bring back last post user id for linking to u…
akinsey Nov 4, 2024
e282db0
fix(proxy-pagination): fix for prev/next style pagination when there …
akinsey Nov 4, 2024
144b3a4
feat(parser): user async parser for signature, code cleanup
akinsey Nov 4, 2024
4a80097
fix(parser): add missing settings that were causing portuguese charac…
akinsey Nov 4, 2024
c0cb6db
feat(credo): upgrade credo to latest
akinsey Nov 4, 2024
7a41e9a
fix(credo): resolve credo issues in bbc parser
akinsey Nov 4, 2024
8cde747
Merge remote-tracking branch 'origin/bbc-parser' into user-find
akinsey Nov 4, 2024
f618c32
feat(last-active): bring back last post date for last active in user …
akinsey Nov 5, 2024
9bace91
refactor(cleanup): use BBCParser Gen Server for parsing user signatur…
akinsey Nov 7, 2024
8af4e0a
feat(gender): calculate gender for user find proxy
akinsey Nov 7, 2024
94157d7
feat(dob): calculate dob for user find proxy
akinsey Nov 7, 2024
ea39654
feat(thread-view): load metadata for child boards
unenglishable Nov 11, 2024
a0948d9
fix(thread-view): re-add original format_board_data_for_find
unenglishable Nov 11, 2024
d9213e6
style(board_json): mix format
unenglishable Nov 12, 2024
72e7857
Merge pull request #30 from slickage/thread-view-board-meta
akinsey Nov 12, 2024
a5af549
test(static): resolve dialyzer errors after upgrade of elixir/erlang
akinsey Nov 12, 2024
d8dbf14
feat(user-find): convert gender and dob into human readable format
akinsey Nov 12, 2024
42f7e3d
Merge remote-tracking branch 'origin/main' into user-find
akinsey Nov 12, 2024
e09340f
test(warnings): resolve test warnings
akinsey Nov 12, 2024
ea4e4de
refactor(proxy_conversion): multiply by 1000 -> @ms_per_sec
unenglishable Nov 14, 2024
aeb5cf3
refactor(proxy_conversion): implement @limit_exceeded_error
unenglishable Nov 14, 2024
b9cefea
feat(last-active): implement last active, respecting flag showOnline …
akinsey Nov 14, 2024
dfd0a30
fix(last-login): use users last login instead of test value, resolve …
akinsey Nov 14, 2024
0068cf4
refactor(user-find): move manipulation of user object into user_json …
akinsey Nov 14, 2024
1bdd8b6
fix(credo): resolve credo error with user_json
akinsey Nov 14, 2024
99ab836
feat(docker): upgrade elixir version in docker file
akinsey Nov 14, 2024
755640e
feat(board-moderators): Added query to get moderators for all boards …
crod951 Nov 15, 2024
1741f4e
feat(helpers/proxy_conversion): load board last post user avatar
unenglishable Nov 15, 2024
015ac7f
Merge pull request #33 from slickage/board-last-post-avatar
akinsey Nov 15, 2024
40044b4
refactor(config): poolboy_config -> bbc_parser_poolboy_config
unenglishable Nov 15, 2024
dc41123
refactor(bbc_parser): reduce bbc parser php call timeout to 1 second
unenglishable Nov 15, 2024
d0f1a03
style(application): mix format
unenglishable Nov 15, 2024
393278e
Merge branch 'main' into user-find
unenglishable Nov 15, 2024
17baed6
Merge pull request #31 from slickage/user-find
unenglishable Nov 15, 2024
92640e3
Merge remote-tracking branch 'origin/main' into board-moderators
crod951 Nov 15, 2024
e1a8e05
Merge pull request #32 from slickage/board-moderators
akinsey Nov 15, 2024
d976b9d
fix(moderators): Changed to inner join to return only matched values …
crod951 Nov 15, 2024
2b31633
Merge pull request #34 from slickage/moderators-fix
akinsey Nov 15, 2024
2f01aa0
refactor(bbc_parser): async_parse -> parse
unenglishable Nov 18, 2024
2f0d80c
refactor(bbc_parser): return unparsed bbcode on poolboy error
unenglishable Nov 18, 2024
e811005
fix(bbc_parser): handle hanging in genserver parse call
unenglishable Nov 18, 2024
d911e38
fix(bbc_parser): use {:ok, data} format for empty string case
unenglishable Nov 18, 2024
a0e701d
refactor(config/runtime): increase bbcode parser pool size to 50
unenglishable Nov 18, 2024
6e48d6d
style(bbc_parser): mix format
unenglishable Nov 18, 2024
19445ab
fix(parser): resolve issue with with posts ending in backslashes caus…
akinsey Nov 22, 2024
bf28bb0
fix(format): run formatter
akinsey Nov 22, 2024
96bee50
Merge remote-tracking branch 'origin/main' into refactor-proxy-conver…
unenglishable Nov 26, 2024
6c40de6
refactor(proxy_conversion): consolidate model builds into one function
unenglishable Nov 26, 2024
7447735
refactor(controllers/post&thread): use new options form for build_model
unenglishable Nov 26, 2024
54cc0b9
style(): mix format
unenglishable Nov 26, 2024
e63f1f5
refactor(helpers/proxy_conversion): move build_model default case int…
unenglishable Nov 26, 2024
4e0aa86
refactor(proxy_conversion): combine build_model function heads
unenglishable Nov 26, 2024
86bd752
refactor(smf_query): migrate proxy_conversion to smf_query
unenglishable Dec 2, 2024
b295b73
fix(smf_query): pass empty build_model opts as %{}
unenglishable Dec 2, 2024
3366aa1
refactor(smf_query): separate extract_opts functionality into private…
unenglishable Dec 2, 2024
cca5b93
refactor(smf_query): remove board_counts() from build_model
unenglishable Dec 2, 2024
ba1e426
refactor(smf_query): remove board_last_post_info() from build_model
unenglishable Dec 2, 2024
d037520
refactor(smf_query): remove board_moderators() from build_model
unenglishable Dec 2, 2024
f33fd62
refactor(smf_query): remove recent_threads() from build_model
unenglishable Dec 2, 2024
217fba0
refactor(smf_query): remove unused build_model header
unenglishable Dec 2, 2024
0429eba
refactor(smf_query): remove category() from build_model
unenglishable Dec 2, 2024
40ebb14
refactor(smf_query): remove board() from build_model
unenglishable Dec 2, 2024
592d0af
refactor(smf_query): remove thread() from build_model
unenglishable Dec 2, 2024
9df19c6
refactor(smf_query): remove post() from build_model
unenglishable Dec 2, 2024
13cef99
refactor(smf_query): remove poll_by_thread() from build_model
unenglishable Dec 2, 2024
e43ae56
refactor(smf_query): remove find_user() from build_model
unenglishable Dec 2, 2024
a35ff1d
refactor(smf_query): remove unused build_model header
unenglishable Dec 2, 2024
554d71a
refactor(smf_query): remove threads_by_board() from build_model
unenglishable Dec 2, 2024
b29cd4b
refactor(smf_query): remove posts_by_thread() from build_model
unenglishable Dec 3, 2024
db7bd19
refactor(smf_query): remove threads_by_user() from build_model
unenglishable Dec 4, 2024
56acb74
refactor(smf_query): remove posts_by_user() from build_model
unenglishable Dec 4, 2024
7217962
refactor(controllers): limit -> per_page
unenglishable Dec 4, 2024
fdc1ce2
refactor(smf_query): remove unused build_model header
unenglishable Dec 4, 2024
819e77f
refactor(controllers): pass limit into per_page
unenglishable Dec 4, 2024
22fa521
Merge remote-tracking branch 'real/main'
unenglishable Dec 6, 2024
e73fffc
fix(controllers/user): remove {:auth, false} case from logout
unenglishable Dec 6, 2024
2d41119
Merge remote-tracking branch 'origin/main' into refactor-proxy-conver…
unenglishable Dec 6, 2024
b5e7ec7
refactor(config/runtime): update bbc parser configs
unenglishable Dec 10, 2024
e7a6eed
style(config/runtime): mix format
unenglishable Dec 10, 2024
bef1c3d
perf(bbc_parser): don't block with receive when starting bbcode parsers
unenglishable Dec 12, 2024
e4e269f
refactor(bbc_parser): split out parse with proc functionality
unenglishable Dec 12, 2024
6ef431a
feat(bbc_parser): use parse_with_proc for parsing list and list tuple
unenglishable Dec 12, 2024
f27dbfc
refactor(bbc_parser): remove timeout error handling from parse conven…
unenglishable Dec 12, 2024
81b1bf7
feat(post_json): implement format_proxy_posts_for_by_thread
unenglishable Dec 12, 2024
76adcf6
feat(bbc_parser): implement call handler for parsing list tuple
unenglishable Dec 12, 2024
81469e5
feat(bbc_parser): implement list tuple parser batch handler
unenglishable Dec 12, 2024
c3836c9
feat(post_json): use BBCParser.parse_list_tuple on body and signature…
unenglishable Dec 12, 2024
0712421
feat(post_json): zip parsed body/signature data back into posts
unenglishable Dec 12, 2024
43c0102
feat(post_json): add logging to batch processing/zip
unenglishable Dec 12, 2024
e90317d
perf(post_json): use batch processor for formatting proxy posts
unenglishable Dec 12, 2024
4a5e52f
refactor(post_json): remove unused proxy format function
unenglishable Dec 12, 2024
a4991fa
style(post_json,bbc_parser): mix format
unenglishable Dec 12, 2024
885396a
refactor(bbc_parser): update timeouts
unenglishable Dec 12, 2024
80a30e5
fix(bbc_parser): add :timeout atom to genserver tuple timeout return
unenglishable Dec 12, 2024
3b8b579
perf(bbc_parser): reduce genserver tuple call timeout
unenglishable Dec 12, 2024
c921a26
refactor(post_json): log unparsed tuple instead of post on error
unenglishable Dec 12, 2024
288e215
feat(script): implement script to sequentially hit by thread route an…
akinsey Dec 13, 2024
cf4bd49
style(bbc_parser): mix format
unenglishable Dec 13, 2024
8f51391
fix(format): resolve error caused by format
akinsey Dec 13, 2024
cc72f36
Merge pull request #36 from slickage/refactor-proxy-conversion
akinsey Dec 13, 2024
d2721b3
Merge pull request #39 from slickage/thread-parse-script
crod951 Dec 13, 2024
7e776c9
Merge pull request #37 from slickage/bbc-parser-configs
akinsey Dec 13, 2024
cfefcd6
refactor(post_json): extract zip posts function
unenglishable Dec 17, 2024
857f275
style(post_json): mix format
unenglishable Dec 17, 2024
9c844d6
Merge pull request #38 from slickage/bbc-parser-optimization
akinsey Dec 17, 2024
2bd18c4
feat(page-threads): make script that hits thread hit each page of a t…
akinsey Dec 20, 2024
1313520
refactor(config/runtime): section off poolboy configs for bbc_parser
unenglishable Dec 20, 2024
603d14b
feat(config/runtime): add configurations for porcelain timeout
unenglishable Dec 20, 2024
c544e3f
perf(config/runtime): set genserver/poolboy timeouts to default (5000ms)
unenglishable Dec 20, 2024
03ca7cb
feat(config/runtime): load receive timeout from application config
unenglishable Dec 20, 2024
4a52bfc
style(config/runtime): mix format
unenglishable Dec 20, 2024
08a4f41
Merge pull request #40 from slickage/parse-by-thread
unenglishable Dec 20, 2024
553fd50
Merge pull request #41 from slickage/bbc-parser-config
akinsey Dec 20, 2024
9bfd61c
fix(post-limit): set max of 100 for posts by thread
akinsey Jan 9, 2025
5330211
fix(thread-limit): add max of 100 for thread by board
akinsey Jan 9, 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
123 changes: 84 additions & 39 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ on:
branches:
- main

# env settings for github releases
# docker image push
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
dependencies:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -162,44 +168,83 @@ jobs:
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
release:
needs: [test, static_code_analysis]
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Semantic Release
uses: cycjimmy/[email protected]
with:
branches: |
[
'main',
{
name: 'prerelease',
prerelease: true
},
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
elixir_docs:
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/elixir-docs' }}
name: Generate project documentation
# release:
# needs: [test, static_code_analysis]
# name: Release
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/[email protected]
# - name: Semantic Release
# uses: cycjimmy/[email protected]
# with:
# branches: |
# [
# 'main',
# {
# name: 'prerelease',
# prerelease: true
# },
# ]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# elixir_docs:
# if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/elixir-docs' }}
# name: Generate project documentation
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/[email protected]
# - name: Sets up an Erlang/OTP environment
# uses: erlef/setup-beam@v1
# with:
# version-file: .tool-versions
# version-type: strict
# - name: Build docs
# uses: lee-dohm/[email protected]
# - name: Publish to Pages
# uses: peaceiris/[email protected]
# with:
# deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }}
# external_repository: epochtalk/server.epochtalk.github.io
# publish_dir: ./doc
# publish_branch: gh-pages

# build and push image to github container registry
build-and-push-image:
needs: [static_code_analysis, test]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout
uses: actions/[email protected]
- name: Sets up an Erlang/OTP environment
uses: erlef/setup-beam@v1
with:
version-file: .tool-versions
version-type: strict
- name: Build docs
uses: lee-dohm/[email protected]
- name: Publish to Pages
uses: peaceiris/[email protected]
with:
deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }}
external_repository: epochtalk/server.epochtalk.github.io
publish_dir: ./doc
publish_branch: gh-pages
- name: Checkout repository
uses: actions/[email protected]
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
id: push
uses: docker/[email protected]
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# https://docs.github.com/en/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds
- name: Generate artifact attestation
uses: actions/[email protected]
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ priv/repo/seeds/permissions.json

# Ignore secret config files
config/*.secret.exs

#Ignore env file
/.env
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
elixir 1.17.3-otp-27
erlang 27.1.2
php 8.3.7
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
FROM elixir:1.14.0
FROM elixir:1.17.3
# install php
RUN curl -sSL https://packages.sury.org/php/README.txt | bash -x
RUN apt update
RUN apt install -y php8.3

# work in /app instead of /
RUN mkdir -p /app
WORKDIR /app
RUN mix local.hex --force
RUN mix local.rebar --force
ADD . .
RUN mix deps.get

# compile for production
ENV MIX_ENV=prod
COPY mix.exs .
COPY mix.lock .
RUN mix deps.get
COPY . .
RUN mix compile

CMD until mix ecto.setup; do sleep 1; done
4 changes: 4 additions & 0 deletions bbcode.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
var_dump($argc); //number of arguments passed
var_dump($argv); //the arguments passed
?>
3 changes: 3 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import Config
# Set ecto repos
config :epochtalk_server, ecto_repos: [EpochtalkServer.Repo]

# Configure Porcelain
config :porcelain, driver: Porcelain.Driver.Basic

# Set Guardian.DB to GuardianRedis
config :guardian, Guardian.DB, repo: GuardianRedis.Repo

Expand Down
152 changes: 152 additions & 0 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -404,3 +404,155 @@ if config_env() == :prod do
port: get_env_cast_integer_with_default.("EMAILER_SMTP_PORT", "465")
end
end

##### PROXY REPO CONFIGURATIONS #####

# configurations for bbcode parser
bbc_parser_config =
case config_env() do
:prod ->
%{
poolboy: %{
size: get_env_cast_integer_with_default.("BBC_PARSER_WORKERS", "50"),
max_overflow: get_env_cast_integer_with_default.("BBC_PARSER_OVERFLOW", "20")
},
parser: %{
porcelain_receive_timeout:
get_env_cast_integer_with_default.("BBC_PARSER_PORCELAIN_TIMEOUT", "100")
}
}

_ ->
%{
poolboy: %{
size: 5,
max_overflow: 2
},
parser: %{
porcelain_receive_timeout: 100
}
}
end

# configure poolboy for bbcode parser
bbc_parser_poolboy_config = [
name: {:local, :bbc_parser},
worker_module: EpochtalkServer.BBCParser,
size: bbc_parser_config.poolboy.size,
max_overflow: bbc_parser_config.poolboy.max_overflow,
strategy: :fifo
]

config :epochtalk_server, bbc_parser_poolboy_config: bbc_parser_poolboy_config

# configure bbcode parser
config :epochtalk_server, bbc_parser_config: bbc_parser_config.parser

# conditionally show debug logs in prod
if config_env() == :prod do
logger_level =
System.get_env("LOGGER_LEVEL")
|> case do
"DEBUG" -> :debug
_ -> :info
end

config :logger, level: logger_level
end

# Configure proxy sequences and boards blacklist
proxy_config =
case config_env() do
:prod ->
id_board_blacklist =
get_env_or_raise_with_message.(
"ID_BOARD_BLACKLIST",
"environment variable ID_BOARD_BLACKLIST is missing."
)

id_board_blacklist =
id_board_blacklist
|> String.split()
|> Enum.map(&String.to_integer(&1))

%{
threads_seq: System.get_env("THREADS_SEQ") || "6000000",
boards_seq: System.get_env("BOARDS_SEQ") || "500",
id_board_blacklist: id_board_blacklist
}

:dev ->
%{
threads_seq: "6000000",
boards_seq: "500",
id_board_blacklist: []
}

# default thread/board seq and empty blacklist
_ ->
%{
threads_seq: "-10",
boards_seq: "-10",
id_board_blacklist: []
}
end

config :epochtalk_server, proxy_config: proxy_config

# Configure SmfRepo for proxy
# - do not configure for testing
if config_env() != :test do
smf_repo_username =
get_env_or_raise_with_message.(
"SMF_REPO_USERNAME",
"environment variable SMF_REPO_USERNAME is missing."
)

smf_repo_password =
get_env_or_raise_with_message.(
"SMF_REPO_PASSWORD",
"environment variable SMF_REPO_PASSWORD is missing."
)

smf_repo_hostname =
get_env_or_raise_with_message.(
"SMF_REPO_HOSTNAME",
"environment variable SMF_REPO_HOSTNAME is missing."
)

smf_repo_database =
get_env_or_raise_with_message.(
"SMF_REPO_DATABASE",
"environment variable SMF_REPO_DATABASE is missing."
)

proxy_repo_config =
case config_env() do
:prod ->
[
username: smf_repo_username,
password: smf_repo_password,
hostname: smf_repo_hostname,
database: smf_repo_database,
port: get_env_cast_integer_with_default.("SMF_REPO_PORT", "3306"),
stacktrace: get_env_cast_bool_with_default.("SMF_REPO_STACKTRACE", "TRUE"),
show_sensitive_data_on_connection_error:
get_env_cast_bool_with_default.("SMF_REPO_SENSITIVE_DATA_ON_ERROR", "FALSE"),
pool_size: get_env_cast_integer_with_default.("SMF_REPO_POOL_SIZE", "10")
]

_ ->
[
username: smf_repo_username,
password: smf_repo_password,
hostname: smf_repo_hostname,
database: smf_repo_database,
port: get_env_cast_integer_with_default.("SMF_REPO_PORT", "3306"),
stacktrace: true,
show_sensitive_data_on_connection_error: true,
pool_size: get_env_cast_integer_with_default.("SMF_REPO_POOL_SIZE", "10")
]
end

config :epochtalk_server, EpochtalkServer.SmfRepo, proxy_repo_config
end
25 changes: 17 additions & 8 deletions lib/epochtalk_server/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ defmodule EpochtalkServer.Application do
{Redix, host: redix_config()[:host], name: redix_config()[:name]},
# Start the Ecto repository
EpochtalkServer.Repo,
# Start the Smf repository
EpochtalkServer.SmfRepo,
# Start the BBC Parser
:poolboy.child_spec(:bbc_parser, bbc_parser_poolboy_config()),
# Start Role Cache
EpochtalkServer.Cache.Role,
# Warm frontend_config variable (referenced by api controllers)
Expand All @@ -38,15 +42,17 @@ defmodule EpochtalkServer.Application do
# {EpochtalkServer.Worker, arg}
]

# don't run config_warmer during tests
# adjust supervised processes for testing
children =
if Application.get_env(:epochtalk_server, :env) == :test,
do:
List.delete(
children,
{Task, &EpochtalkServer.Models.Configuration.warm_frontend_config/0}
),
else: children
if Application.get_env(:epochtalk_server, :env) == :test do
children
# don't run config warmer during tests
|> List.delete({Task, &EpochtalkServer.Models.Configuration.warm_frontend_config/0})
# don't run SmfRepo during tests
|> List.delete(EpochtalkServer.SmfRepo)
else
children
end

# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
Expand All @@ -64,4 +70,7 @@ defmodule EpochtalkServer.Application do

# fetch redix config
defp redix_config(), do: Application.get_env(:epochtalk_server, :redix)

defp bbc_parser_poolboy_config,
do: Application.get_env(:epochtalk_server, :bbc_parser_poolboy_config)
end
Loading
Loading