add upload and delete options to public instance
This commit is contained in:
parent
2b02c2c06c
commit
bd2afc873c
@ -53,6 +53,7 @@
|
|||||||
jq
|
jq
|
||||||
python310
|
python310
|
||||||
unstable.claude-code
|
unstable.claude-code
|
||||||
|
unstable.opencode
|
||||||
### LSP's
|
### LSP's
|
||||||
nil
|
nil
|
||||||
nodePackages_latest.bash-language-server
|
nodePackages_latest.bash-language-server
|
||||||
|
|||||||
@ -42,7 +42,7 @@ let
|
|||||||
ORIENTATION="normal"
|
ORIENTATION="normal"
|
||||||
|
|
||||||
# Simple orientation detection based on which axis has highest absolute value
|
# Simple orientation detection based on which axis has highest absolute value
|
||||||
if [ "$ABS_Z" -gt 9000 ]; then
|
if [ "$ABS_Z" -gt 16000 ]; then
|
||||||
# Device is flat
|
# Device is flat
|
||||||
if [ "$Z" -lt 0 ]; then
|
if [ "$Z" -lt 0 ]; then
|
||||||
ORIENTATION="normal"
|
ORIENTATION="normal"
|
||||||
|
|||||||
@ -87,6 +87,18 @@ in
|
|||||||
description = "Users with read-write access";
|
description = "Users with read-write access";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
allowUpload = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Allow file uploads";
|
||||||
|
};
|
||||||
|
|
||||||
|
allowDelete = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Allow file deletion";
|
||||||
|
};
|
||||||
|
|
||||||
allowSearch = lib.mkOption {
|
allowSearch = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
@ -184,6 +196,8 @@ in
|
|||||||
--bind ${cfg.publicInstance.bind} \
|
--bind ${cfg.publicInstance.bind} \
|
||||||
--port ${toString cfg.publicInstance.port} \
|
--port ${toString cfg.publicInstance.port} \
|
||||||
${authArgs} \
|
${authArgs} \
|
||||||
|
${lib.optionalString cfg.pblicInstance.allowUpload "--allow-upload"} \
|
||||||
|
${lib.optionalString cfg.pblicInstance.allowDelete "--allow-delete"} \
|
||||||
${lib.optionalString cfg.publicInstance.allowSearch "--allow-search"}
|
${lib.optionalString cfg.publicInstance.allowSearch "--allow-search"}
|
||||||
'';
|
'';
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
|
|||||||
@ -186,6 +186,8 @@ in
|
|||||||
publicInstance = {
|
publicInstance = {
|
||||||
enable = true;
|
enable = true;
|
||||||
port = 5000;
|
port = 5000;
|
||||||
|
allowUpload = true;
|
||||||
|
allowDelete = false;
|
||||||
allowSearch = true;
|
allowSearch = true;
|
||||||
# Admin users can upload/modify on public instance
|
# Admin users can upload/modify on public instance
|
||||||
users = [
|
users = [
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user