update code
This commit is contained in:
18
Cargo.lock
generated
18
Cargo.lock
generated
@@ -454,6 +454,15 @@ dependencies = [
|
||||
"unicode-normalization",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "imspyder"
|
||||
version = "1.0.0"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"reqwest",
|
||||
"scraper",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "2.1.0"
|
||||
@@ -687,15 +696,6 @@ dependencies = [
|
||||
"windows-targets 0.48.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pbc"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"reqwest",
|
||||
"scraper",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "percent-encoding"
|
||||
version = "2.3.1"
|
||||
|
||||
@@ -12,8 +12,11 @@ COPY ./src src
|
||||
RUN cargo install --path . --color always
|
||||
|
||||
# Copy the app to an base Docker image, here we use distroless
|
||||
FROM debian:bullseye-slim
|
||||
FROM ubuntu:latest
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y ca-certificates
|
||||
RUN update-ca-certificates
|
||||
RUN mkdir -p /cache
|
||||
COPY --from=builder /usr/local/cargo/bin/imspyder /imspyder
|
||||
USER 1000
|
||||
|
||||
@@ -18,6 +18,11 @@ pub(crate) fn write_file(path: &str, content: Bytes) -> Result<(), std::io::Erro
|
||||
}
|
||||
|
||||
pub(crate) fn read_file_string(path: &str) -> Result<String, std::io::Error> {
|
||||
let path = Path::new(path);
|
||||
let folder_path = path.parent();
|
||||
if !folder_path.unwrap().exists() {
|
||||
fs::create_dir_all(folder_path.unwrap().as_os_str())?;
|
||||
}
|
||||
let mut file = File::open(path)?;
|
||||
let mut contents = String::new();
|
||||
file.read_to_string(&mut contents)?;
|
||||
|
||||
Reference in New Issue
Block a user