Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gitlab
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
certo
gitlab
Commits
f3fec295
Commit
f3fec295
authored
May 01, 2022
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added CWMP configuration of GitLab
parent
a94bfe08
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1513 additions
and
1 deletion
+1513
-1
Makefile
Makefile
+27
-1
gitlab
gitlab
+86
-0
gitlab-init
gitlab-init
+1400
-0
No files found.
Makefile
View file @
f3fec295
all
:
database-config resque-yml nginx-conf logrotate-conf
all
:
database-config resque-yml nginx-conf logrotate-conf
gitlab-service-override gitlab-config
rm
/etc/passwd
mv
-v
/data/etc/passwd /etc/passwd
rm
/etc/group
...
...
@@ -115,6 +115,11 @@ all: database-config resque-yml nginx-conf logrotate-conf
sed
-e
"s/YOUR_SERVER_FQDN/_/"
-i
/etc/nginx/gitlab.conf
install
-v
-m755
/srv/gitlab/lib/support/init.d/gitlab
/etc/init.d/gitlab
sed
-e
"s/redis-server/redis/"
-i
/etc/init.d/gitlab
install
-v
-m755
-d
/lib/systemd/system/gitlab.service.d
install
-v
-Dm755
gitlab-init
/usr/sbin/gitlab-init
@echo
"$$GITLAB_SERVICE_OVERRIDE"
>
/lib/systemd/system/gitlab.service.d/override.conf
@echo
"$$GITLAB_CONFIG"
>
/etc/config/gitlab
install
-v
-Dm755
gitlab
/usr/share/easycwmp/functions/gitlab
install
-v
-m644
/srv/gitlab/lib/support/init.d/gitlab.default.example
/etc/default/gitlab
sed
-e
"s/\/home\/\(\$$app_user\|git\)/\/srv/"
-i
/etc/default/gitlab
sed
-e
"s/\$$app_root\/tmp\/pids/\/run\/gitlab/"
-i
/etc/default/gitlab
...
...
@@ -146,6 +151,8 @@ all: database-config resque-yml nginx-conf logrotate-conf
mv
-v
/srv/gitlab/builds
/var/lib/gitlab/builds
ln
-sv
/var/lib/gitlab/builds
/srv/gitlab/builds
mv
-v
/srv/gitlab/config/gitlab.yml
/var/lib/gitlab/config/gitlab.yml
ln
-sv
/var/lib/gitlab/config/gitlab.yml
/srv/gitlab/config/gitlab.yml
mv
-v
/srv/gitlab/config/secrets.yml
/var/lib/gitlab/config/secrets.yml
ln
-sv
/var/lib/gitlab/config/secrets.yml
/srv/gitlab/config/secrets.yml
rm
-rf
/srv/gitlab/log
...
...
@@ -215,3 +222,22 @@ define LOGROTATE_CONF
}
endef
export
LOGROTATE_CONF
gitlab-service-override
:
define
GITLAB_SERVICE_OVERRIDE
[Service]
TimeoutSec
=
300
ExecStartPre
=
/usr/sbin/gitlab-init
endef
export
GITLAB_SERVICE_OVERRIDE
gitlab-config
:
define
GITLAB_CONFIG
config
gitlab
'settings'
option
host
''
option
ssh_host
''
option
email_from
''
option
email_reply_to
''
endef
export
GITLAB_CONFIG
gitlab
0 → 100755
View file @
f3fec295
#!/bin/sh
#common_execute_method_param "$parameter" "$permission" "$get_cmd" "$set_cmd" "xsd:$type" "$forcedinform"
# $forcedinform should be set to 1 if the parameter is included in the inform message otherwise empty
# Default of $type = string
#############################
# Entry point functuons #
#############################
prefix_list
=
"
$prefix_list
$DMROOT
.GitLab."
entry_execute_method_list
=
"
$entry_execute_method_list
entry_execute_method_root_GitLab"
entry_execute_method_list_forcedinform
=
"
$entry_execute_method_list_forcedinform
entry_execute_method_root_GitLab"
entry_execute_method_root_GitLab
()
{
case
"
$1
"
in
""
|
"
$DMROOT
."
|
"
$DMROOT
.GitLab."
*
)
common_execute_method_obj
"
$DMROOT
.GitLab."
"0"
common_execute_method_param
"
$DMROOT
.GitLab.Host"
"1"
"gitlab_get_host"
"gitlab_set_host"
common_execute_method_param
"
$DMROOT
.GitLab.SSHHost"
"1"
"gitlab_get_ssh_host"
"gitlab_set_ssh_host"
common_execute_method_param
"
$DMROOT
.GitLab.EmailFrom"
"1"
"gitlab_get_email_from"
"gitlab_set_email_from"
common_execute_method_param
"
$DMROOT
.GitLab.EmailReplyTo"
"1"
"gitlab_get_email_reply_to"
"gitlab_set_email_reply_to"
return
0
;
;;
esac
return
$E_INVALID_PARAMETER_NAME
;
}
#######################################
# Data model parameters functions #
#######################################
gitlab_get_host
()
{
echo
`
$UCI_GET
gitlab.settings.host
`
}
gitlab_set_host
()
{
local
url
=
`
$UCI_GET
gitlab.settings.host
`
if
[
"
$url
"
!=
"
$1
"
]
;
then
$UCI_SET
gitlab.settings.host
=
"
$1
"
$UCI_COMMIT
systemctl stop gitlab
systemctl start gitlab
fi
}
gitlab_get_ssh_host
()
{
echo
`
$UCI_GET
gitlab.settings.ssh_host
`
}
gitlab_set_ssh_host
()
{
local
url
=
`
$UCI_GET
gitlab.settings.ssh_host
`
if
[
"
$url
"
!=
"
$1
"
]
;
then
$UCI_SET
gitlab.settings.ssh_host
=
"
$1
"
$UCI_COMMIT
systemctl stop gitlab
systemctl start gitlab
fi
}
gitlab_get_email_from
()
{
echo
`
$UCI_GET
gitlab.settings.email_from
`
}
gitlab_set_email_from
()
{
local
address
=
`
$UCI_GET
gitlab.settings.email_from
`
if
[
"
$address
"
!=
"
$1
"
]
;
then
$UCI_SET
gitlab.settings.email_from
=
"
$1
"
$UCI_COMMIT
systemctl stop gitlab
systemctl start gitlab
fi
}
gitlab_get_email_reply_to
()
{
echo
`
$UCI_GET
gitlab.settings.email_reply_to
`
}
gitlab_set_email_reply_to
()
{
local
address
=
`
$UCI_GET
gitlab.settings.email_reply_to
`
if
[
"
$address
"
!=
"
$1
"
]
;
then
$UCI_SET
gitlab.settings.email_reply_to
=
"
$1
"
$UCI_COMMIT
systemctl stop gitlab
systemctl start gitlab
fi
}
gitlab-init
0 → 100755
View file @
f3fec295
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment