R
Railway•13mo 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•13mo ago
Project ID: 375a1b92-5074-4e27-9bc2-6a3e7a3361cb
Sang Dang
Sang DangOP•13mo ago
375a1b92-5074-4e27-9bc2-6a3e7a3361cb
MantisInABox
MantisInABox•13mo ago
@Sang Dang was this deployed from the template I made?
Sang Dang
Sang DangOP•13mo ago
I used a template. I don't know from who. I think it's official template, right?
MantisInABox
MantisInABox•13mo ago
Nah, it's not an official template. I made it. I'm looking into this right now for you
Sang Dang
Sang DangOP•13mo 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•13mo ago
Yeah, that's true, it is a nextcloud issue for sure... https://nextcloud.vincenzofehring.com/
Brody
Brody•13mo ago
works when installed from the custom domain right?
MantisInABox
MantisInABox•13mo 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•13mo ago
sang installed from the railway url first though?
MantisInABox
MantisInABox•13mo ago
Ah... that might be why then...
Sang Dang
Sang DangOP•13mo ago
🤔 ah damn it when we run the install script, it ttake the current domain
MantisInABox
MantisInABox•13mo ago
Yeah, if I go back to it from the railway URL, i get the access through untrusted domain
Sang Dang
Sang DangOP•13mo ago
ok I got it
Brody
Brody•13mo ago
i think there is a command you can run to update the trusted domains?
Sang Dang
Sang DangOP•13mo 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•13mo ago
Unfortunately, there is no way of updating the trusted domains from the dashboard, which is dumb as hell
Sang Dang
Sang DangOP•13mo ago
No description
Brody
Brody•13mo 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•13mo 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•13mo ago
I still think it's dumb thatyou cant manage that from the admin dashboard
Brody
Brody•13mo ago
full agree with you there
Sang Dang
Sang DangOP•13mo ago
I deleted and setup the new one, assigned custom domain and installed with it, go smoothly inside. Thanks @Vin and @Brody
MantisInABox
MantisInABox•13mo ago
No problem. I'll have to see if theres a way that we can fix that with an env
Brody
Brody•13mo ago
might be worth to try vin?
MantisInABox
MantisInABox•13mo ago
Well damn
No description
MantisInABox
MantisInABox•13mo ago
Updating the template now
Sang Dang
Sang DangOP•13mo 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•13mo ago
how deep was that hidden
MantisInABox
MantisInABox•13mo ago
About 3/4 down the docker hub page
Brody
Brody•13mo ago
might as well add an external database while youre at it
MantisInABox
MantisInABox•13mo ago
Why? There is nothing wrong with using the SQLite database that it comes with
Brody
Brody•13mo ago
for fun
MantisInABox
MantisInABox•13mo ago
Template updated to include that env variable
Sang Dang
Sang DangOP•13mo ago
I think it's good to have different database option, people who consider nextcloud usually also want private db
Brody
Brody•13mo ago
No description
MantisInABox
MantisInABox•13mo ago
I'm gonna go through and add the S3 configurations as well, since the volume on railway is limited
Brody
Brody•13mo ago
no default value 😠
MantisInABox
MantisInABox•13mo ago
No, because it's OPTIONAL!
Sang Dang
Sang DangOP•13mo ago
I think we can't put default value we dont know what is customer's custom domain
MantisInABox
MantisInABox•13mo ago
If I put a value there, it will use that value
Brody
Brody•13mo ago
dont make me send you a link to railways docs
Sang Dang
Sang DangOP•13mo ago
🤣
MantisInABox
MantisInABox•13mo ago
Who linked to railways docs?
Sang Dang
Sang DangOP•13mo ago
default to railway_public_domain?
Brody
Brody•13mo ago
${{RAILWAY_PUBLIC_DOMAIN}}
${{RAILWAY_PUBLIC_DOMAIN}}
MantisInABox
MantisInABox•13mo ago
There. Happy? I added the railway public domain by default
Brody
Brody•13mo ago
yes 🙂 needs health check too 🙂
MantisInABox
MantisInABox•13mo ago
Sang. Would you like me to setup S3 variables by default? Not by default, but provide them?
Sang Dang
Sang DangOP•13mo ago
it would be great, we have 100GB of photos
MantisInABox
MantisInABox•13mo ago
Oh wow! I'm just not sure what will happen if I include them and they aren't filled in...
Sang Dang
Sang DangOP•13mo ago
so I think setup with S3 is great
MantisInABox
MantisInABox•13mo ago
I could mark them as optional I guess
Brody
Brody•13mo ago
they wont be added to the service
Sang Dang
Sang DangOP•13mo ago
are you single?
Brody
Brody•13mo ago
woah
Sang Dang
Sang DangOP•13mo ago
any married husband will have to find a way to store wife's selfie
MantisInABox
MantisInABox•13mo ago
Happily married 11 years!
Sang Dang
Sang DangOP•13mo ago
no 100GB selfie photos? weird
MantisInABox
MantisInABox•13mo ago
Half petabyte storage server at the house 😄
Brody
Brody•13mo ago
and the images are still all webp
Sang Dang
Sang DangOP•13mo 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•13mo ago
awh
Sang Dang
Sang DangOP•13mo ago
modern day with modern problems, eh 😄
MantisInABox
MantisInABox•13mo 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•13mo ago
wow you went to town
MantisInABox
MantisInABox•13mo ago
All the S3 variables my guy
Sang Dang
Sang DangOP•13mo ago
I love this spirit
Brody
Brody•13mo ago
never seen half of these before
Sang Dang
Sang DangOP•13mo ago
thanks so muchhhh
MantisInABox
MantisInABox•13mo ago
No problem. Glad I could make it just that much better of a template
Sang Dang
Sang DangOP•13mo ago
if this work well, I will stop using the vps and do everything in railway 😄
MantisInABox
MantisInABox•13mo 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•13mo ago
nothing wrong with that
Sang Dang
Sang DangOP•13mo 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•13mo ago
vin forgot about the internal network just now
MantisInABox
MantisInABox•13mo ago
I totally did
Brody
Brody•13mo ago
it happens to the best of us
Sang Dang
Sang DangOP•13mo ago
lol I installed umami and wait for custom domain then went to set it up, the NextCloud trauma is HAHAHA
Brody
Brody•13mo ago
did you deploy railways umami?
Sang Dang
Sang DangOP•13mo ago
yes, it works well
Brody
Brody•13mo ago
ill be updating it soon dont get too deep into your current deploy
Sang Dang
Sang DangOP•13mo ago
thanks for reminding, I just set it up for testing, the company might decide to switch maybe next year
Brody
Brody•13mo ago
theres also metabase
MantisInABox
MantisInABox•13mo ago
There's also Axiom! 🤣
Sang Dang
Sang DangOP•13mo 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•13mo ago
The team plan is the $20/month per user, plus usage Wanna send a screenshot of your expanded usage screen?
Brody
Brody•13mo ago
yeah per user, not per project 🙂
Sang Dang
Sang DangOP•13mo ago
1 sec
MantisInABox
MantisInABox•13mo 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 DangOP•13mo ago
No description
MantisInABox
MantisInABox•13mo ago
This top section, sorry
No description
Sang Dang
Sang DangOP•13mo ago
oh I see
MantisInABox
MantisInABox•13mo ago
Sorry, I didn't explain myself soon enough 🤣
Brody
Brody•13mo ago
rich boy
MantisInABox
MantisInABox•13mo ago
That's because of my FastAPI template 😄
Brody
Brody•13mo ago
oh yes and "my" umami template
MantisInABox
MantisInABox•13mo ago
Exactly
Sang Dang
Sang DangOP•13mo ago
thanks so much, for helping out let's get back to chat chit channel 😄
Want results from more Discord servers?
Add your server