From 1c79d4b7018067cc5c6b73054fe4bfe146067c4e Mon Sep 17 00:00:00 2001 From: Rafael Bradley Date: Fri, 6 Feb 2026 21:35:28 -0300 Subject: [PATCH] Migrate to MUSL --- Cargo.lock | 12 +++++++++- Cargo.toml | 4 ++-- Dockerfile | 25 ++++++++++++++------- playbooks/10-apt-update.yml | 14 ++++++++++++ src/groups/calls/strings/tips.json | 30 +------------------------ src/groups/calls/strings/tips.json.bak | 31 ++++++++++++++++++++++++++ 6 files changed, 76 insertions(+), 40 deletions(-) create mode 100644 playbooks/10-apt-update.yml create mode 100644 src/groups/calls/strings/tips.json.bak diff --git a/Cargo.lock b/Cargo.lock index 47796a0..9e76402 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1948,6 +1948,15 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +[[package]] +name = "openssl-src" +version = "300.5.5+3.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f1787d533e03597a7934fd0a765f0d28e94ecc5fb7789f8053b1e699a56f709" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.109" @@ -1956,6 +1965,7 @@ checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] @@ -1996,7 +2006,7 @@ checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" [[package]] name = "payphone" -version = "4.4.12" +version = "4.4.16" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 7e99a3b..20a54d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "payphone" -version = "4.4.12" +version = "4.4.16" edition = "2024" default-run = "payphone" @@ -26,7 +26,7 @@ open = "5.3.2" rand = "0.9.2" rand_chacha = { version = "0.9.0", features = ["os_rng"] } regex = "1.11.1" -reqwest = { version = "0.12.23", features = ["gzip", "brotli", "zstd"] } +reqwest = { version = "0.12.23", features = ["gzip", "brotli", "zstd", "native-tls-vendored"] } rgb = "0.8.52" scc = "2.3.4" scylla = { version = "1.3.1", features = ["time-03"] } diff --git a/Dockerfile b/Dockerfile index 2a2c2ea..0783685 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,28 @@ -FROM rust:latest AS builder +# --- Builder stage --- +FROM rust:1-bookworm AS builder + +# Install musl target and musl-tools +RUN rustup target add x86_64-unknown-linux-musl \ + && apt-get update \ + && apt-get install -y musl-tools build-essential WORKDIR /app COPY Cargo.toml Cargo.lock ./ - COPY . . -RUN cargo build --release +# Build fully static binary +RUN cargo build --release --target x86_64-unknown-linux-musl +# --- Final stage --- FROM debian:bookworm -COPY --from=builder /app/target/release/payphone /usr/local/bin/payphone +# Copy static binary +COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/payphone /usr/local/bin/payphone -RUN apt-get update && apt-get install -y ca-certificates -RUN update-ca-certificates +RUN apt-get update && apt-get install -y ca-certificates \ + && update-ca-certificates \ + && rm -rf /var/lib/apt/lists/* -ENTRYPOINT [ "/usr/local/bin/payphone" ] -CMD [ "start" ] +ENTRYPOINT ["/usr/local/bin/payphone"] +CMD ["start"] diff --git a/playbooks/10-apt-update.yml b/playbooks/10-apt-update.yml new file mode 100644 index 0000000..c347bf4 --- /dev/null +++ b/playbooks/10-apt-update.yml @@ -0,0 +1,14 @@ +- name: APT Update + hosts: all + become: true + tasks: + - name: Update APT package index + ansible.builtin.apt: + update_cache: yes + cache_valid_time: 3600 + + - name: Upgrade APT packages + ansible.builtin.apt: + upgrade: dist + autoremove: yes + autoclean: yes \ No newline at end of file diff --git a/src/groups/calls/strings/tips.json b/src/groups/calls/strings/tips.json index ece778d..bd717d8 100644 --- a/src/groups/calls/strings/tips.json +++ b/src/groups/calls/strings/tips.json @@ -1,31 +1,3 @@ [ - "Automod features are still under development! Join the [official Discord server]() if you detect a bug and we'll help you out.", - "Automod features are still under development! Join the [official Discord server]() if you detect a bug and we'll help you out.", - "Automod features are still under development! Join the [official Discord server]() if you detect a bug and we'll help you out.", - "Automod features are still under development! Join the [official Discord server]() if you detect a bug and we'll help you out.", - "Automod features are still under development! Join the [official Discord server]() if you detect a bug and we'll help you out.", - "Automod features are still under development! Join the [official Discord server]() if you detect a bug and we'll help you out.", - "Payphone needs your help! We're running out of money to pay for next month's hosting. If you can and want to help, consider [donating]() to help Payphone stay alive. All help is greatly appreciated!", - "Payphone needs your help! We're running out of money to pay for next month's hosting. If you can and want to help, consider [donating]() to help Payphone stay alive. All help is greatly appreciated!", - "Payphone needs your help! We're running out of money to pay for next month's hosting. If you can and want to help, consider [donating]() to help Payphone stay alive. All help is greatly appreciated!", - "Payphone needs your help! We're running out of money to pay for next month's hosting. If you can and want to help, consider [donating]() to help Payphone stay alive. All help is greatly appreciated!", - "Payphone needs your help! We're running out of money to pay for next month's hosting. If you can and want to help, consider [donating]() to help Payphone stay alive. All help is greatly appreciated!", - "Payphone needs your help! We're running out of money to pay for next month's hosting. If you can and want to help, consider [donating]() to help Payphone stay alive. All help is greatly appreciated!", - "You can report messages using `Message > Apps > Report Message`.", - "Help us sharing Payphone to make it more active!", - "Emojis will only show if they're from a server Payphone's in.", - "You cannot send links.", - "[Vote for Payphone on top.gg]() to help us reach more users!", - "[Write a review]() to tell everyone your opinion about Payphone!", - "Calls will be automatically hung up after 15 minutes if nobody talks.", - "You can change Payphone's prefix with `{prefix}prefix`.", - "You can use `{prefix}skip` to directly search for a new call.", - "Want to stay hidden? Use `{prefix}mask on`!", - "Did you know you can check your mask with `{prefix}mask`?", - "Do you like Payphone? Consider [making a donation]() to help us grow Payphone (and keep it running)!", - "Using `{prefix}friendreq` is the best way to ask the other party to add you.", - "There's a secret easter egg command. Try to find it! (Hint: cat)", - "Make sure to read Payphone's [Code of Conduct](). Let's keep Payphone safe and fun for everyone!", - "Did you join [Payphone's new official server]() yet? We have a lot of fun stuff there!", - "How high are you on the leaderboard? Use `{prefix}leaderboard` to check it out!" + "We're running out of money to pay for next month's hosting (we have $10 out of $60). If you can and want to help Payphone stay alive, consider [donating](). We'll have to shut down Payphone if we can't pay for the hosting. All help is greatly appreciated!" ] \ No newline at end of file diff --git a/src/groups/calls/strings/tips.json.bak b/src/groups/calls/strings/tips.json.bak new file mode 100644 index 0000000..ece778d --- /dev/null +++ b/src/groups/calls/strings/tips.json.bak @@ -0,0 +1,31 @@ +[ + "Automod features are still under development! Join the [official Discord server]() if you detect a bug and we'll help you out.", + "Automod features are still under development! Join the [official Discord server]() if you detect a bug and we'll help you out.", + "Automod features are still under development! Join the [official Discord server]() if you detect a bug and we'll help you out.", + "Automod features are still under development! Join the [official Discord server]() if you detect a bug and we'll help you out.", + "Automod features are still under development! Join the [official Discord server]() if you detect a bug and we'll help you out.", + "Automod features are still under development! Join the [official Discord server]() if you detect a bug and we'll help you out.", + "Payphone needs your help! We're running out of money to pay for next month's hosting. If you can and want to help, consider [donating]() to help Payphone stay alive. All help is greatly appreciated!", + "Payphone needs your help! We're running out of money to pay for next month's hosting. If you can and want to help, consider [donating]() to help Payphone stay alive. All help is greatly appreciated!", + "Payphone needs your help! We're running out of money to pay for next month's hosting. If you can and want to help, consider [donating]() to help Payphone stay alive. All help is greatly appreciated!", + "Payphone needs your help! We're running out of money to pay for next month's hosting. If you can and want to help, consider [donating]() to help Payphone stay alive. All help is greatly appreciated!", + "Payphone needs your help! We're running out of money to pay for next month's hosting. If you can and want to help, consider [donating]() to help Payphone stay alive. All help is greatly appreciated!", + "Payphone needs your help! We're running out of money to pay for next month's hosting. If you can and want to help, consider [donating]() to help Payphone stay alive. All help is greatly appreciated!", + "You can report messages using `Message > Apps > Report Message`.", + "Help us sharing Payphone to make it more active!", + "Emojis will only show if they're from a server Payphone's in.", + "You cannot send links.", + "[Vote for Payphone on top.gg]() to help us reach more users!", + "[Write a review]() to tell everyone your opinion about Payphone!", + "Calls will be automatically hung up after 15 minutes if nobody talks.", + "You can change Payphone's prefix with `{prefix}prefix`.", + "You can use `{prefix}skip` to directly search for a new call.", + "Want to stay hidden? Use `{prefix}mask on`!", + "Did you know you can check your mask with `{prefix}mask`?", + "Do you like Payphone? Consider [making a donation]() to help us grow Payphone (and keep it running)!", + "Using `{prefix}friendreq` is the best way to ask the other party to add you.", + "There's a secret easter egg command. Try to find it! (Hint: cat)", + "Make sure to read Payphone's [Code of Conduct](). Let's keep Payphone safe and fun for everyone!", + "Did you join [Payphone's new official server]() yet? We have a lot of fun stuff there!", + "How high are you on the leaderboard? Use `{prefix}leaderboard` to check it out!" +] \ No newline at end of file