Commit graph

8 commits

Author SHA1 Message Date
Kailash Nadh b5cd9498b1 Refactore all CRUD functions to a new core package.
This is a long pending refactor. All the DB, query, CRUD, and related
logic scattered across HTTP handlers are now moved into a central
`core` package with clean, abstracted methods, decoupling HTTP
handlers from executing direct DB queries and other business logic.

eg: `core.CreateList()`, `core.GetLists()` etc.

- Remove obsolete subscriber methods.
- Move optin hook queries to core.
- Move campaign methods to `core`.
- Move all campaign methods to `core`.
- Move public page functions to `core`.
- Move all template functions to `core`.
- Move media and settings function to `core`.
- Move handler middleware functions to `core`.
- Move all bounce functions to `core`.
- Move all dashboard functions to `core`.
- Fix GetLists() not honouring type
- Fix unwrapped JSON responses.
- Clean up obsolete pre-core util function.
- Replace SQL array null check with cardinality check.
- Fix missing validations in `core` queries.
- Remove superfluous deps on internal `subimporter`.
- Add dashboard functions to `core`.
- Fix broken domain ban check.
- Fix broken subscriber check middleware.
- Remove redundant error handling.
- Remove obsolete functions.
- Remove obsolete structs.
- Remove obsolete queries and DB functions.
- Document the `core` package.
2022-05-03 10:50:29 +05:30
Gokul Menon 04c4552a9c Fixed typos 2022-02-28 14:19:50 +01:00
Kaustubh Maske Patil be1d048e7b Replace whitespace with dash in names of uploaded files 2022-01-15 13:23:58 +05:30
Kailash Nadh 5988ea36cb Sanitize media upload filenames. Closes #397. 2021-06-19 17:11:27 +05:30
Kailash Nadh dba47bca28 Add file extsnsion check to media uploads.
While file content (MIME) check already existed, the lack of file
extension check allowed arbitrary extensions to be uploaded and
then accessed via the static file server. For instance, a .html file
with JPG content intersperesed with Javascript.

This commit adds a file extension check on top of the MIME type check.
2021-05-23 20:17:42 +05:30
Kailash Nadh 62bce6902e Remove "normalization" of non-Latin characters in tags 2021-01-31 13:06:52 +05:30
Kailash Nadh 1aecd6f2e1 Add serverside sort to tables.
Lists, campaigns, and subscribers tables now support server-side
sorting from the UI. This significantly changes the internal
queries from prepared to string interpolated to support dynamic
sort params.
2020-10-24 20:00:29 +05:30
Kailash Nadh f3e80da339 Clean up root and move app to cmd directory 2020-08-08 13:54:25 +05:30
Renamed from utils.go (Browse further)