Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
4421c643
Commit
4421c643
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Interactive config for static blog
parent
5cc27774
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-app-pelican
+70
-6
70 additions, 6 deletions
src/freedombone-app-pelican
with
70 additions
and
6 deletions
src/freedombone-app-pelican
+
70
−
6
View file @
4421c643
...
...
@@ -33,20 +33,84 @@ VARIANTS=''
IN_DEFAULT_INSTALL
=
0
SHOW_ON_ABOUT
=
0
PELICAN_BLOG_DOMAIN
=
PELICAN_BLOG_CODE
=
STATIC_BLOG_INSTALL_DIR
=
/etc/staticblog
PELICAN_THEMES_REPO
=
"https://github.com/getpelican/pelican-themes"
PELICAN_PLUGINS_REPO
=
"https://github.com/getpelican/pelican-plugins"
DEFAULT_BLOG_TITLE
=
$"Freedombone Blog"
pelican_variables
=(
MY_USERNAME
STATIC_BLOG_DOMAIN
)
ONION_ONLY
PELICAN_BLOG_DOMAIN
PELICAN_BLOG_CODE
)
function
configure_interactive_pelican
{
echo
-n
''
}
function
install_interactive_pelican
{
echo
-n
''
if
[
!
$ONION_ONLY
]
;
then
ONION_ONLY
=
'no'
fi
if
[[
$ONION_ONLY
!=
"no"
]]
;
then
PELICAN_BLOG_DOMAIN
=
'pelican.local'
else
PELICAN_DETAILS_COMPLETE
=
while
[
!
$PELICAN_DETAILS_COMPLETE
]
do
data
=
$(
tempfile 2>/dev/null
)
trap
"rm -f
$data
"
0 1 2 5 15
if
[[
$DDNS_PROVIDER
==
"default@freedns.afraid.org"
]]
;
then
dialog
--backtitle
$"Freedombone Configuration"
\
--title
$"Pelican Blog Configuration"
\
--form
$"
\n
Please enter your blog details.
\n\n
IMPORTANT: This should be a domain name which is supported by Let's Encrypt:"
14 65 2
\
$"Domain:"
1 1
"
$(
grep
'PELICAN_BLOG_DOMAIN'
temp.cfg |
awk
-F
'='
'{print $2}'
)
"
1 25 33 40
\
$"Code:"
2 1
"
$(
grep
'PELICAN_BLOG_CODE'
temp.cfg |
awk
-F
'='
'{print $2}'
)
"
2 25 33 255
\
2>
$data
else
dialog
--backtitle
$"Freedombone Configuration"
\
--title
$"Pelican Blog Configuration"
\
--form
$"
\n
Please enter your GNU Social details. The background image URL can be left blank.
\n\n
IMPORTANT: This should be a domain name which is supported by Let's Encrypt:"
14 65 2
\
$"Domain:"
1 1
"
$(
grep
'PELICAN_BLOG_DOMAIN'
temp.cfg |
awk
-F
'='
'{print $2}'
)
"
1 25 33 40
\
2>
$data
fi
sel
=
$?
case
$sel
in
1
)
exit
1
;;
255
)
exit
1
;;
esac
PELICAN_BLOG_DOMAIN
=
$(
cat
$data
|
sed
-n
1p
)
if
[
$PELICAN_BLOG_DOMAIN
]
;
then
if
[[
$PELICAN_BLOG_DOMAIN
==
"
$HUBZILLA_DOMAIN_NAME
"
]]
;
then
PELICAN_BLOG_DOMAIN
=
""
fi
TEST_DOMAIN_NAME
=
$PELICAN_BLOG_DOMAIN
validate_domain_name
if
[[
$TEST_DOMAIN_NAME
!=
$PELICAN_BLOG_DOMAIN
]]
;
then
PELICAN_BLOG_DOMAIN
=
dialog
--title
$"Domain name validation"
--msgbox
"
$TEST_DOMAIN_NAME
"
15 50
else
if
[[
$DDNS_PROVIDER
==
"default@freedns.afraid.org"
]]
;
then
PELICAN_BLOG_CODE
=
$(
cat
$data
|
sed
-n
2p
)
validate_freedns_code
"
$PELICAN_BLOG_CODE
"
if
[
!
$VALID_CODE
]
;
then
PELICAN_BLOG_DOMAIN
=
fi
fi
fi
fi
if
[
$PELICAN_BLOG_DOMAIN
]
;
then
PELICAN_DETAILS_COMPLETE
=
"yes"
fi
done
# save the results in the config file
write_config_param
"PELICAN_BLOG_CODE"
"
$PELICAN_BLOG_CODE
"
fi
write_config_param
"PELICAN_BLOG_DOMAIN"
"
$PELICAN_BLOG_DOMAIN
"
APP_INSTALLED
=
1
}
...
...
@@ -75,11 +139,11 @@ function restore_remote_pelican {
}
function
remove_pelican
{
if
[
-d
/var/www/
$
STATIC
_BLOG_DOMAIN
/htdocs
]
;
then
rm
-rf
/var/www/
$
STATIC
_BLOG_DOMAIN
/htdocs
if
[
-d
/var/www/
$
PELICAN
_BLOG_DOMAIN
/htdocs
]
;
then
rm
-rf
/var/www/
$
PELICAN
_BLOG_DOMAIN
/htdocs
fi
pip uninstall pelican
remove_certs
$
STATIC
_BLOG_DOMAIN
remove_certs
$
PELICAN
_BLOG_DOMAIN
}
function
create_pelican_conf
{
...
...
@@ -319,7 +383,7 @@ function install_pelican {
pip
install
pelican
STATIC_BLOG_INSTALL_DIR
=
/etc/blog
STATIC_BLOG_PATH
=
/var/www/
$
STATIC
_BLOG_DOMAIN
/htdocs
STATIC_BLOG_PATH
=
/var/www/
$
PELICAN
_BLOG_DOMAIN
/htdocs
if
[
!
-d
$STATIC_BLOG_INSTALL_DIR
]
;
then
mkdir
-p
$STATIC_BLOG_INSTALL_DIR
...
...
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
register
or
sign in
to comment