Compare commits

...

6 Commits

Author SHA1 Message Date
2bacaa163f Bump to v0.9 2021-04-01 18:00:18 -07:00
48c3a8c0d0 Added Dracula/Nord theme (#171)
* Added Dracula theme

* Updated accent and added Nord theme

* Updated accent and added Nord theme

* Added official foreground colors
2021-04-02 00:56:28 +00:00
c23d2dc50b Re-add unprivileged user to Dockerfile 2021-04-01 12:09:08 -07:00
46dbd88d91 New alpine-based Dockerfile with healthcheck 2021-03-31 13:05:22 -07:00
f0f484288e Fix server.rs function name 2021-03-31 13:03:44 -07:00
90d39b121f Example docker-compose 2021-03-31 13:03:18 -07:00
6 changed files with 51 additions and 14 deletions

View File

@ -3,7 +3,7 @@ name = "libreddit"
description = " Alternative private front-end to Reddit"
license = "AGPL-3.0"
repository = "https://github.com/spikecodes/libreddit"
version = "0.8.2"
version = "0.9.0"
authors = ["spikecodes <19519553+spikecodes@users.noreply.github.com>"]
edition = "2018"

View File

@ -1,17 +1,15 @@
FROM rust:latest as builder
FROM rust:alpine as builder
WORKDIR /usr/src/libreddit
COPY . .
RUN apk add --no-cache g++
RUN cargo install --path .
FROM debian:buster-slim
RUN apt-get update && apt-get install -y libcurl4 && rm -rf /var/lib/apt/lists/*
FROM alpine:latest
RUN apk add --no-cache curl
COPY --from=builder /usr/local/cargo/bin/libreddit /usr/local/bin/libreddit
RUN useradd --system --user-group --home-dir /nonexistent --no-create-home --shell /usr/sbin/nologin libreddit
RUN adduser --system --home /nonexistent --no-create-home --disabled-password libreddit
USER libreddit
EXPOSE 8080
HEALTHCHECK --interval=5m --timeout=3s CMD curl -f http://localhost:8080/settings || exit 1
CMD ["libreddit"]
CMD ["libreddit"]

13
docker-compose.yml Normal file
View File

@ -0,0 +1,13 @@
version: "3.8"
services:
web:
build: .
restart: always
container_name: "libreddit"
ports:
- 8080:8080
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/settings"]
interval: 5m
timeout: 3s

View File

@ -171,9 +171,9 @@ impl Server {
parammed.set_params(found.params().to_owned());
// Run the route's function
let yeet = (found.handler().to_owned().to_owned())(parammed);
let func = (found.handler().to_owned().to_owned())(parammed);
async move {
let res: Result<Response<Body>, String> = yeet.await;
let res: Result<Response<Body>, String> = func.await;
// Add default headers to response
res.map(|mut response| {
response.headers_mut().extend(headers);

View File

@ -65,7 +65,33 @@
--shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
/* Dracula theme setting */
.dracula {
--accent: #bd93f9;
--green: #50fa7b;
--text: #f8f8f2;
--foreground: #3d4051;
--background: #282a36;
--outside: #44475a;
--post: #44475a;
--panel-border: 2px solid #44475a;
--highlighted: #4e5267;
--shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
/* Nord theme setting */
.nord {
--accent: #8fbcbb;
--green: #a3be8c;
--text: #eceff4;
--foreground: #3b4252;
--background: #2e3440;
--outside: #434c5e;
--post: #434c5e;
--panel-border: 2px solid #4c566a;
--highlighted: #3b4252;
--shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
/* General */
::selection {
@ -1231,4 +1257,4 @@ td, th {
padding: 7px 0px;
margin-right: -5px;
}
}
}

View File

@ -15,7 +15,7 @@
<div id="theme">
<label for="theme">Theme:</label>
<select name="theme">
{% call utils::options(prefs.theme, ["system", "light", "dark", "black"], "system") %}
{% call utils::options(prefs.theme, ["system", "light", "dark", "black", "dracula", "nord"], "system") %}
</select>
</div>
<p>Interface</p>