From 0d460684138a1f06af03b5e9449fb8766da23dcf Mon Sep 17 00:00:00 2001 From: vincent Date: Wed, 25 Nov 2020 10:50:28 +0100 Subject: [PATCH] correct chisel role --- tasks/main.yml | 2 ++ templates/chisel-server.conf.j2 | 3 +-- templates/chisel-server.service.j2 | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 62da5f5..210dd2b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -29,6 +29,7 @@ template: src: chisel-server.conf.j2 dest: "{{ chisel_config_location }}/chisel-server.conf" + mode: 0740 notify: - restart daemon service when: chisel_server == true @@ -47,3 +48,4 @@ name: chisel-server # required. Name of the service. enabled: true # not required. Whether the service should start on boot. B(At least one of state and enabled are required.) state: started # not required. choices: reloaded;restarted;started;stopped. C(started)/C(stopped) are idempotent actions that will not run commands unless necessary. C(restarted) will always bounce the service. C(reloaded) will always reload. B(At least one of state and enabled are required.) Note that reloaded will start the service if it is not already started, even if your chosen init system wouldn't normally. + when: chisel_server == true \ No newline at end of file diff --git a/templates/chisel-server.conf.j2 b/templates/chisel-server.conf.j2 index a79203a..c646ccd 100644 --- a/templates/chisel-server.conf.j2 +++ b/templates/chisel-server.conf.j2 @@ -5,9 +5,8 @@ HOST={{chisel_server_host}} PORT={{chisel_server_port}} {% endif %} {% if chisel_server_auth %} -AUTH={{chisel_server_auth.user}}:{{chisel_server_auth.pass}} +#AUTH={{chisel_server_auth.user}}:{{chisel_server_auth.pass}} {% endif %} -chisel_server_key {% if chisel_server_key %} KEY={{chisel_server_key}} {% endif %} \ No newline at end of file diff --git a/templates/chisel-server.service.j2 b/templates/chisel-server.service.j2 index 8ac9d74..662cdcc 100644 --- a/templates/chisel-server.service.j2 +++ b/templates/chisel-server.service.j2 @@ -8,7 +8,7 @@ Type=simple User={{chisel_user}} Group={{chisel_group}} EnvironmentFile={{chisel_config_location}}/chisel-server.conf -ExecStart={{chisel_bin_location}}/chisel server {{ '--socks5' if chisel_server_socks5}} {{ '--reverse' if chisel_server_reverse}} {{ '--backend {}'.format(chisel_server_backend) if chisel_server_backend}} +ExecStart={{chisel_bin_location}}/chisel server {{ '--socks5' if chisel_server_socks5}} {{ '--reverse' if chisel_server_reverse}} {{ '--backend {}'.format(chisel_server_backend) if chisel_server_backend}} {{ '--auth {0}:{1}'.format(chisel_server_auth.user,chisel_server_auth.pass) if chisel_server_auth }} [Install] WantedBy=multi-user.target \ No newline at end of file