Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
0x4A6F
FFS Gluon
Commits
6ae067cb
Unverified
Commit
6ae067cb
authored
Jan 20, 2018
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
gluon-core: add domain aliases and pretty name
Based-on-patch-by:
lemoer
<
git@irrelefant.net
>
parent
2ef0af5f
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
package/gluon-core/check_site.lua
+6
-0
6 additions, 0 deletions
package/gluon-core/check_site.lua
package/gluon-site/Makefile
+6
-0
6 additions, 0 deletions
package/gluon-site/Makefile
scripts/domain_aliases.lua
+13
-0
13 additions, 0 deletions
scripts/domain_aliases.lua
with
25 additions
and
0 deletions
package/gluon-core/check_site.lua
+
6
−
0
View file @
6ae067cb
...
...
@@ -13,6 +13,12 @@ if this_domain() then
end
,
nil
,
'be a valid domain name'
)
end
need_domain_name
(
in_site
({
'default_domain'
}))
need_table
(
in_domain
({
'domain_names'
}),
function
(
domain
)
need_alphanumeric_key
(
domain
)
need_string
(
domain
)
end
)
need_string
(
in_domain
({
'domain_names'
,
this_domain
()}))
end
need_string_match
(
in_domain
({
'domain_seed'
}),
'^'
..
(
'%x'
):
rep
(
64
)
..
'$'
)
...
...
This diff is collapsed.
Click to expand it.
package/gluon-site/Makefile
+
6
−
0
View file @
6ae067cb
...
...
@@ -53,9 +53,15 @@ define Build/Compile
$(
call
GenerateJSON,site
)
ifdef
CONFIG_GLUON_MULTIDOMAIN
rm
-rf
$(PKG_BUILD_DIR)/domains
mkdir
-p
$(PKG_BUILD_DIR)/domains
$(
foreach
domain,
$(
patsubst
$(
GLUON_SITEDIR
)
/domains/%.conf,%,
$(
wildcard
$(
GLUON_SITEDIR
)
/domains/
*
.conf
))
,
[
!
-e
'
$(
PKG_BUILD_DIR
)
/domains/
$(
domain
)
.json'
]
$(
call GenerateJSON,domains/
$(
domain
))
lua ../../scripts/domain_aliases.lua
'
$(
PKG_BUILD_DIR
)
/domains/
$(
domain
)
.json'
|
while
read alias
;
do
\
[
"
$$
$${
alias
}
"
!=
'
$(
domain
)
'
]
||
continue
;
\
ln
-s
'
$(
domain
)
.json'
$(
PKG_BUILD_DIR
)
/domains/
$$
$${
alias
}
.json
||
exit
1
;
\
done
)
endif
...
...
This diff is collapsed.
Click to expand it.
scripts/domain_aliases.lua
0 → 100644
+
13
−
0
View file @
6ae067cb
local
cjson
=
require
'cjson'
local
function
load_json
(
filename
)
local
f
=
assert
(
io.open
(
filename
))
local
json
=
cjson
.
decode
(
f
:
read
(
'*a'
))
f
:
close
()
return
json
end
local
domain
=
load_json
(
arg
[
1
])
for
k
,
_
in
pairs
(
domain
.
domain_names
)
do
print
(
k
)
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment