From 8242f45daa9d789422ebba57eb80d041fe0f465a Mon Sep 17 00:00:00 2001 From: oluceps Date: Mon, 21 Oct 2024 13:16:47 +0800 Subject: [PATCH] ~ fix --- modules/rustypaste.nix | 3 ++- repack/rustypaste.nix | 35 ++++++++++++++++++----------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/modules/rustypaste.nix b/modules/rustypaste.nix index f8b89f1b5..106ae5834 100644 --- a/modules/rustypaste.nix +++ b/modules/rustypaste.nix @@ -34,8 +34,9 @@ in serviceConfig = { Type = "simple"; + DynamicUser = true; ExecStart = "${cfg.package}/bin/rustypaste"; - StateDirectory = "paste"; + StateDirectory = "rustypaste"; Environment = "CONFIG=${settingsFormat.generate "config.toml" cfg.settings}"; Restart = "on-failure"; }; diff --git a/repack/rustypaste.nix b/repack/rustypaste.nix index 89a0ee276..51ddef636 100644 --- a/repack/rustypaste.nix +++ b/repack/rustypaste.nix @@ -10,23 +10,23 @@ reIf { content_type = "text/plain; charset=utf-8"; text = '' - /|、 - (˙、.7 - |、~ヽ - じしf_,)ノ + /|、 + (˙、.7 + |、~ヽ + じしf_,)ノ - Submit files via HTTP POST here: - curl -F 'file=@example.txt' - This will return the URL of the uploaded file nya. - The server administrator might remove any pastes that they do not personally - want to host. - If you are the server administrator and want to change this page, just go - into your config file and change it! If you change the expiry time, it is - recommended that you do. - By default, pastes expire every hour. The server admin may or may not have - changed this. - Check out the GitHub repository at https://github.com/orhun/rustypaste - Command line tool is available at https://github.com/orhun/rustypaste-cli + Submit files via HTTP POST here: + curl -F 'file=@example.txt' + This will return the URL of the uploaded file nya. + The server administrator might remove any pastes that they do not personally + want to host. + If you are the server administrator and want to change this page, just go + into your config file and change it! If you change the expiry time, it is + recommended that you do. + By default, pastes expire every hour. The server admin may or may not have + changed this. + Check out the GitHub repository at https://github.com/orhun/rustypaste + Command line tool is available at https://github.com/orhun/rustypaste-cli ''; }; paste = { @@ -85,7 +85,8 @@ reIf { handle_spaces = "replace"; max_content_length = "10MB"; timeout = "30s"; - upload_path = "./upload"; + upload_path = "/var/lib/rustypaste/"; + duplicate_files = true; url = "https://pb.nyaw.xyz"; }; };