Github SECRETs as base64 to FILE in JAVA SPRING project with railway ?
Hi i have simple webapp in java spring, running on tomcat server on railway.app hosting.
I need insert SLL primary key and certificate files via github secrets and actions.
the files will be encoded by Base64 to github secrets. Than i need by GitHub actions convert this secrets to files and put them to folder in project.
The deploying off app is now automated, it deploys every time when i push to master branch.
How can i do it ?
Can you help me? I cannot find some deep tutorial with examples. All documentation which I found is hard to understand.
srvice ID: 8a5bdf0b-f4eb-4868-a0b0-e39a55f7aa88
Solution:Jump to solution
Again, why are you using custom SSL certificates? Railway handles HTTPS for you.
9 Replies
Project ID:
8a5bdf0b-f4eb-4868-a0b0-e39a55f7aa88
@interstellartaco any ideas? π
What are you using your own SSL certificate for?
ok i find another solution, where i dont need files, only env variables.
it is possible to use env variables, if you have key/certificate in form of PEM style text. you need use soring sll bundle pem
spring.ssl.bundle.pem.mybundle.keystore.certificate=${PRIVATE_KEY}
spring.ssl.bundle.pem.mybundle.keystore.private-key=${CERTIFICATE_CRT}
spring.ssl.bundle.pem.mybundle.truststore.certificate=${CA_BUNDLE}
server.port=8443
server.ssl.bundle=mybundle
spring dont have this clearly writen in theri documentation
Solution
Again, why are you using custom SSL certificates? Railway handles HTTPS for you.
Also, you should probably set
server.port=${PORT}
instead of hardcoding it.so you want to say that the everything what i need to do in spring app to enable HTTPS is what? only set server.port=${PORT} ?
Correct.
didnt know it. i was wondering, why my page have SLL certificate before i did set the variables ..... i know the answer now, π