Skip to content

Commit

Permalink
Merge pull request #9 from r-dvl/feature/user-pass-env
Browse files Browse the repository at this point in the history
Release 0.1.20
  • Loading branch information
r-dvl authored May 17, 2024
2 parents f30060c + 5639462 commit 414ca94
Show file tree
Hide file tree
Showing 112 changed files with 59 additions and 4,910 deletions.
8 changes: 2 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@ services:
volumes:
- /home/ansible/logs:/logs
- /var/spool/cron/crontabs:/crontabs
- /home/ansible/ansible-playbooks:/ansible-playbooks

ui:
container_name: ansible-manager-ui
restart: unless-stopped
build:
context: ./ui
args:
- API_URL=http://localhost:8080
ports:
- '3000:3000'
environment:
- USERNAME=admin
- PASSWORD=admin
- '3000:3000'
3 changes: 3 additions & 0 deletions ui/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VITE_API_URL=https://your.api.url
VITE_USERNAME=admin
VITE_PASSWORD=admin
20 changes: 18 additions & 2 deletions ui/config/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
const apiUrl = 'https://ansible-manager-api.rdvl-server.site';
var apiUrl;
var username;
var password;

export default apiUrl;
if (import.meta.env.MODE === "development") {
apiUrl = 'http://localhost:8080';
username = 'dev';
password = 'dev';
} else if (import.meta.env.MODE === "demo") {
apiUrl = 'https://ansible-manager-api.rdvl-server.site';
username = 'demo';
password = 'demo';
} else {
apiUrl = import.meta.env.VITE_API_URL;
username = import.meta.env.VITE_USERNAME;
password = import.meta.env.VITE_PASSWORD;
}

export { apiUrl, username, password };
2 changes: 1 addition & 1 deletion ui/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN npm install

COPY . .

RUN npm run build
RUN npm run build:demo

EXPOSE 3000

Expand Down
Loading

0 comments on commit 414ca94

Please sign in to comment.