Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Gitea to v1.21.4 #5929

Merged
merged 16 commits into from
Jan 22, 2024
Prev Previous commit
Next Next commit
Try to use redesigned shared folder structure
wkobiela committed Nov 25, 2023
commit a5d34610b2b90c14c60815baf3cee1443d0d6283
15 changes: 6 additions & 9 deletions spk/gitea/Makefile
Original file line number Diff line number Diff line change
@@ -13,17 +13,14 @@ LICENSE = MIT
DEPENDS = cross/$(SPK_NAME)
SPK_DEPENDS = "git>=2"

SERVICE_USER = auto
SERVICE_SETUP = src/service-setup.sh
STARTABLE = yes
WIZARDS_DIR = src/wizard
SERVICE_WIZARD_SHARE = wizard_gitea_dir

# Use shared folder provided by DSM for DSM 6 too (not only for DSM 7).
USE_DATA_SHARE_WORKER = yes
SERVICE_USER = auto
SERVICE_SETUP = src/service-setup.sh
STARTABLE = yes
WIZARDS_DIR = src/wizard/
SERVICE_WIZARD_SHARENAME = wizard_shared_folder_name

SERVICE_PORT = 8418
SERVICE_PORT_TITLE = Gitea (HTTP)
SERVICE_PORT_TITLE = $(DISPLAY_NAME) (HTTP)
ADMIN_PORT = $(SERVICE_PORT)

include ../../mk/spksrc.spk.mk
4 changes: 2 additions & 2 deletions spk/gitea/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ SVC_BACKGROUND=y
service_preinst ()
{
if [ "${SYNOPKG_PKG_STATUS}" == "INSTALL" ] && [ $SYNOPKG_DSM_VERSION_MAJOR -lt 6 ]; then
SHARED_FOLDER="${wizard_volume}/${wizard_gitea_dir}"
SHARED_FOLDER="${wizard_shared_folder_name}"
if [ ! -d "${SHARED_FOLDER}" ]; then
mkdir -p "${SHARED_FOLDER}" || {
echo "Failed to create directory \"${SHARED_FOLDER}\"."
@@ -27,7 +27,7 @@ service_preinst ()
service_postinst ()
{
if [ "${SYNOPKG_PKG_STATUS}" == "INSTALL" ]; then
SHARED_FOLDER="${wizard_volume}/${wizard_gitea_dir}"
SHARED_FOLDER="${wizard_shared_folder_name}"
IP=$(ip route get 1 | awk '{print $(NF);exit}')
# Default configuration with shared folder
{
55 changes: 15 additions & 40 deletions spk/gitea/src/wizard/install_uifile
Original file line number Diff line number Diff line change
@@ -1,58 +1,33 @@
[
{
"step_title": "Basic configuration",
"step_title": "Gitea configuration",
"items": [
{
"type": "combobox",
"desc": "Please select a volume to use for the gitea folder",
"subitems": [
{
"key": "wizard_volume",
"desc": "volume name",
"displayField": "display_name",
"valueField": "volume_path",
"editable": false,
"mode": "remote",
"api_store": {
"api": "SYNO.Core.Storage.Volume",
"method": "list",
"version": 1,
"baseParams": {
"limit": -1,
"offset": 0,
"location": "internal"
},
"root": "volumes",
"idProperty": "volume_path",
"fields": [
"display_name",
"volume_path"
]
},
"validator": {
"fn": "{console.log(arguments);return true;}"
}
}
]
},
{
"type": "textfield",
"desc": "Repository shared folder name (using the volume chosen above)",
"desc": "Please specify a shared folder for this package. This share is created at installation when it does not already exist.",
"subitems": [
{
"key": "wizard_gitea_dir",
"desc": "Repository shared folder",
"defaultValue": "git",
"key": "wizard_shared_folder_name",
"desc": "Shared Folder",
"defaultValue": "gitea-share",
"validator": {
"allowBlank": false,
"regex": {
"expr": "/^[\\w _-]+$/",
"errorText": "Subdirectories are not supported."
"errorText": "Subdirectories are not supported."
}
}
}
]
}
}, {
"desc": ""
}, {
"desc": "If you let the installer create the shared folder, it is created under the same volume as the package is installed.<br/>If you want to use a different volume for the share, you must create the shared folder in DSM Control Panel before, and enter the name of the existing share in the field above."
}, {
"desc": ""
}, {
"desc": "This package runs as internal service user <b>'sc-gitea'</b> in DSM. The shared folder above is configured at installation time to be accessible by this user.<p>Please read <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details."
}
]
}
]