Skip to content

Commit

Permalink
Merge pull request #259 from ansibleguy76/release/v5.0.8
Browse files Browse the repository at this point in the history
v5.0.8 into main
  • Loading branch information
ansibleguy76 authored Feb 13, 2025
2 parents 0246c43 + 0d718fb commit b0e923a
Show file tree
Hide file tree
Showing 62 changed files with 959 additions and 427 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**/node_modules/
node_modules
**/vue.config.js
vue.config.js
Dockerfile
.env.*
.env
README.md
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
50 changes: 40 additions & 10 deletions server/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,57 @@ 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

# 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
Expand All @@ -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"]
51 changes: 41 additions & 10 deletions server/Dockerfile-debian → Dockerfile-debian
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,57 @@ 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

# 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
Expand All @@ -94,18 +125,18 @@ 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
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"]
4 changes: 2 additions & 2 deletions app_versions.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ext.version_code = 50007
ext.version_name = "5.0.7"
ext.version_code = 50008
ext.version_name = "5.0.8"
8 changes: 4 additions & 4 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ansible_forms_vue",
"version": "5.0.7",
"version": "5.0.8",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
<ul>
<li v-for="r in profile.roles" :key="r"><font-awesome-icon icon="check" /> {{ r }}</li>
</ul>
<strong class="mt-2">Options : </strong>
<ul>
<li v-for="o in Object.keys(profile.options)" :key="o"><font-awesome-icon icon="check" /> {{ o }} : {{ profile.options[o] }}</li>
</ul>
</div>
</div>
</BulmaModal>
Expand Down Expand Up @@ -107,6 +111,7 @@
// console.log("checking if is admin")
var payload = TokenStorage.getPayload()
if(payload.user && payload.user.roles){
this.profile = payload.user
this.isAdmin=payload.user.roles.includes("admin")
}
},
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/BulmaNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
<router-link class="navbar-item" to="/jobs" v-if="authenticated">
<span class="icon"><font-awesome-icon icon="history" /></span><span>Job log </span><span v-if="approvals" class="ml-1 is-warning tag">{{approvals}} {{(approvals==1)?"approval":"approvals"}} waiting</span>
</router-link>
<router-link class="navbar-item" :to="'/designer?form='+($route.query.form||'')" v-if="isAdmin && authenticated">
<router-link class="navbar-item" :to="'/designer?form='+($route.query.form||'')" v-if="(profile?.options?.showDesigner ?? isAdmin) && authenticated">
<span class="icon"><font-awesome-icon icon="edit" /></span><span>Designer</span>
</router-link>
<router-link class="navbar-item" to="/settings" v-if="isAdmin && authenticated">
<router-link class="navbar-item" to="/settings" v-if="(profile?.options?.showSettings ?? isAdmin) && authenticated">
<span class="icon"><font-awesome-icon icon="cog" /></span><span>Settings</span>
</router-link>
<div class="navbar-item has-dropdown is-hoverable" v-if="authenticated" >
<a class="navbar-link"><span class="icon"><font-awesome-icon icon="question-circle" /></span></a>
<div class="navbar-dropdown">
<router-link class="navbar-item" v-if="isAdmin && authenticated" to="/logs">
<router-link class="navbar-item" v-if="(profile?.options?.showLogs ?? isAdmin) && authenticated" to="/logs">
<span class="icon"><font-awesome-icon icon="file-lines" /></span><span>Logs</span>
</router-link>
<a class="navbar-item" href="https://ansibleforms.com/" target="_blank">
Expand Down
Loading

0 comments on commit b0e923a

Please sign in to comment.