Skip to content

Commit

Permalink
deprecate custom css
Browse files Browse the repository at this point in the history
replaced by custom index html page
  • Loading branch information
ohwgiles committed Dec 5, 2020
1 parent 5e64844 commit ec237f4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
6 changes: 0 additions & 6 deletions src/http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,6 @@ kj::Promise<void> Http::request(kj::HttpMethod method, kj::StringPtr url, const
return writeLogChunk(c, s);
}).attach(kj::mv(output)).attach(kj::mv(stream)).attach(kj::mv(lw));
}
} else if(url == "/custom/style.css") {
responseHeaders.set(kj::HttpHeaderId::CONTENT_TYPE, "text/css; charset=utf-8");
responseHeaders.add("Content-Transfer-Encoding", "binary");
std::string css = laminar.getCustomCss();
auto stream = response.send(200, "OK", responseHeaders, css.size());
return stream->write(css.data(), css.size()).attach(kj::mv(css)).attach(kj::mv(stream));
} else if(resources->handleRequest(url.cStr(), &start, &end, &content_type)) {
responseHeaders.set(kj::HttpHeaderId::CONTENT_TYPE, content_type);
responseHeaders.add("Content-Encoding", "gzip");
Expand Down
13 changes: 0 additions & 13 deletions src/laminar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -826,16 +826,3 @@ R"x(
return true;
}

// TODO: deprecate
std::string Laminar::getCustomCss() {
KJ_IF_MAYBE(cssFile, fsHome->tryOpenFile(kj::Path{"custom","style.css"})) {
static bool warningShown = false;
if(!warningShown) {
LLOG(WARNING, "Custom CSS has been deprecated and will be removed from a future release. Use a custom HTML template instead.");
warningShown = true;
}
return (*cssFile)->readAllText().cStr();
} else {
return std::string();
}
}
5 changes: 0 additions & 5 deletions src/laminar.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ class Laminar final {
// if the job is unknown.
bool handleBadgeRequest(std::string job, std::string& badge);

// Fetches the content of $LAMINAR_HOME/custom/style.css or an empty
// string. Ideally, this would instead be served by a proper web server
// which handles this url.
std::string getCustomCss();

// Aborts a single job
bool abort(std::string job, uint buildNum);

Expand Down

0 comments on commit ec237f4

Please sign in to comment.