Compare commits

..

No commits in common. "5aea1d3946f0e8e1e3dab533942b9ab4078ac3f1" and "120e9b0b4682649eb6f9129ec8712dc658d9bd4d" have entirely different histories.

6 changed files with 13 additions and 24 deletions

4
.gitignore vendored
View file

@ -1,6 +1,2 @@
/graphics /graphics
.DS_Store .DS_Store
**/*.secret
**/*.pw
mounts/

12
api/Cargo.lock generated
View file

@ -326,9 +326,9 @@ dependencies = [
[[package]] [[package]]
name = "backtrace" name = "backtrace"
version = "0.3.75" version = "0.3.74"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a"
dependencies = [ dependencies = [
"addr2line", "addr2line",
"cfg-if", "cfg-if",
@ -1697,9 +1697,9 @@ checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
[[package]] [[package]]
name = "libm" name = "libm"
version = "0.2.15" version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" checksum = "a25169bd5913a4b437588a7e3d127cd6e90127b60e0ffbd834a38f1599e016b8"
[[package]] [[package]]
name = "libredox" name = "libredox"
@ -4230,9 +4230,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]] [[package]]
name = "winnow" name = "winnow"
version = "0.7.10" version = "0.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" checksum = "d9fb597c990f03753e08d3c29efbfcf2019a003b4bf4ba19225c158e1549f0f3"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]

View file

@ -188,14 +188,11 @@ fn get_connection_string() -> String {
if let Some(password_file_location) = env::var_os("DATABASE_PASSWORD_FILE") { if let Some(password_file_location) = env::var_os("DATABASE_PASSWORD_FILE") {
// The password can be left out of the URL, we add it from the specified // The password can be left out of the URL, we add it from the specified
// file (presumably under /run/secrets/) // file (presumably under /run/secrets/)
let password = fs::read(&password_file_location) let password = fs::read(&password_file_location).unwrap_or_else(|err| {
.unwrap_or_else(|err| {
panic!("could not read database password from {password_file_location:?}\n\t{err:?}") panic!("could not read database password from {password_file_location:?}\n\t{err:?}")
}); });
let password = String::from(String::from_utf8_lossy(password.as_slice()));
let password = password.trim_end();
let mut url = Url::parse(&connection_string).expect("invalid connection string"); let mut url = Url::parse(&connection_string).expect("invalid connection string");
url.set_password(Some(password)) url.set_password(Some(String::from_utf8_lossy(password.as_slice()).as_ref()))
.unwrap_or_else(|_| panic!("invalid database URL: {connection_string:?}")); .unwrap_or_else(|_| panic!("invalid database URL: {connection_string:?}"));
url.to_string() url.to_string()
} else { } else {

View file

@ -35,7 +35,7 @@ pub async fn cleanup<A: Adaptor>(
println!("Error reading CRON_KEY_FILE at {path:?}"); println!("Error reading CRON_KEY_FILE at {path:?}");
return Err(ApiError::NotAuthorized); return Err(ApiError::NotAuthorized);
}; };
String::from_utf8_lossy(key.as_slice()).to_owned().trim_end().to_string() String::from_utf8_lossy(key.as_slice()).into()
} else { } else {
Default::default() Default::default()
}; };

View file

@ -33,8 +33,8 @@ ENV NODE_ENV=production
# Uncomment the following line in case you want to disable telemetry during runtime. # Uncomment the following line in case you want to disable telemetry during runtime.
ENV NEXT_TELEMETRY_DISABLED=1 ENV NEXT_TELEMETRY_DISABLED=1
RUN addgroup --system --gid 1001 nodejs RUN addgroup --system --gid 1000 nodejs
RUN adduser --system --uid 1001 nextjs RUN adduser --system --uid 1000 nextjs
COPY --from=builder /app/public ./public COPY --from=builder /app/public ./public

View file

@ -1,4 +0,0 @@
/** @type {import('next').NextConfig} */
module.exports = {
output: 'standalone'
}