Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bash-install
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
witchy
bash-install
Commits
530513d4
Commit
530513d4
authored
3 years ago
by
tamaina
Browse files
Options
Downloads
Patches
Plain Diff
Revert "make docker use host net"
This reverts commit
1f37b52c
.
parent
1f37b52c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ubuntu.sh
+52
-9
52 additions, 9 deletions
ubuntu.sh
update.ubuntu.sh
+4
-2
4 additions, 2 deletions
update.ubuntu.sh
with
56 additions
and
11 deletions
ubuntu.sh
+
52
−
9
View file @
530513d4
...
...
@@ -97,6 +97,14 @@ case "$yn" in
*
)
echo
"Use Docker."
;
method
=
docker
;
echo
"Determine the local IP of this computer as docker host."
;
echo
"The IPs that are supposed to be available are as follows (the result of hostname -I)"
;
echo
"
$(
hostname
-I
)
"
read
-r
-p
"> "
-e
-i
"
$(
hostname
-I
|
cut
-f1
-d
' '
)
"
docker_host_ip
;
echo
"The host name of docker host to bind with 'docker run --add-host='."
;
read
-r
-p
"> "
-e
-i
"docker_host"
misskey_localhost
;
;;
esac
#endregion
...
...
@@ -240,15 +248,15 @@ case "$yn" in
db_local
=
false
;
echo
"Database host: "
;
read
-r
-p
"> "
-e
-i
"localhost"
db_host
;
read
-r
-p
"> "
-e
-i
"
$misskey_
localhost
"
db_host
;
echo
"Database port:"
;
read
-r
-p
"> "
-e
-i
"5432"
db_port
;
;;
*
)
echo
"PostgreSQL will be installed on this computer at localhost:5432."
;
echo
"PostgreSQL will be installed on this computer at
$misskey_
localhost
:5432."
;
db_local
=
true
;
db_host
=
localhost
;
db_host
=
$misskey_
localhost
;
db_port
=
5432
;
;;
esac
...
...
@@ -275,15 +283,15 @@ case "$yn" in
redis_local
=
false
;
echo
"Redis host:"
;
read
-r
-p
"> "
-e
-i
"localhost"
redis_host
;
read
-r
-p
"> "
-e
-i
"
$misskey_
localhost
"
redis_host
;
echo
"Redis port:"
;
read
-r
-p
"> "
-e
-i
"6379"
redis_port
;
;;
*
)
echo
"Redis will be installed on this computer at localhost:6379."
;
echo
"Redis will be installed on this computer at
$misskey_
localhost
:6379."
;
redis_local
=
true
;
redis_host
=
localhost
;
redis_host
=
$misskey_
localhost
;
redis_port
=
6379
;
;;
esac
...
...
@@ -298,7 +306,7 @@ echo "";
echo
"Syslog setting"
;
tput setaf 7
;
echo
"Syslog host: "
;
read
-r
-p
"> "
-e
-i
"localhost"
syslog_host
;
read
-r
-p
"> "
-e
-i
"
$misskey_
localhost
"
syslog_host
;
echo
"Syslog port: "
;
read
-r
-p
"> "
-e
-i
"514"
syslog_port
;
#endregion
...
...
@@ -660,6 +668,36 @@ if [ $method != "systemd" ]; then
docker ps;
MKEOF
#endregion
#region modify postgres confs
if
$db_local
;
then
tput setaf 3
;
echo
"Process: modify postgres confs;"
tput setaf 7
;
pg_hba
=
$(
sudo
-u
postgres psql
-t
-P
format
=
unaligned
-c
'show hba_file'
)
pg_conf
=
$(
sudo
-u
postgres psql
-t
-P
format
=
unaligned
-c
'show config_file'
)
[[
$(
ip addr |
grep
"
$docker_host_ip
"
)
=
~ /
([
0-9]+
)
]]
&&
subnet
=
${
BASH_REMATCH
[1]
}
;
hba_text
=
"host
$db_name
$db_user
$docker_host_ip
/
$subnet
md5"
if
!
grep
"
$hba_text
"
"
$pg_hba
"
;
then
echo
"
$hba_text
"
>>
"
$pg_hba
"
;
fi
pgconf_search
=
"#listen_addresses = 'localhost'"
pgconf_text
=
"listen_addresses = '
$docker_host_ip
'"
if
grep
"
$pgconf_search
"
"
$pg_conf
"
;
then
sed
-i
'.mkmoded'
-e
"s/
$pgconf_search
/
$pgconf_text
/g"
"
$pg_conf
"
;
elif
grep
"
$pgconf_text
"
"
$pg_conf
"
;
then
echo
" skip"
else
echo
"Please edit postgresql.conf to set [listen_addresses = '
$docker_host_ip
'] by your hand."
read
-r
-p
"Enter the editor command and press Enter key > "
-e
-i
"nano"
editorcmd
$editorcmd
"
$pg_conf
"
;
fi
systemctl restart postgresql
;
fi
#endregion
fi
#endregion
...
...
@@ -670,6 +708,7 @@ if $redis_local; then
tput setaf 7
;
if
[
-f
/etc/redis/redis.conf
]
;
then
echo
"requirepass
$redis_pass
"
>
/etc/redis/misskey.conf
$method
!=
"systemd"
&&
echo
"bind
$docker_host_ip
"
>>
/etc/redis/misskey.conf
if
!
grep
"include /etc/redis/misskey.conf"
/etc/redis/redis.conf
;
then
echo
"include /etc/redis/misskey.conf"
>>
/etc/redis/redis.conf
;
...
...
@@ -680,7 +719,8 @@ if $redis_local; then
echo
"Couldn't find /etc/redis/redis.conf."
echo
"Please modify redis config in another shell like following."
echo
""
echo
"requirepass
$redis_pass
"
$method
!=
"systemd"
&&
echo
"requirepass
$redis_pass
"
echo
"bind
$docker_host_ip
"
echo
""
read
-r
-p
"Press Enter key to continue> "
fi
...
...
@@ -783,7 +823,7 @@ echo ""
tput setaf 3
;
echo
"Process: docker run;"
tput setaf 7
;
docker_container
=
$(
sudo
-u
"
$misskey_user
"
XDG_RUNTIME_DIR
=
/run/user/
$m_uid
DOCKER_HOST
=
unix:///run/user/
$m_uid
/docker.sock docker run
-d
-p
$misskey_port
:
$misskey_port
--
net
host
-v
/home/
$misskey_user
/
$misskey_directory
/files:/misskey/files
-v
"/home/
$misskey_user
/
$misskey_directory
/.config/default.yml"
:/misskey/.config/default.yml:ro
--restart
unless-stopped
-t
"
$docker_repository
"
)
;
docker_container
=
$(
sudo
-u
"
$misskey_user
"
XDG_RUNTIME_DIR
=
/run/user/
$m_uid
DOCKER_HOST
=
unix:///run/user/
$m_uid
/docker.sock docker run
-d
-p
$misskey_port
:
$misskey_port
--
add-host
=
$misskey_localhost
:
$docker_
host
_ip
-v
/home/
$misskey_user
/
$misskey_directory
/files:/misskey/files
-v
"/home/
$misskey_user
/
$misskey_directory
/.config/default.yml"
:/misskey/.config/default.yml:ro
--restart
unless-stopped
-t
"
$docker_repository
"
)
;
echo
$docker_container
su
"
$misskey_user
"
<<
MKEOF
set -eu;
...
...
@@ -798,6 +838,8 @@ method="$method"
host="
$host
"
misskey_port=
$misskey_port
misskey_directory="
$misskey_directory
"
misskey_localhost="
$misskey_localhost
"
docker_host_ip=
$docker_host_ip
docker_repository="
$docker_repository
"
docker_container="
$docker_container
"
version="
$version
"
...
...
@@ -820,6 +862,7 @@ cat > ".misskey.env" << _EOF
host="
$host
"
misskey_port=
$misskey_port
misskey_directory="
$misskey_directory
"
misskey_localhost="
$misskey_localhost
"
version="
$version
"
_EOF
MKEOF
...
...
This diff is collapsed.
Click to expand it.
update.ubuntu.sh
+
4
−
2
View file @
530513d4
...
...
@@ -44,17 +44,19 @@ if [ -f "/root/.misskey.env" ]; then
else
misskey_user
=
misskey
;
misskey_directory
=
misskey
;
misskey_localhost
=
localhost
;
method
=
systemd
;
echo
"use default"
fi
else
misskey_user
=
misskey
;
misskey_directory
=
misskey
;
misskey_localhost
=
localhost
;
method
=
systemd
;
echo
"use default"
fi
echo
"method:
$method
/ user:
$misskey_user
/ dir:
$misskey_directory
/ localhost:
$misskey_port
"
echo
"method:
$method
/ user:
$misskey_user
/ dir:
$misskey_directory
/
$misskey_
localhost
:
$misskey_port
"
if
[
$method
==
"systemd"
]
;
then
#region systemd
...
...
@@ -105,6 +107,6 @@ else
fi
docker_container
=
$(
sudo
-u
"
$misskey_user
"
XDG_RUNTIME_DIR
=
/run/user/
$m_uid
DOCKER_HOST
=
unix:///run/user/
$m_uid
/docker.sock docker run
-d
-p
$misskey_port
:
$misskey_port
--
net
host
-v
/home/
$misskey_user
/
$misskey_directory
/files:/misskey/files
-v
"/home/
$misskey_user
/
$misskey_directory
/.config/default.yml"
:/misskey/.config/default.yml:ro
--restart
unless-stopped
-t
"
$docker_repository
"
)
;
docker_container
=
$(
sudo
-u
"
$misskey_user
"
XDG_RUNTIME_DIR
=
/run/user/
$m_uid
DOCKER_HOST
=
unix:///run/user/
$m_uid
/docker.sock docker run
-d
-p
$misskey_port
:
$misskey_port
--
add-host
=
$misskey_localhost
:
$docker_
host
_ip
-v
/home/
$misskey_user
/
$misskey_directory
/files:/misskey/files
-v
"/home/
$misskey_user
/
$misskey_directory
/.config/default.yml"
:/misskey/.config/default.yml:ro
--restart
unless-stopped
-t
"
$docker_repository
"
)
;
sudo
docker image
rm local
/misskey:latest
fi
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