Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic port being added to the host from .env file #213

Closed
Ryuk-hash opened this issue Jan 10, 2023 · 2 comments · Fixed by #240
Closed

Automatic port being added to the host from .env file #213

Ryuk-hash opened this issue Jan 10, 2023 · 2 comments · Fixed by #240
Labels
bug Something isn't working

Comments

@Ryuk-hash
Copy link

Ryuk-hash commented Jan 10, 2023

Using: ssh-action@master
In-app port: 3000 inside the .env file with the name "PORT"
Problem: connection timeout error; action's using .env defined application port instead.
Fix: Renamed "PORT" in your app to "APP_PORT" and it worked.

Please look at why it's using the variables from inside the .env file and not its default provided ones.

Script:

- name: restart
        uses: appleboy/ssh-action@master
        with:
          key: ***
          host: ***
          username: 'ubuntu'
          script: |
            nvm use 14.18.3
            cd ...
            sudo npm i
            pm2 restart ...

After execution: (restart script fails)

======CMD======

nvm use 14.18.3
cd ...
sudo npm i
pm2 restart ...

======END======
2023/01/10 08:39:13 dial tcp {HOST}:3000: i/o timeout
@tklivan
Copy link

tklivan commented Jan 10, 2023

same issue. since 0.1.7 its reading from my .env file the variable PORT

@appleboy
Copy link
Owner

I will remove the unused global variable like PORT conflicts with the custom variable from .env file.

@appleboy appleboy added the bug Something isn't working label Apr 13, 2023
appleboy added a commit to appleboy/drone-ssh that referenced this issue Apr 13, 2023
- Modify the `EnvVars` slice to include `INPUT_` prefix when needed
- Remove unused environment variables from the `EnvVars` slice
- Update the `EnvVars` slice to include `PROXY_` prefix when needed
- Modify the `EnvVars` slice to include `PLUGIN_SSH_CIPHERS` as `PROXY_SSH_CIPHERS`
- Modify the `EnvVars` slice to include `PLUGIN_PROXY_USE_INSECURE_CIPHER` as `PROXY_SSH_USE_INSECURE_CIPHER`
- Modify the `EnvVars` slice to include `PLUGIN_PROXY_FINGERPRINT` as `PROXY_SSH_FINGERPRINT`
- Remove the environment variable `PROXY_HOST`
- Modify the `EnvVars` slice to include `PLUGIN_DEBUG` as `INPUT_DEBUG`

* appleboy/ssh-action#53 (comment)
* appleboy/ssh-action#32 (comment)
* appleboy/ssh-action#213
appleboy added a commit that referenced this issue Apr 13, 2023
- Update base image version from `1.6.12` to `1.6.13` in Dockerfile
- Add `envs_format` input with flexible configuration in action.yml
- Add a line to README.md pointing to action.yml for more information

fix #213
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants