Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compose.libre.sh
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Timothee Gosselin
compose.libre.sh
Commits
ee272903
Commit
ee272903
authored
9 years ago
by
Pierre Ozoux
Browse files
Options
Downloads
Patches
Plain Diff
With applications \o/
parent
291c72af
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utils/provision.sh
+22
-0
22 additions, 0 deletions
utils/provision.sh
with
22 additions
and
0 deletions
utils/provision.sh
+
22
−
0
View file @
ee272903
...
@@ -29,6 +29,8 @@ LOG_LEVEL="${LOG_LEVEL:-6}" # 7 = debug -> 0 = emergency
...
@@ -29,6 +29,8 @@ LOG_LEVEL="${LOG_LEVEL:-6}" # 7 = debug -> 0 = emergency
read
-r
-d
''
usage
<<-
'
EOF
'
read
-r
-d
''
usage
<<-
'
EOF
'
-u [arg] URL to process. Required.
-u [arg] URL to process. Required.
-f [arg] Certificate file to use.
-f [arg] Certificate file to use.
-a [arg] Application to install. (in the form github.com/indiehosters/wordress)
-s Start the application right away.
-g Generates the necessary certificate.
-g Generates the necessary certificate.
-p Paste certificate from previous run.
-p Paste certificate from previous run.
-b Buys the associated domain name.
-b Buys the associated domain name.
...
@@ -41,6 +43,7 @@ EOF
...
@@ -41,6 +43,7 @@ EOF
### Functions
### Functions
#####################################################################
#####################################################################
source
/etc/environment
source
/data/indiehosters/utils/helpers.sh
source
/data/indiehosters/utils/helpers.sh
source
/data/indiehosters/utils/configure_dkim_dns.sh
source
/data/indiehosters/utils/configure_dkim_dns.sh
...
@@ -122,6 +125,7 @@ function provision_certificate () {
...
@@ -122,6 +125,7 @@ function provision_certificate () {
cp
-Ra
$(
dirname
${
arg_f
}
)
${
TLS_FOLDER
}
cp
-Ra
$(
dirname
${
arg_f
}
)
${
TLS_FOLDER
}
cd
${
TLS_FOLDER
}
cd
${
TLS_FOLDER
}
mv
*
.pem
${
arg_u
}
.pem
mv
*
.pem
${
arg_u
}
.pem
/data/indiehosters/utils/append_crt_list.sh
${
arg_u
}
}
}
function
generate_certificate
()
{
function
generate_certificate
()
{
...
@@ -158,6 +162,22 @@ function paste_certificate () {
...
@@ -158,6 +162,22 @@ function paste_certificate () {
/data/indiehosters/utils/append_crt_list.sh
${
arg_u
}
/data/indiehosters/utils/append_crt_list.sh
${
arg_u
}
}
}
function
application
()
{
export
MAIL_PASS
=
`
tr
-dc
A-Za-z0-9_ < /dev/urandom |
head
-c
20 | xargs
`
export
MAIL_USER
=
"noreply.
${
arg_u
}
@
${
MAIL_DOMAIN
}
"
export
URL
=
${
arg_u
}
/data/indiehosters/utils/add_mailbox.sh
${
MAIL_USER
}
${
MAIL_PASS
}
git clone https://
${
arg_a
}
.git /data/domains/
${
arg_u
}
cd
/data/domains/
${
arg_u
}
./install
}
function
start
()
{
systemctl start u@
${
arg_u
}
systemctl
enable
u@
${
arg_u
}
}
### Parse commandline options
### Parse commandline options
#####################################################################
#####################################################################
...
@@ -247,10 +267,12 @@ FOLDER=/data/domains/${arg_u}
...
@@ -247,10 +267,12 @@ FOLDER=/data/domains/${arg_u}
TLS_FOLDER
=
${
FOLDER
}
/TLS
TLS_FOLDER
=
${
FOLDER
}
/TLS
[
${
arg_b
}
-eq
1
]
&&
buy_domain_name
[
${
arg_b
}
-eq
1
]
&&
buy_domain_name
[
!
-z
"
${
arg_a
}
"
]
&&
application
[
${
arg_g
}
-eq
1
]
&&
generate_certificate
[
${
arg_g
}
-eq
1
]
&&
generate_certificate
[
${
arg_p
}
-eq
1
]
&&
paste_certificate
[
${
arg_p
}
-eq
1
]
&&
paste_certificate
[
!
-z
"
${
arg_f
}
"
]
&&
provision_certificate
[
!
-z
"
${
arg_f
}
"
]
&&
provision_certificate
[
${
arg_i
}
-eq
1
]
&&
provision_dkim
[
${
arg_i
}
-eq
1
]
&&
provision_dkim
[
${
arg_c
}
-eq
1
]
&&
configure_dns
[
${
arg_c
}
-eq
1
]
&&
configure_dns
[
${
arg_s
}
-eq
1
]
&&
start
exit
0
exit
0
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