You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/modules
zeripath bb0ff77e46
Share HTML template renderers and create a watcher framework (#20218)
The recovery, API, Web and package frameworks all create their own HTML
Renderers. This increases the memory requirements of Gitea
unnecessarily with duplicate templates being kept in memory.

Further the reloading framework in dev mode for these involves locking
and recompiling all of the templates on each load. This will potentially
hide concurrency issues and it is inefficient.

This PR stores the templates renderer in the context and stores this
context in the NormalRoutes, it then creates a fsnotify.Watcher
framework to watch files.

The watching framework is then extended to the mailer templates which
were previously not being reloaded in dev.

Then the locales are simplified to a similar structure.

Fix #20210 
Fix #20211
Fix #20217

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years ago
..
activitypub Refactor AssertExistsAndLoadBean to use generics (#20797) 3 years ago
analyze Simplify `IsVendor` (#19626) 3 years ago
appstate Use a struct as test options (#19393) 3 years ago
auth Remove legacy `+build:` constraint (#19582) 3 years ago
avatar Remove legacy `+build:` constraint (#19582) 3 years ago
base Add more linters to improve code readability (#19989) 3 years ago
cache Update go-chi/cache to utilize Ping() (#19719) 3 years ago
charset Share HTML template renderers and create a watcher framework (#20218) 2 years ago
container Move reaction to models/issues/ (#19264) 3 years ago
context Share HTML template renderers and create a watcher framework (#20218) 2 years ago
convert Move some files into models' sub packages (#20262) 2 years ago
csv Allow render HTML with css/js external links (#19017) 3 years ago
doctor Move some files into models' sub packages (#20262) 2 years ago
emoji format with gofumpt (#18184) 3 years ago
eventsource Move some files into models' sub packages (#20262) 2 years ago
generate Use base32 for 2FA scratch token (#18384) 3 years ago
git Set no-tags in git fetch on compare (#20893) 2 years ago
gitgraph Add more linters to improve code readability (#19989) 3 years ago
graceful Support Proxy protocol (#12527) 2 years ago
hcaptcha hCaptcha Support (#12594) 4 years ago
highlight Rework file highlight rendering and fix yaml copy-paste (#19967) 3 years ago
hostmatcher Add proxy host into allow list (#20798) 2 years ago
httpcache Add Cache-Control header to html and api responses, add no-transform (#20432) 3 years ago
httplib refactor httplib (#18338) 3 years ago
indexer Fix `dump-repo` git init, fix wrong error type for NullDownloader (#20182) 3 years ago
json Refactor legacy `unknwon/com` package, improve golangci lint (#19284) 3 years ago
lfs Removed some vestigial code related to Range bounds checks (#20312) 3 years ago
log Disable doctor logging on panic (#20847) 2 years ago
markup Should also support upper-case README files (#20581) 3 years ago
mcaptcha Add support mCaptcha as captcha provider (#20458) 3 years ago
metrics Move some files into models' sub packages (#20262) 2 years ago
migration Fix `dump-repo` git init, fix wrong error type for NullDownloader (#20182) 3 years ago
mirror Implement sync push mirror on commit (#19411) 3 years ago
nosql Fix various typos (#20338) 3 years ago
notification Move some files into models' sub packages (#20262) 2 years ago
options Share HTML template renderers and create a watcher framework (#20218) 2 years ago
packages Add migrate repo archiver and packages storage support on command line (#20757) 3 years ago
paginator Remove legacy unmaintained packages, refactor to support change default locale (#19308) 3 years ago
password Fixed assert statements. (#16089) 4 years ago
pprof refactor: move from io/ioutil to io and os package (#17109) 3 years ago
private Support Proxy protocol (#12527) 2 years ago
process Add more linters to improve code readability (#19989) 3 years ago
proxy Return nil proxy function if proxy not enabled (#16742) 4 years ago
proxyprotocol Support Proxy protocol (#12527) 2 years ago
public Remove legacy `+build:` constraint (#19582) 3 years ago
queue Add more linters to improve code readability (#19989) 3 years ago
recaptcha refactor: move from io/ioutil to io and os package (#17109) 3 years ago
references Add more linters to improve code readability (#19989) 3 years ago
regexplru Custom regexp external issues (#17624) 3 years ago
repository Move some files into models' sub packages (#20262) 2 years ago
secret Use `CryptoRandomBytes` instead of `CryptoRandomString` (#18439) 3 years ago
session format with gofumpt (#18184) 3 years ago
setting Only show relevant repositories on explore page (#19361) 2 years ago
sitemap Add sitemap support (#18407) 3 years ago
ssh Support Proxy protocol (#12527) 2 years ago
storage Add more linters to improve code readability (#19989) 3 years ago
structs Add new API endpoints for push mirrors management (#19841) 3 years ago
svg Remove legacy `+build:` constraint (#19582) 3 years ago
sync Use queue instead of memory queue in webhook send service (#19390) 3 years ago
templates Share HTML template renderers and create a watcher framework (#20218) 2 years ago
test Refactor AssertExistsAndLoadBean to use generics (#20797) 3 years ago
timeutil Share HTML template renderers and create a watcher framework (#20218) 2 years ago
translation Share HTML template renderers and create a watcher framework (#20218) 2 years ago
typesniffer Rework raw file http header logic (#20484) 3 years ago
updatechecker format with gofumpt (#18184) 3 years ago
upload Simplify parameter types (#18006) 3 years ago
uri Prevent NPE if gitea uploader fails to open url (#18080) 3 years ago
user Add gitea-vet (#10948) 5 years ago
util Share HTML template renderers and create a watcher framework (#20218) 2 years ago
validation use IsLoopback (#19477) 3 years ago
watcher Share HTML template renderers and create a watcher framework (#20218) 2 years ago
web refactor webhook *NewPost (#20729) 3 years ago