blob: 047d28e4b5694ccfe8516ad385b2e5533a1cc98e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# clog
Blog hacked in C using
[kore.io](https://kore.io),
[PostgreSQL](https://www.postgresql.org),
[Markdown](https://github.com/mity/md4c),
& [Mermaid](https://mermaid.js.org).
## Running
```sh
docker compose up
```
## Build and run locally
Install kore & then:
```sh
make
```
Make sure a database is up & then
```sh
./run-local.sh
```
## Notes
To run locally modify `conf/clog.conf`, comment out `root /var/chroot/` and uncomment
the `skip chroot` section:
```conf
privsep worker {
runas clog
# root /var/chroot/
skip chroot
}
```
Maybe disable `seccomp_tracing` in `conf/clog.conf` if running into problems:
```conf
seccomp_tracing no
# seccomp_tracing yes
```
## Bootstrapping the database
Use `psql` and load `db/db.sql` for models,
`db/data.sql` for some example data.
## TODO
1. Pagination.
2. Delete entries.
3. Fix `tests.py` to work after refactor.
4. Have `tests.py` load and drop database.
5. Get rid of `requests` dependency in `tests.py`.
6. Fix query parsing for search.
7. Add preview functionality to edit form.
## Using C in 2024 is dangerous?
I guess it depends:
* [https://chromium.googlesource.com/chromium/src/+/master/docs/security/rule-of-2.md](https://chromium.googlesource.com/chromium/src/+/master/docs/security/rule-of-2.md)
* [https://verdagon.dev/blog/when-to-use-memory-safe-part-1](https://verdagon.dev/blog/when-to-use-memory-safe-part-1)
|