diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..37285699 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +**/node_modules/ +node_modules +**/vue.config.js +vue.config.js +Dockerfile +.env.* +.env +README.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 0adcd875..4adc7dee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [5.0.8] - 2025-02-13 + +### Fixed + +- Regex in repo's +- Jwt token issuer added (use env variable ACCESS_TOKEN_ISSUER) - credits to le-martre for the fix +- maxBuffer causing abort by operator, adding PROCESS_MAX_BUFFER variable. + +### Changed + +- The admin user can now be removed, and will be recreated automatically if needed at first start. + use env variables ADMIN_USERNAME and ADMIN_PASSWORD. + +### Added + +- YTT extra environment variable (see help) +- Role options (showDesigner, showLogs, showSettings, ...) allowing for custom semi-admin or designer roles +- Added branch to repos + ## [5.0.7] - 2024-10-03 ### Added @@ -756,7 +775,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Allow change password for current local user - Start tracking versions -[Unreleased]: https://github.com/ansibleguy76/ansibleforms/compare/5.0.7...HEAD +[Unreleased]: https://github.com/ansibleguy76/ansibleforms/compare/5.0.8...HEAD + +[5.0.8]: https://github.com/ansibleguy76/ansibleforms/compare/5.0.7...5.0.8 [5.0.7]: https://github.com/ansibleguy76/ansibleforms/compare/5.0.6...5.0.7 diff --git a/server/Dockerfile b/Dockerfile similarity index 74% rename from server/Dockerfile rename to Dockerfile index 5b84eb73..717c4265 100644 --- a/server/Dockerfile +++ b/Dockerfile @@ -45,20 +45,41 @@ RUN npm install -g npm@9.8.1 FROM node AS tmp_builder -# Use /app -WORKDIR /app - -# Copy package.json and package-lock.json to /app -COPY package*.json ./ - # Update npm RUN npm install -g npm@9.8.1 +# Install vue cli service +RUN npm install -g @vue/cli-service + +# Use /app/client +WORKDIR /app/client + +# Copy client package.json and package-lock.json to /app/client +COPY ./client/package*.json ./ + +# install node modules for client +RUN npm install + +# Copy the rest of the code +COPY ./client . + +# build client +RUN npm run build + +# Use /app/server +WORKDIR /app/server + +# Copy package.json and package-lock.json to /app/server +COPY ./server/package*.json ./ + # install node modules RUN npm install # Copy the rest of the code -COPY . . +COPY ./server . + +# Copy the docs help file to /app/server +COPY ./docs/_data/help.yaml . # Invoke the build script to transpile code to js RUN npm run build @@ -66,6 +87,15 @@ RUN npm run build # Remove persistent subfolder RUN rm -rf ./dist/persistent +# Remove client subfolder +RUN rm -rf ./dist/views + +# Create the views folder +RUN mkdir -p ./dist/views + +# move client build to server +RUN mv /app/client/dist/* ./dist/views + ################################################## # final build # take base and install production app dependencies @@ -74,16 +104,16 @@ RUN rm -rf ./dist/persistent FROM nodebase as final # Copy package.json and package-lock.json -COPY package*.json ./ +COPY ./server/package*.json ./ # Install only production dependencies RUN npm i --only=production # Copy transpiled js from builder stage into the final image -COPY --from=tmp_builder /app/dist ./dist +COPY --from=tmp_builder /app/server/dist ./dist # Copy the ansible.cfg file to /etc/ansible/ directory -COPY ansible.cfg /etc/ansible/ansible.cfg +COPY ./server/ansible.cfg /etc/ansible/ansible.cfg # Use js files to run the application ENTRYPOINT ["node", "./dist/index.js"] diff --git a/server/Dockerfile-debian b/Dockerfile-debian similarity index 79% rename from server/Dockerfile-debian rename to Dockerfile-debian index dc85074b..343e81ad 100644 --- a/server/Dockerfile-debian +++ b/Dockerfile-debian @@ -66,19 +66,41 @@ RUN ansible-galaxy collection install community.mysql -p /usr/share/ansible/coll FROM node:16-alpine AS tmp_builder -# Use /app -WORKDIR /app +# Update npm +RUN npm install -g npm@9.8.1 + +# Install vue cli service +RUN npm install -g @vue/cli-service + +# Use /app/client +WORKDIR /app/client + +# Copy client package.json and package-lock.json to /app/client +COPY ./client/package*.json ./ + +# install node modules for client +RUN npm install + +# Copy the rest of the code +COPY ./client . + +# build client +RUN npm run build -# Copy package.json and package-lock.json to /app -COPY package*.json ./ +# Use /app/server +WORKDIR /app/server -# Install all dependencies -RUN npm install -g +# Copy package.json and package-lock.json to /app/server +COPY ./server/package*.json ./ +# install node modules RUN npm install # Copy the rest of the code -COPY . . +COPY ./server . + +# Copy the docs help file to /app/server +COPY ./docs/_data/help.yaml . # Invoke the build script to transpile code to js RUN npm run build @@ -86,6 +108,15 @@ RUN npm run build # Remove persistent subfolder RUN rm -rf ./dist/persistent +# Remove client subfolder +RUN rm -rf ./dist/views + +# Create the views folder +RUN mkdir -p ./dist/views + +# move client build to server +RUN mv /app/client/dist/* ./dist/views + ################################################## # final build # take base and install production app dependencies @@ -94,10 +125,10 @@ RUN rm -rf ./dist/persistent FROM debianbase as final # Copy package.json and package-lock.json -COPY package*.json ./ +COPY ./server/package*.json ./ # Copy transpiled js from builder stage into the final image -COPY --from=tmp_builder /app/dist ./dist +COPY --from=tmp_builder /app/server/dist ./dist # Install only production dependencies # the build was done in alpine, so we need to remove any previous node_modules @@ -105,7 +136,7 @@ RUN rm -rf ./dist/node_modules RUN npm install --only=production # Copy the ansible.cfg file to /etc/ansible/ directory -COPY ansible.cfg /etc/ansible/ansible.cfg +COPY ./server/ansible.cfg /etc/ansible/ansible.cfg # Use js files to run the application ENTRYPOINT ["node", "./dist/index.js"] diff --git a/app_versions.gradle b/app_versions.gradle index 9936260c..bf0d8377 100644 --- a/app_versions.gradle +++ b/app_versions.gradle @@ -1,2 +1,2 @@ -ext.version_code = 50007 -ext.version_name = "5.0.7" +ext.version_code = 50008 +ext.version_name = "5.0.8" diff --git a/client/package.json b/client/package.json index b85e4bd4..19294810 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "ansible_forms_vue", - "version": "5.0.7", + "version": "5.0.8", "private": true, "scripts": { "serve": "vue-cli-service serve", @@ -19,7 +19,7 @@ "@fortawesome/free-regular-svg-icons": "~6.5.2", "@fortawesome/free-solid-svg-icons": "~6.5.2", "@fortawesome/vue-fontawesome": "2.0.10", - "axios": "~1.7.7", + "axios": "~1.7.9", "brace": "~0.11.1", "bulma": "0.9.4", "bulma-calendar": "6.1.19", @@ -28,7 +28,7 @@ "bulma-quickview": "*", "bulmaswatch": "0.8.1", "copy-to-clipboard": "~3.3.3", - "core-js": "~3.38.1", + "core-js": "~3.40.0", "es6-promise": "~4.2.8", "highlight.js": "^10.7.2", "jsonwebtoken": "^9.0.2", @@ -55,7 +55,7 @@ "babel-eslint": "~10.1.0", "eslint": "~6.8.0", "eslint-plugin-vue": "~6.2.2", - "nodemon": "~3.1.5", + "nodemon": "~3.1.9", "sass": "~1.49.11", "sass-loader": "10.1.1", "vue-template-compiler": "~2.6.11" diff --git a/client/src/App.vue b/client/src/App.vue index d830cc03..902f6fd8 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -56,6 +56,10 @@