Ver Fonte

minor: 增加反向代理

Lenovo há 6 dias atrás
pai
commit
e6159711cc
5 ficheiros alterados com 588 adições e 0 exclusões
  1. 1 0
      SynoBuildConf/install
  2. 10 0
      conf/resource
  3. 369 0
      docs/drive.json
  4. 197 0
      docs/web-station.json
  5. 11 0
      etc/web-config/dsm.nginx-ui.conf

+ 1 - 0
SynoBuildConf/install

@@ -18,6 +18,7 @@ create_package_tgz() {
 	### install needed file into PKG_DIR
 	cp -av ui $package_tgz_dir
 	cp -av src $package_tgz_dir
+	cp -av etc $package_tgz_dir
 	chown -R http:http $package_tgz_dir/src
 
 	### create package.tgz $1: source_dir $2: dest_dir

+ 10 - 0
conf/resource

@@ -28,5 +28,15 @@
         "send_timeout": 60
       }
     ]
+  },
+  "web-config": {
+    "nginx-static-config": {
+      "enable": [
+        {
+          "relpath": "etc/web-config/dsm.nginx-ui.conf",
+          "type": "dsm"
+        }
+      ]
+    }
   }
 }

+ 369 - 0
docs/drive.json

@@ -0,0 +1,369 @@
+{
+  "certificate-config": {
+    "services": [
+      {
+        "display_name": "Synology Drive Server",
+        "display_name_i18n": "SYNO.SDS.Drive.Application:app:pkg_name",
+        "service": "SynologyDrive"
+      }
+    ]
+  },
+  "content-extractor": {
+    "extensions": [
+      {
+        "conf-relpath": "lib/extension/file_parser.conf",
+        "lib-relpath": "lib/extension/file_parser.so",
+        "name": "synology_drive_file_parser",
+        "type": "basic"
+      }
+    ]
+  },
+  "csp-rule": {
+    "conf": "etc/csp/rules"
+  },
+  "feasibility-config": {
+    "configs": [
+      {
+        "check-type": "share_transform",
+        "name": "SynologyDriveServer_home_transform",
+        "plugin-relpath": "scripts/HomeTransformCheck.sh",
+        "task": "Synology Drive Server Share Transform",
+        "task_i18n": "SYNO.SDS.Drive.Application:warning:warn_drive_homes_transform",
+        "type": "soft-check",
+        "version": 1
+      },
+      {
+        "check-type": "share_transform",
+        "name": "SynologyDriveServer_share_transform",
+        "plugin-relpath": "scripts/ShareTransformCheck.sh",
+        "task": "Synology Drive Server Share Transform",
+        "task_i18n": "SYNO.SDS.Drive.Application:warning:warn_drive_share_transform",
+        "type": "soft-check",
+        "version": 1
+      },
+      {
+        "check-type": "volume_delete",
+        "name": "SynologyDriveServer_volume_delete",
+        "plugin-relpath": "scripts/VolumeDeleteCheck.sh",
+        "task": "Synology Drive is using this volume. Please uninstall the package before deleting this volume.",
+        "task_i18n": "SYNO.SDS.Drive.Application:warning:uninstall_before_proceed",
+        "type": "hard-check",
+        "version": 1
+      },
+      {
+        "check-type": "home_disable",
+        "name": "SynologyDriveServer_home_disable",
+        "plugin-relpath": "scripts/HomeDisableCheck.sh",
+        "task": "Synology Drive's 'My Drive' requires home service to function, which will be disabled as well.",
+        "task_i18n": "SYNO.SDS.Drive.Application:warning:warn_home_disable",
+        "type": "soft-check",
+        "version": 1
+      },
+      {
+        "check-type": "volume_offline",
+        "customs": {
+          "stopPackage": "SynologyDrive"
+        },
+        "name": "SynologyDriveServer_volume_offline",
+        "plugin-relpath": "scripts/VolumeOfflineCheck.sh",
+        "task": "Synology Drive is using this volume. It will be disabled when the volume is offline.",
+        "type": "soft-check",
+        "version": 1
+      },
+      {
+        "check-type": "volume_offline",
+        "customs": {
+          "stopPackage": "SynologyDrive"
+        },
+        "name": "SynologyDriveShareSync_volume_offline",
+        "plugin-relpath": "sharesync/scripts/ShareSyncVolumeOfflineCheck.sh",
+        "task": "Synology Drive ShareSync is using this volume. It will be disabled when the volume is offline.",
+        "type": "soft-check",
+        "version": 1
+      },
+      {
+        "check-type": "share_offline",
+        "customs": {
+          "stopPackage": "SynologyDrive"
+        },
+        "name": "SynologyDriveShareSync_share_offline",
+        "plugin-relpath": "sharesync/scripts/ShareSyncShareOfflineCheck.sh",
+        "task": "Synology Drive ShareSync is using this share. It will be disabled when the share is offline.",
+        "type": "soft-check",
+        "version": 1
+      },
+      {
+        "check-type": "share_transform",
+        "name": "SynologyDriveShareSync_share_transform",
+        "plugin-relpath": "sharesync/scripts/ShareSyncShareTransformCheck.sh",
+        "task": "Synology Share Sync is using this shared folder",
+        "task_i18n": "SYNO.SDS.SynologyDriveShareSync.Instance:warning:warn_share_transform",
+        "type": "hard-check",
+        "version": 1
+      }
+    ]
+  },
+  "indexdb": {
+    "app-index": {
+      "conf-relpath": "ui/index.conf",
+      "db-relpath": "indexdb/appindexdb"
+    },
+    "help-index": {
+      "conf-relpath": "ui/helptoc.conf",
+      "db-relpath": "indexdb/helpindexdb"
+    }
+  },
+  "pam-config": {
+    "configs": [
+      {
+        "auth-types": [
+          "local",
+          "domain",
+          "ldap"
+        ],
+        "autoblock": {
+          "log-failure": true,
+          "log-success": true,
+          "service-name": "SynologyDrive"
+        },
+        "filename": "synologydrive"
+      }
+    ]
+  },
+  "port-config": {
+    "protocol-file": "etc/synology_drive_port"
+  },
+  "sas-plugin": {
+    "plugins": [
+      {
+        "event": "profile_change",
+        "relpath": "hook/profile-change-hook"
+      }
+    ]
+  },
+  "sdk-plugin": {
+    "plugins": [
+      {
+        "event": "user_set",
+        "relpath": "scripts/SynologyDriveUserSet.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "user_delete",
+        "relpath": "scripts/SynologyDriveUserDelete.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "user_expire",
+        "relpath": "scripts/SynologyDriveUserExpire.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "group_set",
+        "relpath": "scripts/SynologyDriveGroupSet.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "group_delete",
+        "relpath": "scripts/SynologyDriveGroupDelete.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "user_membership_change",
+        "relpath": "scripts/SynologyDriveUserMembershipChange.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "share_set",
+        "relpath": "scripts/SynologyDriveShareSet.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "share_delete",
+        "relpath": "scripts/SynologyDriveShareDelete.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "share_mount_action",
+        "relpath": "scripts/SynologyDriveShareMount.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "share_snapshot",
+        "relpath": "scripts/SynologyDriveShareSnapShot.sh",
+        "timing": "from_postinst_to_preuninst"
+      },
+      {
+        "event": "dirsvs_join",
+        "relpath": "scripts/SynologyDriveDirJoin.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "dirsvs_leave",
+        "relpath": "scripts/SynologyDriveDirLeave.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "dirsvs_db_refresh",
+        "relpath": "scripts/SynologyDriveDirRefresh.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "dirsvs_user/rename",
+        "relpath": "scripts/SynologyDriveDirUserRename.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "user_home_service",
+        "relpath": "scripts/SynologyDriveHomeService.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "app_privilege_set",
+        "relpath": "scripts/SynologyDriveUserAppPrivilege.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "volume/unmount",
+        "relpath": "scripts/SynologyDriveVolumeUnmount.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "volume/offline",
+        "relpath": "scripts/SynologyDriveVolumeOffline.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "share_transform",
+        "relpath": "scripts/SynologyDriveShareTransform.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "package_install",
+        "relpath": "scripts/SynologyDrivePackageInstall.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "package_start",
+        "relpath": "scripts/SynologyDrivePackageStart.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "recovery_bootup",
+        "relpath": "scripts/SynologyDriveRecoveryBootup.sh",
+        "timing": "from_postinst_to_preuninst"
+      },
+      {
+        "event": "share_set",
+        "relpath": "sharesync/hook/SynologyDriveShareSyncSet.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "share_delete",
+        "relpath": "sharesync/hook/SynologyDriveShareSyncDelete.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "share_mount_action",
+        "relpath": "sharesync/hook/SynologyDriveShareSyncMount.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "share_snapshot",
+        "relpath": "sharesync/hook/SynologyDriveShareSyncSnapShot.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "share_transform",
+        "relpath": "sharesync/hook/SynologyDriveShareSyncTransform.sh",
+        "timing": "from_startup_to_halt"
+      }
+    ]
+  },
+  "synocrond": {
+    "conf": "etc/synocrond.json"
+  },
+  "synoelastic-filter-plugin": {
+    "filters": [
+      {
+        "fields": [
+          "SYNODriveFileID",
+          "SYNOMDPath"
+        ],
+        "name": "synology_drive_permission_filter",
+        "path": "lib/extension/synology_drive_permission_filter.so"
+      }
+    ]
+  },
+  "syslog-config": {
+    "logrotate-relpath": "etc/log/synologydrive.logrotate",
+    "patterndb-relpath": "etc/log/synologydrive.syslog-ng",
+    "patterninc": [
+      {
+        "conf-relpath": "etc/log/synologydrive.not2msg",
+        "target-dir": "not2msg"
+      }
+    ]
+  },
+  "sysnotify": {
+    "app_privileges": [
+      {
+        "app_id": "SYNO.SDS.SynologyDriveShareSync.Instance"
+      }
+    ],
+    "texts_dir": "ui/mail_texts"
+  },
+  "systemd-unit": {},
+  "userdata-collector": {
+    "configs": [
+      {
+        "relpath": "etc/user-data-collection.config"
+      },
+      {
+        "relpath": "sharesync/etc/sharesync-user-data-collection.config"
+      }
+    ]
+  },
+  "web-config": {
+    "app-portal": {
+      "json-relpath": "etc/web-config/SynologyDrive.json",
+      "mustache-relpath": "etc/web-config/SynologyDrive.mustache"
+    },
+    "nginx-static-config": {
+      "enable": [
+        {
+          "relpath": "etc/web-config/dsm.SynologyDrive.conf",
+          "type": "dsm"
+        }
+      ]
+    }
+  },
+  "webapi-desc": {
+    "apidaemon": {
+      "auto_preload_webapi_libs": true,
+      "daemon_config": "etc/synoapid.json"
+    },
+    "apis": [
+      {
+        "auth": [
+          "etc/synologydrive.auth"
+        ],
+        "lib": [
+          "webapi/drive/SYNO.SynologyDrive.lib"
+        ],
+        "type": "webapi"
+      },
+      {
+        "lib": [
+          "sharesync/lib/SYNO.SynologyDriveShareSync.lib"
+        ],
+        "type": "webapi"
+      }
+    ]
+  },
+  "wsg-service-plugin": {
+    "config_path": [
+      "/var/packages/SynologyDrive/etc/wsg_service.json"
+    ]
+  }
+}

+ 197 - 0
docs/web-station.json

@@ -0,0 +1,197 @@
+{
+  "certificate-config": {
+    "reloader-relpath": "tools/webstation_crt_reload.sh"
+  },
+  "data-share": {
+    "shares": [
+      {
+        "name": "web",
+        "permission": {
+          "ro": [
+            "http"
+          ]
+        },
+        "strong-dependence": true
+      },
+      {
+        "name": "web_packages",
+        "permission": {
+          "group_ro": [
+            "http"
+          ],
+          "ro": [
+            "http"
+          ]
+        },
+        "strong-dependence": true
+      }
+    ]
+  },
+  "feasibility-config": {
+    "configs": [
+      {
+        "check-type": "package_stop",
+        "name": "check_web_package.sh",
+        "plugin-relpath": "feasibility_checks/check_web_package_stop.sh",
+        "task": "This action will cause some functionalities (Default Backend, Personal Website or Virtual Host) of WebStation behave abnormally. If you wish to continue, please click Yes.",
+        "task_i18n": "SYNO.SDS.WebStation.Application:app:support_backend_stop_warning",
+        "type": "soft-check",
+        "version": 1
+      },
+      {
+        "check-type": "package_uninstall",
+        "name": "check_web_package.sh",
+        "plugin-relpath": "feasibility_checks/check_web_package_stop.sh",
+        "task": "This action will cause some functionalities (Default Backend, Personal Website or Virtual Host) of WebStation behave abnormally. If you wish to continue, please click Yes.",
+        "task_i18n": "SYNO.SDS.WebStation.Application:app:support_backend_stop_warning",
+        "type": "soft-check",
+        "version": 1
+      },
+      {
+        "check-type": "share_transform",
+        "name": "check_web_package.sh",
+        "plugin-relpath": "feasibility_checks/check_share.sh",
+        "task": "This action will disable WebStation Personal Website.",
+        "task_i18n": "SYNO.SDS.WebStation.Application:app:userdir_stop_warning",
+        "type": "soft-check",
+        "version": 1
+      },
+      {
+        "check-type": "share_umount",
+        "name": "check_web_package.sh",
+        "plugin-relpath": "feasibility_checks/check_share.sh",
+        "task": "This action will disable WebStation Personal Website.",
+        "task_i18n": "SYNO.SDS.WebStation.Application:app:userdir_stop_warning",
+        "type": "soft-check",
+        "version": 1
+      },
+      {
+        "check-type": "home_disable",
+        "name": "userdir_home_service_disable",
+        "plugin-relpath": "feasibility_checks/check_userdir.sh",
+        "task": "This action will disable WebStation Personal Website.",
+        "task_i18n": "SYNO.SDS.WebStation.Application:app:personal_page",
+        "type": "soft-check",
+        "version": 1
+      }
+    ]
+  },
+  "indexdb": {
+    "app-index": {
+      "conf-relpath": "ui/index.conf",
+      "db-relpath": "indexdb/appindexdb"
+    },
+    "help-index": {
+      "conf-relpath": "ui/helptoc.conf",
+      "db-relpath": "indexdb/helpindexdb"
+    }
+  },
+  "sdk-plugin": {
+    "plugins": [
+      {
+        "event": "share_set",
+        "relpath": "tools/webstation_shareset.sh"
+      },
+      {
+        "event": "dirsvs_join",
+        "relpath": "tools/apache.sh"
+      },
+      {
+        "event": "share_transform",
+        "relpath": "tools/webstation_sharetransform.sh"
+      },
+      {
+        "event": "share_mount_action",
+        "relpath": "tools/webstation_shareumount.sh"
+      },
+      {
+        "event": "timezone_change",
+        "relpath": "tools/php_timezone_change.sh"
+      },
+      {
+        "event": "package_start",
+        "relpath": "tools/webstation_pkg_start_change.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "package_install",
+        "relpath": "tools/webstation_pkg_install_change.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "package_uninstall",
+        "relpath": "tools/webstation_pkg_install_change.sh",
+        "timing": "from_startup_to_halt"
+      },
+      {
+        "event": "user_home_service",
+        "relpath": "tools/webstation_personal_web"
+      }
+    ]
+  },
+  "synocrond": {
+    "conf": "cron/webstation.conf"
+  },
+  "synolog": {
+    "app": {
+      "config": "synolog/config",
+      "event": "synolog/event"
+    }
+  },
+  "syslog-config": {
+    "logrotate-relpath": "misc/logrotate.conf",
+    "patterndb-relpath": "misc/syslog.conf"
+  },
+  "sysnotify": {
+    "texts_dir": "ui/texts"
+  },
+  "systemd-unit": {},
+  "userdata-collector": {
+    "configs": [
+      {
+        "relpath": "tools/webstation.config"
+      }
+    ]
+  },
+  "usr-local-linker": {
+    "bin": [
+      "usr/local/bin/htdigest",
+      "usr/local/bin/htpasswd"
+    ]
+  },
+  "webapi-desc": {
+    "apis": [
+      {
+        "api-dir": "webapi",
+        "lib": [
+          "webapi/SYNO.WebStation.lib"
+        ],
+        "type": "webapi"
+      }
+    ]
+  },
+  "worker-plugin": {
+    "plugins": [
+      {
+        "acquire": "postinst",
+        "api-version": {
+          "major": 1,
+          "minor": 0
+        },
+        "id": "webservice",
+        "release": "postuninst",
+        "relpath": "worker/libwebserviceinstallworker.so"
+      },
+      {
+        "acquire": "enable",
+        "api-version": {
+          "major": 1,
+          "minor": 0
+        },
+        "id": "webservice",
+        "release": "disable",
+        "relpath": "worker/libwebserviceenableworker.so"
+      }
+    ]
+  }
+}

+ 11 - 0
etc/web-config/dsm.nginx-ui.conf

@@ -0,0 +1,11 @@
+ location  /nginx-ui/ {
+        proxy_pass      http://127.0.0.1:38080/nginx-ui/;
+        proxy_set_header X-Real-IP $remote_addr;
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_set_header Host $host;
+        proxy_set_header Upgrade $http_upgrade;
+        proxy_set_header Connection "upgrade";
+        proxy_connect_timeout  30s;
+        proxy_read_timeout  10m;
+        proxy_http_version  1.1;
+}