From 6007ee81db16df6c4fabdccbd00346623826a1d9 Mon Sep 17 00:00:00 2001 From: Felix Bartels Date: Sat, 2 Jun 2018 10:38:46 +0200 Subject: [PATCH 1/6] update base image Signed-off-by: Felix Bartels --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 015255a..c1d8609 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM cloudron/base:0.10.0 +FROM cloudron/base:0.11.0 # setup nodejs version ENV NODEJS_VERSION 6.9.5 From 23b511501a440e4eae250f79b18892e07f877313 Mon Sep 17 00:00:00 2001 From: Felix Bartels Date: Sat, 2 Jun 2018 12:27:17 +0200 Subject: [PATCH 2/6] remove invalid todo. maybe dataloss was because of larger update? --- TODO.md | 1 - 1 file changed, 1 deletion(-) diff --git a/TODO.md b/TODO.md index db7e4fe..a876eb0 100644 --- a/TODO.md +++ b/TODO.md @@ -1,4 +1,3 @@ # TODO list - inside of the app the uid is shown instead of the username -- notes seem to get lost during update From 93913775372b07c42ec538146311250df7cd5709 Mon Sep 17 00:00:00 2001 From: Felix Bartels Date: Mon, 4 Jun 2018 12:05:02 +0200 Subject: [PATCH 3/6] first attempt at using the upstream docker image as source, not functional as of yet Signed-off-by: Felix Bartels --- Dockerfile | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c1d8609..ae82dc2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,32 @@ FROM cloudron/base:0.11.0 # setup nodejs version -ENV NODEJS_VERSION 6.9.5 +ENV NODEJS_VERSION 8.10.3 +ENV NODE_ENV=production RUN ln -s /usr/local/node-$NODEJS_VERSION/bin/node /usr/local/bin/node && \ ln -s /usr/local/node-$NODEJS_VERSION/bin/npm /usr/local/bin/npm +RUN curl -sS http://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \ + echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y yarn + WORKDIR /app/code ENV HACKMD_VERSION 1.1.1-ce RUN curl -L https://github.com/hackmdio/hackmd/archive/$HACKMD_VERSION.tar.gz | tar -xz --strip-components 1 -f - +# Install NPM dependencies and build project +RUN yarn install --pure-lockfile && \ + yarn install --production=false --pure-lockfile && \ + yarn global add webpack && \ + npm run build && \ + # npm, deps -RUN npm install +#RUN npm install # build front-end bundle -RUN npm run build +#RUN npm run build # remove dev dependencies RUN npm prune --production From 8ea138f512b7a7647300c40d40bab08c44b74433 Mon Sep 17 00:00:00 2001 From: Thierry Pasquier Date: Mon, 4 Jun 2018 22:31:13 +0200 Subject: [PATCH 4/6] added partial config file to set tmp directory and ldap username --- Dockerfile | 1 + config.json | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 config.json diff --git a/Dockerfile b/Dockerfile index 015255a..0d7f828 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,7 @@ RUN npm prune --production # add utils ADD start.sh ./ RUN chmod +x ./start.sh +ADD config.json ./ # use local storage RUN ln -sfn /app/data/build/constant.js ./public/build/constant.js && \ diff --git a/config.json b/config.json new file mode 100644 index 0000000..1922ab0 --- /dev/null +++ b/config.json @@ -0,0 +1,8 @@ +{ + "production": { + "tmpPath": "../../app/data/tmp", + "ldap": { + "usernameField": "username" + } + } +} From de461fc4c9cbdd7acdbb1e77a9d13ddf3091548f Mon Sep 17 00:00:00 2001 From: Thierry Pasquier Date: Tue, 5 Jun 2018 08:28:07 +0200 Subject: [PATCH 5/6] Revert "Merge remote-tracking branch 'upstream/upstream-docker'" This reverts commit 974e1cb69286e2545bce43e49f7189c859dc8640, reversing changes made to 8ea138f512b7a7647300c40d40bab08c44b74433. --- Dockerfile | 20 ++++---------------- TODO.md | 1 + 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index c8c1913..0d7f828 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,32 +1,20 @@ -FROM cloudron/base:0.11.0 +FROM cloudron/base:0.10.0 # setup nodejs version -ENV NODEJS_VERSION 8.10.3 -ENV NODE_ENV=production +ENV NODEJS_VERSION 6.9.5 RUN ln -s /usr/local/node-$NODEJS_VERSION/bin/node /usr/local/bin/node && \ ln -s /usr/local/node-$NODEJS_VERSION/bin/npm /usr/local/bin/npm -RUN curl -sS http://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \ - echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \ - apt-get update && \ - apt-get install -y yarn - WORKDIR /app/code ENV HACKMD_VERSION 1.1.1-ce RUN curl -L https://github.com/hackmdio/hackmd/archive/$HACKMD_VERSION.tar.gz | tar -xz --strip-components 1 -f - -# Install NPM dependencies and build project -RUN yarn install --pure-lockfile && \ - yarn install --production=false --pure-lockfile && \ - yarn global add webpack && \ - npm run build && \ - # npm, deps -#RUN npm install +RUN npm install # build front-end bundle -#RUN npm run build +RUN npm run build # remove dev dependencies RUN npm prune --production diff --git a/TODO.md b/TODO.md index a876eb0..db7e4fe 100644 --- a/TODO.md +++ b/TODO.md @@ -1,3 +1,4 @@ # TODO list - inside of the app the uid is shown instead of the username +- notes seem to get lost during update From 41fa120ed4bd3eaefba42cb888e3c438511ec402 Mon Sep 17 00:00:00 2001 From: Thierry Pasquier Date: Thu, 7 Jun 2018 13:23:26 +0200 Subject: [PATCH 6/6] access default permissions setting --- start.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/start.sh b/start.sh index ae8f1d8..4320814 100644 --- a/start.sh +++ b/start.sh @@ -14,7 +14,6 @@ fi sleep 3 export NODE_ENV='production' -export HMD_ALLOW_ANONYMOUS="false" export HMD_DB_URL="$POSTGRESQL_URL" export HMD_LDAP_URL="$LDAP_URL" export HMD_LDAP_BINDDN="$LDAP_BIND_DN" @@ -23,6 +22,11 @@ export HMD_LDAP_SEARCHBASE="$LDAP_USERS_BASE_DN" export HMD_LDAP_SEARCHFILTER="(username={{username}})" export HMD_LDAP_USERNAMEFIELD="username" export HMD_IMAGE_UPLOAD_TYPE=filesystem +# access default permissions setting +export HMD_ALLOW_ANONYMOUS=false +export HMD_ALLOW_ANONYMOUS_EDITS=true +export HMD_ALLOW_FREEURL=false +export HMD_DEFAULT_PERMISSION="limited" # the following two changes could be transferred to config.json to enable users to change this export HMD_EMAIL=false export HMD_ALLOW_EMAIL_REGISTER=false