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
This is a good idea, what is the process of creating a third party package, and also adding it to the synology app store?
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
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.
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.
So that could be closed?
I'd still like to see this happen.
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. 😄
Bump! I would love to see an official gitea package in the Synology app store :-)
Do we know who should we ask (someone probably working at Syno) for such an integration?
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.
@nguyenxndaidev there already exist docker builds for gitea https://github.com/dockhippie/gitea for example
@nguyenxndaidev there already exist docker builds for gitea https://github.com/dockhippie/gitea for example
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.
Are you able to generate the appropriate dockerfile for this?
I run on my syno NAS using docker following the steps here: https://docs.gitea.io/en-us/install-with-docker/#postgresql-database
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
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:
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.
@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.
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:32769
e.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.
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.
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:
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/gitea
is 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?
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.
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
Thanks @jboxberger - yeah it seems the external host directory /docker/gitea
wasn't created for me, even though I also have GitLab installed and the /docker
directory on the host nas previously existed ok. As you say, perhaps creating /docker/gitea
manually using Synology File Station is recommended before creating the Gitea container. Also, I am not sure if the volume mapping /docker/gitea/ -> /data
is 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:
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 /data
is created, persisted and populated with the app.ini
config 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 /data
inside 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_pending
then cp -R /data/* /data_pending
or something like that).
Verify that your Gitea install is picking up the mapped volume config by editing /docker/gitea/data/gitea/config/app.ini
and changing something e.g. the Site Title as controlled by the APP_NAME
entry, 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.ini
using Synology File Station.
Since you will be accessing Gitea from outside the Synology NAS, you also want to edit your /data/gitea/conf/app.ini
and set the domain entries to the ip of your nas e.g.
SSH_DOMAIN = 192.168.0.99
DOMAIN = 192.168.0.99
ROOT_URL = http://192.168.0.99:32769/
do not leave them as the default localhost
.
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.ini
and set SSH_PORT = 32222
After 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://[email protected]:32222/andy/test01.git
notice the domain and port are correct. Thus now
git clone ssh://[email protected]:32222/andy/test01.git
should work and you won't be prompted with a password, as long as your SSH key is registered in Gitea. Note that the 32222
in the git url is a
reference to the NAS host _local port_ which you have specified in both the docker port mappings and also in the Gitea app.ini
file.
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.
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.
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.
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"
https://gist.github.com/salesgroup/bacb5882250df8d843491efe2784b38c
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?
Most helpful comment
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. 😄