mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
dev: begin mountpoints
This commit is contained in:
parent
ef298ce3aa
commit
e98ff552d1
@ -1,24 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2024 Puter Technologies Inc.
|
|
||||||
*
|
|
||||||
* This file is part of Puter.
|
|
||||||
*
|
|
||||||
* Puter is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published
|
|
||||||
* by the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.Test = void 0;
|
|
||||||
class Test {
|
|
||||||
}
|
|
||||||
exports.Test = Test;
|
|
@ -1,3 +0,0 @@
|
|||||||
export class Test {
|
|
||||||
//
|
|
||||||
}
|
|
@ -0,0 +1,7 @@
|
|||||||
|
const { AdvancedBase } = require("@heyputer/puter-js-common");
|
||||||
|
|
||||||
|
class LocalFilesystem extends AdvancedBase {
|
||||||
|
async _init () {
|
||||||
|
this.root_ = this.config.path;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
### implementations needed
|
||||||
|
- stat a file from fsentry row or inode
|
||||||
|
- get a read stream for a file
|
||||||
|
-
|
||||||
|
```mermaid
|
||||||
|
classDiagram
|
||||||
|
API ..> HLOperation
|
||||||
|
HLOperation ..> LLOperation
|
||||||
|
LLOperation ..> LLFilesystem
|
||||||
|
LLFilesystem <|-- PuterFS
|
||||||
|
LLFilesystem <|-- LocalFS
|
||||||
|
PuterFS o--> Storage
|
||||||
|
PuterFS o--> FSEntryService
|
||||||
|
```
|
@ -11,11 +11,34 @@ const BaseService = require("./BaseService");
|
|||||||
* initialize a context.
|
* initialize a context.
|
||||||
*/
|
*/
|
||||||
class MountpointService extends BaseService {
|
class MountpointService extends BaseService {
|
||||||
|
static default_mountpoints = [
|
||||||
|
{
|
||||||
|
mapping: '/',
|
||||||
|
engine: 'puter',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
mapping: '/x/mnt/local',
|
||||||
|
engine: 'local',
|
||||||
|
parameters: {
|
||||||
|
auto_mkdir: true,
|
||||||
|
path: '{runtime}/local',
|
||||||
|
uid_strategy: 'uuidv4',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
async _init () {
|
async _init () {
|
||||||
// this.mountpoints_ = {};
|
// this.mountpoints_ = {};
|
||||||
|
|
||||||
// Temporary solution - we'll develop this incrementally
|
// Temporary solution - we'll develop this incrementally
|
||||||
this.storage_ = null;
|
this.storage_ = null;
|
||||||
|
this.mounts_ = {};
|
||||||
|
|
||||||
|
const mountpoints = [
|
||||||
|
...this.constructor.default_mountpoints,
|
||||||
|
...(this.config.mountpoints ?? [])
|
||||||
|
];
|
||||||
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
// Temporary solution - we'll develop this incrementally
|
// Temporary solution - we'll develop this incrementally
|
||||||
|
Loading…
Reference in New Issue
Block a user