mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-12 02:24:21 -05:00
Gitea as a third party package for Synology NAS #2172
Closed
opened 2025-11-02 04:26:01 -06:00 by GiteaMirror
·
29 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.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-rc1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#2172
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @s-celles on GitHub (Aug 11, 2018).
Hello,
it will be great if Gitea could be added as a third party package for Synology NAS.
https://forum.synology.com/enu/viewtopic.php?f=190&t=144985&p=539591#p539591
Kind regards
@techknowlogick commented on GitHub (Aug 11, 2018):
This is a good idea, what is the process of creating a third party package, and also adding it to the synology app store?
@s-celles commented on GitHub (Aug 11, 2018):
It seems that @jboxberger have done https://github.com/jboxberger/synology-gitea-jboxberger
But it's not available from Synology app store
There's also
https://github.com/flipswitchingmonkey/gitea-spk from @flipswitchingmonkey
@stale[bot] commented on GitHub (Jan 14, 2019):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
@typeless commented on GitHub (Jan 25, 2019):
References:
https://gist.github.com/walkerjeffd/374750c366605cd5123d
https://forum.synology.com/enu/viewtopic.php?t=144985
https://github.com/jboxberger/synology-gitea-jboxberger
https://github.com/SynoCommunity/spksrc
@stale[bot] commented on GitHub (Mar 26, 2019):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
@lunny commented on GitHub (Mar 26, 2019):
So that could be closed?
@Libbum commented on GitHub (Mar 26, 2019):
I'd still like to see this happen.
@typeless commented on GitHub (Mar 28, 2019):
I have successfully deployed a Gitea server on a Synology DS1817+ at our department.
I used https://github.com/flipswitchingmonkey/gitea-spk to generate the SPK.
I think it's possible to integrate the SPK generation into the official Gitea release, not sure if that is desirable though. 😄
@BorisBrock commented on GitHub (Nov 13, 2019):
Bump! I would love to see an official gitea package in the Synology app store :-)
@s-celles commented on GitHub (Nov 13, 2019):
Do we know who should we ask (someone probably working at Syno) for such an integration?
@xuanswe commented on GitHub (Jan 26, 2020):
Instead of install gitea and all required services directly on Synology DSM, I suggest to install all inside docker. GitLab is doing a good job to provide synology package in synology package center (not just docker image gitlab-ce), that deploys gitlab and dependencies using docker.
The problem is that GitLab consumes too much CPU and RAM. If Gitea can do the same thing, I am sure I will switch to use Gitea on my Synology.
On my Synology DS918+, GitLab consumes nearly 2GB without doing anything. If there are active users, it will be worse. Recommended RAM is 4GB and that's stupid for home users with private projects.
@6543 commented on GitHub (Jan 26, 2020):
@nguyenxndaidev there already exist docker builds for gitea https://github.com/dockhippie/gitea for example
@xuanswe commented on GitHub (Jan 26, 2020):
I know that there is even official gitea/gitea image, but that requires multiple manual steps to configure gitea, database (ex. mariadb), cache (ex. redis), volumns, networks. While, for the same thing, GitLab publishes their official Synology package, so that I just need to click install and everything is ready to go.
@zeripath commented on GitHub (Jan 26, 2020):
Are you able to generate the appropriate dockerfile for this?
@techknowlogick commented on GitHub (Jan 26, 2020):
I run on my syno NAS using docker following the steps here: https://docs.gitea.io/en-us/install-with-docker/#postgresql-database
@jboxberger commented on GitHub (Jan 26, 2020):
Hello Guys,
i've done all this already for you. Fell free to use or copy. Works simply out of the box, same as the GitLab Package. I've also a modified official GitlabPackage with the "latest" GitLab version possible.
Gitea: https://github.com/jboxberger/synology-gitea-jboxberger/releases
GitLab: https://github.com/jboxberger/synology-gitlab/releases
@nguyenxndaidev : Yes 2GB is minimum 4GB or more is Recommended. You should also mention that the GitLab Redis Worker in the container do not allow the Synology to go to Sleep, if configured so.
Thats why i use Gitea. I don't need the power of GitLab at home so Gitea suites my needs.
Kind Regards
@xuanswe commented on GitHub (Jan 26, 2020):
I tried to install using the docker GUI provided by DSM following the official docs: https://docs.gitea.io/en-us/install-with-docker/#mysql-database
CPU/RAM usage is amazing:

Here is my steps:
@jboxberger commented on GitHub (Jan 26, 2020):
Yes this is great, you can also use the builtin SQLite database if you're not planing to use the installation with many users. I've used it long time with maria DB an now i am using it with SQLite and do not feel any performance differences at all.
With SQLite you do not need the additional conatiner and its depenecy for the DB because your DB is a flat File in the mounted Volume.
Just in case you want to make it even more slim.
@xuanswe commented on GitHub (Jan 26, 2020):
@jboxberger thanks for your advice to use SQLite. If you have a good exprience with SQLite, I think I will do so because I am the only user of my git server.
@abulka commented on GitHub (Jan 28, 2020):
Seems that these days (2020) there is a docker image for Gitea available to be selected via the Docker UI inside Synology - point and click installation! 👌✨
Simply open the official Docker UI app in Synology, click 'Registry' in the left side panel, then type 'gitea' in the search area to find the Gitea image:

Click 'download' or double click on the image, and it will be run as a container. Then you can switch to the 'Containers' tab of the Docker UI app and see your running container:

Double click on the running container to access more info and view logs etc. Note the local port settings are being displayed:

Visit Gitea using the address
YOUR-NAS-IP:32769e.g. http://192.168.888.999:32769 - or whatever 'local port' is displayed here e.g. for me it was 32769 but because the port is on auto, it will be different for you.Setup tips
During the setup (which is triggered when you add the first user), I changed the Gitea Base URL from
http://localhost:3000/ to
http://192.168.0.9:32769/
which is the address of my NAS and the port is the 'local port' as reported when you double click on the running container to see more info about it (or click the 'Details button'). I got this tip from #5209 (re the port) but I also changed the domain since I was getting problems with issue text previews and viewing issue images when gitea is accessed from other machines.
On the same setup screen, I also opened up the admin accordion and set up an admin user, as it can be a bit tricky to add an admin user later.
port is changing on every container restart
The port for Gitea was changing randomly every time I restarted the container e.g.
http://192.168.0.99:32769/
http://192.168.0.99:32778/
so I stopped the container and edited the container config to set a fixed port:

Remaining question - where is /data ?
Gitea is running well, the only thing I don't understand is where the repo data is being kept, and where the sqlite database physically is. Is
/data/giteais inside the container? Seems not, since when I restart the container my Gitea data is still OK (containers never persist anything - you have to map a real host volume to a container volume to achieve persistence in Docker's way of doing things). I can't see anything on my host NAS using Synology File Station - yes there is a Docker directory and a subdirectory for GitLab (which I also have installed), but nothing for Gitea?@jboxberger commented on GitHub (Jan 28, 2020):
It depends on your volume mapping
mine is mounted at /docker/gitea and on the Filesystem it is on at "/volume1/docker/gitea".
The Database is located at "/volume1/docker/gitea/gitea/gitea.db"
Have you tried to ssh into your nas and check the filesystem there? The FIle is owned by root so maybe its an permissions issue.
@jboxberger commented on GitHub (Jan 28, 2020):
I've checked my preinstall script an there i create the data folder before installation
https://github.com/jboxberger/synology-gitlab-jboxberger/blob/master/src/scripts/preinst
So maybe the mount fails because of the missing directory and the data stays within your container.
Try to stop the container and then create the directory
drwxr-xr-x 1 root root 36 Mar 3 2019 gitea
@abulka commented on GitHub (Jan 29, 2020):
Thanks @jboxberger - yeah it seems the external host directory
/docker/giteawasn't created for me, even though I also have GitLab installed and the/dockerdirectory on the host nas previously existed ok. As you say, perhaps creating/docker/giteamanually using Synology File Station is recommended before creating the Gitea container. Also, I am not sure if the volume mapping/docker/gitea/ -> /datais supposed to be automatically created, but that didn't exist for me either, and I had to create that mapping manually. Here are some of my notes I am sharing in case it helps others:Solution to the /data persistence issue
It seems that the Gitea container does in fact have persistence (despite containers not supposed to have persistence unless you map to volumes, not sure what is going on with this!) and the container
/datais created, persisted and populated with theapp.iniconfig file, sqlite3 database plus everything else Gitea needs and uses.Watch out - if the container gets deleted and recreated, all of this data will be lost, so its worth converting /data into a proper volume mapped to a real directory on the host synology nas, e.g. something in the Synology nas /docker directory (to follow the convention of putting docker related data in /docker/APPNAME) e.g.
/docker/gitea/data.To do the mapping simply go into the docker container UI and create the volume mapping

/docker/gitea/data -> /data(or as @jboxberger has it,/docker/gitea/ -> /data, its up to you what the host directory path actually is).Note that if you already have installed Gitea without the volume mapping, the existing /data inside the container will be overridden by this new external mount point (but don't worry, the original
/datainside the container won't actually be lost). If you want to keep your old config and db simply copy the container's existing /data files to the external host /docker/gitea/data before setting up the permanent volume mount (e.g. temporarily mount/docker/gitea/data -> /data_pendingthencp -R /data/* /data_pendingor something like that).Verify that your Gitea install is picking up the mapped volume config by editing
/docker/gitea/data/gitea/config/app.iniand changing something e.g. the Site Title as controlled by theAPP_NAMEentry, restart the container and visit e.g. http://192.168.0.99:32769/admin/config to view the Gitea configuration web page - and make sure the new Site Title is being displayed there.To edit app.ini on your NAS you will probably need to download the file to your machine via the Synology File Station, edit it, then re-upload it into the NAS file system
/docker/gitea/data/gitea/config/app.iniusing Synology File Station.Edit your app.ini domain entries correctly
Since you will be accessing Gitea from outside the Synology NAS, you also want to edit your
/data/gitea/conf/app.iniand set the domain entries to the ip of your nas e.g.do not leave them as the default
localhost.SSH port is changing on every container restart
There are two ports needed by Gitea, the main port and the ssh port. As I mentioned in an earlier post in this thread, I had to change the main Gitea UI port to a fixed local port so that it wouldn't change each time I restarted Gitea inside Synology Docker - which unfortunately has those ports set to 'auto' by default. Incidentally the Synology GitLab Docker installation process manages to lock those ports to specific values by default, so perhaps a future Gitea Docker install experience will do the same.
Anyway, so it turns out I need to allocate a fixed port to the SSH port too e.g. 32222 (you can change the ssh local port to any free port number you want, but keep it mapped to the same ssh container port 22).
You will also need to edit your
/data/gitea/conf/app.iniand setSSH_PORT = 32222After restarting Gitea, verify that the new SSH settings are in effect by looking at the clone url offered by Gitea for any repo in Gitea e.g.
ssh://git@192.168.0.99:32222/andy/test01.gitnotice the domain and port are correct. Thus nowgit clone ssh://git@192.168.0.99:32222/andy/test01.gitshould work and you won't be prompted with a password, as long as your SSH key is registered in Gitea. Note that the32222in the git url is areference to the NAS host local port which you have specified in both the docker port mappings and also in the Gitea
app.inifile.Environment Variables
I didn't have much luck changing any of the above values using docker environment variables via the Synology Docker UI. I had to actually edit the app.ini file.
@lunny commented on GitHub (Jan 29, 2020):
Good news. So I think we can close this one. And someone could write a blog or send a PR to add something on gitea docs.
@wkobiela commented on GitHub (May 22, 2020):
Sure its really good thing, that there is a package available in Docker. Is there any possibility to create a real third party package for Synology NAS - I mean - .spk that could be installed through PACKAGE CENTER. Not all devices are able to use Docker but in the meantime they are fully capable of running Gitea.
I know, there are third party package like https://github.com/flipswitchingmonkey/gitea-spk but its 3 years old now, and luck of any support. Sometimes it works, sometimes it doesn't.
@salesgroup commented on GitHub (Jun 12, 2020):
We really like gitea and synology.
We have a cron script to create gitea.spk and install it in every update.
So we have Gitea always updated.
You can see the script here:
https://gist.github.com/salesgroup/bacb5882250df8d843491efe2784b38c
Our synology model is: RS815+
We also have:
-a version with acme.sh to renew the SSL certificate.
-boot-up event to start gitea, with "synoservice --start pkgctl-Gitea"
@wkobiela commented on GitHub (Jun 12, 2020):
Thx, nice one! Actually, the only thing that should be changed is line 24 and 34, whitch depends on your synology CPU architecture. Do you have any problems with custom confugiration in app.ini in every update? What is being delated and should be replaced by hand after update?
@caifenglin commented on GitHub (Dec 6, 2021):
Can you provide a tutorial for synology to install gitea? I install gitea through synology's docker. I normally enter the setting page. After setting the parameters, I can't find the page. After restarting gitea, I'm still on the setting page. What should I do? The version is 1.15.7
@techknowlogick commented on GitHub (Apr 13, 2022):
https://synocommunity.com/package/gitea