[GH-ISSUE #12] community-scripts deployment #2

Closed
opened 2026-02-27 15:54:28 +03:00 by kerem · 25 comments
Owner

Originally created by @CrazyWolf13 on GitHub (May 21, 2025).
Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/12

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.

Originally created by @CrazyWolf13 on GitHub (May 21, 2025). Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/12 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.
kerem closed this issue 2026-02-27 15:54:28 +03:00
Author
Owner

@CrazyWolf13 commented on GitHub (May 21, 2025):

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'.
<!-- gh-comment-id:2898132487 --> @CrazyWolf13 commented on GitHub (May 21, 2025): 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'. ```
Author
Owner

@arunavo4 commented on GitHub (May 21, 2025):

@CrazyWolf13 Have a look at the new PR

<!-- gh-comment-id:2898641000 --> @arunavo4 commented on GitHub (May 21, 2025): @CrazyWolf13 Have a look at the new PR
Author
Owner

@CrazyWolf13 commented on GitHub (May 22, 2025):

@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.

<!-- gh-comment-id:2900026020 --> @CrazyWolf13 commented on GitHub (May 22, 2025): @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.
Author
Owner

@arunavo4 commented on GitHub (May 22, 2025):

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

<!-- gh-comment-id:2900041815 --> @arunavo4 commented on GitHub (May 22, 2025): Thanks @CrazyWolf13 I dont have a proxmox setup to test and fix issues with it, would appreaciate a PR on this.
Author
Owner

@CrazyWolf13 commented on GitHub (May 22, 2025):

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.

<!-- gh-comment-id:2900054057 --> @CrazyWolf13 commented on GitHub (May 22, 2025): 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.
Author
Owner

@arunavo4 commented on GitHub (May 22, 2025):

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

<!-- gh-comment-id:2900199234 --> @arunavo4 commented on GitHub (May 22, 2025): @CrazyWolf13 Ahh thats great then I can just add a link to community-scripts in my readme and not worry about maintaining it here.
Author
Owner

@arunavo4 commented on GitHub (May 22, 2025):

@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.

<!-- gh-comment-id:2900203429 --> @arunavo4 commented on GitHub (May 22, 2025): @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.
Author
Owner

@CrazyWolf13 commented on GitHub (May 22, 2025):

@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?

<!-- gh-comment-id:2901487543 --> @CrazyWolf13 commented on GitHub (May 22, 2025): @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?
Author
Owner

@arunavo4 commented on GitHub (May 22, 2025):

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

<!-- gh-comment-id:2901511354 --> @arunavo4 commented on GitHub (May 22, 2025): @CrazyWolf13 Yea you can move the db anywhere as long as its available to the app. Even with future verisons
Author
Owner

@arunavo4 commented on GitHub (May 28, 2025):

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

<!-- gh-comment-id:2915361682 --> @arunavo4 commented on GitHub (May 28, 2025): Hi @CrazyWolf13 is the LXC script ready? Any updates on it?
Author
Owner

@CrazyWolf13 commented on GitHub (May 28, 2025):

@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.

<!-- gh-comment-id:2915593433 --> @CrazyWolf13 commented on GitHub (May 28, 2025): @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.
Author
Owner

@arunavo4 commented on GitHub (May 28, 2025):

@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.

<!-- gh-comment-id:2915604407 --> @arunavo4 commented on GitHub (May 28, 2025): @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.
Author
Owner

@CrazyWolf13 commented on GitHub (Jun 2, 2025):

@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 :)

<!-- gh-comment-id:2929375493 --> @CrazyWolf13 commented on GitHub (Jun 2, 2025): @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 :)
Author
Owner

@CrazyWolf13 commented on GitHub (Jun 2, 2025):

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.

<!-- gh-comment-id:2929602809 --> @CrazyWolf13 commented on GitHub (Jun 2, 2025): 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.
Author
Owner

@CrazyWolf13 commented on GitHub (Jun 2, 2025):

@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.

<!-- gh-comment-id:2929647784 --> @CrazyWolf13 commented on GitHub (Jun 2, 2025): @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.
Author
Owner

@arunavo4 commented on GitHub (Jun 2, 2025):

@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.

<!-- gh-comment-id:2929711984 --> @arunavo4 commented on GitHub (Jun 2, 2025): @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.
Author
Owner

@CrazyWolf13 commented on GitHub (Jun 2, 2025):

@arunavo4 Perfect!

Though I'm seeing vunknown now:

Image

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

@CrazyWolf13 commented on GitHub (Jun 2, 2025):

@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 ^^

<!-- gh-comment-id:2930179061 --> @CrazyWolf13 commented on GitHub (Jun 2, 2025): @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 ^^
Author
Owner

@arunavo4 commented on GitHub (Jun 2, 2025):

@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.
github.com/arunavo4/gitea-mirror@e24b856416/docker-entrypoint.sh (L203-L207)

<!-- gh-comment-id:2930910101 --> @arunavo4 commented on GitHub (Jun 2, 2025): > [@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
Author
Owner

@CrazyWolf13 commented on GitHub (Jun 2, 2025):

@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.

<!-- gh-comment-id:2930939436 --> @CrazyWolf13 commented on GitHub (Jun 2, 2025): @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.
Author
Owner

@arunavo4 commented on GitHub (Jun 2, 2025):

@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"
<!-- gh-comment-id:2930960821 --> @arunavo4 commented on GitHub (Jun 2, 2025): @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" ```
Author
Owner

@arunavo4 commented on GitHub (Jun 2, 2025):

@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
<!-- gh-comment-id:2930974516 --> @arunavo4 commented on GitHub (Jun 2, 2025): @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 ```
Author
Owner

@CrazyWolf13 commented on GitHub (Jun 4, 2025):

@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.

<!-- gh-comment-id:2939893898 --> @CrazyWolf13 commented on GitHub (Jun 4, 2025): @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.
Author
Owner

@CrazyWolf13 commented on GitHub (Jun 5, 2025):

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)

<!-- gh-comment-id:2944905391 --> @CrazyWolf13 commented on GitHub (Jun 5, 2025): 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)
Author
Owner

@arunavo4 commented on GitHub (Jun 5, 2025):

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

<!-- gh-comment-id:2945530748 --> @arunavo4 commented on GitHub (Jun 5, 2025): @CrazyWolf13 Thank you for your work. I have updated the readme with the new updated links
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/gitea-mirror#2
No description provided.