Comments (6)
Hey, I checked this, and it should be possible. You already found out that bash.exe -c "some command"
can run a command in the bash. All files should be accessible, however the path has to be converted:
A path like C:\Users\youruser\somefile.txt
would be /mnt/c/Users/youruser/somefile.txt
.
The drive letter has to be a small letter, the :
has to be removed, and the \
have to be replaced with /
- that's it.
from vscode-ansible-vault.
Since I don't have Windows computer, welcome for contributing if anyone wants to help :)
I could provide a setup session for this.
from vscode-ansible-vault.
I don't have any experience with typescript or vscode plugins, but I suspect it would have something to do with how the ansible-vault
process is launched.
Briefly looking at the code - I see there are no special options given to child_process.execSync
when an encrypt or decrypt is triggered. If I look at the child_process.execSync documentation, the only Windows specific option I see there is the windowsHide
option, which by default should show a window from a child process as far as I understand? I however never see a child window, and don't think that would be a desirable behavior anyway, setting this to true
wouldn't hurt right?
Another issue is that the command touch ${keypath} && echo "${pass}" > ${keypath}
is executed when the user is prompted for a password - which also fails on Windows. Opening the file and writing it yourself without spawning other processes would probably be the more portable/safer way.
from vscode-ansible-vault.
We are similar. I am also new to typescript and vscode thingy. This is just my "toy project" to avoid developer directly deal with terminal and remember ansible-vault command in my working space. Therefore you may feel the code is not really clean and organized... sorry 🙇
I have setup the dev env in Windows and it looks like cannot take the correct path in extension runtime.
I would try to define ansibleVault.useWSL
for running C:\Windows\System32\bash.exe -lc "..."
on every child_process
command. But just feeling skeptical if bash.exe
could access C:\Users\...
paths.
Back to your question,
[child_process.exeSync] setting
windowsHide
totrue
wouldn't hurt right?
It's fine for debug purpose, and actually I could get the command output in my development env. Once I could regenerate the error, I could check the message and fix it.
touch ${keypath} && echo "${pass}" > ${keypath}
This command also requires bash.exe
with WSL -- once we figure out the right way to make use of bash.exe
in WSL, the problem solved.
Thanks again your comments and please let me know if I understand wrongly.
from vscode-ansible-vault.
I'd be happy to set up a session with you @dhoeric if you wanted to get Windows support for this working. I may be able to take a look at the code but I'm not too familiar with Typescript
from vscode-ansible-vault.
Hey, I checked this, and it should be possible. You already found out that
bash.exe -c "some command"
can run a command in the bash. All files should be accessible, however the path has to be converted:
A path likeC:\Users\youruser\somefile.txt
would be/mnt/c/Users/youruser/somefile.txt
.
The drive letter has to be a small letter, the:
has to be removed, and the\
have to be replaced with/
- that's it.
It does not work as simple as you say, I have just tried.
from vscode-ansible-vault.
Related Issues (20)
- vault password file not found HOT 4
- Cannot find ansible.cfg when using multi-root workspaces HOT 6
- Error when decrypting file HOT 5
- Support pyenv installs of ansible-vault HOT 2
- Problems with some special chars in password
- Feature request - ansible-vault view/edit HOT 1
- Windows: decoding fail when entering password HOT 2
- Feature - Encrypt_String HOT 2
- how do identify encoding encryption types?
- No longer functioning HOT 2
- Encryption fails if ansible fault file is specified in ansible.cfg HOT 4
- Extension doesn't recognize !vault tags
- Plugin not respecting ANSIBLE_VAULT_PASSWORD_FILE env variable?
- Command failed: ansible-vault decrypt
- ModuleNotFoundError: No module named 'ansible'
- GetPassWarning: Can not control echo on the terminal. HOT 2
- Proposal: deprecating extension HOT 2
- Password stored as plaintext
- Can't pass the vault password
- Feature Request: Support vault_password_file via ansible.cfg HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-ansible-vault.