Skip to content

Commit

Permalink
substitue rathole token from secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
LegitCamper committed Sep 11, 2024
1 parent 77fe751 commit aa16dd1
Show file tree
Hide file tree
Showing 5 changed files with 196 additions and 169 deletions.
133 changes: 63 additions & 70 deletions docker/rathole/rathole.toml
Original file line number Diff line number Diff line change
@@ -1,70 +1,63 @@
$ANSIBLE_VAULT;1.1;AES256
30653135396635303865616562393832376237376138353561356461323362396436346665363761
3232313737373230626537626537383463623538383035390a353038353232646465393166386432
64613635306235653636633463383038666366303333663237643962626339386536323665616433
6363373063653166310a663336333831663161333665373331646664646339383135663231396464
63636130633536343830646533396463353966323863356337653433366166316264643733306631
62613738663861653034623361623461376430313730383163366166653633333736626266646163
36303062363337663730643965386639376633316364666637323232643636383636336532393132
31313032316233663832393938346163316363376164393561393035623739316630363034316135
62633862343233383135356233356436336639626339653233346664303637313137303230333339
32323963663961316133363830383564643832613163343632343039306366353465386337623633
35653134636161346634356463363532363130333138303861396562656638633463363430333039
36633161636163323236633736626630643836383237643738386665343738353265653961343035
64643261353965343836656334396136396238353836313864373734663065613366326666663838
38313766393561653532353130653031313061376230643830326262626666306330376432343535
32313765373238303264303739383132643530336265613737656334343232653435633362646337
66633264623238383236653061653064626638333338613333393930653936343662656162616361
64663533383738636436353963383263623830393236343963363737346338376338373034633431
30343761303738656130623962386164333465363034353061306236393434343566653230343231
39323763623839393938386236386262633361383639393961623836366439306538623934383963
39616163373663663466323166626131316164623566643132346665343936623438353538633763
66373034646231363233326265643463343866656132303864393833366634663837303030653233
32653533653038326366326164373639346366666131643763303733633939313337663338313761
62336663303662653731663465616139316231653661353538333466393033376666393065313936
33663434323638353133376637336561623535363636373635663036623239353837353663313638
66636162323938383331626565613766633364313530376430366164383237396532393636306131
64343034343332366461316136663764353130326435313234323562346532393035633538643833
30393437613430366130663364633235626565333966343134643335383566623831613963616364
37643564363239396331393564353635363361323138306563366532393062613239373234343661
37623066386233616262613834313235633661393063646565326461306337396437326366643632
61623135316265383630396438643137306538353164386461353866663964383631306362383131
62363031646364303834656239633766353461333965356239633663363966613062393563303362
66663539383261613532343233666166633438303039323666376134353236313430333062643565
33353236666263373537346365316538393832623065633930396131353062326633386463306137
38313964373436346434393736616461646134626163613063336136616334376531353730303539
61386361356133663065343665626164353039663433343934663965623334613066626264333239
33343130353963313230646631386632363666616633613466613237336539376339333039396633
62643430363766616238366139633163383234376638663163653263313239636663313763623830
62323532323830616537633663613236353966366639616663613636373465623262633338353939
30613635393033366561666564666234663932633438336466666536656162663864376662353132
63666332313466663137353438313935336466383866613562396334376233323064396135383835
66656635636164303935313366626530323837303238333263646334386536613435623031393330
30666539316633356232376235303535653465326165666531373166373366376265373237333435
34383436386637636337663138636235363930663236613164373762356634393638366435363166
64386435353132383061343065626262333130353166313464396338323838623638383964303264
63386362313761393066343766336233653666643531623335303339363235336537303533616537
32323630363233343364393732643161383265336336396439363132336133656333376562646635
38643439383536623864376434633433336337343065616166636536386431393536333239626462
34656466383539393462313465373461353033363438366133323563653464376531653365336635
39636136393231306437316539373861616639376436646137393731653635386166316662363933
63333636383062363135306661653966316330303231313833366232386539643331386563616566
31326361623461356161343935366439653162393938353933323930626161613230653962656231
36623331323530303537633461333332376536656639623736616635343034376231666665646665
36363938373738396134666664333637373832323733383533656664353563313535633838356632
30616662396662636662623636306562303330643861343231656365303361653966323934636436
33313034356332633363656638363463316638653831323638363236303236323261643731316433
36363839356235653632363466346335356132636233656165306331333063363432306665366631
62613662316332383937643930346637396139353964663231363764636665376266333930313362
62356431626635326362653966373632313762316234353837326535386130363435373130326566
35303062363338666161313136353765343233336261373134613835386663306665303339386233
34613430623339396466633638313736303366653233613930613233643133646463323363316362
30383065303731376636323561653537663533383339653339343566343763626231303763363736
64666638316665396630306230353832346639363263663966616464386531653534353862623164
66373737376236393862646465626635376462393833316164653339333061343235626232343833
37663063356536373435633432333233303836656234333866396463313735356630663765616239
63623133393634633765306636303932663231663135643132363563363534313635646638376137
32663561393338363030353034303637343264323439343335643033396137323335363932393338
64363466386165633630623666636264376137643639376139363664306334663164326535626462
33393161646566386535616439616265303230343761633863346634303363356239313434663565
3965
[server]
bind_addr = "0.0.0.0:2333"
[client]
remote_addr = "rathole.sawyer.services:2333"

[server.services.dns]
token = "token"
bind_addr = "0.0.0.0:80"
[server.services.dns-udp]
type = "udp"
token = "token"
bind_addr = "0.0.0.0:80"
[client.services.dns]
token = "token"
local_addr = "127.0.0.1:80"
[client.services.dns-udp]
type = "udp"
token = "token"
local_addr = "0.0.0.0:80"

[server.services.dns-quic]
token = "token"
bind_addr = "0.0.0.0:853"
[client.services.dns-quic]
token = "token"
local_addr = "127.0.0.1:853"
[server.services.dns-quic-udp]
type = "udp"
token = "token"
bind_addr = "0.0.0.0:853"
[client.services.dns-quic-udp]
type = "udp"
token = "token"
local_addr = "127.0.0.1:853"

[server.services.http]
token = "token"
bind_addr = "0.0.0.0:80"
[client.services.http]
token = "token"
local_addr = "127.0.0.1:80"

[server.services.https]
token = "token"
bind_addr = "0.0.0.0:443"
[client.services.https]
token = "token"
local_addr = "127.0.0.1:443"

[server.services.minecraft]
token = "token"
bind_addr = "0.0.0.0:25565"
[client.services.minecraft]
token = "token"
local_addr = "127.0.0.1:25565"
[server.services.minecraft-udp]
type = "udp"
token = "token"
bind_addr = "0.0.0.0:25565"
[client.services.minecraft-udp]
type = "udp"
token = "token"
local_addr = "127.0.0.1:25565"
1 change: 1 addition & 0 deletions files/rathole.toml
13 changes: 13 additions & 0 deletions gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@
src: docker/rathole/rathole.toml
dest: ~/

- name: Get rathole token
ansible.builtin.shell:
cat ~/compose-files/secrets.env | grep RATHOLE_TOKEN | sed 's/^.*RATHOLE_TOKEN=//'
register: rathole_token
ignore_errors: true
changed_when: false

- name: Replace rathole tokens with secret
ansible.builtin.replace:
path: ~/rathole.toml
regexp: '/"token"/'
replace: '"{{ rathole_token }}"'

- name: Start Rathole container
docker_container:
name: "rathole"
Expand Down
13 changes: 13 additions & 0 deletions homeserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@
src: docker
dest: ~/compose-files

- name: Get rathole token
ansible.builtin.shell:
cat ~/compose-files/secrets.env | grep RATHOLE_TOKEN | sed 's/^.*RATHOLE_TOKEN=//'
register: rathole_token
ignore_errors: true
changed_when: false

- name: Replace rathole tokens with secret
ansible.builtin.replace:
path: ~/compose-files/rathole/rathole.toml
regexp: '/"token"/'
replace: '"{{ rathole_token }}"'

- name: Create 'web' network
community.docker.docker_network:
name: web
Expand Down
Loading

0 comments on commit aa16dd1

Please sign in to comment.