community-scripts deployment #3

Closed
opened 2026-10-05 01:33:21 +02:00 by adam · 25 comments
Owner

Hi

After running the install script, I noticed that the service is failing with a permission denied error, due to unable to start the bun. Which seems to be installed to /root/.bun/bin/bun and therefore only accessible via root.

I tried changing permissions of bun executable to

chmod a+rx /root/.bun/bin/bun

though this did not solve it, possibly it would be simpler to run under root user inside the container?

EDIT: I was not able to look into this deeper yet, I just though I report it, maybe I have some time to look into this and submit a PR.

Hi After running the install script, I noticed that the service is failing with a permission denied error, due to unable to start the bun. Which seems to be installed to /root/.bun/bin/bun and therefore only accessible via root. I tried changing permissions of bun executable to ```bash chmod a+rx /root/.bun/bin/bun ``` though this did not solve it, possibly it would be simpler to run under root user inside the container? EDIT: I was not able to look into this deeper yet, I just though I report it, maybe I have some time to look into this and submit a PR. <!-- github-sync-id:3080393111 -->
adam closed this issue 2026-10-05 01:33:21 +02:00
Author
Owner

Log:

May 21 16:14:25 gitteam-mirror systemd[1]: Started gitea-mirror.service - Gitea Mirror.
May 21 16:14:25 gitteam-mirror (bun)[2375]: gitea-mirror.service: Failed to execute /root/.bun/bin/bun: Permission denied
May 21 16:14:25 gitteam-mirror (bun)[2375]: gitea-mirror.service: Failed at step EXEC spawning /root/.bun/bin/bun: Permission denied
May 21 16:14:25 gitteam-mirror systemd[1]: gitea-mirror.service: Main process exited, code=exited, status=203/EXEC
May 21 16:14:25 gitteam-mirror systemd[1]: gitea-mirror.service: Failed with result 'exit-code'.
Log: ``` May 21 16:14:25 gitteam-mirror systemd[1]: Started gitea-mirror.service - Gitea Mirror. May 21 16:14:25 gitteam-mirror (bun)[2375]: gitea-mirror.service: Failed to execute /root/.bun/bin/bun: Permission denied May 21 16:14:25 gitteam-mirror (bun)[2375]: gitea-mirror.service: Failed at step EXEC spawning /root/.bun/bin/bun: Permission denied May 21 16:14:25 gitteam-mirror systemd[1]: gitea-mirror.service: Main process exited, code=exited, status=203/EXEC May 21 16:14:25 gitteam-mirror systemd[1]: gitea-mirror.service: Failed with result 'exit-code'. ``` <!-- github-comment-id:2898132487 -->
Author
Owner

@CrazyWolf13 Have a look at the new PR

@CrazyWolf13 Have a look at the new PR <!-- github-comment-id:2898641000 -->
Author
Owner

@arunavo4
The script has quite some errors:
Problem with template download, on local-lvm you cannot templates

  • Problem with instaling bun due to --yes
  • Other problems

I was able to build a container myself and then install through the commands there.

I will now test it and if no errors occur, I'll create a script on community-scripts to replace your proxmox install script.

@arunavo4 The script has quite some errors: Problem with template download, on local-lvm you cannot templates - Problem with instaling bun due to --yes - Other problems I was able to build a container myself and then install through the commands there. I will now test it and if no errors occur, I'll create a script on community-scripts to replace your proxmox install script. <!-- github-comment-id:2900026020 -->
Author
Owner

Thanks @CrazyWolf13 I dont have a proxmox setup to test and fix issues with it, would appreaciate a PR on this.

Thanks @CrazyWolf13 I dont have a proxmox setup to test and fix issues with it, would appreaciate a PR on this. <!-- github-comment-id:2900041815 -->
Author
Owner

are you sure about this?
If I create a script on community-scripts, we have all the neccessary helper functions, which heavily simplifies the process, building the whole thing again here, does not make much sense in my eyes, though I can certainly look into fixing it, but then I don't see a reason for a script in our org.

are you sure about this? If I create a script on community-scripts, we have all the neccessary helper functions, which heavily simplifies the process, building the whole thing again here, does not make much sense in my eyes, though I can certainly look into fixing it, but then I don't see a reason for a script in our org. <!-- github-comment-id:2900054057 -->
Author
Owner

@CrazyWolf13 Ahh thats great then I can just add a link to community-scripts in my readme and not worry about maintaining it here.

@CrazyWolf13 Ahh thats great then I can just add a link to community-scripts in my readme and not worry about maintaining it here. <!-- github-comment-id:2900199234 -->
Author
Owner

@CrazyWolf13 Once you have it ready please leave the link here so that I can update my readme with the correct scripts or you can update my readme on how to use the community-scripts and make a PR. whatever way you feel best.

@CrazyWolf13 Once you have it ready please leave the link here so that I can update my readme with the correct scripts or you can update my readme on how to use the community-scripts and make a PR. whatever way you feel best. <!-- github-comment-id:2900203429 -->
Author
Owner

@arunavo4
WIP: https://github.com/community-scripts/ProxmoxVED/blob/main/install/gitea-mirror-install.sh

Is it possible to install the db to a different location, like /opt/db

So we can remove and re-deploy the app code on update, without removing user data?

Our Update process always involves removing the app, checking for new GH-Realse, downloading the source tarball and building.

EDIT: Oh I see just now there is a data folder with the db, can we also just backup that?

@arunavo4 WIP: https://github.com/community-scripts/ProxmoxVED/blob/main/install/gitea-mirror-install.sh Is it possible to install the db to a different location, like /opt/db So we can remove and re-deploy the app code on update, without removing user data? Our Update process always involves removing the app, checking for new GH-Realse, downloading the source tarball and building. EDIT: Oh I see just now there is a data folder with the db, can we also just backup that? <!-- github-comment-id:2901487543 -->
Author
Owner

@CrazyWolf13 Yea you can move the db anywhere as long as its available to the app. Even with future verisons

@CrazyWolf13 Yea you can move the db anywhere as long as its available to the app. Even with future verisons <!-- github-comment-id:2901511354 -->
Author
Owner

Hi @CrazyWolf13 is the LXC script ready? Any updates on it?

Hi @CrazyWolf13 is the LXC script ready? Any updates on it? <!-- github-comment-id:2915361682 -->
Author
Owner

@arunavo4 Currently a bit busy, so I've not yet been able to finish it nor test the app or the script.

Perfect!

Is the db the only thing that stores user data in the long term?
or should we consider backing up that data folder?

Because normally on update script we fully remove the app then freshly install it and backup+ restore user-data.

@arunavo4 Currently a bit busy, so I've not yet been able to finish it nor test the app or the script. Perfect! Is the db the only thing that stores user data in the long term? or should we consider backing up that data folder? Because normally on update script we fully remove the app then freshly install it and backup+ restore user-data. <!-- github-comment-id:2915593433 -->
Author
Owner

@CrazyWolf13 yea the db is the only thing that stores everything now since the redis is also gone you can only backup the db but i think backing up the data folder is a better choice since if we decide to update the way we store data and add other files in there you don't have to update your script in the future.

P.S: a lot of issues have been addressed so use the latest release to test.

@CrazyWolf13 yea the db is the only thing that stores everything now since the redis is also gone you can only backup the db but i think backing up the data folder is a better choice since if we decide to update the way we store data and add other files in there you don't have to update your script in the future. >P.S: a lot of issues have been addressed so use the latest release to test. <!-- github-comment-id:2915604407 -->
Author
Owner

@arunavo4
Please remove the links to the repo, these are in to our VED Repo, which is our testing non-prod repo, I'll notify once it's in the correct repo :)

@arunavo4 Please remove the links to the repo, these are in to our VED Repo, which is our testing non-prod repo, I'll notify once it's in the correct repo :) <!-- github-comment-id:2929375493 -->
Author
Owner

Here is an example how homarr documented our install:
https://homarr.dev/docs/getting-started/installation/proxmox

The Website after PR is merged will be https://community-scripts.github.io/ProxmoxVE/scripts?id=gitea-mirror

and the command will be:

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/gitea-mirror.sh)"

I finished the script, am now at testing, if I don't see any issues, I'll propose the PR and notify after merge.

Here is an example how homarr documented our install: https://homarr.dev/docs/getting-started/installation/proxmox The Website after PR is merged will be https://community-scripts.github.io/ProxmoxVE/scripts?id=gitea-mirror and the command will be: ```bash bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/gitea-mirror.sh)" ``` I finished the script, am now at testing, if I don't see any issues, I'll propose the PR and notify after merge. <!-- github-comment-id:2929602809 -->
Author
Owner

@arunavo4
Any idea what this error is?

Image

Noticed during rebuild test.

Also the db seems to be already present after running

bun install
bun run build

it then shows db already present.

@arunavo4 Any idea what this error is? ![Image](https://github.com/user-attachments/assets/c078d0f6-f383-44f0-a2f3-4f84caf921d9) Noticed during rebuild test. Also the db seems to be already present after running ```bash bun install bun run build ````` it then shows db already present. <!-- github-comment-id:2929647784 -->
Author
Owner

@CrazyWolf13 I think you did not run the migrations, but its fine I have made a new release that makes sure that all the tables are present before running the application. use the latest release v2.12.0

And I will update the docs once you notify me after the PR.

@CrazyWolf13 I think you did not run the migrations, but its fine I have made a new release that makes sure that all the tables are present before running the application. use the latest release `v2.12.0` And I will update the docs once you notify me after the PR. <!-- github-comment-id:2929711984 -->
Author
Owner

@arunavo4 Perfect!

Though I'm seeing vunknown now:

Image

@arunavo4 Perfect! Though I'm seeing vunknown now: ![Image](https://github.com/user-attachments/assets/fdc9355b-65f5-4386-a399-6af780f13d1c) <!-- github-comment-id:2930155829 -->
Author
Owner

@arunavo4 Script seems to work so far, error with the migrations does not appear anymore.

Could you please check the bun commands?
In your readme there seem to be different commands mixed up, once with bun run setup.
Here the install: https://github.com/community-scripts/ProxmoxVED/blob/main/install/gitea-mirror-install.sh#L35-L37
Update: https://github.com/community-scripts/ProxmoxVED/blob/main/ct/gitea-mirror.sh#L55-L56

After that I can push to main ^^

@arunavo4 Script seems to work so far, error with the migrations does not appear anymore. Could you please check the `bun` commands? In your readme there seem to be different commands mixed up, once with `bun run setup`. Here the install: https://github.com/community-scripts/ProxmoxVED/blob/main/install/gitea-mirror-install.sh#L35-L37 Update: https://github.com/community-scripts/ProxmoxVED/blob/main/ct/gitea-mirror.sh#L55-L56 After that I can push to main ^^ <!-- github-comment-id:2930179061 -->
Author
Owner

@arunavo4 Perfect!

Though I'm seeing vunknown now:

Image

@CrazyWolf13 a lot of things that the docker-entrypoint.sh file does you also need to do for your LXC, like in this case it sets the verison as a environment variable for the app to access.
https://github.com/arunavo4/gitea-mirror/blob/e24b856416f1a14f029791ed26e20aa72daaf6ef/docker-entrypoint.sh#L203-L207

> [@arunavo4](https://github.com/arunavo4) Perfect! > > Though I'm seeing vunknown now: > > ![Image](https://github.com/user-attachments/assets/fdc9355b-65f5-4386-a399-6af780f13d1c) @CrazyWolf13 a lot of things that the `docker-entrypoint.sh` file does you also need to do for your LXC, like in this case it sets the verison as a environment variable for the app to access. https://github.com/arunavo4/gitea-mirror/blob/e24b856416f1a14f029791ed26e20aa72daaf6ef/docker-entrypoint.sh#L203-L207 <!-- github-comment-id:2930910101 -->
Author
Owner

@arunavo4
Well that was the whole point of it.

I initially said we only accept it we have a direct deployment as we always have issues with dockerfile conversion approach, so you created the bun installation no?

Can't you handle this on your side of the app?

Otherwise your lxc and your normal installed would also be need to adapted.

@arunavo4 Well that was the whole point of it. I initially said we only accept it we have a direct deployment as we always have issues with dockerfile conversion approach, so you created the bun installation no? Can't you handle this on your side of the app? Otherwise your lxc and your normal installed would also be need to adapted. <!-- github-comment-id:2930939436 -->
Author
Owner

@CrazyWolf13 thats why the bun run setup it makes sures that all the migrations and db stuff is run. Use that instead of the install

msg_info "Installing gitea-mirror"
cd /opt/gitea-mirror
$STD bun run setup  # This does both bun install AND bun run manage-db init
$STD bun run build
msg_ok "Installed gitea-mirror"
@CrazyWolf13 thats why the `bun run setup` it makes sures that all the migrations and db stuff is run. Use that instead of the install ```sh msg_info "Installing gitea-mirror" cd /opt/gitea-mirror $STD bun run setup # This does both bun install AND bun run manage-db init $STD bun run build msg_ok "Installed gitea-mirror" ``` <!-- github-comment-id:2930960821 -->
Author
Owner

@CrazyWolf13

msg_info "Installing gitea-mirror"
cd /opt/gitea-mirror
$STD bun run setup  # This does: bun install && bun run manage-db init
$STD bun run build
msg_ok "Installed gitea-mirror"

msg_info "Creating Services"
JWT_SECRET=$(openssl rand -hex 32)

# Extract version from package.json
APP_VERSION=$(grep -o '"version": *"[^"]*"' package.json | cut -d'"' -f4)

cat <<EOF >/etc/systemd/system/gitea-mirror.service
[Unit]
Description=Gitea Mirror
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/gitea-mirror
ExecStart=/usr/local/bin/bun dist/server/entry.mjs
Restart=on-failure
RestartSec=10
Environment=NODE_ENV=production
Environment=HOST=0.0.0.0
Environment=PORT=4321
Environment=DATABASE_URL=file:/opt/gitea-mirror/data/gitea-mirror.db
Environment=JWT_SECRET=${JWT_SECRET}
Environment=npm_package_version=${APP_VERSION}
[Install]
WantedBy=multi-user.target
EOF
@CrazyWolf13 ```sh msg_info "Installing gitea-mirror" cd /opt/gitea-mirror $STD bun run setup # This does: bun install && bun run manage-db init $STD bun run build msg_ok "Installed gitea-mirror" msg_info "Creating Services" JWT_SECRET=$(openssl rand -hex 32) # Extract version from package.json APP_VERSION=$(grep -o '"version": *"[^"]*"' package.json | cut -d'"' -f4) cat <<EOF >/etc/systemd/system/gitea-mirror.service [Unit] Description=Gitea Mirror After=network.target [Service] Type=simple WorkingDirectory=/opt/gitea-mirror ExecStart=/usr/local/bin/bun dist/server/entry.mjs Restart=on-failure RestartSec=10 Environment=NODE_ENV=production Environment=HOST=0.0.0.0 Environment=PORT=4321 Environment=DATABASE_URL=file:/opt/gitea-mirror/data/gitea-mirror.db Environment=JWT_SECRET=${JWT_SECRET} Environment=npm_package_version=${APP_VERSION} [Install] WantedBy=multi-user.target EOF ``` <!-- github-comment-id:2930974516 -->
Author
Owner

@arunavo4
Ah you changed install commands, in the meantime, alright.
I adapted the script :)

Currently have some issues with our functions to deploy, but will be ready soon.

@arunavo4 Ah you changed install commands, in the meantime, alright. I adapted the script :) Currently have some issues with our functions to deploy, but will be ready soon. <!-- github-comment-id:2939893898 -->
Author
Owner

Script is online:
https://community-scripts.github.io/ProxmoxVE/scripts?id=gitea-mirror

Has already been installed 5 Times via our deployment :)
https://community-scripts.github.io/ProxmoxVE/data --> Table view, scroll down (Our Public, Opt-In API)

Script is online: https://community-scripts.github.io/ProxmoxVE/scripts?id=gitea-mirror Has already been installed 5 Times via our deployment :) https://community-scripts.github.io/ProxmoxVE/data --> Table view, scroll down (Our Public, Opt-In API) <!-- github-comment-id:2944905391 -->
Author
Owner

@CrazyWolf13 Thank you for your work. I have updated the readme with the new updated links

@CrazyWolf13 Thank you for your work. I have updated the readme with the new updated links <!-- github-comment-id:2945530748 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/gitea-mirror#3