15 Commits

Author SHA1 Message Date
7ba16464c4 handle file variations correctly
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-25 19:47:44 -07:00
66230d031c do not redownload 2025-08-25 19:47:44 -07:00
f6aa44ffc5 return list verbatim if no cursor 2025-08-25 19:47:44 -07:00
ae166d8509 do not error on remove 2025-08-25 19:47:44 -07:00
a4ae552169 fix cursor bug 2025-08-25 19:47:44 -07:00
23d687e072 explicit error path 2025-08-25 19:47:44 -07:00
71bbfa0128 fix stack overflow 2025-08-25 19:47:44 -07:00
89da9108c2 allow the versions to not exist 2025-08-25 19:47:44 -07:00
04d5592aaf delete cursor file if completed 2025-08-25 19:47:44 -07:00
bd3605ab87 allow the cursor to not exist 2025-08-25 19:47:44 -07:00
13cff42bbc fix error path 2025-08-25 19:47:44 -07:00
60ba5511ad plumb api key through DownloadCreationsHistory
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-25 17:54:52 -07:00
cf67ad510b allow resume from files
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-25 17:42:04 -07:00
e6a548a1a1 get_asset_v2 2025-08-25 17:42:04 -07:00
d2bee93fbb DownloadCreationsHistory 2025-08-25 17:42:04 -07:00
6 changed files with 30 additions and 45 deletions

View File

@@ -7,17 +7,6 @@ platform:
arch: amd64
steps:
- name: build
image: clux/muslrust:1.89.0-stable
commands:
- cargo build --release --target x86_64-unknown-linux-musl
when:
branch:
- master
event:
- push
- pull_request
- name: image
image: plugins/docker
settings:
@@ -30,15 +19,6 @@ steps:
password:
from_secret: GIT_PASS
dockerfile: Containerfile
depends_on:
- build
when:
branch:
- master
event:
- push
---
kind: signature
hmac: 52507904dfaada892c05a61422dc5e147c1438419ed841d0f1e3e3ec2b193540
...
- master

4
Cargo.lock generated
View File

@@ -124,7 +124,7 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
[[package]]
name = "asset-tool"
version = "0.5.0"
version = "0.4.12"
dependencies = [
"anyhow",
"clap",
@@ -1449,7 +1449,7 @@ dependencies = [
[[package]]
name = "rbx_asset"
version = "0.5.0"
version = "0.4.10"
dependencies = [
"bytes",
"chrono",

View File

@@ -1,7 +1,7 @@
workspace = { members = ["rbx_asset", "rox_compiler"] }
[package]
name = "asset-tool"
version = "0.5.0"
version = "0.4.12"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -10,9 +10,9 @@ edition = "2021"
anyhow = "1.0.75"
clap = { version = "4.4.2", features = ["derive"] }
futures = "0.3.30"
git2 = { version = "0.20.0", optional = true }
git2 = "0.20.0"
lazy-regex = "3.1.0"
rbx_asset = { path = "rbx_asset", features = ["gzip", "rustls-tls"], default-features = false }
rbx_asset = { path = "rbx_asset" }
rbx_binary = "1.0.0"
rbx_dom_weak = "3.0.0"
rbx_reflection_database = "1.0.3"
@@ -21,10 +21,6 @@ rox_compiler = { path = "rox_compiler" }
serde_json = "1.0.111"
tokio = { version = "1.35.1", features = ["macros", "rt-multi-thread", "fs"] }
[features]
default = []
git = ["dep:git2"]
[profile.release]
#lto = true
strip = true

View File

@@ -1,3 +1,23 @@
FROM alpine:3.22 AS runtime
COPY /target/x86_64-unknown-linux-musl/release/asset-tool /
ENTRYPOINT ["/asset-tool"]
# Using the `rust-musl-builder` as base image, instead of
# the official Rust toolchain
FROM docker.io/clux/muslrust:stable AS chef
USER root
RUN cargo install cargo-chef
WORKDIR /app
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
# Notice that we are specifying the --target flag!
RUN cargo chef cook --release --target x86_64-unknown-linux-musl --recipe-path recipe.json
COPY . .
RUN cargo build --release --target x86_64-unknown-linux-musl --bin asset-tool
FROM docker.io/alpine:latest AS runtime
RUN addgroup -S myuser && adduser -S myuser -G myuser
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/asset-tool /usr/local/bin/
USER myuser
ENTRYPOINT ["/usr/local/bin/asset-tool"]

View File

@@ -1,6 +1,6 @@
[package]
name = "rbx_asset"
version = "0.5.0"
version = "0.4.10"
edition = "2021"
publish = ["strafesnet"]
repository = "https://git.itzana.me/StrafesNET/asset-tool"

View File

@@ -8,7 +8,6 @@ use rbx_asset::cookie::{Cookie,Context as CookieContext,AssetVersion,CreationsIt
type AssetID=u64;
type AssetIDFileMap=Vec<(AssetID,PathBuf)>;
#[cfg(feature="git")]
const CONCURRENT_DECODE:usize=8;
const CONCURRENT_REQUESTS:usize=32;
const CONCURRENT_FS:usize=64;
@@ -44,9 +43,7 @@ enum Commands{
CompileUploadAsset(CompileUploadAssetSubcommand),
CompileUploadPlace(CompileUploadPlaceSubcommand),
Decompile(DecompileSubcommand),
#[cfg(feature="git")]
DecompileHistoryIntoGit(DecompileHistoryIntoGitSubcommand),
#[cfg(feature="git")]
DownloadAndDecompileHistoryIntoGit(DownloadAndDecompileHistoryIntoGitSubcommand),
RunLuau(RunLuauSubcommand),
}
@@ -742,7 +739,6 @@ async fn main()->AResult<()>{
write_models:subcommand.write_models.unwrap_or(false),
write_scripts:subcommand.write_scripts.unwrap_or(true),
}).await,
#[cfg(feature="git")]
Commands::DecompileHistoryIntoGit(subcommand)=>decompile_history_into_git(DecompileHistoryConfig{
git_committer_name:subcommand.git_committer_name,
git_committer_email:subcommand.git_committer_email,
@@ -753,7 +749,6 @@ async fn main()->AResult<()>{
write_models:subcommand.write_models.unwrap_or(false),
write_scripts:subcommand.write_scripts.unwrap_or(true),
}).await,
#[cfg(feature="git")]
Commands::DownloadAndDecompileHistoryIntoGit(subcommand)=>download_and_decompile_history_into_git(DownloadAndDecompileHistoryConfig{
git_committer_name:subcommand.git_committer_name,
git_committer_email:subcommand.git_committer_email,
@@ -1717,7 +1712,6 @@ async fn download_decompile(config:DownloadDecompileConfig)->AResult<()>{
Ok(())
}
#[cfg(feature="git")]
struct WriteCommitConfig{
git_committer_name:String,
git_committer_email:String,
@@ -1728,7 +1722,6 @@ struct WriteCommitConfig{
write_scripts:bool,
}
#[cfg(feature="git")]
async fn write_commit(config:WriteCommitConfig,b:Result<AResult<(AssetVersion,rox_compiler::DecompiledContext)>,tokio::task::JoinError>,repo:&git2::Repository)->AResult<()>{
let (asset_version,context)=b??;
println!("writing files for version {}",asset_version.assetVersionNumber);
@@ -1810,7 +1803,6 @@ async fn write_commit(config:WriteCommitConfig,b:Result<AResult<(AssetVersion,ro
Ok(())
}
#[cfg(feature="git")]
struct DecompileHistoryConfig{
git_committer_name:String,
git_committer_email:String,
@@ -1822,7 +1814,6 @@ struct DecompileHistoryConfig{
write_scripts:bool,
}
#[cfg(feature="git")]
async fn decompile_history_into_git(config:DecompileHistoryConfig)->AResult<()>{
//use prexisting versions list
let mut versions_path=config.input_folder.clone();
@@ -1861,7 +1852,6 @@ async fn decompile_history_into_git(config:DecompileHistoryConfig)->AResult<()>{
Ok(())
}
#[cfg(feature="git")]
struct DownloadAndDecompileHistoryConfig{
cookie:Cookie,
asset_id:AssetID,
@@ -1874,7 +1864,6 @@ struct DownloadAndDecompileHistoryConfig{
write_scripts:bool,
}
#[cfg(feature="git")]
async fn download_and_decompile_history_into_git(config:DownloadAndDecompileHistoryConfig)->AResult<()>{
let context=CookieContext::new(config.cookie);