R
Railway•8mo ago
Sang Dang

How to add Railway custom domain into trusted_domains of NextCloud?

Using custom domain to access NextCloud today, I saw this message. In order to fix it, I have to edit the file inside the container, which Railway does not support right now. I think the only way left is edit the template/source code that inject custom domain as environment variable into that file. Any better idea?
No description
Solution:
sang installed from the railway url first though?
Jump to solution
100 Replies
Percy
Percy•8mo ago
Project ID: 375a1b92-5074-4e27-9bc2-6a3e7a3361cb
Sang Dang
Sang Dang•8mo ago
375a1b92-5074-4e27-9bc2-6a3e7a3361cb
MantisInABox
MantisInABox•8mo ago
@Sang Dang was this deployed from the template I made?
Sang Dang
Sang Dang•8mo ago
I used a template. I don't know from who. I think it's official template, right?
MantisInABox
MantisInABox•8mo ago
Nah, it's not an official template. I made it. I'm looking into this right now for you
Sang Dang
Sang Dang•8mo ago
thanks when I installed in VPS, I can ssh and edit the config file directly, (I know it's not the best practice 😄 But it's NextCloud issue 😛 )
MantisInABox
MantisInABox•8mo ago
Yeah, that's true, it is a nextcloud issue for sure... https://nextcloud.vincenzofehring.com/
Brody
Brody•8mo ago
works when installed from the custom domain right?
MantisInABox
MantisInABox•8mo ago
I just deployed the template https://railway.app/template/LddOJ1 Added my custom domain to cloudflare and the service, and I don't see that message
Solution
Brody
Brody•8mo ago
sang installed from the railway url first though?
MantisInABox
MantisInABox•8mo ago
Ah... that might be why then...
Sang Dang
Sang Dang•8mo ago
🤔 ah damn it when we run the install script, it ttake the current domain
MantisInABox
MantisInABox•8mo ago
Yeah, if I go back to it from the railway URL, i get the access through untrusted domain
Sang Dang
Sang Dang•8mo ago
ok I got it
Brody
Brody•8mo ago
i think there is a command you can run to update the trusted domains?
Sang Dang
Sang Dang•8mo ago
let me add the custom domain first, then run the script my cloud has 0 stuffs so I can destroy it now
MantisInABox
MantisInABox•8mo ago
Unfortunately, there is no way of updating the trusted domains from the dashboard, which is dumb as hell
Sang Dang
Sang Dang•8mo ago
No description
Brody
Brody•8mo ago
nextcloud.occ config:system:set trusted_domains 1 --value=${RAILWAY_PUBLIC_DOMAIN}
nextcloud.occ config:system:set trusted_domains 1 --value=${RAILWAY_PUBLIC_DOMAIN}
Brody
Brody•8mo ago
so maybe something like this for a start command
/bin/sh -c "nextcloud.occ config:system:set trusted_domains 1 --value=${RAILWAY_PUBLIC_DOMAIN} && /entrypoint.sh apache2-foreground"
/bin/sh -c "nextcloud.occ config:system:set trusted_domains 1 --value=${RAILWAY_PUBLIC_DOMAIN} && /entrypoint.sh apache2-foreground"
MantisInABox
MantisInABox•8mo ago
I still think it's dumb thatyou cant manage that from the admin dashboard
Brody
Brody•8mo ago
full agree with you there
Sang Dang
Sang Dang•8mo ago
I deleted and setup the new one, assigned custom domain and installed with it, go smoothly inside. Thanks @Vin and @Brody
MantisInABox
MantisInABox•8mo ago
No problem. I'll have to see if theres a way that we can fix that with an env
Brody
Brody•8mo ago
might be worth to try vin?
MantisInABox
MantisInABox•8mo ago
Well damn
No description
MantisInABox
MantisInABox•8mo ago
Updating the template now
Sang Dang
Sang Dang•8mo ago
I agree, that would be great if we can fix it, because usually adding sub domain take time (up to hours) and people usually can not wait for it, e.g. most likely will go and install with railway domain
Brody
Brody•8mo ago
how deep was that hidden
MantisInABox
MantisInABox•8mo ago
About 3/4 down the docker hub page
Brody
Brody•8mo ago
might as well add an external database while youre at it
MantisInABox
MantisInABox•8mo ago
Why? There is nothing wrong with using the SQLite database that it comes with
Brody
Brody•8mo ago
for fun
MantisInABox
MantisInABox•8mo ago
Template updated to include that env variable
Sang Dang
Sang Dang•8mo ago
I think it's good to have different database option, people who consider nextcloud usually also want private db
Brody
Brody•8mo ago
No description
MantisInABox
MantisInABox•8mo ago
I'm gonna go through and add the S3 configurations as well, since the volume on railway is limited
Brody
Brody•8mo ago
no default value 😠
MantisInABox
MantisInABox•8mo ago
No, because it's OPTIONAL!
Sang Dang
Sang Dang•8mo ago
I think we can't put default value we dont know what is customer's custom domain
MantisInABox
MantisInABox•8mo ago
If I put a value there, it will use that value
Brody
Brody•8mo ago
dont make me send you a link to railways docs
Sang Dang
Sang Dang•8mo ago
🤣
MantisInABox
MantisInABox•8mo ago
Who linked to railways docs?
Sang Dang
Sang Dang•8mo ago
default to railway_public_domain?
Brody
Brody•8mo ago
${{RAILWAY_PUBLIC_DOMAIN}}
${{RAILWAY_PUBLIC_DOMAIN}}
MantisInABox
MantisInABox•8mo ago
There. Happy? I added the railway public domain by default
Brody
Brody•8mo ago
yes 🙂 needs health check too 🙂
MantisInABox
MantisInABox•8mo ago
Sang. Would you like me to setup S3 variables by default? Not by default, but provide them?
Sang Dang
Sang Dang•8mo ago
it would be great, we have 100GB of photos
MantisInABox
MantisInABox•8mo ago
Oh wow! I'm just not sure what will happen if I include them and they aren't filled in...
Sang Dang
Sang Dang•8mo ago
so I think setup with S3 is great
MantisInABox
MantisInABox•8mo ago
I could mark them as optional I guess
Brody
Brody•8mo ago
they wont be added to the service
Sang Dang
Sang Dang•8mo ago
are you single?
Brody
Brody•8mo ago
woah
Sang Dang
Sang Dang•8mo ago
any married husband will have to find a way to store wife's selfie
MantisInABox
MantisInABox•8mo ago
Happily married 11 years!
Sang Dang
Sang Dang•8mo ago
no 100GB selfie photos? weird
MantisInABox
MantisInABox•8mo ago
Half petabyte storage server at the house 😄
Brody
Brody•8mo ago
and the images are still all webp
Sang Dang
Sang Dang•8mo ago
just kiddin actually there were a bunch of silly videos that my kids filming each other, and they are so cute that I dont want to delete any of those
Brody
Brody•8mo ago
awh
Sang Dang
Sang Dang•8mo ago
modern day with modern problems, eh 😄
MantisInABox
MantisInABox•8mo ago
Done... all the S3 variables have been added to the service for configuration on deploy I'll add them to the template page in a bit
Brody
Brody•8mo ago
wow you went to town
MantisInABox
MantisInABox•8mo ago
All the S3 variables my guy
Sang Dang
Sang Dang•8mo ago
I love this spirit
Brody
Brody•8mo ago
never seen half of these before
Sang Dang
Sang Dang•8mo ago
thanks so muchhhh
MantisInABox
MantisInABox•8mo ago
No problem. Glad I could make it just that much better of a template
Sang Dang
Sang Dang•8mo ago
if this work well, I will stop using the vps and do everything in railway 😄
MantisInABox
MantisInABox•8mo ago
Also, their MySQL config expects your database to be listening on 3306 and Postgres on 5432 So, I might just keep it with SQLite for now
Brody
Brody•8mo ago
nothing wrong with that
Sang Dang
Sang Dang•8mo ago
when I installed on my vps, using Postgres has problem, I cant move forward, switch to sqllite is ok Im not sure what is problem, it constantly said can not connect to postgres etc
Brody
Brody•8mo ago
vin forgot about the internal network just now
MantisInABox
MantisInABox•8mo ago
I totally did
Brody
Brody•8mo ago
it happens to the best of us
Sang Dang
Sang Dang•8mo ago
lol I installed umami and wait for custom domain then went to set it up, the NextCloud trauma is HAHAHA
Brody
Brody•8mo ago
did you deploy railways umami?
Sang Dang
Sang Dang•8mo ago
yes, it works well
Brody
Brody•8mo ago
ill be updating it soon dont get too deep into your current deploy
Sang Dang
Sang Dang•8mo ago
thanks for reminding, I just set it up for testing, the company might decide to switch maybe next year
Brody
Brody•8mo ago
theres also metabase
MantisInABox
MantisInABox•8mo ago
There's also Axiom! 🤣
Sang Dang
Sang Dang•8mo ago
poggers to ask question out of context of this topic, but for example I spawn lot of services inside my current team with pro plan, does it make the bills hype up like from $20/m to $100 or $200/m?
MantisInABox
MantisInABox•8mo ago
The team plan is the $20/month per user, plus usage Wanna send a screenshot of your expanded usage screen?
Brody
Brody•8mo ago
yeah per user, not per project 🙂
Sang Dang
Sang Dang•8mo ago
1 sec
MantisInABox
MantisInABox•8mo ago
On your usage page, just hit "show breakdown" over your estimated bill... Don't need anything more than that top section
Sang Dang
Sang Dang•8mo ago
No description
MantisInABox
MantisInABox•8mo ago
This top section, sorry
No description
Sang Dang
Sang Dang•8mo ago
oh I see
MantisInABox
MantisInABox•8mo ago
Sorry, I didn't explain myself soon enough 🤣
Brody
Brody•8mo ago
rich boy
MantisInABox
MantisInABox•8mo ago
That's because of my FastAPI template 😄
Brody
Brody•8mo ago
oh yes and "my" umami template
MantisInABox
MantisInABox•8mo ago
Exactly
Sang Dang
Sang Dang•8mo ago
thanks so much, for helping out let's get back to chat chit channel 😄