{"id":123,"date":"2020-04-14T14:37:52","date_gmt":"2020-04-14T06:37:52","guid":{"rendered":"http:\/\/www.gaohui.xyz\/?p=123"},"modified":"2020-04-22T16:38:44","modified_gmt":"2020-04-22T08:38:44","slug":"%e8%87%aa%e5%bb%ba%e7%bd%91%e7%bb%9c%e4%ba%91%e7%9b%98","status":"publish","type":"post","link":"https:\/\/www.gaohui.xyz\/?p=123","title":{"rendered":"\u81ea\u5efa\u7f51\u7edc\u4e91\u76d8"},"content":{"rendered":"\n<p>\u5982\u679c\u81ea\u5df1\u6709\u591a\u4f59\u7684\u4e91\u4e3b\u673a\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u81ea\u5df1\u642d\u5efa\u4e00\u5957\u7f51\u7edc\u4e91\u76d8\uff0c\u65b9\u4fbf\u6587\u4ef6\u7684\u5b58\u50a8\u548c\u5171\u4eab\u3002\u8fd9\u91cc\u63a8\u8350\u4e00\u4e2a\u5f00\u6e90\u7684\u4ea7\u54c1\u2014\u2014Nextcloud\u3002<\/p>\n\n\n\n<p>Nextcloud\u662f\u4e00\u6b3e\u5f00\u6e90\u514d\u8d39\u7684\u79c1\u6709\u4e91\u5b58\u50a8\u7f51\u76d8\u9879\u76ee\uff0c\u53ef\u4ee5\u8ba9\u4f60\u5feb\u901f\u4fbf\u6377\u5730\u642d\u5efa\u4e00\u5957\u5c5e\u4e8e\u81ea\u5df1\u6216\u56e2\u961f\u7684\u4e91\u540c\u6b65\u7f51\u76d8\uff0c\u4ece\u800c\u5b9e\u73b0\u8de8\u5e73\u53f0\u8de8\u8bbe\u5907\u6587\u4ef6\u540c\u6b65\u3001\u5171\u4eab\u3001\u7248\u672c\u63a7\u5236\u3001\u56e2\u961f\u534f\u4f5c\u7b49\u529f\u80fd\u3002\u5b83\u7684\u5ba2\u6237\u7aef\u8986\u76d6\u4e86Windows\u3001Mac\u3001Android\u3001iOS\u3001Linux \u7b49\u5404\u79cd\u5e73\u53f0\uff0c\u4e5f\u63d0\u4f9b\u4e86\u7f51\u9875\u7aef\u4ee5\u53ca WebDAV\u63a5\u53e3\uff0c\u6240\u4ee5\u4f60\u51e0\u4e4e\u53ef\u4ee5\u5728\u5404\u79cd\u8bbe\u5907\u4e0a\u65b9\u4fbf\u5730\u8bbf\u95ee\u4f60\u7684\u4e91\u76d8\u3002<\/p>\n\n\n\n<p>\u5f53\u7136\uff0c\u6211\u6700\u559c\u6b22\u7684\u4e00\u70b9\u8fd8\u662f\u5b98\u65b9\u63d0\u4f9b\u4e86docker\u955c\u50cf\uff0c\u53ef\u4ee5\u4e00\u952e\u5f0f\u90e8\u7f72\u3002<\/p>\n\n\n\n<p>\u5728\u5f00\u59cb\u90e8\u7f72\u4e4b\u524d\uff0c\u786e\u4fdd\u4ee5\u4e0b\u73af\u5883\u5df2\u5177\u5907\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u4e00\u53f0Linux\u4e91\u4e3b\u673a\uff0c\u914d\u7f6e\u4e0d\u9700\u8981\u592a\u9ad8\uff0c\u4f46\u662f\u786c\u76d8\u7a7a\u95f4\u6700\u597d\u5927\u4e00\u70b9\uff0c\u6bd5\u7adf\u662f\u7528\u6765\u505a\u7f51\u7edc\u4e91\u76d8\u7684<\/li><li>\u4e91\u4e3b\u673a\u5b89\u88c5\u597ddocker<\/li><li>\u516c\u7f51IP\u3001\u516c\u7f51\u57df\u540d\u4ee5\u53caSSL\u8bc1\u4e66<\/li><\/ul>\n\n\n\n<p>\u8fd9\u5957\u73af\u5883\u4e3b\u8981\u7531\u4e00\u4e0b\u4e09\u4e2a\u7ec4\u4ef6\u6784\u6210\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>MariaDB\uff08MySQL\uff09<\/li><li>Nextcloud<\/li><li>Nginx<\/li><\/ul>\n\n\n\n<p>\u5176\u4e2dMariaDB\u4e3a\u540e\u53f0\u6570\u636e\u5e93\uff0cNextcloud\u4e3a\u5e94\u7528\u7a0b\u5e8f\uff0cNginx\u7528\u4e8e\u5b9e\u73b0https\u4e2d\u8bc1\u4e66\u7684\u5378\u8f7d\u3002\u4e09\u4e2a\u7ec4\u4ef6\u5747\u4ee5\u5bb9\u5668\u7684\u65b9\u5f0f\u8fd0\u884c\uff0c\u4f7f\u7528docker-compose\u7f16\u6392\u5bb9\u5668\u7684\u8fd0\u884c\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u662fdocker-compose.yaml\u7684\u914d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>version: '2'\n\nservices:\n  db:\n    image: mariadb\n    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW\n    restart: always\n    volumes:\n      - \/nextcloud\/db:\/var\/lib\/mysql\n    environment:\n      - MYSQL_ROOT_PASSWORD=XXXXXXXXX\n      - MYSQL_PASSWORD=XXXXXXXXX\n      - MYSQL_DATABASE=XXXXXXXXX\n      - MYSQL_USER=XXXXXXXXX\n  app:\n    image: nextcloud\n    links:\n      - db\n    volumes:\n      - \/nextcloud\/app:\/var\/www\/html\n    restart: always\n  nginx:\n    image: nginx:alpine\n    ports:\n      - 80:80\n      - 443:443\n    links:\n      - app\n    volumes:\n      - \/nextcloud\/nginx:\/etc\/nginx\n    restart: always<\/code><\/pre>\n\n\n\n<p>Nginx\u4e2d\u5b9e\u73b0HTTPS\u8bc1\u4e66\u5378\u8f7d\u7684\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>stream {\n\tupstream stream_backend {\n\t\tserver app:80;\t\n\t}\n\tserver {\n\t\tlisten 443 ssl;\n\t\tproxy_pass stream_backend;\n\t\tssl_certificate \/etc\/nginx\/ssl\/cert.pem;\n\t        ssl_certificate_key \/etc\/nginx\/ssl\/cert.key;\n\t        ssl_protocols       TLSv1.2 TLSv1.3;\n\t\tssl_prefer_server_ciphers on;\n\t        ssl_ciphers         HIGH:!aNULL:!MD5;\n\t\tssl_session_cache\tshared:SSL:20m;\n\t\tssl_session_timeout\t4h;\n\t\tssl_handshake_timeout\t30s;\n\t}\n\t\n\tserver {\n\t\tlisten 80;\n\t\tproxy_pass\tstream_backend;\n\t}\n\n}<\/code><\/pre>\n\n\n\n<p>HTTP\u5230HTTPS\u7684\u8df3\u8f6c\u6211\u6ca1\u6709\u4f7f\u7528Nginx\uff0c\u800c\u662f\u5728\u5e94\u7528\u7a0b\u5e8f\u7aef\u4e5f\u5c31\u662fNextcloud\u5b9e\u73b0\u7684\uff0c\u4fee\u6539\/nextcloud\/app\/config\/config.php\u914d\u7f6e\u6587\u4ef6\u7684\uff0c\u4fee\u6539\u9879\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  array (\n    0 => 'xx.xx.xx.xx',\n    'www.gaohui.xyz',\n  ),\n  'overwrite.cli.url' => 'https:\/\/www.gaohui.xyz',\n  'overwritehost' => 'www.gaohui.xyz',\n  'overwriteprotocol' => 'https',<\/code><\/pre>\n\n\n\n<p>config.php\u914d\u7f6e\u6587\u4ef6\u4e2d\u5404\u914d\u7f6e\u7684\u8bf4\u660e\u53ef\u53c2\u8003\u901a\u76ee\u5f55\u4e0bconfig.sample.php\u6587\u4ef6\u3002<\/p>\n\n\n\n<p>\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u6d4f\u89c8\u5668\u8f93\u5165\u57df\u540d\u5c31\u53ef\u4ee5\u8fdb\u5230Nextcloud\u5f00\u59cb\u57fa\u7840\u914d\u7f6e\u5566\u3002\u540c\u65f6\u4f60\u4e5f\u53ef\u4ee5\u4e0b\u8f7diOS\u6216\u8005Android\u7684\u5ba2\u6237\u7aef\uff0c\u624b\u673a\u4e0a\u67e5\u770b\u7f51\u76d8\u5185\u5bb9\u6216\u8005\u4f7f\u7528\u624b\u673a\u4e0a\u4f20\u4e0b\u8f7d\u6587\u4ef6\u4e86\u3002<\/p>\n\n\n\n<p>Nextcloud\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e2a\u547d\u4ee4\u884c\u7ba1\u7406\u5de5\u5177occ\uff0c\u6709\u65f6\u5019\u9700\u8981\u7528\u5b83\u6765\u7ba1\u7406\u7528\u6237\uff0c\u4f8b\u5982\u91cd\u7f6e\u5bc6\u7801\u4ec0\u4e48\u7684\uff0c\u8be6\u7ec6\u53ef\u4ee5\u53bb\u7814\u7a76\u4e0bNextcloud\u7684\u5b98\u65b9\u6587\u6863\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@nextcloud:~# docker exec --user www-data 381 php occ\nNextcloud 18.0.3\n\nUsage:\n  command &#91;options] &#91;arguments]\n\nOptions:\n  -h, --help            Display this help message\n  -q, --quiet           Do not output any message\n  -V, --version         Display this application version\n      --ansi            Force ANSI output\n      --no-ansi         Disable ANSI output\n  -n, --no-interaction  Do not ask any interactive question\n      --no-warnings     Skip global warnings, show command output only\n  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\n\nAvailable commands:\n  check                               check dependencies of the server environment\n  help                                Displays help for a command\n  list                                Lists commands\n  status                              show some status information\n  upgrade                             run upgrade routines after installation of a new release. The release has to be installed before.\n activity\n  activity:send-mails                 Sends the activity notification mails\n app\n  app:check-code                      check code to be compliant\n  app:disable                         disable an app\n  app:enable                          enable an app\n  app:getpath                         Get an absolute path to the app directory\n  app:install                         install an app\n  app:list                            List all available apps\n  app:remove                          remove an app\n  app:update                          update an app or all apps\n background\n  background:ajax                     Use ajax to run background jobs\n  background:cron                     Use cron to run background jobs\n  background:webcron                  Use webcron to run background jobs\n broadcast\n  broadcast:test                      test the SSE broadcaster\n config\n  config:app:delete                   Delete an app config value\n  config:app:get                      Get an app config value\n  config:app:set                      Set an app config value\n  config:import                       Import a list of configs\n  config:list                         List all configs\n  config:system:delete                Delete a system config value\n  config:system:get                   Get a system config value\n  config:system:set                   Set a system config value\n dav\n  dav:create-addressbook              Create a dav addressbook\n  dav:create-calendar                 Create a dav calendar\n  dav:list-calendars                  List all calendars of a user\n  dav:move-calendar                   Move a calendar from an user to another\n  dav:remove-invalid-shares           Remove invalid dav shares\n  dav:send-event-reminders            Sends event reminders\n  dav:sync-birthday-calendar          Synchronizes the birthday calendar\n  dav:sync-system-addressbook         Synchronizes users to the system addressbook\n db\n  db:add-missing-indices              Add missing indices to the database tables\n  db:convert-filecache-bigint         Convert the ID columns of the filecache to BigInt\n  db:convert-mysql-charset            Convert charset of MySQL\/MariaDB to use utf8mb4\n  db:convert-type                     Convert the Nextcloud database to the newly configured one\n encryption\n  encryption:change-key-storage-root  Change key storage root\n  encryption:decrypt-all              Disable server-side encryption and decrypt all files\n  encryption:disable                  Disable encryption\n  encryption:enable                   Enable encryption\n  encryption:encrypt-all              Encrypt all files for all users\n  encryption:list-modules             List all available encryption modules\n  encryption:set-default-module       Set the encryption default module\n  encryption:show-key-storage-root    Show current key storage root\n  encryption:status                   Lists the current status of encryption\n federation\n  federation:sync-addressbooks        Synchronizes addressbooks of all federated clouds\n files\n  files:cleanup                       cleanup filecache\n  files:recommendations:recommend     \n  files:scan                          rescan filesystem\n  files:scan-app-data                 rescan the AppData folder\n  files:transfer-ownership            All files and folders are moved to another user - shares are moved as well.\n group\n  group:add                           Add a group\n  group:adduser                       add a user to a group\n  group:delete                        Remove a group\n  group:list                          list configured groups\n  group:removeuser                    remove a user from a group\n integrity\n  integrity:check-app                 Check integrity of an app using a signature.\n  integrity:check-core                Check integrity of core code using a signature.\n  integrity:sign-app                  Signs an app using a private key.\n  integrity:sign-core                 Sign core using a private key.\n l10n\n  l10n:createjs                       Create javascript translation files for a given app\n log\n  log:file                            manipulate logging backend\n  log:manage                          manage logging configuration\n  log:tail                            Tail the nextcloud logfile\n  log:watch                           Watch the nextcloud logfile\n maintenance\n  maintenance:data-fingerprint        update the systems data-fingerprint after a backup is restored\n  maintenance:mimetype:update-db      Update database mimetypes and update filecache\n  maintenance:mimetype:update-js      Update mimetypelist.js\n  maintenance:mode                    set maintenance mode\n  maintenance:repair                  repair this installation\n  maintenance:theme:update            Apply custom theme changes\n  maintenance:update:htaccess         Updates the .htaccess file\n migrations\n  migrations:execute                  Execute a single migration version manually.\n  migrations:generate                 \n  migrations:generate-from-schema     \n  migrations:migrate                  Execute a migration to a specified version or the latest available version.\n  migrations:status                   View the status of a set of migrations.\n notification\n  notification:generate               Generate a notification for the given user\n security\n  security:certificates               list trusted certificates\n  security:certificates:import        import trusted certificate\n  security:certificates:remove        remove trusted certificate\n sharing\n  sharing:cleanup-remote-storages     Cleanup shared storage entries that have no matching entry in the shares_external table\n  sharing:expiration-notification     Notify share initiators when a share will expire the next day.\n text\n  text:reset                          Reset a text document\n trashbin\n  trashbin:cleanup                    Remove deleted files\n  trashbin:expire                     Expires the users trashbin\n twofactorauth\n  twofactorauth:cleanup               Clean up the two-factor user-provider association of an uninstalled\/removed provider\n  twofactorauth:disable               Disable two-factor authentication for a user\n  twofactorauth:enable                Enable two-factor authentication for a user\n  twofactorauth:enforce               Enabled\/disable enforced two-factor authentication\n  twofactorauth:state                 Get the two-factor authentication (2FA) state of a user\n update\n  update:check                        Check for server and app updates\n user\n  user:add                            adds a user\n  user:delete                         deletes the specified user\n  user:disable                        disables the specified user\n  user:enable                         enables the specified user\n  user:info                           show user info\n  user:lastseen                       shows when the user was logged in last time\n  user:list                           list configured users\n  user:report                         shows how many users have access\n  user:resetpassword                  Resets the password of the named user\n  user:setting                        Read and modify user settings\n versions\n  versions:cleanup                    Delete versions\n  versions:expire                     Expires the users file versions\n workflows\n  workflows:list                      Lists configured workflows\n<\/code><\/pre>\n\n\n\n<p>\u6700\u7ec8\u6548\u679c\u56fe\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"495\" src=\"https:\/\/hui-tokyo-1258674280.cos.ap-tokyo.myqcloud.com\/wordpress\/2020\/04\/\u6355\u83b7-1024x495.jpg\" alt=\"\" class=\"wp-image-124\" srcset=\"https:\/\/www.gaohui.xyz\/wp-content\/uploads\/2020\/04\/\u6355\u83b7-1024x495.jpg 1024w, https:\/\/www.gaohui.xyz\/wp-content\/uploads\/2020\/04\/\u6355\u83b7-300x145.jpg 300w, https:\/\/www.gaohui.xyz\/wp-content\/uploads\/2020\/04\/\u6355\u83b7-768x371.jpg 768w, https:\/\/www.gaohui.xyz\/wp-content\/uploads\/2020\/04\/\u6355\u83b7-1536x742.jpg 1536w, https:\/\/www.gaohui.xyz\/wp-content\/uploads\/2020\/04\/\u6355\u83b7.jpg 1912w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u81ea\u5df1\u6709\u591a\u4f59\u7684\u4e91\u4e3b\u673a\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u81ea\u5df1\u642d\u5efa\u4e00\u5957\u7f51\u7edc\u4e91\u76d8\uff0c\u65b9\u4fbf\u6587\u4ef6\u7684\u5b58\u50a8\u548c\u5171\u4eab\u3002\u8fd9\u91cc &hellip; <a href=\"https:\/\/www.gaohui.xyz\/?p=123\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-123","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=\/wp\/v2\/posts\/123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=123"}],"version-history":[{"count":5,"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=\/wp\/v2\/posts\/123\/revisions"}],"predecessor-version":[{"id":130,"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=\/wp\/v2\/posts\/123\/revisions\/130"}],"wp:attachment":[{"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gaohui.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}