Enable build support by adding .onedev-buildspec.yml
README.md
dev.lutov.net
dev.lutov.net - config for onedev server
Copyright (C) 2022 Vladimir Liutov <vs@lutov.net>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Requirements
For actual installation you need:
- podman
- systemctl
- nginx (optional)
- rsyncd (optional for backup)
- msmtp (optional for backup messages)
Installation
# Install and run services
./install.sh
# Install configs for nginx
cp *.conf /etc/nginx/sites-available/
ln -s /etc/nginx/sites-available/dev.lutov.local.conf /etc/nginx/sites-enabled
systemctl restart nginx
# Optional: Install semodule package for runners
checkmodule -M -m -o onedev-runners.mod onedev-runners.te
semodule_package -o onedev-runners.pp -m onedev-runners.mod
sudo semodule -X 300 -i onedev-runners.pp
# Optional: Configure rsync for backups
cat rsync.conf >>/etc/rsync.conf
cat rsync.scrt >>/etc/rsync.scrt
systemctl enable --now rsyncd
# And add backup task on backup server (copy .env to backup server)
./install_backup.sh
Upgrade
Upgrade onedev version or postgres minor version:
- Upgrade version in
.env
systemctl --user stop pod-dev.lutov.net
./install.sh
Upgrade postgres major version:
- Upgrade version in .env
OLD_POST_MAJOR=<WRITE HERE VERSION>
systemctl --user stop pod-dev.lutov.net
source .env
POSTGRES_MAJOR=$(cut -d. -f1 - <<<"${POSTGRES_VERSION}")
podman run -d \
--name "${POD_NAME}-postgres" \
-v "${POD_NAME}-postgres${POSTGRES_MAJOR}:/var/lib/postgresql/data" \
-e POSTGRES_USER=onedev \
-e POSTGRES_PASSWORD="${POSTGRES_PASSWORD}" \
-e POSTGRES_DB=onedev \
"docker.io/postgres:${POSTGRES_VERSION}"
podman exec -it "${POD_NAME}-postgres" psql -U onedev -d postgres <<<"DROP DATABASE onedev;"
podman rm -f "${POD_NAME}-postgres"
podman run -it --name "${POD_NAME}-postgres" -v "dev.lutov.net-postgres:/var/lib/postgresql/${OLD_POST_MAJOR}/data" -v "dev.lutov.net-postgres${POSTGRES_MAJOR}:/var/lib/postgresql/${POSTGRES_MAJOR}/data" "tianon/postgres-upgrade:${OLD_POST_MAJOR}-to-${POSTGRES_MAJOR}" -U onedev
podman rm "${POD_NAME}-postgres"
./install.sh