diff --git a/.gitignore b/.gitignore index 2eb482b..11fcf0c 100755 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ yarn.lock .DS_Store package-lock.json .umi/ +dist/ diff --git a/Dockerfile b/Dockerfile index 2fd3a26..0cac8f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,18 @@ +FROM jelastic/nodejs:8.16.1-npm AS frontend + +WORKDIR /app +ADD . /app +RUN npm install +RUN npm run build + FROM jelastic/nodejs:8.16.1-npm -COPY . /app +WORKDIR /app +ADD . /app +COPY --from=frontend /app/dist /frontend +RUN cp ./backend/package.json . +RUN npm install --registry=https://registry.npm.taobao.org +RUN yum install -y nginx +RUN cp /app/nginx/artipub.conf /etc/nginx/conf.d + +CMD /app/docker_init.sh diff --git a/Dockerfile-local b/Dockerfile-local new file mode 100644 index 0000000..207506f --- /dev/null +++ b/Dockerfile-local @@ -0,0 +1,18 @@ +FROM jelastic/nodejs:8.16.1-npm AS frontend + +WORKDIR /app +ADD . /app +RUN npm install --registry=https://registry.npm.taobao.org +RUN npm run build + +FROM jelastic/nodejs:8.16.1-npm + +WORKDIR /app +ADD . /app +COPY --from=frontend /app/dist /frontend +RUN cp ./backend/package.json . +RUN npm install --registry=https://registry.npm.taobao.org +RUN yum install -y nginx +RUN cp /app/nginx/artipub.conf /etc/nginx/conf.d + +CMD /app/docker_init.sh diff --git a/README.md b/README.md index 87fbd0e..822926c 100644 --- a/README.md +++ b/README.md @@ -17,16 +17,20 @@ ArtiPub提供3种安装方式如下。 ### 通过Docker安装 -通过Docker,可以免去 +通过Docker,可以免去安装MongoDB的步骤,也是我们最推荐的安装方式。 **安装Docker Compose** ```bash -docker-compose +docker-compose up ``` +就这一行命令,然后在浏览器中输入`http://localhost:8000`可以看到界面。 + ### 通过npm包安装 +如果您对npm熟悉,且已经有MongoDB的环境,这是最为快捷的方式。 + **安装npm包** ```bash diff --git a/backend/package.json b/backend/package.json index 5dec7c5..1798d96 100644 --- a/backend/package.json +++ b/backend/package.json @@ -4,7 +4,8 @@ "description": "", "main": "server.js", "scripts": { - "start": "node server.js" + "start": "node server.js", + "start:backend": "node server.js" }, "author": "", "license": "ISC", diff --git a/config/defaultSettings.ts b/config/defaultSettings.ts index 2f5b5f6..1d61570 100644 --- a/config/defaultSettings.ts +++ b/config/defaultSettings.ts @@ -54,7 +54,7 @@ export default { menu: { locale: true, }, - title: 'ArtiPub v0.1.0', + title: 'ArtiPub v0.1.2', pwa: false, iconfontUrl: '', } as DefaultSettings; diff --git a/docker-compose.yaml b/docker-compose.yaml index a942bf9..2a55d0f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,15 +1,16 @@ version: '3.3' services: - master: + app: image: "tikazyq/artipub:latest" environment: - CRAWLAB_API_ADDRESS: "192.168.99.100:8000" - CRAWLAB_SERVER_MASTER: "Y" - CRAWLAB_MONGO_HOST: "192.168.99.1" - CRAWLAB_REDIS_ADDRESS: "192.168.99.1" - CRAWLAB_LOG_PATH: "/var/logs/crawlab" - ports: - - "8080:8080" # frontend - - "8000:8000" # backend - volumes: - - "/Users/yeqing/projects/artipub/spiders:/app/spiders" + MONGO_HOST: "mongo" + ports: + - "8000:8000" # frontend + - "3000:3000" # backend + depends_on: + - mongo + mongo: + image: mongo:latest + restart: always + ports: + - "27017:27017" diff --git a/docker_init.sh b/docker_init.sh new file mode 100755 index 0000000..2f5a5a8 --- /dev/null +++ b/docker_init.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# replace original url to new one +if [ "${ARTIPUB_API_ADDRESS}" = "" ]; +then + : +else + jspath=`ls /frontend/umi.*.js` + sed -i "s?localhost:3000?${ARTIPUB_API_ADDRESS}?g" ${jspath} +fi + +# start frontend +nginx -s stop | true +nginx + +# start backend +npm run start:backend diff --git a/extensions/package-lock.json b/extensions/package-lock.json index 0c3a97c..d87b525 100644 --- a/extensions/package-lock.json +++ b/extensions/package-lock.json @@ -834,9 +834,9 @@ } }, "bluebird": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz", - "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==", + "version": "3.5.5", + "resolved": "https://registry.npm.taobao.org/bluebird/download/bluebird-3.5.5.tgz", + "integrity": "sha1-qNCv1zJR7/u9X+OEp31zADwXpx8=", "dev": true }, "bn.js": { @@ -1051,30 +1051,76 @@ "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" }, "cacache": { - "version": "10.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", - "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", - "dev": true, - "requires": { - "bluebird": "^3.5.1", - "chownr": "^1.0.1", - "glob": "^7.1.2", - "graceful-fs": "^4.1.11", - "lru-cache": "^4.1.1", - "mississippi": "^2.0.0", + "version": "12.0.3", + "resolved": "https://registry.npm.taobao.org/cacache/download/cacache-12.0.3.tgz", + "integrity": "sha1-vpmruk4b9d9GHNWiwQcfxDJXM5A=", + "dev": true, + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", "mkdirp": "^0.5.1", "move-concurrently": "^1.0.1", "promise-inflight": "^1.0.1", - "rimraf": "^2.6.2", - "ssri": "^5.2.4", - "unique-filename": "^1.1.0", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", "y18n": "^4.0.0" }, "dependencies": { + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npm.taobao.org/glob/download/glob-7.1.4.tgz", + "integrity": "sha1-qmCKL2xXetNX4a5aXCbZqNGWklU=", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "graceful-fs": { + "version": "4.2.2", + "resolved": "https://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.2.2.tgz", + "integrity": "sha1-bwlSYF0BQMHP2xOO0AV3W5LWewI=", + "dev": true + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npm.taobao.org/lru-cache/download/lru-cache-5.1.1.tgz", + "integrity": "sha1-HaJ+ZxAnGUdpXa9oSOhH8B2EuSA=", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npm.taobao.org/rimraf/download/rimraf-2.7.1.tgz?cache=0&sync_timestamp=1566289585759&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frimraf%2Fdownload%2Frimraf-2.7.1.tgz", + "integrity": "sha1-NXl/E6f9rcVmFCwp1PB8ytSD4+w=", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "y18n": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "resolved": "https://registry.npm.taobao.org/y18n/download/y18n-4.0.0.tgz", + "integrity": "sha1-le+U+F7MgdAHwmThkKEg8KPIVms=", + "dev": true + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npm.taobao.org/yallist/download/yallist-3.0.3.tgz", + "integrity": "sha1-tLBJ4xS+VF486AIjbWzSLNkcPek=", "dev": true } } @@ -1307,9 +1353,9 @@ } }, "commander": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", - "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", + "version": "2.20.0", + "resolved": "https://registry.npm.taobao.org/commander/download/commander-2.20.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.20.0.tgz", + "integrity": "sha1-1YuytcHuj4ew00ACfp6U4iLFpCI=", "dev": true }, "commondir": { @@ -2806,14 +2852,14 @@ } }, "find-cache-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", - "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/find-cache-dir/download/find-cache-dir-2.1.0.tgz", + "integrity": "sha1-jQ+UzRP+Q8bHwmGg2GEVypGMBfc=", "dev": true, "requires": { "commondir": "^1.0.1", - "make-dir": "^1.0.0", - "pkg-dir": "^2.0.0" + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" } }, "find-up": { @@ -2949,8 +2995,7 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true, - "optional": true + "bundled": true }, "aproba": { "version": "1.2.0", @@ -2968,13 +3013,11 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, - "optional": true + "bundled": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2987,18 +3030,15 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "concat-map": { "version": "0.0.1", - "bundled": true, - "optional": true + "bundled": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "core-util-is": { "version": "1.0.2", @@ -3101,8 +3141,7 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, - "optional": true + "bundled": true }, "ini": { "version": "1.3.5", @@ -3112,7 +3151,6 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -3125,20 +3163,17 @@ "minimatch": { "version": "3.0.4", "bundled": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true, - "optional": true + "bundled": true }, "minipass": { "version": "2.3.5", "bundled": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -3155,7 +3190,6 @@ "mkdirp": { "version": "0.5.1", "bundled": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -3234,8 +3268,7 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, - "optional": true + "bundled": true }, "object-assign": { "version": "4.1.1", @@ -3245,7 +3278,6 @@ "once": { "version": "1.4.0", "bundled": true, - "optional": true, "requires": { "wrappy": "1" } @@ -3321,8 +3353,7 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true, - "optional": true + "bundled": true }, "safer-buffer": { "version": "2.1.2", @@ -3352,7 +3383,6 @@ "string-width": { "version": "1.0.2", "bundled": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -3370,7 +3400,6 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -3409,13 +3438,11 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, - "optional": true + "bundled": true }, "yallist": { "version": "3.0.3", - "bundled": true, - "optional": true + "bundled": true } } }, @@ -4000,6 +4027,12 @@ "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", "dev": true }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/infer-owner/download/infer-owner-1.0.4.tgz", + "integrity": "sha1-xM78qo5RBRwqQLos6KPScpWvlGc=", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -4462,18 +4495,18 @@ } }, "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-3.0.0.tgz", + "integrity": "sha1-2+w7OrdZdYBxtY/ln8QYca8hQA4=", "dev": true, "requires": { - "p-locate": "^2.0.0", + "p-locate": "^3.0.0", "path-exists": "^3.0.0" }, "dependencies": { "path-exists": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-3.0.0.tgz", "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true } @@ -4569,18 +4602,19 @@ } }, "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/make-dir/download/make-dir-2.1.0.tgz", + "integrity": "sha1-XwMQ4YuL6JjMBwCSlaMK5B6R5vU=", "dev": true, "requires": { - "pify": "^3.0.0" + "pify": "^4.0.1", + "semver": "^5.6.0" }, "dependencies": { "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "version": "4.0.1", + "resolved": "https://registry.npm.taobao.org/pify/download/pify-4.0.1.tgz", + "integrity": "sha1-SyzSXFDVmHNcUCkiJP2MbfQeMjE=", "dev": true } } @@ -4792,9 +4826,9 @@ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "mississippi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-2.0.0.tgz", - "integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==", + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/mississippi/download/mississippi-3.0.0.tgz", + "integrity": "sha1-6goykfl+C16HdrNj1fChLZTGcCI=", "dev": true, "requires": { "concat-stream": "^1.5.0", @@ -4803,10 +4837,22 @@ "flush-write-stream": "^1.0.0", "from2": "^2.1.0", "parallel-transform": "^1.1.0", - "pump": "^2.0.1", + "pump": "^3.0.0", "pumpify": "^1.3.3", "stream-each": "^1.1.0", "through2": "^2.0.0" + }, + "dependencies": { + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/pump/download/pump-3.0.0.tgz", + "integrity": "sha1-tKIRaBW94vTh6mAjVOjHVWUQemQ=", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } } }, "mixin-deep": { @@ -5283,21 +5329,21 @@ "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=" }, "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "version": "2.2.1", + "resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-2.2.1.tgz", + "integrity": "sha1-qgeniMwxUck5tRMfY1cPDdIAlTc=", "dev": true, "requires": { - "p-try": "^1.0.0" + "p-try": "^2.0.0" } }, "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-3.0.0.tgz", + "integrity": "sha1-Mi1poFwCZLJZl9n0DNiokasAZKQ=", "dev": true, "requires": { - "p-limit": "^1.1.0" + "p-limit": "^2.0.0" } }, "p-map": { @@ -5314,9 +5360,9 @@ } }, "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "version": "2.2.0", + "resolved": "https://registry.npm.taobao.org/p-try/download/p-try-2.2.0.tgz", + "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=", "dev": true }, "pako": { @@ -5482,21 +5528,21 @@ } }, "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-3.0.0.tgz", + "integrity": "sha1-J0kCDyOe2ZCIGx9xIQ1R62UjvqM=", "dev": true, "requires": { - "find-up": "^2.1.0" + "find-up": "^3.0.0" }, "dependencies": { "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/find-up/download/find-up-3.0.0.tgz", + "integrity": "sha1-SRafHXmTQwZG2mHsxa41XCHJe3M=", "dev": true, "requires": { - "locate-path": "^2.0.0" + "locate-path": "^3.0.0" } } } @@ -6898,9 +6944,9 @@ } }, "serialize-javascript": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.5.0.tgz", - "integrity": "sha512-Ga8c8NjAAp46Br4+0oZ2WxJCwIzwP60Gq1YPgU+39PiTVxyed/iKE/zyZI6+UlVYH5Q4PaQdHhcegIFPZTUfoQ==", + "version": "1.9.1", + "resolved": "https://registry.npm.taobao.org/serialize-javascript/download/serialize-javascript-1.9.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fserialize-javascript%2Fdownload%2Fserialize-javascript-1.9.1.tgz", + "integrity": "sha1-z8IArvd7YAxH2pu4FJyUPnmML9s=", "dev": true }, "serve-index": { @@ -7337,12 +7383,12 @@ } }, "ssri": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz", - "integrity": "sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==", + "version": "6.0.1", + "resolved": "https://registry.npm.taobao.org/ssri/download/ssri-6.0.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fssri%2Fdownload%2Fssri-6.0.1.tgz", + "integrity": "sha1-KjxBso3UW2K2Nnbst0ABJlrp7dg=", "dev": true, "requires": { - "safe-buffer": "^5.1.1" + "figgy-pudding": "^3.5.1" } }, "state-toggle": { @@ -7839,45 +7885,67 @@ "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.20.tgz", "integrity": "sha512-8OaIKfzL5cpx8eCMAhhvTlft8GYF8b2eQr6JkCyVdrgjcytyOmPCXrqXFcUnhonRpLlh5yxEZVohm6mzaowUOw==" }, - "uglify-es": { - "version": "3.3.9", - "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", - "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", + "uglify-js": { + "version": "3.6.0", + "resolved": "https://registry.npm.taobao.org/uglify-js/download/uglify-js-3.6.0.tgz", + "integrity": "sha1-cEaBNFxTqLIHn7bOwpSwXq0kL/U=", "dev": true, "requires": { - "commander": "~2.13.0", + "commander": "~2.20.0", "source-map": "~0.6.1" }, "dependencies": { "source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", "dev": true } } }, "uglifyjs-webpack-plugin": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.3.0.tgz", - "integrity": "sha512-ovHIch0AMlxjD/97j9AYovZxG5wnHOPkL7T1GKochBADp/Zwc44pEWNqpKl1Loupp1WhFg7SlYmHZRUfdAacgw==", + "version": "2.2.0", + "resolved": "https://registry.npm.taobao.org/uglifyjs-webpack-plugin/download/uglifyjs-webpack-plugin-2.2.0.tgz", + "integrity": "sha1-51vIDn8ZN/cllUybTFoeln6p0Nc=", "dev": true, "requires": { - "cacache": "^10.0.4", - "find-cache-dir": "^1.0.0", - "schema-utils": "^0.4.5", - "serialize-javascript": "^1.4.0", + "cacache": "^12.0.2", + "find-cache-dir": "^2.1.0", + "is-wsl": "^1.1.0", + "schema-utils": "^1.0.0", + "serialize-javascript": "^1.7.0", "source-map": "^0.6.1", - "uglify-es": "^3.3.4", - "webpack-sources": "^1.1.0", - "worker-farm": "^1.5.2" + "uglify-js": "^3.6.0", + "webpack-sources": "^1.4.0", + "worker-farm": "^1.7.0" }, "dependencies": { + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/schema-utils/download/schema-utils-1.0.0.tgz?cache=0&sync_timestamp=1567421964718&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fschema-utils%2Fdownload%2Fschema-utils-1.0.0.tgz", + "integrity": "sha1-C3mpMgTXtgDUsoUNH2bCo0lRx3A=", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, "source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", "dev": true + }, + "webpack-sources": { + "version": "1.4.3", + "resolved": "https://registry.npm.taobao.org/webpack-sources/download/webpack-sources-1.4.3.tgz?cache=0&sync_timestamp=1568302998163&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwebpack-sources%2Fdownload%2Fwebpack-sources-1.4.3.tgz", + "integrity": "sha1-7t2OwLko+/HL/plOItLYkPMwqTM=", + "dev": true, + "requires": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + } } } }, @@ -8253,17 +8321,193 @@ "uri-js": "^4.2.2" } }, + "cacache": { + "version": "10.0.4", + "resolved": "https://registry.npm.taobao.org/cacache/download/cacache-10.0.4.tgz", + "integrity": "sha1-ZFI2eZnv+dQYiu/ZoU6dfGomNGA=", + "dev": true, + "requires": { + "bluebird": "^3.5.1", + "chownr": "^1.0.1", + "glob": "^7.1.2", + "graceful-fs": "^4.1.11", + "lru-cache": "^4.1.1", + "mississippi": "^2.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.2", + "ssri": "^5.2.4", + "unique-filename": "^1.1.0", + "y18n": "^4.0.0" + } + }, + "commander": { + "version": "2.13.0", + "resolved": "https://registry.npm.taobao.org/commander/download/commander-2.13.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.13.0.tgz", + "integrity": "sha1-aWS8pnaF33wfFDDFhPB9dZeIW5w=", + "dev": true + }, "fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", "dev": true }, + "find-cache-dir": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/find-cache-dir/download/find-cache-dir-1.0.0.tgz", + "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^2.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/find-up/download/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npm.taobao.org/make-dir/download/make-dir-1.3.0.tgz", + "integrity": "sha1-ecEDO4BRW9bSTsmTPoYMp17ifww=", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "mississippi": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/mississippi/download/mississippi-2.0.0.tgz", + "integrity": "sha1-NEKlCPr8KFAEhv7qmUCWduTuWm8=", + "dev": true, + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^2.0.1", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-1.3.0.tgz", + "integrity": "sha1-uGvV8MJWkJEcdZD8v8IBDVSzzLg=", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/p-try/download/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/pify/download/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "dev": true + }, + "ssri": { + "version": "5.3.0", + "resolved": "https://registry.npm.taobao.org/ssri/download/ssri-5.3.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fssri%2Fdownload%2Fssri-5.3.0.tgz", + "integrity": "sha1-ujhyycbTOgcEp9cf8EXl7EiZnQY=", + "dev": true, + "requires": { + "safe-buffer": "^5.1.1" + } + }, + "uglify-es": { + "version": "3.3.9", + "resolved": "https://registry.npm.taobao.org/uglify-es/download/uglify-es-3.3.9.tgz", + "integrity": "sha1-DBxPBwC+2NvBJM2zBNJZLKID5nc=", + "dev": true, + "requires": { + "commander": "~2.13.0", + "source-map": "~0.6.1" + } + }, + "uglifyjs-webpack-plugin": { + "version": "1.3.0", + "resolved": "https://registry.npm.taobao.org/uglifyjs-webpack-plugin/download/uglifyjs-webpack-plugin-1.3.0.tgz", + "integrity": "sha1-dfVIFghYFjoIZD4IbV/v4YpdZ94=", + "dev": true, + "requires": { + "cacache": "^10.0.4", + "find-cache-dir": "^1.0.0", + "schema-utils": "^0.4.5", + "serialize-javascript": "^1.4.0", + "source-map": "^0.6.1", + "uglify-es": "^3.3.4", + "webpack-sources": "^1.1.0", + "worker-farm": "^1.5.2" + } + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/y18n/download/y18n-4.0.0.tgz", + "integrity": "sha1-le+U+F7MgdAHwmThkKEg8KPIVms=", + "dev": true } } }, @@ -8910,9 +9154,9 @@ } }, "worker-farm": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.6.0.tgz", - "integrity": "sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ==", + "version": "1.7.0", + "resolved": "https://registry.npm.taobao.org/worker-farm/download/worker-farm-1.7.0.tgz", + "integrity": "sha1-JqlMU5G7ypJhUgAvabhKS/dy5ag=", "dev": true, "requires": { "errno": "~0.1.7" diff --git a/extensions/package.json b/extensions/package.json index 7db07f5..2c12c76 100755 --- a/extensions/package.json +++ b/extensions/package.json @@ -1,7 +1,7 @@ { - "name": "chrome-extension-react-typescript-boilerplate", - "version": "1.0.0", - "description": "A boilerplate project to quickly build a Chrome extension using TypeScript and React (built using webpack).", + "name": "artipub-chrome-extension", + "version": "0.1.2", + "description": "Chrome extension login helper for ArtiPub", "scripts": { "dev": "webpack-dev-server --config webpack.dev.js --content-base ./dist", "build:dev": "webpack --config webpack.dev.js", @@ -9,8 +9,8 @@ "watch": "webpack -w --config webpack.dev.js", "lint": "tslint 'src/**/*.{ts, tsx}'" }, - "author": "Joe Martella", - "license": "MIT", + "author": "Marvin Zhang", + "license": "BSD-3-Clause", "devDependencies": { "@types/chrome": "0.0.60", "@types/react": "^16.9.1", @@ -37,8 +37,6 @@ "html-webpack-plugin": "^3.2.0", "react": "^16.2.0", "react-dom": "^16.2.0", - "react-markdown": "^4.1.0", - "react-markdown-editor-lite": "^0.4.2", "ts-import-plugin": "^1.6.1", "webpack-dev-server": "^3.8.0" } diff --git a/extensions/src/icon.png b/extensions/src/icon.png index 4823224..9906546 100644 Binary files a/extensions/src/icon.png and b/extensions/src/icon.png differ diff --git a/extensions/src/manifest.json b/extensions/src/manifest.json index 440a858..da2d71d 100644 --- a/extensions/src/manifest.json +++ b/extensions/src/manifest.json @@ -1,8 +1,8 @@ { "name": "ArtiPub", - "version": "0.0.1", + "version": "0.1.2", "manifest_version": 2, - "description": "ArtiPub登陆助手", + "description": "ArtiPub登陆助手,帮助登陆掘金、SegmentFault、CSDN、知乎等技术平台", "icons": { "16": "icon.png", "48": "icon.png", @@ -31,7 +31,6 @@ ], "permissions": [ "cookies", - "tabs", "http://*/*", "https://*/*", "storage" diff --git a/nginx/artipub.conf b/nginx/artipub.conf new file mode 100644 index 0000000..dc78478 --- /dev/null +++ b/nginx/artipub.conf @@ -0,0 +1,7 @@ +server { + listen 8000; + location / { + root /frontend; + index index.html; + } +} diff --git a/package.json b/package.json index d293b8f..a5dfbfe 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,13 @@ { "name": "artipub", - "version": "0.1.1", + "version": "0.1.2", "description": "Article publishing platform that automatically distributes your articles to various media channels", "main": "index.js", "scripts": { "start": "node cli.js start", "start:frontend": "umi dev", "start:backend": "node server.js", + "build": "umi build", "test": "echo \"Error: no test specified\" && exit 1" }, "bin": { diff --git a/public/artipub-helper.zip b/public/artipub-helper.zip index 9a0afc5..a897685 100644 Binary files a/public/artipub-helper.zip and b/public/artipub-helper.zip differ diff --git a/public/favicon.ico b/public/favicon.ico index dffb8b3..9906546 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/favicon.png b/public/favicon.png index ece59ce..9906546 100644 Binary files a/public/favicon.png and b/public/favicon.png differ diff --git a/server.js b/server.js index 163f22e..a78558f 100644 --- a/server.js +++ b/server.js @@ -13,6 +13,7 @@ const logger = require('./logger') const app = express() // 环境变量覆盖 +console.log(process.env) if (process.env.MONGO_HOST) config.MONGO_HOST = process.env.MONGO_HOST if (process.env.MONGO_PORT) config.MONGO_PORT = process.env.MONGO_PORT if (process.env.MONGO_DB) config.MONGO_DB = process.env.MONGO_DB diff --git a/src/pages/Helper/Helper.tsx b/src/pages/Helper/Helper.tsx index 3f46098..4686a41 100644 --- a/src/pages/Helper/Helper.tsx +++ b/src/pages/Helper/Helper.tsx @@ -18,14 +18,14 @@ const Helper: React.FC = () => { -

登陆助手试用步骤

+

登陆助手使用步骤

    -
  • 1. 点击"下载登陆助手",保存文件名为"artipub-helper.zip"
  • -
  • 2. 在Chrome浏览器种输入chrome://extensions
  • -
  • 3. 将下载的登陆助手文件artipub-helper.zip拖入浏览器中,浏览器将自动安装插件
  • -
  • 4. 在使用登陆助手之前,请确保您的各个平台账号已经处于登陆状态
  • -
  • 5. 右上角点击安装好的插件按钮,点击"一键获取登陆信息",插件将获取所有平台的Cookie
  • -
  • 6. 到"平台管理"页面,查看"Cookie状态",确保其为"已导入"状态
  • +
  • 1. 点击"下载登陆助手",保存文件名为"artipub-helper.zip"
  • +
  • 2. 在Chrome浏览器中输入chrome://extensions,并开启开发者模式(点击右上角)
  • +
  • 3. 将下载的登陆助手文件artipub-helper.zip拖入浏览器中,浏览器将自动安装插件(如果不能拖拽,请刷新页面后重试)
  • +
  • 4. 在使用登陆助手之前,请确保您的各个平台账号已经处于登陆状态
  • +
  • 5. 右上角点击安装好的插件图标,点击"一键获取登陆信息",插件将获取所有平台的Cookie
  • +
  • 6. 到"平台管理"页面,查看"Cookie状态",确保其为"已导入"状态
  • 7. 到"文章管理"页面,点击"发布",选择登陆方式为"Cookie",然后发布文章
diff --git a/src/pages/document.ejs b/src/pages/document.ejs index 7710be6..5d1b48c 100644 --- a/src/pages/document.ejs +++ b/src/pages/document.ejs @@ -9,7 +9,7 @@ /> ArtiPub - +