mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-08 00:39:16 +00:00
Compare commits
No commits in common. "b8a16376d48d10a731a438b3b58c745acfe36fd9" and "4c99c917bb8ca19990a0dd05bb67ed14bdeb3a0e" have entirely different histories.
b8a16376d4
...
4c99c917bb
@ -57,9 +57,8 @@ header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -d /opt/outline ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||
RELEASE_TAG=$(curl -s https://api.github.com/repos/outline/outline/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
RELEASE=${RELEASE_TAG#v}
|
||||
if [[ "${RELEASE}" != "$(cat /opt/Outline_version.txt)" ]] || [[ ! -f /opt/Outline_version.txt ]]; then
|
||||
RELEASE=$(curl -s https://api.github.com/repos/outline/outline/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||
msg_info "Stopping ${APP}"
|
||||
systemctl stop outline
|
||||
msg_ok "Stopped ${APP}"
|
||||
@ -68,17 +67,20 @@ if [[ "${RELEASE}" != "$(cat /opt/Outline_version.txt)" ]] || [[ ! -f /opt/Outli
|
||||
cd /opt
|
||||
cp /opt/outline/.env /opt/.env
|
||||
mv /opt/outline /opt/outline_bak
|
||||
wget -q "https://github.com/outline/outline/archive/refs/tags/${RELEASE_TAG}.zip"
|
||||
unzip -q ${RELEASE_TAG}.zip
|
||||
mv outline-${RELEASE} /opt/outline
|
||||
wget -q "https://github.com/outline/outline/archive/refs/tags/${RELEASE}.zip"
|
||||
unzip -q ${RELEASE}.zip
|
||||
mv outline-${RELEASE:1} /opt/outline
|
||||
cd /opt/outline
|
||||
|
||||
yarn install --no-optional --frozen-lockfile &>/dev/null
|
||||
yarn cache clean &>/dev/null
|
||||
## Build in development mode
|
||||
unset NODE_ENV
|
||||
yarn install --no-optional --frozen-lockfile &>/dev/null &&
|
||||
yarn cache clean &>/dev/null &&
|
||||
yarn build &>/dev/null
|
||||
|
||||
## Continue in production mode
|
||||
rm -rf ./node_modules
|
||||
yarn install --production=true --frozen-lockfile &>/dev/null
|
||||
yarn install --production=true--frozen-lockfile &>/dev/null &&
|
||||
yarn cache clean &>/dev/null
|
||||
|
||||
mv /opt/.env /opt/outline/.env
|
||||
@ -89,9 +91,8 @@ if [[ "${RELEASE}" != "$(cat /opt/Outline_version.txt)" ]] || [[ ! -f /opt/Outli
|
||||
msg_info "Starting ${APP}"
|
||||
systemctl start outline
|
||||
msg_ok "Started ${APP}"
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -rf /opt/${RELEASE_TAG}.zip
|
||||
rm -rf /opt/${RELEASE}.zip
|
||||
rm -rf /opt/outline_bak
|
||||
msg_ok "Cleaned"
|
||||
msg_ok "Updated Successfully"
|
||||
|
@ -5,6 +5,9 @@
|
||||
# License: MIT
|
||||
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
|
||||
read -r -p "Enter the public url for your Outline instance (e.g., https://outline.your-domain.tld)): " URL
|
||||
read -r -p "Would you like to add Adminer? <y/N> " adminer_prompt
|
||||
|
||||
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
@ -16,7 +19,6 @@ update_os
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
sudo \
|
||||
mc \
|
||||
curl \
|
||||
lsb-release \
|
||||
postgresql \
|
||||
@ -25,9 +27,10 @@ $STD apt-get install -y \
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Setting up Node.js Repository"
|
||||
NODE_MAJOR=20
|
||||
mkdir -p /etc/apt/keyrings
|
||||
wget -qO- https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
|
||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
|
||||
msg_ok "Set up Node.js Repository"
|
||||
|
||||
msg_info "Setting up Redis Repository"
|
||||
@ -58,74 +61,74 @@ $STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PAS
|
||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER WITH CREATEDB;"
|
||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';"
|
||||
|
||||
cat <<EOF >~/outline.creds
|
||||
Outline-Credentials
|
||||
Outline Database User: $DB_USER
|
||||
Outline Database Password: $DB_PASS
|
||||
Outline Database Name: $DB_NAME
|
||||
Outline Secret: $SECRET_KEY
|
||||
Outline Utils Secret: $UTILS_SECRET
|
||||
EOF
|
||||
{
|
||||
echo "Outline-Credentials"
|
||||
echo "Outline Database User: $DB_USER"
|
||||
echo "Outline Database Password: $DB_PASS"
|
||||
echo "Outline Database Name: $DB_NAME"
|
||||
echo "Outline Secret: $SECRET_KEY"
|
||||
echo "Outline Utils Secret: $UTILS_SECRET"
|
||||
} >> ~/outline.creds
|
||||
msg_ok "Set up PostgreSQL DB"
|
||||
|
||||
|
||||
read -r -p "Would you like to add Adminer? <y/N> " adminer_prompt
|
||||
if [[ "${adminer_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Installing Adminer"
|
||||
$STD apt install -y adminer
|
||||
$STD a2enconf adminer
|
||||
systemctl reload apache2
|
||||
IP=$(hostname -I | awk '{print $1}')
|
||||
cat <<EOF >>~/outline.creds
|
||||
|
||||
Adminer Interface: $IP/adminer/
|
||||
Adminer System: PostgreSQL
|
||||
Adminer Server: localhost:5432
|
||||
Adminer Username: $DB_USER
|
||||
Adminer Password: $DB_PASS
|
||||
Adminer Database: $DB_NAME
|
||||
EOF
|
||||
{
|
||||
echo ""
|
||||
echo "Adminer Interface: $IP/adminer/"
|
||||
echo "Adminer System: PostgreSQL"
|
||||
echo "Adminer Server: localhost:5432"
|
||||
echo "Adminer Username: $DB_USER"
|
||||
echo "Adminer Password: $DB_PASS"
|
||||
echo "Adminer Database: $DB_NAME"
|
||||
} >> ~/outline.creds
|
||||
msg_ok "Installed Adminer"
|
||||
fi
|
||||
|
||||
read -r -p "Enter the public url for your Outline instance (e.g., https://outline.your-domain.tld)): " URL
|
||||
msg_info "Installing Outline (Patience)"
|
||||
msg_info "Installing $APPLICATION (Patience)"
|
||||
cd /opt
|
||||
RELEASE_TAG=$(curl -s https://api.github.com/repos/outline/outline/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
RELEASE=${RELEASE_TAG#v}
|
||||
wget -q "https://github.com/outline/outline/archive/refs/tags/${RELEASE_TAG}.zip"
|
||||
unzip -q ${RELEASE_TAG}.zip
|
||||
mv outline-${RELEASE} /opt/outline
|
||||
RELEASE=$(curl -s https://api.github.com/repos/outline/outline/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
wget -q "https://github.com/outline/outline/archive/refs/tags/${RELEASE}.zip"
|
||||
unzip -q ${RELEASE}.zip
|
||||
mv outline-${RELEASE:1} /opt/outline
|
||||
cd /opt/outline
|
||||
|
||||
## First build in development
|
||||
$STD yarn install --no-optional --frozen-lockfile
|
||||
$STD yarn cache clean
|
||||
$STD yarn build
|
||||
|
||||
## Continue in production
|
||||
rm -rf ./node_modules
|
||||
$STD yarn install --production=true --frozen-lockfile
|
||||
$STD yarn install --production=true--frozen-lockfile
|
||||
$STD yarn cache clean
|
||||
|
||||
FILE_STORAGE_LOCAL_ROOT_DIR=/var/lib/outline/data
|
||||
mkdir -p $FILE_STORAGE_LOCAL_ROOT_DIR
|
||||
|
||||
cat <<EOF >/opt/outline/.env
|
||||
NODE_ENV=production
|
||||
SECRET_KEY=$SECRET_KEY
|
||||
UTILS_SECRET=$UTILS_SECRET
|
||||
DATABASE_URL=$DATABASE_URL
|
||||
REDIS_URL=redis://localhost:6379
|
||||
URL=$URL
|
||||
FILE_STORAGE=local
|
||||
FILE_STORAGE_LOCAL_ROOT_DIR=$FILE_STORAGE_LOCAL_ROOT_DIR
|
||||
FILE_STORAGE_UPLOAD_MAX_SIZE=262144000
|
||||
WEB_CONCURRENCY=2
|
||||
EOF
|
||||
{
|
||||
echo NODE_ENV=production
|
||||
echo SECRET_KEY=$SECRET_KEY
|
||||
echo UTILS_SECRET=$UTILS_SECRET
|
||||
echo DATABASE_URL=$DATABASE_URL
|
||||
echo REDIS_URL=redis://localhost:6379
|
||||
echo URL=$URL
|
||||
echo FILE_STORAGE=local
|
||||
echo FILE_STORAGE_LOCAL_ROOT_DIR=$FILE_STORAGE_LOCAL_ROOT_DIR
|
||||
echo FILE_STORAGE_UPLOAD_MAX_SIZE=262144000
|
||||
echo WEB_CONCURRENCY=2
|
||||
} > /opt/outline/.env
|
||||
|
||||
$STD yarn sequelize db:create
|
||||
$STD yarn sequelize db:migrate
|
||||
|
||||
echo "${RELEASE}" >/opt/Outline_version.txt
|
||||
msg_ok "Installed Outline"
|
||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
||||
msg_ok "Installed $APPLICATION"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/outline.service
|
||||
@ -148,7 +151,7 @@ motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm /opt/${RELEASE_TAG}.zip
|
||||
rm -rf /opt/${RELEASE}.zip
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
||||
|
Loading…
Reference in New Issue
Block a user