tangled
alpha
login
or
join now
oppi.li
/
lurker
16
fork
atom
selfhostable, read-only reddit client
16
fork
atom
overview
issues
1
pulls
pipelines
rename to lurker
oppi.li
1 year ago
f11e488e
2dcddd94
+33
-22
8 changed files
expand all
collapse all
unified
split
flake.nix
readme.txt
src
db.js
mixins
head.pug
public
styles.css
views
index.pug
login.pug
register.pug
+15
-15
flake.nix
···
20
overlays.default = final: prev: {
21
node_modules = with final;
22
stdenv.mkDerivation {
23
-
pname = "readit-node-modules";
24
version = "0.0.1";
25
impureEnvVars =
26
lib.fetchers.proxyImpureEnvVars
···
42
outputHashAlgo = "sha256";
43
outputHashMode = "recursive";
44
};
45
-
readit = with final;
46
stdenv.mkDerivation {
47
-
pname = "readit";
48
version = "0.0.1";
49
src = ./.;
50
nativeBuildInputs = [makeBinaryWrapper];
···
84
});
85
86
packages = forAllSystems (system: {
87
-
inherit (nixpkgsFor."${system}") readit node_modules;
88
});
89
90
-
defaultPackage = forAllSystems (system: nixpkgsFor."${system}".readit);
91
92
apps = forAllSystems (system: let
93
pkgs = nixpkgsFor.${system};
94
in {
95
default = {
96
type = "app";
97
-
program = "${pkgs.readit}/bin/readit";
98
};
99
});
100
···
108
}:
109
with lib; {
110
options = {
111
-
services.readit = {
112
enable = mkOption {
113
type = types.bool;
114
default = false;
115
-
description = "Enable readit";
116
};
117
port = mkOption {
118
type = types.int;
119
default = 3000;
120
-
description = "Port to run readit on";
121
};
122
};
123
};
124
125
-
config = mkIf config.services.readit.enable {
126
nixpkgs.overlays = [self.overlays.default];
127
-
systemd.services.readit = {
128
-
description = "readit service";
129
wantedBy = ["multi-user.target"];
130
131
serviceConfig = {
132
-
ListenStream = "0.0.0.0:${toString config.services.readit.port}";
133
-
ExecStart = "${pkgs.readit}/bin/readit";
134
Restart = "always";
135
};
136
137
# If the binary needs specific environment variables, set them here
138
environment = {
139
-
READIT_PORT = "${toString config.services.readit.port}";
140
};
141
};
142
};
···
20
overlays.default = final: prev: {
21
node_modules = with final;
22
stdenv.mkDerivation {
23
+
pname = "lurker-node-modules";
24
version = "0.0.1";
25
impureEnvVars =
26
lib.fetchers.proxyImpureEnvVars
···
42
outputHashAlgo = "sha256";
43
outputHashMode = "recursive";
44
};
45
+
lurker = with final;
46
stdenv.mkDerivation {
47
+
pname = "lurker";
48
version = "0.0.1";
49
src = ./.;
50
nativeBuildInputs = [makeBinaryWrapper];
···
84
});
85
86
packages = forAllSystems (system: {
87
+
inherit (nixpkgsFor."${system}") lurker node_modules;
88
});
89
90
+
defaultPackage = forAllSystems (system: nixpkgsFor."${system}".lurker);
91
92
apps = forAllSystems (system: let
93
pkgs = nixpkgsFor.${system};
94
in {
95
default = {
96
type = "app";
97
+
program = "${pkgs.lurker}/bin/lurker";
98
};
99
});
100
···
108
}:
109
with lib; {
110
options = {
111
+
services.lurker = {
112
enable = mkOption {
113
type = types.bool;
114
default = false;
115
+
description = "Enable lurker";
116
};
117
port = mkOption {
118
type = types.int;
119
default = 3000;
120
+
description = "Port to run lurker on";
121
};
122
};
123
};
124
125
+
config = mkIf config.services.lurker.enable {
126
nixpkgs.overlays = [self.overlays.default];
127
+
systemd.services.lurker = {
128
+
description = "lurker service";
129
wantedBy = ["multi-user.target"];
130
131
serviceConfig = {
132
+
ListenStream = "0.0.0.0:${toString config.services.lurker.port}";
133
+
ExecStart = "${pkgs.lurker}/bin/lurker";
134
Restart = "always";
135
};
136
137
# If the binary needs specific environment variables, set them here
138
environment = {
139
+
LURKER_PORT = "${toString config.services.lurker.port}";
140
};
141
};
142
};
+3
-3
readme.txt
···
1
-
nix build .#readit
2
3
todo:
4
- [ ] support crossposts
5
-
- [ ] fix gallery thumbnails
6
- [x] pass query params into templates, add into pagination
7
- [ ] subscription manager: reorder, mass add
8
- [x] styles for info-containers
9
- [ ] open in reddit/reply in reddit link
10
-
- [ ] placeholder for unresolvable thumbnails
11
- [x] expand/collapse comments
12
- [x] fix title rendering in views/comments.pug
13
- [x] fix spacing between comments
···
1
+
nix build .#lurker
2
3
todo:
4
- [ ] support crossposts
5
+
- [x] fix gallery thumbnails
6
- [x] pass query params into templates, add into pagination
7
- [ ] subscription manager: reorder, mass add
8
- [x] styles for info-containers
9
- [ ] open in reddit/reply in reddit link
10
+
- [x] placeholder for unresolvable thumbnails
11
- [x] expand/collapse comments
12
- [x] fix title rendering in views/comments.pug
13
- [x] fix spacing between comments
+1
-1
src/db.js
···
1
const { Database } = require("bun:sqlite");
2
-
const db = new Database("readit.db", {
3
strict: true,
4
});
5
···
1
const { Database } = require("bun:sqlite");
2
+
const db = new Database("lurker.db", {
3
strict: true,
4
});
5
+1
-1
src/mixins/head.pug
···
2
head
3
meta(name="viewport" content="width=device-width, initial-scale=1.0")
4
meta(charset='UTF-8')
5
-
title #{`${title} · readit `}
6
link(rel="stylesheet", href="/styles.css")
7
link(rel="preconnect" href="https://rsms.me/")
8
link(rel="stylesheet" href="https://rsms.me/inter/inter.css")
···
2
head
3
meta(name="viewport" content="width=device-width, initial-scale=1.0")
4
meta(charset='UTF-8')
5
+
title #{`${title} · lurker `}
6
link(rel="stylesheet", href="/styles.css")
7
link(rel="preconnect" href="https://rsms.me/")
8
link(rel="stylesheet" href="https://rsms.me/inter/inter.css")
+5
src/public/styles.css
···
525
color: var(--error-text-color);
526
}
527
0
0
0
0
0
528
.invite-table {
529
width: 100%;
530
padding: 10px 0;
···
525
color: var(--error-text-color);
526
}
527
528
+
.register-message {
529
+
margin-bottom: 1rem;
530
+
flex-flow: row wrap;
531
+
}
532
+
533
.invite-table {
534
width: 100%;
535
padding: 10px 0;
+2
-2
src/views/index.pug
···
14
div.sub-title
15
h1
16
if isMulti
17
-
a(href=`/`) readit
18
else
19
a(href=`/r/${subreddit}`)
20
| r/#{subreddit}
···
30
div.about
31
| consider donating to
32
a(href="https://donate.stripe.com/dR62bTaZH1295Da4gg") oppiliappan
33
-
|, author of readit
34
hr
35
details
36
summary.sorting sorting by #{query.sort + (query.t?' '+query.t:'')}
···
14
div.sub-title
15
h1
16
if isMulti
17
+
a(href=`/`) lurker
18
else
19
a(href=`/r/${subreddit}`)
20
| r/#{subreddit}
···
30
div.about
31
| consider donating to
32
a(href="https://donate.stripe.com/dR62bTaZH1295Da4gg") oppiliappan
33
+
|, author of lurker
34
hr
35
details
36
summary.sorting sorting by #{query.sort + (query.t?' '+query.t:'')}
+3
src/views/login.pug
···
9
if message
10
div.register-error-message
11
| #{message}
0
0
0
12
- var url = redirect ? `/login?redirect=${redirect}` : '/login'
13
form(action=url method="post")
14
div.input-text
···
9
if message
10
div.register-error-message
11
| #{message}
12
+
else
13
+
div.register-message
14
+
| lurker is a read-only reddit client
15
- var url = redirect ? `/login?redirect=${redirect}` : '/login'
16
form(action=url method="post")
17
div.input-text
+3
src/views/register.pug
···
10
if message
11
div.register-error-message
12
| #{message}
0
0
0
13
form(action=`${action}` method="post")
14
div.input-text
15
label(for="username") username
···
10
if message
11
div.register-error-message
12
| #{message}
13
+
else
14
+
div.register-message
15
+
| lurker is a read-only reddit client
16
form(action=`${action}` method="post")
17
div.input-text
18
label(for="username") username