Compare commits
2 Commits
9b52524548
...
v0.31.2-im
Author | SHA1 | Date | |
---|---|---|---|
992257a8b1 | |||
d49d32fbc6 |
22
Dockerfile
22
Dockerfile
@ -1,28 +1,16 @@
|
|||||||
FROM rust:1.77.1-buster AS builder
|
FROM alpine:3.19
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY ./ ./
|
|
||||||
|
|
||||||
RUN cargo build --release
|
|
||||||
|
|
||||||
FROM debian:stable
|
|
||||||
|
|
||||||
ARG TARGET
|
ARG TARGET
|
||||||
|
|
||||||
RUN apt-get update
|
RUN apk add --no-cache curl
|
||||||
RUN apt-get install -y ca-certificates wget
|
|
||||||
|
|
||||||
RUN apt-get clean -y; \
|
RUN curl -L https://github.com/redlib-org/redlib/releases/latest/download/redlib-${TARGET}.tar.gz | \
|
||||||
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
|
tar xz -C /usr/local/bin/
|
||||||
|
|
||||||
COPY --from=builder /app/target/release/ /usr/local/bin
|
|
||||||
|
|
||||||
RUN adduser --home /nonexistent --no-create-home --disabled-password redlib
|
RUN adduser --home /nonexistent --no-create-home --disabled-password redlib
|
||||||
|
|
||||||
USER redlib
|
USER redlib
|
||||||
|
|
||||||
# Tell Docker to expose port 808
|
# Tell Docker to expose port 8080
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
# Run a healthcheck every minute to make sure redlib is functional
|
# Run a healthcheck every minute to make sure redlib is functional
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
FROM alpine:3.19
|
|
||||||
|
|
||||||
ARG TARGET
|
|
||||||
|
|
||||||
RUN apk add --no-cache curl
|
|
||||||
|
|
||||||
RUN curl -L https://github.com/redlib-org/redlib/releases/latest/download/redlib-${TARGET}.tar.gz | \
|
|
||||||
tar xz -C /usr/local/bin/
|
|
||||||
|
|
||||||
RUN adduser --home /nonexistent --no-create-home --disabled-password redlib
|
|
||||||
USER redlib
|
|
||||||
|
|
||||||
# Tell Docker to expose port 8080
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
# Run a healthcheck every minute to make sure redlib is functional
|
|
||||||
HEALTHCHECK --interval=1m --timeout=3s CMD wget --spider --q http://localhost:8080/settings || exit 1
|
|
||||||
|
|
||||||
CMD ["redlib"]
|
|
||||||
|
|
@ -883,7 +883,8 @@ pub fn rewrite_urls(input_text: &str) -> String {
|
|||||||
let text1 =
|
let text1 =
|
||||||
// Rewrite Reddit links to Redlib
|
// Rewrite Reddit links to Redlib
|
||||||
REDDIT_REGEX.replace_all(input_text, r#"href="/"#)
|
REDDIT_REGEX.replace_all(input_text, r#"href="/"#)
|
||||||
.to_string();
|
.to_string()
|
||||||
|
.replace("a href=\"https://preview.redd.it", "img src=\"https://preview.redd.it");
|
||||||
let text1 = REDDIT_EMOJI_REGEX
|
let text1 = REDDIT_EMOJI_REGEX
|
||||||
.replace_all(&text1, format_url(REDDIT_EMOJI_REGEX.find(&text1).map(|x| x.as_str()).unwrap_or_default()))
|
.replace_all(&text1, format_url(REDDIT_EMOJI_REGEX.find(&text1).map(|x| x.as_str()).unwrap_or_default()))
|
||||||
.to_string()
|
.to_string()
|
||||||
|
Reference in New Issue
Block a user