浏览代码

scripts

master
michael 5 年前
父节点
当前提交
5fcb0fc284
共有 6 个文件被更改,包括 26 次插入4 次删除
  1. +1
    -1
      config/srvconfig.json
  2. +5
    -0
      installSvc.sh
  3. +14
    -0
      nas-webdav.service
  4. +3
    -2
      package.json
  5. +1
    -1
      src/index.ts
  6. +2
    -0
      start.sh

+ 1
- 1
config/srvconfig.json 查看文件

@@ -1,6 +1,6 @@
{
"port": 8088,
"realm": "manas",
"realm": "WebDAV-manas",
"mounts": {
"Music": "/media/hd1/Music",
"Movies": "/media/hd1/Movies",


+ 5
- 0
installSvc.sh 查看文件

@@ -0,0 +1,5 @@
#!/bin/bash
sudo cp ./nas-webdav.service /etc/systemd/system/
sudo systemctl enable nas-webdav
sudo systemctl start nas-webdav
sudo systemctl status nas-webdav

+ 14
- 0
nas-webdav.service 查看文件

@@ -0,0 +1,14 @@
[Unit]
Description=NAS WebDav-Server

[Service]
EnvironmentFile=-/etc/default/my-application
ExecStart=/home/michael/nas-webdav/start.sh
WorkingDirectory=/home/michael/nas-webdav
LimitNOFILE=4096
IgnoreSIGPIPE=false
KillMode=process
User=michael

[Install]
WantedBy=multi-user.target

+ 3
- 2
package.json 查看文件

@@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"build": "tsc -p ./tsconfig.json",
"build": "npx tsc -p ./tsconfig.json",
"start": "node dist/index.js",
"start-debug": "nodemon --inspect dist/index.js",
"test": "echo \"Error: no test specified\" && exit 1"
@@ -20,6 +20,7 @@
"webdav-server": "^2.6.2"
},
"devDependencies": {
"typescript": "^3.9.7",
"@types/node": "^14.11.2",
"@typescript-eslint/eslint-plugin": "^4.1.1",
"@typescript-eslint/parser": "^4.1.1",
@@ -27,4 +28,4 @@
"prettier": "^2.1.2",
"rimraf": "^3.0.2"
}
}
}

+ 1
- 1
src/index.ts 查看文件

@@ -23,7 +23,7 @@ const users = getConfig('users');
if (typeof config.port === undefined)
config.port = 8080;
if (typeof config.realm === undefined)
config.realm = "realm";
config.realm = "WebDAV";

let mountNames : string[] = [];
for (let mount in config['mounts']) {


+ 2
- 0
start.sh 查看文件

@@ -0,0 +1,2 @@
#!/bin/bash
npm start

正在加载...
取消
保存