Compare commits

..

3 Commits

Author SHA1 Message Date
dd11f0a224 Finalize initial implementation
Some checks failed
Cargo Build & Test / Rust project - latest (stable) (push) Failing after 10s
2025-10-04 18:15:11 -05:00
148f0743c4 Add MUSL build step
Some checks failed
Cargo Build & Test / Rust project - latest (beta) (push) Failing after 8s
Cargo Build & Test / Rust project - latest (stable) (push) Failing after 7s
Cargo Build & Test / Rust project - latest (nightly) (push) Failing after 58s
2025-10-04 16:56:44 -05:00
20b6fe6cc9 Switch container to add support for building for musl 2025-10-04 16:56:04 -05:00
4 changed files with 25 additions and 7 deletions

View File

@@ -10,15 +10,30 @@ env:
jobs:
build_and_test:
name: Rust project - latest
runs-on: rustup-all
runs-on: rustup-all-musl
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
# - beta
# - nightly
steps:
- uses: actions/checkout@v4
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cargo build --verbose
- run: cargo test --verbose
- run: cargo build --release --target=x86_64-unknown-linux-musl
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: gitea.loadingm.xyz
username: "the10thwiz"
password: ${{ secrets.PACKAGE_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
file: 'Dockerfile'
tags: gitea.loadingm.xyz/the10thwiz/gpodder:latest

View File

@@ -3,6 +3,7 @@ WORKDIR /
COPY ./target/x86_64-unknown-linux-musl/release/gpodder-rs /gpodder-rs
COPY ./Rocket.toml /Rocket.toml
COPY ./templates /templates
VOLUME ["/data/"]
CMD ["/gpodder-rs"]

View File

@@ -8,7 +8,7 @@ use crate::{
use rocket::{
Route, TypedError, get, post, routes,
serde::{Deserialize, Serialize, json::Json},
trace::debug,
trace::{debug, info},
};
use rocket_db_pools::{
Connection,
@@ -71,6 +71,7 @@ pub async fn update(
.await?;
// debug!("Users: {:?}", sqlx::query!("SELECT * FROM users").fetch_all(&mut **db).await);
debug!("INSERT INTO devices (id, user, caption, type) VALUES ({:?}, {:?}, {:?}, {:?})", device, username, dev.caption, dev.r#type);
let res = sqlx::query("INSERT INTO devices (id, user, caption, type) VALUES (?, ?, ?, ?)")
.bind(device)
.bind(username)

View File

@@ -1,5 +1,5 @@
#![allow(private_interfaces)]
use rocket::{catch, catchers, fairing::AdHoc, launch, TypedError};
use rocket::{catch, catchers, fairing::AdHoc, launch, TypedError, trace::error};
mod auth;
mod devices;
@@ -31,6 +31,7 @@ impl From<sqlx::Error> for SqlError {
#[catch(default, error = "<error>")]
fn catch_sql(error: &SqlError) -> String {
error!("DB: {}", error.0);
format!("Db Error: {}", error.0)
}
@@ -58,7 +59,7 @@ const SQL_INIT: &[&str] = &[
updated INTEGER NOT NULL,
PRIMARY KEY(url, user, device) ON CONFLICT REPLACE,
FOREIGN KEY(user) REFERENCES users(name),
FOREIGN KEY(device) REFERENCES devices(id)
FOREIGN KEY(device, user) REFERENCES devices(id, user)
);",
"CREATE TABLE IF NOT EXISTS episodes (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -74,7 +75,7 @@ const SQL_INIT: &[&str] = &[
total INTEGER,
updated INTEGER NOT NULL,
FOREIGN KEY(user) REFERENCES users(name),
FOREIGN KEY(device) REFERENCES devices(id)
FOREIGN KEY(device, user) REFERENCES devices(id, user)
);",
];