Compare commits

...

4 commits
prod ... main

Author SHA1 Message Date
D. Scott Boggs 5aea1d3946 Repo is deployment dir
Some checks failed
API Checks / clippy (push) Has been cancelled
Frontend Checks / lint (push) Has been cancelled
Frontend Checks / typecheck (push) Has been cancelled
Deploy API / Deploy to Fly.io (push) Has been cancelled
Deploy Frontend / Deploy to Vercel (push) Has been cancelled
Rather than putting the source repo in a build dir and having a mount dir next to that, the
source repo itself is the deployment dir, with the mount dir inside of it. We do not want
to commit the contents of the database to the repo obviously
2025-05-08 08:54:57 -04:00
D. Scott Boggs 13c5193344 Fix Next config to match example Dockerfile expectations 2025-05-08 08:54:30 -04:00
D. Scott Boggs e459bb20ee UID/GID 1000 was in use 2025-05-08 08:54:30 -04:00
D. Scott Boggs 4b7ec853b1 Password files must be trimmed of newlines 2025-05-08 08:54:30 -04:00
5 changed files with 16 additions and 7 deletions

2
.gitignore vendored
View file

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

View file

@ -188,11 +188,14 @@ fn get_connection_string() -> String {
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
// file (presumably under /run/secrets/)
let password = fs::read(&password_file_location).unwrap_or_else(|err| {
let password = fs::read(&password_file_location)
.unwrap_or_else(|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");
url.set_password(Some(String::from_utf8_lossy(password.as_slice()).as_ref()))
url.set_password(Some(password))
.unwrap_or_else(|_| panic!("invalid database URL: {connection_string:?}"));
url.to_string()
} else {

View file

@ -35,7 +35,7 @@ pub async fn cleanup<A: Adaptor>(
println!("Error reading CRON_KEY_FILE at {path:?}");
return Err(ApiError::NotAuthorized);
};
String::from_utf8_lossy(key.as_slice()).into()
String::from_utf8_lossy(key.as_slice()).to_owned().trim_end().to_string()
} else {
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.
ENV NEXT_TELEMETRY_DISABLED=1
RUN addgroup --system --gid 1000 nodejs
RUN adduser --system --uid 1000 nextjs
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public

4
frontend/next.config.js Normal file
View file

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