Problems with installing

root@StilauVPS:/etc/coder.d# /usr/bin/coder server
Coder v0.8.10+01a06e1 - Remote development on your infrastucture
Using built-in PostgreSQL (/root/.config/coderv2/postgres)
The built-in PostgreSQL cannot run as the root user. Create a non-root user and run again!
Run 'coder server --help' for usage.
root@StilauVPS:/etc/coder.d# /usr/bin/coder server
Coder v0.8.10+01a06e1 - Remote development on your infrastucture
Using built-in PostgreSQL (/root/.config/coderv2/postgres)
The built-in PostgreSQL cannot run as the root user. Create a non-root user and run again!
Run 'coder server --help' for usage.
65 Replies
Phorcys
Phorcysā€¢3y ago
(context)
root@StilauVPS:/etc/coder.d# systemctl status coder
ā— coder.service - "Coder - Self-hosted developer workspaces on your infra"
Loaded: loaded (/lib/systemd/system/coder.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2022-08-31 20:14:23 CEST; 1min 53s ago
Docs: https://coder.com/docs/coder-oss
Process: 622903 ExecStart=/usr/bin/coder server (code=exited, status=1/FAILURE)
Main PID: 622903 (code=exited, status=1/FAILURE)

Aug 31 20:14:23 StilauVPS systemd[1]: coder.service: Scheduled restart job, restart counter is at 3.
Aug 31 20:14:23 StilauVPS systemd[1]: Stopped "Coder - Self-hosted developer workspaces on your infra".
Aug 31 20:14:23 StilauVPS systemd[1]: coder.service: Start request repeated too quickly.
Aug 31 20:14:23 StilauVPS systemd[1]: coder.service: Failed with result 'exit-code'.
Aug 31 20:14:23 StilauVPS systemd[1]: Failed to start "Coder - Self-hosted developer workspaces on your infra".
Aug 31 20:15:01 StilauVPS systemd[1]: coder.service: Start request repeated too quickly.
Aug 31 20:15:01 StilauVPS systemd[1]: coder.service: Failed with result 'exit-code'.
Aug 31 20:15:01 StilauVPS systemd[1]: Failed to start "Coder - Self-hosted developer workspaces on your infra".
root@StilauVPS:/etc/coder.d# systemctl status coder
ā— coder.service - "Coder - Self-hosted developer workspaces on your infra"
Loaded: loaded (/lib/systemd/system/coder.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2022-08-31 20:14:23 CEST; 1min 53s ago
Docs: https://coder.com/docs/coder-oss
Process: 622903 ExecStart=/usr/bin/coder server (code=exited, status=1/FAILURE)
Main PID: 622903 (code=exited, status=1/FAILURE)

Aug 31 20:14:23 StilauVPS systemd[1]: coder.service: Scheduled restart job, restart counter is at 3.
Aug 31 20:14:23 StilauVPS systemd[1]: Stopped "Coder - Self-hosted developer workspaces on your infra".
Aug 31 20:14:23 StilauVPS systemd[1]: coder.service: Start request repeated too quickly.
Aug 31 20:14:23 StilauVPS systemd[1]: coder.service: Failed with result 'exit-code'.
Aug 31 20:14:23 StilauVPS systemd[1]: Failed to start "Coder - Self-hosted developer workspaces on your infra".
Aug 31 20:15:01 StilauVPS systemd[1]: coder.service: Start request repeated too quickly.
Aug 31 20:15:01 StilauVPS systemd[1]: coder.service: Failed with result 'exit-code'.
Aug 31 20:15:01 StilauVPS systemd[1]: Failed to start "Coder - Self-hosted developer workspaces on your infra".
I asked the user to try running it manually to see what's going on ---------- can you give me the contents of /lib/systemd/system/coder.service ? I wanna be sure of something
StilauGamer
StilauGamerOPā€¢3y ago
What information would you like?
Phorcys
Phorcysā€¢3y ago
wrong file I want to know if coder runs a separate user which it clearly does just to be sure
StilauGamer
StilauGamerOPā€¢3y ago
No description
Phorcys
Phorcysā€¢3y ago
alright sudo -u coder /usr/bin/coder server btw, any more logs using journalctl -xe coder ?
StilauGamer
StilauGamerOPā€¢3y ago
ok tons of errors when I tried going on tyhe domain šŸ¤”
Warning: The access URL http://127.0.0.1:3000 isn't externally reachable, this may cause unexpected problems when creating workspaces. Generate a unique *.try.coder.app URL with:
Warning: The access URL http://127.0.0.1:3000 isn't externally reachable, this may cause unexpected problems when creating workspaces. Generate a unique *.try.coder.app URL with:
any clue, @Phorcys?
Phorcys
Phorcysā€¢3y ago
sorry I am kinda busy I answer when I can so you should change your access URL but there's no reason for it to crash send me the full log please
StilauGamer
StilauGamerOPā€¢3y ago
root@StilauVPS:/usr/bin# sudo -u coder /usr/bin/coder server
Coder v0.8.10+01a06e1 - Remote development on your infrastucture
Using built-in PostgreSQL (/home/coder/.config/coderv2/postgres)
Warning: The access URL http://127.0.0.1:3000 isn't externally reachable, this may cause unexpected problems when creating workspaces. Generate a unique *.try.coder.app URL with:
/usr/bin/coder server --tunnel
View the Web UI: http://127.0.0.1:3000
2022-08-31 18:49:03.283 [INFO] (coderd) <./enterprise/coderd/features.go:230> (*featuresService).syncEntitlements syncing licensed entitlements
2022-08-31 18:49:03.644 [WARN] (coderd) <./coderd/httpmw/logger.go:55> Logger.func1.1 GET {"host": "127.0.0.1:3000", "path": "/api/v2/users/first", "proto": "HTTP/1.1", "remote_addr": "127.0.0.1:39786", "took": "2.036582ms", "status_code": 404, "latency_ms": 2, "response_body": "{\"message\":\"The initial user has not been created!\"}\n"}
root@StilauVPS:/usr/bin# sudo -u coder /usr/bin/coder server
Coder v0.8.10+01a06e1 - Remote development on your infrastucture
Using built-in PostgreSQL (/home/coder/.config/coderv2/postgres)
Warning: The access URL http://127.0.0.1:3000 isn't externally reachable, this may cause unexpected problems when creating workspaces. Generate a unique *.try.coder.app URL with:
/usr/bin/coder server --tunnel
View the Web UI: http://127.0.0.1:3000
2022-08-31 18:49:03.283 [INFO] (coderd) <./enterprise/coderd/features.go:230> (*featuresService).syncEntitlements syncing licensed entitlements
2022-08-31 18:49:03.644 [WARN] (coderd) <./coderd/httpmw/logger.go:55> Logger.func1.1 GET {"host": "127.0.0.1:3000", "path": "/api/v2/users/first", "proto": "HTTP/1.1", "remote_addr": "127.0.0.1:39786", "took": "2.036582ms", "status_code": 404, "latency_ms": 2, "response_body": "{\"message\":\"The initial user has not been created!\"}\n"}
Phorcys
Phorcysā€¢3y ago
yeah sorry I didn't have the time, I'll take a look later which ones btw try this too
StilauGamer
StilauGamerOPā€¢3y ago
Okayokayokay, so I got it up and working with the --tunnel, but without it doesn't work šŸ¤” Then I get this:
Warning: The access URL http://127.0.0.1:3000 isn't externally reachable, this may cause unexpected problems when creating workspaces. Generate a unique *.try.coder.app URL with:
Warning: The access URL http://127.0.0.1:3000 isn't externally reachable, this may cause unexpected problems when creating workspaces. Generate a unique *.try.coder.app URL with:
I changed the access url to: http://myip:3000 btw ^^ I discovered my issue I am pretty sure.
Aug 31 22:33:37 StilauVPS coder[657886]: configure tls: read file "/etc/letsencrypt/live/coder.stilaugamer.com/fullchain.pem": open /etc/letsencrypt/live/coder.stilaugamer.com/fullchain.pem: permission denied
Aug 31 22:33:37 StilauVPS coder[657886]: configure tls: read file "/etc/letsencrypt/live/coder.stilaugamer.com/fullchain.pem": open /etc/letsencrypt/live/coder.stilaugamer.com/fullchain.pem: permission denied
PS: It wasnt the issue lol
Phorcys
Phorcysā€¢3y ago
it clearly is also please post the entire log when asked to I can't troubleshoot anything if you just send portions of the log
StilauGamer
StilauGamerOPā€¢3y ago
I fixed the permission denied, but it looks like there is an issue with postgres:
Sep 01 12:04:11 StilauVPS systemd[1]: Starting "Coder - Self-hosted developer workspaces on your infra"...
Sep 01 12:04:11 StilauVPS coder[859540]: Coder v0.8.10+01a06e1 - Remote development on your infrastucture
Sep 01 12:04:11 StilauVPS coder[859540]: View the Web UI: https://coder.stilaugamer.com:3000
Sep 01 12:04:11 StilauVPS coder[859540]: ping postgres: dial tcp 127.0.0.1:35635: connect: connection refused
Sep 01 12:04:11 StilauVPS coder[859540]: Run 'coder server --help' for usage.
Sep 01 12:04:11 StilauVPS systemd[1]: coder.service: Main process exited, code=exited, status=1/FAILURE
Sep 01 12:04:11 StilauVPS systemd[1]: coder.service: Failed with result 'exit-code'.
Sep 01 12:04:11 StilauVPS systemd[1]: Failed to start "Coder - Self-hosted developer workspaces on your infra".
Sep 01 12:04:11 StilauVPS systemd[1]: Starting "Coder - Self-hosted developer workspaces on your infra"...
Sep 01 12:04:11 StilauVPS coder[859540]: Coder v0.8.10+01a06e1 - Remote development on your infrastucture
Sep 01 12:04:11 StilauVPS coder[859540]: View the Web UI: https://coder.stilaugamer.com:3000
Sep 01 12:04:11 StilauVPS coder[859540]: ping postgres: dial tcp 127.0.0.1:35635: connect: connection refused
Sep 01 12:04:11 StilauVPS coder[859540]: Run 'coder server --help' for usage.
Sep 01 12:04:11 StilauVPS systemd[1]: coder.service: Main process exited, code=exited, status=1/FAILURE
Sep 01 12:04:11 StilauVPS systemd[1]: coder.service: Failed with result 'exit-code'.
Sep 01 12:04:11 StilauVPS systemd[1]: Failed to start "Coder - Self-hosted developer workspaces on your infra".
Phorcys
Phorcysā€¢3y ago
lsof -i :35635
StilauGamer
StilauGamerOPā€¢3y ago
No description
StilauGamer
StilauGamerOPā€¢3y ago
So after a lot of digging. These are my errors:
root@StilauVPS:/# journalctl -u coder.service -b
-- Logs begin at Sun 2022-06-19 19:27:47 CEST, end at Thu 2022-09-01 21:48:40 CEST. --
Sep 01 21:46:08 StilauVPS systemd[1]: Starting "Coder - Self-hosted developer workspaces on your infra"...
Sep 01 21:46:08 StilauVPS coder[932]: Coder v0.8.10+01a06e1 - Remote development on your infrastucture
Sep 01 21:46:08 StilauVPS coder[932]: View the Web UI: https://coder.stilaugamer.com
Sep 01 21:48:19 StilauVPS coder[932]: ping postgres: dial tcp 172.0.0.1:35635: connect: connection timed out
Sep 01 21:48:19 StilauVPS coder[932]: Run 'coder server --help' for usage.
Sep 01 21:48:19 StilauVPS systemd[1]: coder.service: Main process exited, code=exited, status=1/FAILURE
Sep 01 21:48:19 StilauVPS systemd[1]: coder.service: Failed with result 'exit-code'.
Sep 01 21:48:19 StilauVPS systemd[1]: Failed to start "Coder - Self-hosted developer workspaces on your infra".
Sep 01 21:48:24 StilauVPS systemd[1]: coder.service: Scheduled restart job, restart counter is at 1.
Sep 01 21:48:24 StilauVPS systemd[1]: Stopped "Coder - Self-hosted developer workspaces on your infra".
Sep 01 21:48:24 StilauVPS systemd[1]: Starting "Coder - Self-hosted developer workspaces on your infra"...
Sep 01 21:48:24 StilauVPS coder[3275]: Coder v0.8.10+01a06e1 - Remote development on your infrastucture
Sep 01 21:48:24 StilauVPS coder[3275]: View the Web UI: https://coder.stilaugamer.com
root@StilauVPS:/# journalctl -u coder.service -b
-- Logs begin at Sun 2022-06-19 19:27:47 CEST, end at Thu 2022-09-01 21:48:40 CEST. --
Sep 01 21:46:08 StilauVPS systemd[1]: Starting "Coder - Self-hosted developer workspaces on your infra"...
Sep 01 21:46:08 StilauVPS coder[932]: Coder v0.8.10+01a06e1 - Remote development on your infrastucture
Sep 01 21:46:08 StilauVPS coder[932]: View the Web UI: https://coder.stilaugamer.com
Sep 01 21:48:19 StilauVPS coder[932]: ping postgres: dial tcp 172.0.0.1:35635: connect: connection timed out
Sep 01 21:48:19 StilauVPS coder[932]: Run 'coder server --help' for usage.
Sep 01 21:48:19 StilauVPS systemd[1]: coder.service: Main process exited, code=exited, status=1/FAILURE
Sep 01 21:48:19 StilauVPS systemd[1]: coder.service: Failed with result 'exit-code'.
Sep 01 21:48:19 StilauVPS systemd[1]: Failed to start "Coder - Self-hosted developer workspaces on your infra".
Sep 01 21:48:24 StilauVPS systemd[1]: coder.service: Scheduled restart job, restart counter is at 1.
Sep 01 21:48:24 StilauVPS systemd[1]: Stopped "Coder - Self-hosted developer workspaces on your infra".
Sep 01 21:48:24 StilauVPS systemd[1]: Starting "Coder - Self-hosted developer workspaces on your infra"...
Sep 01 21:48:24 StilauVPS coder[3275]: Coder v0.8.10+01a06e1 - Remote development on your infrastucture
Sep 01 21:48:24 StilauVPS coder[3275]: View the Web UI: https://coder.stilaugamer.com
It looks like its something with postgresql not connecting properly and the ports are open + not used šŸ¤” I use the built-in postgresql db with the url given by:
coder server postgres-builtin-url
coder server postgres-builtin-url
Any clue on what that can be causing this issue? The website works fine when tunneling, but when using:
/usr/bin/coder server
/usr/bin/coder server
I get this error:
root@StilauVPS:/# sudo -u coder /usr/bin/coder server
Coder v0.8.10+01a06e1 - Remote development on your infrastucture
Using built-in PostgreSQL (/home/coder/.config/coderv2/postgres)
Warning: The access URL http://127.0.0.1:3000 isn't externally reachable, this may cause unexpected problems when creating workspaces. Generate a unique *.try.coder.app URL with:
/usr/bin/coder server --tunnel
View the Web UI: http://127.0.0.1:3000
2022-09-01 19:51:33.255 [INFO] (coderd) <./enterprise/coderd/features.go:230> (*featuresService).syncEntitlements syncing licensed entitlements

==> Logs will stream in below (press ctrl+c to gracefully exit):
root@StilauVPS:/# sudo -u coder /usr/bin/coder server
Coder v0.8.10+01a06e1 - Remote development on your infrastucture
Using built-in PostgreSQL (/home/coder/.config/coderv2/postgres)
Warning: The access URL http://127.0.0.1:3000 isn't externally reachable, this may cause unexpected problems when creating workspaces. Generate a unique *.try.coder.app URL with:
/usr/bin/coder server --tunnel
View the Web UI: http://127.0.0.1:3000
2022-09-01 19:51:33.255 [INFO] (coderd) <./enterprise/coderd/features.go:230> (*featuresService).syncEntitlements syncing licensed entitlements

==> Logs will stream in below (press ctrl+c to gracefully exit):
The config is all correct and the access url is not 127.0.0.1 šŸ¤”;
Phorcys
Phorcysā€¢3y ago
the access url is 127.0.0.1:3000 postgres aint running at least not on that port
StilauGamer
StilauGamerOPā€¢3y ago
Not in the config?
Phorcys
Phorcysā€¢3y ago
doesn't matter what you think it is your access url is http://127.0.0.1:3000
StilauGamer
StilauGamerOPā€¢3y ago
How do I change the access url then?
Phorcys
Phorcysā€¢3y ago
using the CODER_ACCESS_URL=http://whatever env variable
StilauGamer
StilauGamerOPā€¢3y ago
In the config?
Phorcys
Phorcysā€¢3y ago
no in the environment variables what do you call the config
StilauGamer
StilauGamerOPā€¢3y ago
Coder.env file In etc/coder.d/
Phorcys
Phorcysā€¢3y ago
alright, so that file define environment variables too but they only apply to coder, but it should still function properly in that case can you show me that file ? coder reads your access url as this, so it's likely to be a config error
StilauGamer
StilauGamerOPā€¢3y ago
No description
Phorcys
Phorcysā€¢3y ago
oh yeah it might not be using that env file when running it manually
StilauGamer
StilauGamerOPā€¢3y ago
Thats what I am also worried about, it works when tunneling, but not when doing it alone?
Phorcys
Phorcysā€¢3y ago
yeah because tunnelling overwrites your access url
StilauGamer
StilauGamerOPā€¢3y ago
Yeah, so how would I fix this/check if it runs that?
Phorcys
Phorcysā€¢3y ago
I would say it doesn't does coder server --help say anything about specifying a config file ? I'm pretty sure the service itself is eating from that config using EnvironmentFile= in the SystemD service
StilauGamer
StilauGamerOPā€¢3y ago
No description
Phorcys
Phorcysā€¢3y ago
yeah I checked anyways you should just try to do systemctl start coder and we would debug using journalctl -xe coder because that would use the env file
StilauGamer
StilauGamerOPā€¢3y ago
No description
StilauGamer
StilauGamerOPā€¢3y ago
Systemctl indeed uses the env file ( checked the service file ). I did:
journalctl -u coder.service -b
journalctl -u coder.service -b
And got this:
Sep 03 14:53:17 StilauVPS systemd[1]: Starting "Coder - Self-hosted developer workspaces on your infra"...
Sep 03 14:53:17 StilauVPS coder[391514]: Coder v0.8.10+01a06e1 - Remote development on your infrastucture
Sep 03 14:53:17 StilauVPS coder[391514]: View the Web UI: https://coder.stilaugamer.com
Sep 03 14:53:17 StilauVPS coder[391514]: ping postgres: dial tcp 127.0.0.1:35635: connect: connection refused
Sep 03 14:53:17 StilauVPS coder[391514]: Run 'coder server --help' for usage.
Sep 03 14:53:17 StilauVPS systemd[1]: coder.service: Main process exited, code=exited, status=1/FAILURE
Sep 03 14:53:17 StilauVPS systemd[1]: coder.service: Failed with result 'exit-code'.
Sep 03 14:53:17 StilauVPS systemd[1]: Failed to start "Coder - Self-hosted developer workspaces on your infra".
Sep 03 14:53:22 StilauVPS systemd[1]: coder.service: Scheduled restart job, restart counter is at 3.
Sep 03 14:53:22 StilauVPS systemd[1]: Stopped "Coder - Self-hosted developer workspaces on your infra".
Sep 03 14:53:22 StilauVPS systemd[1]: coder.service: Start request repeated too quickly.
Sep 03 14:53:22 StilauVPS systemd[1]: coder.service: Failed with result 'exit-code'.
Sep 03 14:53:22 StilauVPS systemd[1]: Failed to start "Coder - Self-hosted developer workspaces on your infra".
Sep 03 14:53:17 StilauVPS systemd[1]: Starting "Coder - Self-hosted developer workspaces on your infra"...
Sep 03 14:53:17 StilauVPS coder[391514]: Coder v0.8.10+01a06e1 - Remote development on your infrastucture
Sep 03 14:53:17 StilauVPS coder[391514]: View the Web UI: https://coder.stilaugamer.com
Sep 03 14:53:17 StilauVPS coder[391514]: ping postgres: dial tcp 127.0.0.1:35635: connect: connection refused
Sep 03 14:53:17 StilauVPS coder[391514]: Run 'coder server --help' for usage.
Sep 03 14:53:17 StilauVPS systemd[1]: coder.service: Main process exited, code=exited, status=1/FAILURE
Sep 03 14:53:17 StilauVPS systemd[1]: coder.service: Failed with result 'exit-code'.
Sep 03 14:53:17 StilauVPS systemd[1]: Failed to start "Coder - Self-hosted developer workspaces on your infra".
Sep 03 14:53:22 StilauVPS systemd[1]: coder.service: Scheduled restart job, restart counter is at 3.
Sep 03 14:53:22 StilauVPS systemd[1]: Stopped "Coder - Self-hosted developer workspaces on your infra".
Sep 03 14:53:22 StilauVPS systemd[1]: coder.service: Start request repeated too quickly.
Sep 03 14:53:22 StilauVPS systemd[1]: coder.service: Failed with result 'exit-code'.
Sep 03 14:53:22 StilauVPS systemd[1]: Failed to start "Coder - Self-hosted developer workspaces on your infra".
Phorcys
Phorcysā€¢3y ago
oh yeah still the same issue your postgres somehow isn't running
StilauGamer
StilauGamerOPā€¢3y ago
Neither on port: 35635 or 5432
Phorcys
Phorcysā€¢3y ago
maybe you should use the built-in postgres ? idk how did you install postgres
StilauGamer
StilauGamerOPā€¢3y ago
I am I am using the built-in
Phorcys
Phorcysā€¢3y ago
No description
StilauGamer
StilauGamerOPā€¢3y ago
Yeah?
Phorcys
Phorcysā€¢3y ago
I don't know honestly since this is just normal @sharkymark any idea ? and what if you don't specify the port ?
StilauGamer
StilauGamerOPā€¢3y ago
I can try Give me 2 sec
03 15:52:19 StilauVPS systemd[1]: Stopped "Coder - Self-hosted developer workspaces on your infra".
Sep 03 15:52:19 StilauVPS systemd[1]: Starting "Coder - Self-hosted developer workspaces on your infra"...
Sep 03 15:52:19 StilauVPS coder[400904]: Coder v0.8.10+01a06e1 - Remote development on your infrastucture
Sep 03 15:52:19 StilauVPS coder[400904]: View the Web UI: https://coder.stilaugamer.com
Sep 03 15:52:19 StilauVPS coder[400904]: ping postgres: dial tcp 127.0.0.1:5432: connect: connection refused
Sep 03 15:52:19 StilauVPS coder[400904]: Run 'coder server --help' for usage.
Sep 03 15:52:19 StilauVPS systemd[1]: coder.service: Main process exited, code=exited, status=1/FAILURE
Sep 03 15:52:19 StilauVPS systemd[1]: coder.service: Failed with result 'exit-code'.
Sep 03 15:52:19 StilauVPS systemd[1]: Failed to start "Coder - Self-hosted developer workspaces on your infra".
03 15:52:19 StilauVPS systemd[1]: Stopped "Coder - Self-hosted developer workspaces on your infra".
Sep 03 15:52:19 StilauVPS systemd[1]: Starting "Coder - Self-hosted developer workspaces on your infra"...
Sep 03 15:52:19 StilauVPS coder[400904]: Coder v0.8.10+01a06e1 - Remote development on your infrastucture
Sep 03 15:52:19 StilauVPS coder[400904]: View the Web UI: https://coder.stilaugamer.com
Sep 03 15:52:19 StilauVPS coder[400904]: ping postgres: dial tcp 127.0.0.1:5432: connect: connection refused
Sep 03 15:52:19 StilauVPS coder[400904]: Run 'coder server --help' for usage.
Sep 03 15:52:19 StilauVPS systemd[1]: coder.service: Main process exited, code=exited, status=1/FAILURE
Sep 03 15:52:19 StilauVPS systemd[1]: coder.service: Failed with result 'exit-code'.
Sep 03 15:52:19 StilauVPS systemd[1]: Failed to start "Coder - Self-hosted developer workspaces on your infra".
Okok, so I got postgres working with:
sudo -u coder coder server postgres-bultin-serve
sudo -u coder coder server postgres-bultin-serve
And then it ran fine, but when I go on https://coder.stilaugamer.com, I get an 404?
Phorcys
Phorcysā€¢3y ago
that's because you're listening on 3000 and also it's probably not even using your config
StilauGamer
StilauGamerOPā€¢3y ago
So I would need to do: https://coder.stilaugamer.com:3000
Phorcys
Phorcysā€¢3y ago
well no can just set port to 443
StilauGamer
StilauGamerOPā€¢3y ago
Where? šŸ¤”šŸ¤”
Phorcys
Phorcysā€¢3y ago
CODER_ADDRESS well, if it actually cares about that one you can edit your service file to add postgres-builtin-serve at the end
StilauGamer
StilauGamerOPā€¢3y ago
So basicslly:
CODER_ADDRESS=myip:443
CODER_ADDRESS=myip:443
Phorcys
Phorcysā€¢3y ago
yes
StilauGamer
StilauGamerOPā€¢3y ago
I get already in use šŸ¤” Port already in use
Phorcys
Phorcysā€¢3y ago
are you running nginx/apache/any other web server ?
StilauGamer
StilauGamerOPā€¢3y ago
Nginx
Phorcys
Phorcysā€¢3y ago
why not run coder in http and reverse-proxy it then?
StilauGamer
StilauGamerOPā€¢3y ago
How would I do that to be exact? What I've done is basically: Take ip and port and make it https
Phorcys
Phorcysā€¢3y ago
NGINX Reverse Proxy
Configure NGINX as a reverse proxy for HTTP and other protocols, with support for modifying request headers and fine-tuned buffering of responses.
Phorcys
Phorcysā€¢3y ago
using the proxy_pass directive and you would also make coder http basically nginx would handle the SSL
StilauGamer
StilauGamerOPā€¢3y ago
So something like this:
server {
server_name coder.stilaugamer.com

location / {
proxy_pass https://coder.stilaugamer.com
}



Ssl stuff
}
server {
server_name coder.stilaugamer.com

location / {
proxy_pass https://coder.stilaugamer.com
}



Ssl stuff
}
@Phorcys Would I just leave: CODER_TLS_CERT_FILE and CODER_TLS_KEY_FILE empty and have CODER_TLS_ENABLE as false and then reverse proxy it with nginx? Would basically be:
CODER_ACCESS_URL=http://coder.stilaugamer.com
CODER_ADDRESS=myip:3000
CODER_PG_CONNECTION_URL=MyPostGresURL
CODER_TLS_ENABLE=false
CODER_TLS_CERT_FILE=
CODER_TLS_KEY_FILE=
CODER_ACCESS_URL=http://coder.stilaugamer.com
CODER_ADDRESS=myip:3000
CODER_PG_CONNECTION_URL=MyPostGresURL
CODER_TLS_ENABLE=false
CODER_TLS_CERT_FILE=
CODER_TLS_KEY_FILE=
Phorcys
Phorcysā€¢3y ago
yes but no
StilauGamer
StilauGamerOPā€¢3y ago
šŸ¤”
Phorcys
Phorcysā€¢3y ago
close enough though
server {
server_name coder.stilaugamer.com

location / {
proxy_pass http://127.0.0.1:3000
}

Ssl stuff
}
server {
server_name coder.stilaugamer.com

location / {
proxy_pass http://127.0.0.1:3000
}

Ssl stuff
}
CODER_ACCESS_URL=https://coder.stilaugamer.com
CODER_ADDRESS=127.0.0.1:3000
CODER_PG_CONNECTION_URL=MyPostGresURL
CODER_ACCESS_URL=https://coder.stilaugamer.com
CODER_ADDRESS=127.0.0.1:3000
CODER_PG_CONNECTION_URL=MyPostGresURL
StilauGamer
StilauGamerOPā€¢3y ago
Ah ok, I was close šŸ˜‚ I'll give it a try IT WORKS :HAPPY: It works on: coder.stilaugamer.com now, but ssl hasn't came yet. Sometimes takes a lil before it comes. But it works! Thanks! Finally it works :HAPPY:
StilauGamer
StilauGamerOPā€¢3y ago
But the agent is just saying connecting šŸ¤”
No description
StilauGamer
StilauGamerOPā€¢3y ago
@Phorcys Any clue on why its just connecting?
Phorcys
Phorcysā€¢3y ago
oh yeah you have to proxy websockets too check out the pinned message in #Websocket connection failed (nginx websocket passthrough)
StilauGamer
StilauGamerOPā€¢3y ago
This is my current location thingy:
location / {
proxy_pass http://myip:3000/;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
}
location / {
proxy_pass http://myip:3000/;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
}
Would it be smth like this?
location / {
proxy_pass_request_headers on;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Accept-Encoding gzip;
}
location / {
proxy_pass_request_headers on;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Accept-Encoding gzip;
}
( I am unsure of what to set in the top header with the X-Real-IP $remote_addr ) Wouldn't it be smth like this ^^ I resolved the issue and not facing anymore problems šŸ™‚
Want results from more Discord servers?
Add your server