Coder Social home page Coder Social logo

synology-gitea-jboxberger's Introduction

Gitea is a community managed fork of Gogs, lightweight code hosting solution written in Go and published under the MIT license.

Project Page: https://gitea.io Documentation: https://docs.gitea.io/en-us/ Download Gitea 1.11.1 SPK: here

Packages:

Supported Architectures

x86 avoton bromolow cedarview braswell kvmx64 broadwell apollolake Since i can't test all architectures i had to make a choice which i can cover or which i expect to work. If your architecture is not in this list, please feel free to contact me and we can give it a try.

You can check the architecture of your device here or here.

Version Enumeration

Gitea <Gitea-Version>-<Package-Version> (Gitea 1.4)
Gitea-Version:  as expected the GitLab version
Package-Version: version of the application around GitLab, install backup an other scripts

Build instructions

################################################################################################################
# Make shure docker is already installed and runnig
# All in One Package: The docker image is in the .spk. This leads to a much bigger .spk file but on the other
#                     hand you avoid all possible issues during docker pull and this package could be installed
#                     offline. Harder to build but gives a more stable update process.
# On Demand Package : (not recommended) Docker image is not in the .spk file an will be pulled during spk
#                     installation. The benefit here is a smaller package size and easy to build .spk - May
#                     cause problems during installtaion when the docker image pull not working properly or
#                     connection breaks down. This may cause a half installed Package which should be cleaned
#                     up and backup properly to be able to re-install.
################################################################################################################

# All in One Package
----------------------------------------------------------------------------------------------------------------
# 1) export the needed docker image version
bash tools/save-docker-image.sh --image="gitea/gitea:1.9.5" --target-dir=./docker

# 2) Execute all steps from 'On Demand Package'. The build script will automatically detect the exported image
#    in the docker directory and include it in the .spk

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# On Demand Package (docker image will be pulled during spk installation)
----------------------------------------------------------------------------------------------------------------
# 1) add an new line (or modify existing) in the rebuild-all.sh with the desired version
# the value of '45' is just the expected container size in MB for Synology installer progressbar.
versions["1.9.5"]="45"; orders+=( "1.9.5" )

# 2) execute the rebuild-all.sh script (required packages will be installed automatically)
bash rebuild-all.sh

# you will find the new .spk in the folder build/<version>/

Enable / Disable SSL

After setup (install package and setup gitea) you can enable or disable self-signed-ssl connection

# enable
sudo ./var/packages/synology-gitea-jboxberger/scripts/gitea-ssl enable
# disable
sudo ./var/packages/synology-gitea-jboxberger/scripts/gitea-ssl disable

Use MySQL/MariaDB instead of SQLite3

By default you can use SQLite3, this is a fast and reliable one file database solution. If your Gitea serves a couple of developers this should be more than sufficient but if you run your environment for more than 10 developers then you might have better performance with MySQL/MariaDB.

1. Install the official MairaDB10 Package from Synology repository and set the root password.
2. Create databse schema and user for gitea. If you're not familliar with mysql cli then you
   can install phpmyadmin from official synology repository.

   CREATE DATABASE `gitea` DEFAULT CHARACTER SET `utf8mb4` COLLATE `utf8mb4_general_ci`;
   CREATE USER `gitea`@'%' IDENTIFIED BY '<mypassword>';
   GRANT ALL PRIVILEGES ON `gitea`.* TO `gitea`@`%`;

   CREATE USER `gitea`@'localhost' IDENTIFIED BY '<mypassword>';
   GRANT ALL PRIVILEGES ON `gitea`.* TO `gitea`@`localhost`;

3. Now you can selecte MariaDB during the Gitea setup and the rest of the schema will be created automatically
   during the Gitea setup.
4. Don't forget to backup your database regulary, this schema will not be backuped in the included backup script.

Bash into your Gitea container

sudo docker exec -it synology_gitea bash

Backup

# create backup directory
sudo mkdir -p /volume1/docker/gitea/backups
sudo chown 1000:1000 /volume1/docker/gitea/backups

# create backup
sudo /usr/local/bin/docker exec -it -u git synology_gitea bash -c "cd /data/backups && gitea dump -c /data/gitea/conf/app.ini && chmod -R 777 /data/backups/*"

Restore

sudo docker exec -it synology_gitea bash
cd /data/backups
rm -rf gitea-dump && mkdir gitea-dump && unzip gitea-dump-1568411897.zip -d gitea-dump/ && cd gitea-dump/
rm -rf /data/gitea/* && mv data/* /data/gitea

rm -rf gitea-repo && mkdir gitea-repo && unzip gitea-repo.zip -d gitea-repo/
rm -rf /data/git/repositories && mv gitea-repo/* /data/git/

# restore MYSQL (not required if use Sqlite3)
mysql -u$USER -p$PASS $DATABASE <gitea-db.sql

# if needed restore from .sql file (Sqlite3)
rm /data/gitea/gitea.db && sqlite3 /data/gitea/gitea.db <gitea-db.sql

# set permissions
chown -R git:git /data/gitea /data/git/repositories

# cleanup
cd .. && rm -rf gitea-dump/
exit

# restart gitea container
sudo /var/packages/synology-gitea-jboxberger/scripts/start-stop-status stop
sudo /var/packages/synology-gitea-jboxberger/scripts/start-stop-status start

SPK Changelog

xx.x.x-0101
- removed custom backup scripts, added backup procedure from https://docs.gitea.io/en-us/backup-and-restore

synology-gitea-jboxberger's People

Contributors

jboxberger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

synology-gitea-jboxberger's Issues

Support geminilake please

Hi,

Since new version of DS720+, DS420+... released and they are using GeminiLake. Could you please help to support this type ?

Many thanks,
Miller Nguyen

How to enable SSL on Synology?

Hey,
first of all: Thanks for the great package!

I have a question about setting up SSL. The readme explains that SSL can be enabled using
sudo./var/packages/synology-gitea-jboxberger/scripts/gitea-ssl enable.
Unfortunately I can't execute sudo via SSH (I get a "command not found" despite the latest DSM version and root). What do I have to do to set up SSL and deposit a certificate?
Thank you in advance.

Build Instruction

Could you include some build instructions if you get a chance? Would be nice to be able to build this myself to upgrade to newer versions sooner. Thanks!

How to enable autostart of gitea on synology

Hi there,
first of all thanks for the great work. Gitea runs flawlessly on our Synology, except for the autostart. When I reboot the synology, gitea isn't showing up automatically. Is there a possibility to config synology/gitea so it starts automatically after reboot?

Thanks in advance,
@aljole

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.