disable tests, add instructions and create config stub for token
This commit is contained in:
parent
129d60f07f
commit
aa5d4aeacd
5 changed files with 27 additions and 3 deletions
2
.cargo/config.toml
Normal file
2
.cargo/config.toml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[env]
|
||||||
|
PIXIV_REFRESH_TOKEN = ""
|
|
@ -6,6 +6,13 @@ The pixiv embed fixer
|
||||||
|
|
||||||
This project is still in development, please be patient until this project is actually usable.
|
This project is still in development, please be patient until this project is actually usable.
|
||||||
|
|
||||||
|
## build
|
||||||
|
|
||||||
|
Simply use `cargo build` and/or `cargo run`.
|
||||||
|
|
||||||
|
**Mind that you need a refresh token from pixiv to get API access.**
|
||||||
|
|
||||||
|
|
||||||
## nix build
|
## nix build
|
||||||
|
|
||||||
As this mainly runs on my NixOS server for now, so build and service files are included.
|
As this mainly runs on my NixOS server for now, so build and service files are included.
|
||||||
|
|
|
@ -5,3 +5,6 @@ port = 5470
|
||||||
[production]
|
[production]
|
||||||
address = "0.0.0.0"
|
address = "0.0.0.0"
|
||||||
port = 5470
|
port = 5470
|
||||||
|
|
||||||
|
[default.databases]
|
||||||
|
illustrations = { url = "sqlite:fxpixiv.db" }
|
|
@ -10,6 +10,10 @@ rustPlatform.buildRustPackage rec {
|
||||||
lockFile = ./Cargo.lock;
|
lockFile = ./Cargo.lock;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
checkFlags = [
|
||||||
|
"--skip=client_tests::login --skip=client_tests::illust_details"
|
||||||
|
];
|
||||||
|
|
||||||
cargoSha256 = lib.fakeSha256; # Replace with the actual hash
|
cargoSha256 = lib.fakeSha256; # Replace with the actual hash
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgs.pkg-config ];
|
nativeBuildInputs = [ pkgs.pkg-config ];
|
||||||
|
|
|
@ -15,9 +15,14 @@ in
|
||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
type = types.int;
|
type = types.int;
|
||||||
default = 8000;
|
|
||||||
description = "Port on which the fxpixiv embed helper listens.";
|
description = "Port on which the fxpixiv embed helper listens.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
refreshToken = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
description = "Allows access to the Pixiv API.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.services.fxpixiv.enable {
|
config = mkIf config.services.fxpixiv.enable {
|
||||||
|
@ -29,7 +34,10 @@ in
|
||||||
serviceConfig.ExecStart = "${fxpixivApp}/bin/fxpixiv";
|
serviceConfig.ExecStart = "${fxpixivApp}/bin/fxpixiv";
|
||||||
|
|
||||||
# Set the port environment variable
|
# Set the port environment variable
|
||||||
serviceConfig.Environment = [ "ROCKET_PORT=${toString config.services.fxpixiv.port}" ];
|
serviceConfig.Environment = [
|
||||||
|
"ROCKET_PORT=${toString config.services.fxpixiv.port}"
|
||||||
|
"PIXIV_REFRESH_TOKEN=${toString config.services.fxpixiv.refreshToken}"
|
||||||
|
];
|
||||||
|
|
||||||
# Restart on failure
|
# Restart on failure
|
||||||
serviceConfig.Restart = "always";
|
serviceConfig.Restart = "always";
|
||||||
|
|
Loading…
Add table
Reference in a new issue