Remove unstable feature and fix docker build

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/1/head
trivernis 4 years ago
parent e42eee2c54
commit d14bb1a687
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -1,4 +1,5 @@
FROM rust AS builder
FROM alpine AS builder
RUN apk add --no-cache build-base cargo
WORKDIR /usr/src
RUN USER=root cargo new snekcloud-server
WORKDIR /usr/src/snekcloud-server

@ -1,4 +1,5 @@
FROM rust AS builder
FROM alpine AS builder
RUN apk add --no-cache build-base cargo
WORKDIR /usr/src
RUN USER=root cargo new snekcloud-server
WORKDIR /usr/src/snekcloud-server
@ -14,4 +15,4 @@ FROM scratch
COPY --from=builder /usr/src/snekcloud-server/target/release/snekcloud-server .
COPY --from=builder /usr/src/snekcloud-server/target/release/config /
COPY --from=builder /usr/src/snekcloud-server/target/release/private_key /
ENTRYPOINT ["./snekcloud-server"]
ENTRYPOINT ["/snekcloud-server"]

@ -62,12 +62,9 @@ pub fn extract_public_key(content: &str) -> SnekcloudResult<PublicKey> {
/// Extracts a base64 encoded key between the prefix and suffix
fn extract_key(content: &str, prefix: &str, suffix: &str) -> SnekcloudResult<[u8; 32]> {
let mut content = content
.strip_prefix(prefix)
.ok_or(SnekcloudError::InvalidKey)?;
content = content
.strip_suffix(suffix)
.ok_or(SnekcloudError::InvalidKey)?;
if !content.starts_with(prefix) || !content.ends_with(suffix) {}
let mut content = content.trim_start_matches(prefix);
content = content.trim_end_matches(suffix);
let key = base64::decode(content)?;
if key.len() != 32 {

Loading…
Cancel
Save