diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7df46bc..699ac59 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,6 +35,6 @@ jobs: username: ${{ secrets.OVPN_USERNAME }} password: ${{ secrets.OVPN_PASSWORD }} client_key: ${{ secrets.OVPN_CLIENT_KEY }} - tls_auth_key: ${{ secrets.OVPN_TLS_AUTH_KEY }} + tls_crypt_key: ${{ secrets.OVPN_TLS_AUTH_KEY }} - name: Check if connected run: curl -v http://172.20.4.173:8080 diff --git a/action.yml b/action.yml index 9ad840b..37dfe99 100644 --- a/action.yml +++ b/action.yml @@ -14,10 +14,13 @@ inputs: description: "Password" required: false tls_auth_key: - description: "Pre-shared secret for TLS-auth HMAC signature" + description: "Pre-shared group key for TLS Auth" + required: false + tls_crypt_key: + description: "Pre-shared group key for TLS Crypt" required: false tls_crypt_v2_key: - description: "Pre-shared secret for tls-crypt-v2" + description: "Per-client key for TLS Crypt V2" required: false client_key: description: "Local peer's private key" diff --git a/dist/index.js b/dist/index.js index 915cca2..203c244 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3176,6 +3176,7 @@ const run = (callback) => { const password = core.getInput("password"); const clientKey = core.getInput("client_key"); const tlsAuthKey = core.getInput("tls_auth_key"); + const tlsCryptKey = core.getInput("tls_crypt_key"); const tlsCryptV2Key = core.getInput("tls_crypt_v2_key"); if (!fs.existsSync(configFile)) { @@ -3202,6 +3203,12 @@ const run = (callback) => { fs.appendFileSync(configFile, "tls-auth ta.key 1\n"); fs.writeFileSync("ta.key", tlsAuthKey, { mode: 0o600 }); } + + if (tlsCryptKey) { + fs.appendFileSync(configFile, "tls-crypt tc.key 1\n"); + fs.writeFileSync("tc.key", tlsCryptKey, { mode: 0o600 }); + } + if (tlsCryptV2Key) { fs.appendFileSync(configFile, "tls-crypt-v2 tcv2.key 1\n"); fs.writeFileSync("tcv2.key", tlsCryptV2Key, { mode: 0o600 }); diff --git a/src/main.js b/src/main.js index 26f53e7..19a557e 100644 --- a/src/main.js +++ b/src/main.js @@ -9,6 +9,7 @@ const run = (callback) => { const password = core.getInput("password"); const clientKey = core.getInput("client_key"); const tlsAuthKey = core.getInput("tls_auth_key"); + const tlsCryptKey = core.getInput("tls_crypt_key"); const tlsCryptV2Key = core.getInput("tls_crypt_v2_key"); if (!fs.existsSync(configFile)) { @@ -35,6 +36,12 @@ const run = (callback) => { fs.appendFileSync(configFile, "tls-auth ta.key 1\n"); fs.writeFileSync("ta.key", tlsAuthKey, { mode: 0o600 }); } + + if (tlsCryptKey) { + fs.appendFileSync(configFile, "tls-crypt tc.key 1\n"); + fs.writeFileSync("tc.key", tlsCryptKey, { mode: 0o600 }); + } + if (tlsCryptV2Key) { fs.appendFileSync(configFile, "tls-crypt-v2 tcv2.key 1\n"); fs.writeFileSync("tcv2.key", tlsCryptV2Key, { mode: 0o600 });