add upload and delete options to public instance
This commit is contained in:
		
							parent
							
								
									2b02c2c06c
								
							
						
					
					
						commit
						bd2afc873c
					
				@ -53,6 +53,7 @@
 | 
			
		||||
    jq
 | 
			
		||||
    python310
 | 
			
		||||
    unstable.claude-code
 | 
			
		||||
    unstable.opencode
 | 
			
		||||
    ### LSP's
 | 
			
		||||
    nil
 | 
			
		||||
    nodePackages_latest.bash-language-server
 | 
			
		||||
 | 
			
		||||
@ -42,7 +42,7 @@ let
 | 
			
		||||
        ORIENTATION="normal"
 | 
			
		||||
 | 
			
		||||
        # 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
 | 
			
		||||
          if [ "$Z" -lt 0 ]; then
 | 
			
		||||
            ORIENTATION="normal"
 | 
			
		||||
 | 
			
		||||
@ -87,6 +87,18 @@ in
 | 
			
		||||
        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 {
 | 
			
		||||
        type = lib.types.bool;
 | 
			
		||||
        default = true;
 | 
			
		||||
@ -184,6 +196,8 @@ in
 | 
			
		||||
              --bind ${cfg.publicInstance.bind} \
 | 
			
		||||
              --port ${toString cfg.publicInstance.port} \
 | 
			
		||||
              ${authArgs} \
 | 
			
		||||
              ${lib.optionalString cfg.pblicInstance.allowUpload "--allow-upload"} \
 | 
			
		||||
              ${lib.optionalString cfg.pblicInstance.allowDelete "--allow-delete"} \
 | 
			
		||||
              ${lib.optionalString cfg.publicInstance.allowSearch "--allow-search"}
 | 
			
		||||
          '';
 | 
			
		||||
        Restart = "on-failure";
 | 
			
		||||
 | 
			
		||||
@ -186,6 +186,8 @@ in
 | 
			
		||||
      publicInstance = {
 | 
			
		||||
        enable = true;
 | 
			
		||||
        port = 5000;
 | 
			
		||||
        allowUpload = true;
 | 
			
		||||
        allowDelete = false;
 | 
			
		||||
        allowSearch = true;
 | 
			
		||||
        # Admin users can upload/modify on public instance
 | 
			
		||||
        users = [
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user