Skip to content
Snippets Groups Projects
Commit acfa5b80 authored by tamaina's avatar tamaina
Browse files

✌️

parent 79d3106e
No related branches found
No related tags found
No related merge requests found
......@@ -363,8 +363,8 @@ tput setaf 7;
apt update -y;
apt install -y curl nano gnupg2 apt-transport-https ca-certificates lsb-release git build-essential software-properties-common ffmpeg uidmap$($nginx_local && echo " certbot")$($cloudflare && echo " python3-certbot-dns-cloudflare");
#region work with misskey user
if [ $method != "docker_hub" ]; then
#region work with misskey user
su "$misskey_user" << MKEOF
set -eu;
cd ~;
......@@ -380,9 +380,9 @@ if [ -e "./$misskey_directory" ]; then
fi
git clone -b "$branch" --depth 1 --recursive "$repository" "$misskey_directory";
MKEOF
#endregion
else
#region work with misskey user
su "$misskey_user" << MKEOF
set -eu;
cd ~;
......@@ -401,8 +401,13 @@ else
mkdir "./$misskey_directory/.config"
fi
MKEOF
#endregion
fi
tput setaf 3;
echo "Process: write default.yml;";
tput setaf 7;
#region work with misskey user
su "$misskey_user" << MKEOF
set -eu;
cd ~;
......@@ -611,6 +616,7 @@ tput setaf 7;
systemctl restart nginx;
systemctl enable nginx;
tput setaf 2;
echo "Check: localhost returns nginx;";
tput setaf 7;
......@@ -828,6 +834,7 @@ echo "Process: create .misskey-docker.env;"
tput setaf 7;
cat > ".misskey-docker.env" << _EOF
method="$method"
host="$host"
misskey_port=$misskey_port
misskey_directory="$misskey_directory"
......
......@@ -18,8 +18,46 @@
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
misskey_user=misskey
misskey_directory=misskey
tput setaf 2;
echo "Check: root user;";
if [ "$(whoami)" != 'root' ]; then
tput setaf 1;
echo " NG. This script must be run as root.";
exit 1;
else
tput setaf 7;
echo " OK. I am root user.";
fi
tput setaf 3;
echo "Process: import environment and detect method;";
tput setaf 7;
if [ -f "/root/.misskey.env" ]; then
. "/root/.misskey.env";
if [ -f "/home/$misskey_user/.misskey.env" ]; then
. "/home/$misskey_user/.misskey.env";
method=systemd;
elif [ -f "/home/$misskey_user/.misskey-docker.env" ]; then
. "/home/$misskey_user/.misskey-docker.env";
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 / $misskey_localhost:$misskey_port"
if [ $method == "systemd" ]; then
#region work with misskey user
su $misskey_user << MKEOF
......@@ -49,3 +87,9 @@ if [ $1 == "-r" ]; then
else
systemctl start misskey;
fi
elif [ $method == "docker" ]; then
echo "todo"
else
echo "todo"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment