Skip to content

Commit

Permalink
馃挌 Fix yarn timeout issues during install step (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronleopold committed Apr 26, 2024
1 parent 58c168d commit a71fbe1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
17 changes: 13 additions & 4 deletions core/src/opds/author.rs
Expand Up @@ -13,6 +13,15 @@ pub struct StumpAuthor {
pub uri: Option<String>,
}

impl Default for StumpAuthor {
fn default() -> Self {
Self {
name: "Stump".to_string(),
uri: Some("https://github.com/stumpapp/stump".to_string()),
}
}
}

impl StumpAuthor {
/// Creates a new author.
pub fn new(name: String, uri: Option<String>) -> StumpAuthor {
Expand Down Expand Up @@ -56,7 +65,7 @@ mod tests {

#[test]
fn test_author_with_only_name() {
let author = StumpAuthor::new("Aaron Leopold".to_string(), None);
let author = StumpAuthor::new("Stump".to_string(), None);

let mut writer = EventWriter::new(Vec::new());
author.write(&mut writer).unwrap();
Expand All @@ -66,7 +75,7 @@ mod tests {
r#"
<?xml version="1.0" encoding="utf-8"?>
<author>
<name>Aaron Leopold</name>
<name>Stump</name>
</author>
"#,
);
Expand All @@ -77,7 +86,7 @@ mod tests {
#[test]
fn test_author_with_name_and_uri() {
let author = StumpAuthor::new(
"Aaron Leopold".to_string(),
"Stump".to_string(),
Some("https://www.stumpapp.dev/".to_string()),
);

Expand All @@ -89,7 +98,7 @@ mod tests {
r#"
<?xml version="1.0" encoding="utf-8"?>
<author>
<name>Aaron Leopold</name>
<name>Stump</name>
<uri>https://www.stumpapp.dev/</uri>
</author>
"#,
Expand Down
8 changes: 8 additions & 0 deletions core/src/opds/feed.rs
Expand Up @@ -11,6 +11,7 @@ use tracing::warn;
use xml::{writer::XmlEvent, EventWriter};

use super::{
author::StumpAuthor,
entry::OpdsEntry,
link::{OpdsLinkRel, OpdsLinkType},
util,
Expand Down Expand Up @@ -86,6 +87,9 @@ impl OpdsFeed {
util::write_xml_element("title", &self.title, &mut writer)?;
util::write_xml_element("updated", &updated.to_rfc3339(), &mut writer)?;

let author = StumpAuthor::default();
author.write(&mut writer)?;

if let Some(links) = &self.links {
for link in links {
link.write(&mut writer)?;
Expand Down Expand Up @@ -318,6 +322,10 @@ mod tests {
<id>feed_id</id>
<title>Feed Title</title>
<updated>{{{INSERT}}}</updated>
<author>
<name>Stump</name>
<uri>https://github.com/stumpapp/stump</uri>
</author>
<entry>
<title>Modern Online Philately</title>
<id>urn:uuid:6409a00b-7bf2-405e-826c-3fdff0fd0734</id>
Expand Down
12 changes: 8 additions & 4 deletions docker/Dockerfile
Expand Up @@ -9,9 +9,12 @@ WORKDIR /app

COPY . .

RUN yarn install; \
yarn web build; \
mv ./apps/web/dist build
# https://github.com/nodejs/docker-node/issues/1335
RUN yarn config set network-timeout 300000 && \
yarn install --frozen-lockfile && \
yarn web build && \
mv ./apps/web/dist/ ./build && \
if [ ! -d "./build" ] || [ ! "$(ls -A ./build)" ]; then exit 1; fi

# ------------------------------------------------------------------------------
# Cargo Build Stage
Expand Down Expand Up @@ -78,7 +81,8 @@ COPY --from=frontend /app/build /app/client
COPY docker/entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh; \
ln -s /opt/pdfium/lib/libpdfium.so /lib/libpdfium.so
ln -s /opt/pdfium/lib/libpdfium.so /lib/libpdfium.so; \
if [ ! -d "/app/client" ] || [ ! "$(ls -A /app/client)" ]; then exit 1; fi

# Default Stump environment variables
ENV STUMP_CONFIG_DIR=/config \
Expand Down

0 comments on commit a71fbe1

Please sign in to comment.