Compare commits
	
		
			2 commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 34cdc771d2 | |||
| b007620e8d | 
					 38 changed files with 171 additions and 896 deletions
				
			
		| 
						 | 
					@ -4,7 +4,7 @@ name: image building
 | 
				
			||||||
 | 
					
 | 
				
			||||||
steps:
 | 
					steps:
 | 
				
			||||||
- name: build&push squashed image
 | 
					- name: build&push squashed image
 | 
				
			||||||
  image: harbor.hq.rosti.cz/library/builder:39
 | 
					  image: harbor.hq.rosti.cz/library/builder:38
 | 
				
			||||||
  environment:
 | 
					  environment:
 | 
				
			||||||
    username: robot$rosti+rosti
 | 
					    username: robot$rosti+rosti
 | 
				
			||||||
    password: 
 | 
					    password: 
 | 
				
			||||||
| 
						 | 
					@ -29,7 +29,7 @@ name: test image
 | 
				
			||||||
 | 
					
 | 
				
			||||||
steps:
 | 
					steps:
 | 
				
			||||||
- name: test build
 | 
					- name: test build
 | 
				
			||||||
  image: harbor.hq.rosti.cz/library/builder:39
 | 
					  image: harbor.hq.rosti.cz/library/builder:38
 | 
				
			||||||
  environment:
 | 
					  environment:
 | 
				
			||||||
    username: robot$rosti+rosti
 | 
					    username: robot$rosti+rosti
 | 
				
			||||||
    password: 
 | 
					    password: 
 | 
				
			||||||
							
								
								
									
										31
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										31
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
								
							| 
						 | 
					@ -1,31 +0,0 @@
 | 
				
			||||||
name: Release into production
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
on:
 | 
					 | 
				
			||||||
  release:
 | 
					 | 
				
			||||||
    types: [published]
 | 
					 | 
				
			||||||
  workflow_dispatch:
 | 
					 | 
				
			||||||
    inputs:
 | 
					 | 
				
			||||||
      version:
 | 
					 | 
				
			||||||
        description: 'Version to release'
 | 
					 | 
				
			||||||
        required: true
 | 
					 | 
				
			||||||
        default: 'latest'
 | 
					 | 
				
			||||||
        type: string
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
jobs:
 | 
					 | 
				
			||||||
  build:
 | 
					 | 
				
			||||||
    runs-on: [dev, amd64]
 | 
					 | 
				
			||||||
    steps:
 | 
					 | 
				
			||||||
      - uses: actions/checkout@v4
 | 
					 | 
				
			||||||
      - name: Get git tag
 | 
					 | 
				
			||||||
        id: get_tag
 | 
					 | 
				
			||||||
        if: github.event_name == 'release'
 | 
					 | 
				
			||||||
        run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
 | 
					 | 
				
			||||||
      - name: Set version from input
 | 
					 | 
				
			||||||
        if: github.event_name == 'workflow_dispatch'
 | 
					 | 
				
			||||||
        run: echo "TAG_NAME=${{ github.event.inputs.version }}" >> $GITHUB_ENV
 | 
					 | 
				
			||||||
      - name: Registry login
 | 
					 | 
				
			||||||
        run: echo -n "${{ secrets.HARBOR_REPO_PASSWORD }}" | docker login harbor.rosti.cz -u "${{ secrets.HARBOR_REPO_USERNAME }}" --password-stdin
 | 
					 | 
				
			||||||
      - name: Final build
 | 
					 | 
				
			||||||
        run: task squashed REPO=harbor.rosti.cz/rosti-public/runtime VERSION=${{ env.TAG_NAME }}
 | 
					 | 
				
			||||||
      - name: Push
 | 
					 | 
				
			||||||
        run: task push REPO=harbor.rosti.cz/rosti-public/runtime VERSION=${{ env.TAG_NAME }}
 | 
					 | 
				
			||||||
							
								
								
									
										25
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										25
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							| 
						 | 
					@ -1,25 +0,0 @@
 | 
				
			||||||
name: Test build
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
on:
 | 
					 | 
				
			||||||
  push:
 | 
					 | 
				
			||||||
    branches: [ main ]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
jobs:
 | 
					 | 
				
			||||||
  build:
 | 
					 | 
				
			||||||
    runs-on: [dev, amd64]
 | 
					 | 
				
			||||||
    steps:
 | 
					 | 
				
			||||||
      - uses: actions/checkout@v4
 | 
					 | 
				
			||||||
      - name: docker login
 | 
					 | 
				
			||||||
        run: |
 | 
					 | 
				
			||||||
          docker login gitea.ceperka.net -u "${{ secrets.REPO_USERNAME }}" -p "${{ secrets.REPO_PASSWORD }}"
 | 
					 | 
				
			||||||
      - name: Build
 | 
					 | 
				
			||||||
        run: task build REPO=gitea.ceperka.net/rosti/runtime VERSION=pipeline
 | 
					 | 
				
			||||||
      - name: Test
 | 
					 | 
				
			||||||
        run: task test REPO=gitea.ceperka.net/rosti/runtime VERSION=pipeline
 | 
					 | 
				
			||||||
      - name: Push
 | 
					 | 
				
			||||||
        run: task push REPO=gitea.ceperka.net/rosti/runtime VERSION=pipeline
 | 
					 | 
				
			||||||
      - name: Cleaning step
 | 
					 | 
				
			||||||
        if: always()
 | 
					 | 
				
			||||||
        run: docker stop dev_test || exit 0
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
							
								
								
									
										14
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,14 @@
 | 
				
			||||||
 | 
					name: Image testing
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					on: 
 | 
				
			||||||
 | 
					- push
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  tests:
 | 
				
			||||||
 | 
					   runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					   steps:
 | 
				
			||||||
 | 
					   - uses: actions/checkout@v1
 | 
				
			||||||
 | 
					   - name: testing
 | 
				
			||||||
 | 
					     run: |
 | 
				
			||||||
 | 
					       make build
 | 
				
			||||||
 | 
					       make test
 | 
				
			||||||
							
								
								
									
										99
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										99
									
								
								Dockerfile
									
									
									
									
									
								
							| 
						 | 
					@ -1,12 +1,12 @@
 | 
				
			||||||
FROM debian:bookworm
 | 
					FROM debian:bullseye
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RUN DEBIAN_FRONTEND=noninteractive apt-get update
 | 
					RUN DEBIAN_FRONTEND=noninteractive apt-get update
 | 
				
			||||||
RUN DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
 | 
					RUN DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
 | 
				
			||||||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget gpg
 | 
					RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget gpg
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RUN echo "deb http://deb.debian.org/debian/ bookworm main contrib non-free" > /etc/apt/sources.list && \
 | 
					RUN echo "deb http://deb.debian.org/debian/ bullseye main contrib non-free" > /etc/apt/sources.list && \
 | 
				
			||||||
    echo "deb http://security.debian.org/debian-security bookworm-security main" >> /etc/apt/sources.list && \
 | 
					    echo "deb http://security.debian.org/debian-security bullseye-security main" >> /etc/apt/sources.list && \
 | 
				
			||||||
    echo "deb http://deb.debian.org/debian/ bookworm-updates main contrib non-free" >> /etc/apt/sources.list
 | 
					    echo "deb http://deb.debian.org/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales libffi-dev \
 | 
					RUN DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales libffi-dev \
 | 
				
			||||||
libssl-dev default-libmysqlclient-dev ca-certificates libpq-dev libjpeg62 libjpeg-dev \
 | 
					libssl-dev default-libmysqlclient-dev ca-certificates libpq-dev libjpeg62 libjpeg-dev \
 | 
				
			||||||
| 
						 | 
					@ -14,20 +14,14 @@ libpng-dev libpng-dev build-essential git mercurial build-essential \
 | 
				
			||||||
libbz2-dev libsqlite3-dev libreadline-dev zlib1g-dev libncurses5-dev \
 | 
					libbz2-dev libsqlite3-dev libreadline-dev zlib1g-dev libncurses5-dev \
 | 
				
			||||||
libgdbm-dev libgd-dev cron git subversion vim nano mc htop procps \
 | 
					libgdbm-dev libgd-dev cron git subversion vim nano mc htop procps \
 | 
				
			||||||
dropbear gettext wget redis-server memcached supervisor curl ssh \
 | 
					dropbear gettext wget redis-server memcached supervisor curl ssh \
 | 
				
			||||||
mariadb-client postgresql-client-15 postgresql-15-postgis-3-scripts bind9-host dnsutils nginx nginx-extras libnginx-mod-http-image-filter \
 | 
					mariadb-client postgresql-client-13 postgresql-13-postgis-3-scripts bind9-host dnsutils nginx nginx-extras libnginx-mod-http-image-filter \
 | 
				
			||||||
libxml2-dev libxslt1-dev openssh-sftp-server links2 lynx \
 | 
					libxml2-dev libxslt1-dev openssh-sftp-server links2 lynx \
 | 
				
			||||||
imagemagick libmagick++-6.q16-dev libmagick++-6.q16hdri-dev libmagickwand-dev ncdu libsodium-dev \
 | 
					imagemagick libmagick++-6.q16-dev libmagick++-6.q16hdri-dev libmagickwand-dev ncdu libsodium-dev \
 | 
				
			||||||
python3 python3-pip python3-virtualenv \
 | 
					python3 python3-pip python3-virtualenv \
 | 
				
			||||||
libcurl4-openssl-dev python3-dev libproj-dev gdal-bin libmemcached-dev swig mutt \
 | 
					libcurl4-openssl-dev python-dev libproj-dev gdal-bin libmemcached-dev swig mutt \
 | 
				
			||||||
ffmpeg libyaml-dev libc-client2007e-dev libonig-dev libkrb5-dev dialog \
 | 
					ffmpeg libyaml-dev libc-client2007e-dev libonig-dev libkrb5-dev dialog \
 | 
				
			||||||
whiptail tmux rsync nmap libzip-dev libfreetype6-dev \
 | 
					whiptail tmux rsync nmap libzip-dev libfreetype6-dev \
 | 
				
			||||||
jpegoptim optipng pngquant gifsicle webp libvpx-dev libwebp-dev jq inotify-tools ripgrep \
 | 
					jpegoptim optipng pngquant gifsicle webp libvpx-dev libwebp-dev jq inotify-tools ripgrep
 | 
				
			||||||
wkhtmltopdf libzbar0 fzf cmake \
 | 
					 | 
				
			||||||
gnupg2 unixodbc-dev apt-transport-https libgssapi-krb5-2 # for MS SQL Server extension
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# This is stange thing in Debian 12, it blocks installation of chromium
 | 
					 | 
				
			||||||
RUN DEBIAN_FRONTEND=noninteractive apt-get remove -y luit
 | 
					 | 
				
			||||||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y chromium
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
WORKDIR /srv
 | 
					WORKDIR /srv
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,82 +42,43 @@ ENV TERM       xterm
 | 
				
			||||||
#############
 | 
					#############
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Node.js
 | 
					## Node.js
 | 
				
			||||||
# From https://nodejs.org/en/about/previous-releases
 | 
					 | 
				
			||||||
WORKDIR /usr/src
 | 
					WORKDIR /usr/src
 | 
				
			||||||
ADD build_node.sh /usr/local/bin/build_node.sh
 | 
					ADD build_node.sh /usr/local/bin/build_node.sh
 | 
				
			||||||
RUN build_node.sh 20.19.5
 | 
					# 2023/08
 | 
				
			||||||
RUN build_node.sh 22.19.0
 | 
					RUN build_node.sh 16.20.2
 | 
				
			||||||
RUN build_node.sh 23.11.1
 | 
					RUN build_node.sh 17.9.1
 | 
				
			||||||
RUN build_node.sh 24.7.0
 | 
					RUN build_node.sh 19.9.0
 | 
				
			||||||
 | 
					RUN build_node.sh 18.17.1
 | 
				
			||||||
 | 
					RUN build_node.sh 20.6.1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Python
 | 
					## Python
 | 
				
			||||||
# https://www.python.org/downloads/
 | 
					 | 
				
			||||||
WORKDIR /usr/src
 | 
					WORKDIR /usr/src
 | 
				
			||||||
ADD build_python.sh /usr/local/bin/build_python.sh
 | 
					ADD build_python.sh /usr/local/bin/build_python.sh
 | 
				
			||||||
RUN build_python.sh 3.12.11
 | 
					# 2023/08
 | 
				
			||||||
RUN build_python.sh 3.13.7
 | 
					RUN build_python.sh 3.11.5
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## PHP 7
 | 
				
			||||||
 | 
					ADD build_php.sh /usr/local/bin/build_php.sh
 | 
				
			||||||
 | 
					RUN build_php.sh 7.4.33
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## PHP 8
 | 
					## PHP 8
 | 
				
			||||||
# https://www.php.net/supported-versions.php
 | 
					 | 
				
			||||||
ADD build_php8.sh /usr/local/bin/build_php8.sh
 | 
					ADD build_php8.sh /usr/local/bin/build_php8.sh
 | 
				
			||||||
RUN build_php8.sh 8.3.25
 | 
					# 2023/08
 | 
				
			||||||
RUN build_php8.sh 8.4.12
 | 
					RUN build_php8.sh 8.2.9
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Ruby
 | 
					## Ruby
 | 
				
			||||||
# https://www.ruby-lang.org/en/downloads/releases/
 | 
					 | 
				
			||||||
WORKDIR /usr/src
 | 
					WORKDIR /usr/src
 | 
				
			||||||
ADD build_ruby.sh /usr/local/bin/build_ruby.sh
 | 
					ADD build_ruby.sh /usr/local/bin/build_ruby.sh
 | 
				
			||||||
RUN build_ruby.sh 3.3.9
 | 
					# 2023/08
 | 
				
			||||||
RUN build_ruby.sh 3.4.5
 | 
					RUN build_ruby.sh 3.2.2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Deno
 | 
					## Deno
 | 
				
			||||||
# From: https://github.com/denoland/deno/releases
 | 
					 | 
				
			||||||
ADD build_deno.sh /usr/local/bin/build_deno.sh
 | 
					ADD build_deno.sh /usr/local/bin/build_deno.sh
 | 
				
			||||||
# TODO: deno cannot run in parallel because it downloads filenames with the same name
 | 
					# 2023/08
 | 
				
			||||||
RUN build_deno.sh 2.4.5
 | 
					RUN build_deno.sh 1.36.4
 | 
				
			||||||
 | 
					 | 
				
			||||||
# Bun
 | 
					 | 
				
			||||||
# From here: https://bun.sh/
 | 
					 | 
				
			||||||
ADD build_bun.sh /usr/local/bin/build_bun.sh
 | 
					 | 
				
			||||||
RUN build_bun.sh 1.2.21
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# OpenJDK
 | 
					 | 
				
			||||||
# From here: https://jdk.java.net/
 | 
					 | 
				
			||||||
ADD build_openjdk.sh /usr/local/bin/build_openjdk.sh
 | 
					 | 
				
			||||||
RUN build_openjdk.sh 24.0.2 fdc5d0102fe0414db21410ad5834341f 12
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Golang
 | 
					 | 
				
			||||||
# From here: https://go.dev/dl/
 | 
					 | 
				
			||||||
ADD build_golang.sh /usr/local/bin/build_golang.sh
 | 
					 | 
				
			||||||
RUN build_golang.sh 1.25.1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#############
 | 
					#############
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# WKHTMLTOX This is not in development anymore so we will remove it with next version of Debian
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
WORKDIR /usr/src
 | 
					 | 
				
			||||||
RUN apt install -f xfonts-75dpi && \
 | 
					 | 
				
			||||||
      wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb && \
 | 
					 | 
				
			||||||
      dpkg -i wkhtmltox_0.12.6.1-3.bookworm_amd64.deb && \
 | 
					 | 
				
			||||||
      rm wkhtmltox_0.12.6.1-3.bookworm_amd64.deb
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#############
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# ODBC driver
 | 
					 | 
				
			||||||
# Updates: https://packages.microsoft.com/debian/12/prod/pool/main/m/msodbcsql18/
 | 
					 | 
				
			||||||
RUN export DEBIAN_FRONTEND=noninteractive && export ACCEPT_EULA=Y && \
 | 
					 | 
				
			||||||
      wget https://packages.microsoft.com/debian/12/prod/pool/main/m/msodbcsql18/msodbcsql18_18.5.1.1-1_amd64.deb && \
 | 
					 | 
				
			||||||
      dpkg -i msodbcsql18_18.5.1.1-1_amd64.deb; \
 | 
					 | 
				
			||||||
      apt install -f -y && \
 | 
					 | 
				
			||||||
      rm msodbcsql18_18.5.1.1-1_amd64.deb
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#############
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Up to date PostgreSQL
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql-common && /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y && DEBIAN_FRONTEND=noninteractive apt-get install postgresql -y
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Support tools and miscellaneous stuff
 | 
					## Support tools and miscellaneous stuff
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RUN rm -f /etc/cron.d/* /etc/cron.daily/* /etc/cron.hourly/* /etc/cron.monthly/* /etc/cron.weekly/*
 | 
					RUN rm -f /etc/cron.d/* /etc/cron.daily/* /etc/cron.hourly/* /etc/cron.monthly/* /etc/cron.weekly/*
 | 
				
			||||||
| 
						 | 
					@ -161,10 +116,6 @@ ADD ./rosti.tmpl.sh /usr/src/
 | 
				
			||||||
ADD ./Dockerfile /usr/src/
 | 
					ADD ./Dockerfile /usr/src/
 | 
				
			||||||
RUN cd /usr/src && /usr/local/bin/gen_rosti.fish > /usr/local/bin/rosti && chmod 755 /usr/local/bin/rosti
 | 
					RUN cd /usr/src && /usr/local/bin/gen_rosti.fish > /usr/local/bin/rosti && chmod 755 /usr/local/bin/rosti
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Rosti tooling
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ADD ./activate_tech.fish /usr/local/bin/activate_tech
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Cleaning
 | 
					## Cleaning
 | 
				
			||||||
RUN apt-get clean && rm -rf /usr/src/*
 | 
					RUN apt-get clean && rm -rf /usr/src/*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										4
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Makefile
									
									
									
									
									
								
							| 
						 | 
					@ -1,8 +1,8 @@
 | 
				
			||||||
# TODO: Unnecessary, remo this file
 | 
					# TODO: Unnecessary, remo this file
 | 
				
			||||||
REPO=harbor.hq.rosti.cz/rosti/runtime
 | 
					REPO=harbor.hq.rosti.cz/rosti/runtime
 | 
				
			||||||
DOCKER=docker
 | 
					DOCKER=docker
 | 
				
			||||||
VERSION=2023.12-1
 | 
					VERSION=2023.08-1
 | 
				
			||||||
BASEIMAGE=debian:12
 | 
					BASEIMAGE=debian:11
 | 
				
			||||||
 | 
					
 | 
				
			||||||
all: build
 | 
					all: build
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										26
									
								
								Taskfile.yml
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								Taskfile.yml
									
									
									
									
									
								
							| 
						 | 
					@ -3,9 +3,8 @@
 | 
				
			||||||
version: '3'
 | 
					version: '3'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
vars:
 | 
					vars:
 | 
				
			||||||
  REPO: harbor.hq.rosti.cz
 | 
					  REPO: harbor.hq.rosti.cz/rosti/runtime
 | 
				
			||||||
  REPO_PUBLIC: rosti-public/runtime
 | 
					  VERSION: 2023.04-2
 | 
				
			||||||
  VERSION: 2025.09-1
 | 
					 | 
				
			||||||
  BASEIMAGE: debian:bookworm
 | 
					  BASEIMAGE: debian:bookworm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
tasks:
 | 
					tasks:
 | 
				
			||||||
| 
						 | 
					@ -13,16 +12,10 @@ tasks:
 | 
				
			||||||
    deps:
 | 
					    deps:
 | 
				
			||||||
    - build
 | 
					    - build
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  pipeline:
 | 
					 | 
				
			||||||
    cmds:
 | 
					 | 
				
			||||||
    - task: build
 | 
					 | 
				
			||||||
    - task: test
 | 
					 | 
				
			||||||
    - task: push
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  build:
 | 
					  build:
 | 
				
			||||||
    cmds:
 | 
					    cmds:
 | 
				
			||||||
    - docker pull {{ .BASEIMAGE }}
 | 
					    - docker pull {{ .BASEIMAGE }}
 | 
				
			||||||
    - docker build --progress plain -t {{ .REPO }}:dev .
 | 
					    - docker build -t {{ .REPO }}:dev .
 | 
				
			||||||
    - docker tag {{ .REPO }}:dev {{ .REPO }}:{{ .VERSION }}
 | 
					    - docker tag {{ .REPO }}:dev {{ .REPO }}:{{ .VERSION }}
 | 
				
			||||||
    - echo "JSON for admin:"
 | 
					    - echo "JSON for admin:"
 | 
				
			||||||
    - python3 generate_versions.py
 | 
					    - python3 generate_versions.py
 | 
				
			||||||
| 
						 | 
					@ -34,7 +27,7 @@ tasks:
 | 
				
			||||||
  squashed:
 | 
					  squashed:
 | 
				
			||||||
    cmds:
 | 
					    cmds:
 | 
				
			||||||
    - docker pull {{ .BASEIMAGE }}
 | 
					    - docker pull {{ .BASEIMAGE }}
 | 
				
			||||||
    - docker build --progress plain --squash -t {{ .REPO }}:dev-squashed .
 | 
					    - docker build --squash -t {{ .REPO }}:dev-squashed .
 | 
				
			||||||
    - docker tag {{ .REPO }}:dev-squashed {{ .REPO }}:{{ .VERSION }}
 | 
					    - docker tag {{ .REPO }}:dev-squashed {{ .REPO }}:{{ .VERSION }}
 | 
				
			||||||
    - echo "JSON for admin:"
 | 
					    - echo "JSON for admin:"
 | 
				
			||||||
    - python3 generate_versions.py
 | 
					    - python3 generate_versions.py
 | 
				
			||||||
| 
						 | 
					@ -42,14 +35,3 @@ tasks:
 | 
				
			||||||
  push:
 | 
					  push:
 | 
				
			||||||
    cmds:
 | 
					    cmds:
 | 
				
			||||||
    - docker push {{ .REPO }}:{{ .VERSION }}
 | 
					    - docker push {{ .REPO }}:{{ .VERSION }}
 | 
				
			||||||
    # deps:
 | 
					 | 
				
			||||||
    # - squashed
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  install:
 | 
					 | 
				
			||||||
    cmds:
 | 
					 | 
				
			||||||
    - ssh rosti-node-26 docker pull {{ .REPO }}:{{ .VERSION }}
 | 
					 | 
				
			||||||
    - ssh rosti-node-26 docker tag {{ .REPO }}:{{ .VERSION }} {{ .REPO_PUBLIC }}:{{ .VERSION }}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  publish:
 | 
					 | 
				
			||||||
    cmds:
 | 
					 | 
				
			||||||
    - ssh rosti-node-26 docker push {{ .REPO_PUBLIC }}:{{ .VERSION }}
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,24 +0,0 @@
 | 
				
			||||||
#!/usr/bin/fish
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
for techline in (ls /opt/techs | fzf --layout reverse)
 | 
					 | 
				
			||||||
    set tech (echo $techline | string split -f 1 - )
 | 
					 | 
				
			||||||
    set ver (echo $techline | string split -f 2 - )
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    test -e /srv/bin/active_$tech && unlink /srv/bin/active_$tech
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    set primary_tech (readlink /srv/bin/primary_tech | string split -f 4 / | string split -f 1 "-")
 | 
					 | 
				
			||||||
    if test $primary_tech = $tech
 | 
					 | 
				
			||||||
        set_color -b red
 | 
					 | 
				
			||||||
        echo "Technology $tech is already activated as primary tech, you can't activate it as secondary."
 | 
					 | 
				
			||||||
        set_color normal
 | 
					 | 
				
			||||||
        continue
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    set_color yellow
 | 
					 | 
				
			||||||
    echo "Activating $tech-$ver"
 | 
					 | 
				
			||||||
    set_color normal
 | 
					 | 
				
			||||||
    ln -s /opt/techs/$tech-$ver/bin /srv/bin/active_$tech
 | 
					 | 
				
			||||||
    set_color green
 | 
					 | 
				
			||||||
    echo "Done."
 | 
					 | 
				
			||||||
    set_color normal
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
							
								
								
									
										16
									
								
								build_bun.sh
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								build_bun.sh
									
									
									
									
									
								
							| 
						 | 
					@ -1,16 +0,0 @@
 | 
				
			||||||
#!/bin/bash
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
set -e
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
mkdir -p /opt/techs
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
VERSION=$1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
cd /usr/src
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
wget https://github.com/oven-sh/bun/releases/download/bun-v$VERSION/bun-linux-x64.zip
 | 
					 | 
				
			||||||
unzip bun-linux-x64.zip
 | 
					 | 
				
			||||||
mkdir -p /opt/techs/bun-$VERSION
 | 
					 | 
				
			||||||
mv bun-linux-x64 /opt/techs/bun-$VERSION/bin
 | 
					 | 
				
			||||||
rm bun-linux-x64.zip
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,15 +0,0 @@
 | 
				
			||||||
#!/bin/bash
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
set -e
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
mkdir -p /opt/techs
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
VERSION=$1
 | 
					 | 
				
			||||||
HASH=$2
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
cd /usr/src
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
wget https://go.dev/dl/go${VERSION}.linux-amd64.tar.gz
 | 
					 | 
				
			||||||
tar xf go${VERSION}.linux-amd64.tar.gz
 | 
					 | 
				
			||||||
mv go /opt/techs/golang-$VERSION
 | 
					 | 
				
			||||||
rm go${VERSION}.linux-amd64.tar.gz
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,16 +0,0 @@
 | 
				
			||||||
#!/bin/bash
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
set -e
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
mkdir -p /opt/techs
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
VERSION=$1
 | 
					 | 
				
			||||||
HASH=$2
 | 
					 | 
				
			||||||
NUM=$3
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
cd /usr/src
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
wget https://download.java.net/java/GA/jdk${VERSION}/${HASH}/${NUM}/GPL/openjdk-${VERSION}_linux-x64_bin.tar.gz
 | 
					 | 
				
			||||||
tar xf openjdk-${VERSION}_linux-x64_bin.tar.gz
 | 
					 | 
				
			||||||
mv jdk-${VERSION} /opt/techs/openjdk-$VERSION
 | 
					 | 
				
			||||||
rm openjdk-${VERSION}_linux-x64_bin.tar.gz
 | 
					 | 
				
			||||||
| 
						 | 
					@ -78,6 +78,7 @@ cd -
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "no" | /opt/techs/php-$VERSION/bin/pecl install redis
 | 
					echo "no" | /opt/techs/php-$VERSION/bin/pecl install redis
 | 
				
			||||||
echo "no" | /opt/techs/php-$VERSION/bin/pecl install imagick
 | 
					echo "no" | /opt/techs/php-$VERSION/bin/pecl install imagick
 | 
				
			||||||
 | 
					echo "no" | /opt/techs/php-$VERSION/bin/pecl install memcached
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "zend_extension=opcache.so" > /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
 | 
					echo "zend_extension=opcache.so" > /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
 | 
				
			||||||
echo "extension=redis.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
 | 
					echo "extension=redis.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,6 @@ set -e
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VERSION=$1
 | 
					VERSION=$1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
mkdir -p /opt/techs
 | 
					mkdir -p /opt/techs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cd /usr/src
 | 
					cd /usr/src
 | 
				
			||||||
| 
						 | 
					@ -71,27 +70,13 @@ cd -
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "no" | /opt/techs/php-$VERSION/bin/pecl install redis
 | 
					echo "no" | /opt/techs/php-$VERSION/bin/pecl install redis
 | 
				
			||||||
echo "no" | /opt/techs/php-$VERSION/bin/pecl install mongodb
 | 
					echo "no" | /opt/techs/php-$VERSION/bin/pecl install mongodb
 | 
				
			||||||
echo "no" | /opt/techs/php-$VERSION/bin/pecl install sqlsrv
 | 
					 | 
				
			||||||
echo "no" | /opt/techs/php-$VERSION/bin/pecl install pdo_sqlsrv
 | 
					 | 
				
			||||||
echo "no" | /opt/techs/php-$VERSION/bin/pecl install memcached
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
export PATH=$PATH:/opt/techs/php-$VERSION/bin
 | 
					 | 
				
			||||||
composer.phar require ext-simplexml
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "zend_extension=opcache.so" > /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
 | 
					echo "zend_extension=opcache.so" > /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
 | 
				
			||||||
echo "extension=redis.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
 | 
					echo "extension=redis.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
 | 
				
			||||||
echo "extension=mongodb.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
 | 
					echo "extension=mongodb.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
 | 
				
			||||||
echo "extension=sqlsrv.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
 | 
					 | 
				
			||||||
echo "extension=pdo_sqlsrv.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
 | 
					 | 
				
			||||||
echo "extension=memcached.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Not supported yet
 | 
					# Not supported yet
 | 
				
			||||||
# https://github.com/Imagick/imagick/issues/358
 | 
					# https://github.com/Imagick/imagick/issues/358
 | 
				
			||||||
# We ignore PHP 8.3.2 until it's fixed
 | 
					echo "no" | /opt/techs/php-$VERSION/bin/pecl install imagick
 | 
				
			||||||
# if [ "$VERSION" != "8.3.2" -a "$VERSION" != "8.3.6" -a "$VERSION" != "8.3.9" -a "$VERSION" != "8.3.12" ]; then
 | 
					echo "extension=imagick.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
 | 
				
			||||||
# 	echo "no" | /opt/techs/php-$VERSION/bin/pecl install imagick
 | 
					 | 
				
			||||||
# 	echo "extension=imagick.so" >> /opt/techs/php-$VERSION/etc/conf.d/extensions.ini
 | 
					 | 
				
			||||||
# fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
ln -s /srv/conf/php-fpm/php.ini /opt/techs/php-$VERSION/etc/conf.d/99-app.ini
 | 
					ln -s /srv/conf/php-fpm/php.ini /opt/techs/php-$VERSION/etc/conf.d/99-app.ini
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,10 +18,3 @@ cd ruby-$VERSION
 | 
				
			||||||
./configure --prefix=/opt/techs/ruby-$VERSION
 | 
					./configure --prefix=/opt/techs/ruby-$VERSION
 | 
				
			||||||
make -j
 | 
					make -j
 | 
				
			||||||
make install
 | 
					make install
 | 
				
			||||||
 | 
					 | 
				
			||||||
/opt/techs/ruby-${VERSION}/bin/gem update --system
 | 
					 | 
				
			||||||
/opt/techs/ruby-${VERSION}/bin/gem install passenger
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
git clone --depth 1 https://github.com/rbenv/rbenv.git /opt/techs/ruby-$VERSION/rbenv
 | 
					 | 
				
			||||||
ln -s /opt/techs/ruby-$VERSION/rbenv/libexec/rbenv /opt/techs/ruby-$VERSION/bin/rbenv
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,16 +1,4 @@
 | 
				
			||||||
export PATH=/srv/bin/primary_tech:/srv/bin/primary_tech/sbin:/srv/bin:$PATH:/usr/sbin:/sbin
 | 
					export PATH=/srv/bin/primary_tech:/srv/bin/primary_tech/sbin:/srv/bin:$PATH:/usr/sbin:/sbin
 | 
				
			||||||
export PATH=$PATH:/srv/bin/active_bun
 | 
					 | 
				
			||||||
export PATH=$PATH:/srv/bin/active_deno
 | 
					 | 
				
			||||||
export PATH=$PATH:/srv/bin/active_golang
 | 
					 | 
				
			||||||
export PATH=$PATH:/srv/bin/active_node
 | 
					 | 
				
			||||||
export PATH=$PATH:/srv/bin/active_openjdk
 | 
					 | 
				
			||||||
export PATH=$PATH:/srv/bin/active_php
 | 
					 | 
				
			||||||
export PATH=$PATH:/srv/bin/active_python
 | 
					 | 
				
			||||||
export PATH=$PATH:/srv/bin/active_ruby
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Ruby related variables
 | 
					 | 
				
			||||||
export BUNDLE_PATH=/srv/tmp/cache
 | 
					 | 
				
			||||||
export GEM_HOME=/srv/.gem
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Use only if the shell is opened via SSH
 | 
					# Use only if the shell is opened via SSH
 | 
				
			||||||
if [ -n "$SSH_TTY" ]; then
 | 
					if [ -n "$SSH_TTY" ]; then
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,8 +1,8 @@
 | 
				
			||||||
worker_processes  1;
 | 
					worker_processes  1;
 | 
				
			||||||
error_log  stderr;
 | 
					 | 
				
			||||||
pid        /srv/run/nginx.pid;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
include /etc/nginx/modules-enabled/*.conf;
 | 
					error_log  stderr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pid        /srv/run/nginx.pid;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
events {
 | 
					events {
 | 
				
			||||||
| 
						 | 
					@ -82,6 +82,3 @@ http {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    include             /srv/conf/nginx.d/*;
 | 
					    include             /srv/conf/nginx.d/*;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
include             /srv/conf/nginx.main.d/*;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| 
						 | 
					@ -1,9 +0,0 @@
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    "name": "welcome",
 | 
					 | 
				
			||||||
    "version": "0.1.0",
 | 
					 | 
				
			||||||
    "description": "Welcome page by Roští.cz",
 | 
					 | 
				
			||||||
    "author": "Adam Štrauch <cx@initd.cz>",
 | 
					 | 
				
			||||||
    "scripts": {
 | 
					 | 
				
			||||||
      "start": "/srv/bin/primary_tech/bun run app.js"
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,14 +0,0 @@
 | 
				
			||||||
[program:app]
 | 
					 | 
				
			||||||
command=/srv/bin/primary_tech/bun run start
 | 
					 | 
				
			||||||
environment=PATH="/srv/bin/primary_tech:/usr/local/bin:/usr/bin:/bin:/srv/.npm-packages/bin"
 | 
					 | 
				
			||||||
stopasgroup=true
 | 
					 | 
				
			||||||
directory=/srv/app
 | 
					 | 
				
			||||||
process_name=app
 | 
					 | 
				
			||||||
autostart=true
 | 
					 | 
				
			||||||
autorestart=true
 | 
					 | 
				
			||||||
stdout_logfile=/srv/log/bun.log
 | 
					 | 
				
			||||||
stdout_logfile_maxbytes=2MB
 | 
					 | 
				
			||||||
stdout_logfile_backups=5
 | 
					 | 
				
			||||||
stdout_capture_maxbytes=2MB
 | 
					 | 
				
			||||||
stdout_events_enabled=false
 | 
					 | 
				
			||||||
redirect_stderr=true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -50,7 +50,7 @@
 | 
				
			||||||
                <p>Nyní je nutné přihlásit se do kontejneru s vaší aplikací přes SSH a použít příkaz <em>rosti</em> k základnímu nastavení prostředí. Přístupy najdete v naší administraci v info kartě aplikace.</p>
 | 
					                <p>Nyní je nutné přihlásit se do kontejneru s vaší aplikací přes SSH a použít příkaz <em>rosti</em> k základnímu nastavení prostředí. Přístupy najdete v naší administraci v info kartě aplikace.</p>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <p>V případě problémů se prosím obraťte na <a href="mailto:podpora@rosti.cz">technickou podporu</a> nebo na <a href="https://docs.rosti.cz/" target="_blank">dokumentaci</a>.</p>
 | 
					            <p>V případě problémů se prosím obraťte na <a href="mailto:podpora@rosti.cz">technickou podporu</a> nebo na <a href="https://docs.rosti.cz/" target="_blank">dokumentaci</a>.</p>
 | 
				
			||||||
            <p>Tým <a href="https://rosti.cz">Roští.cz</a> | <a href="https://rosti.social/@we">@we@rosti.social</a></p>
 | 
					            <p>Tým <a href="https://rosti.cz">Roští.cz</a> | <a href="http://twitter.com/rosti_cz">@rosti_cz</a></p>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <script type="application/javascript">
 | 
					    <script type="application/javascript">
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,11 @@
 | 
				
			||||||
const bodyContent = `<!DOCTYPE html>
 | 
					import { serve } from "https://deno.land/std@0.86.0/http/server.ts";
 | 
				
			||||||
<html>
 | 
					
 | 
				
			||||||
 | 
					const server = serve({ hostname: "0.0.0.0", port: 8080 });
 | 
				
			||||||
 | 
					console.log(`HTTP webserver running.  Access it at:  http://localhost:8080/`);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					for await (const request of server) {
 | 
				
			||||||
 | 
					  let bodyContent = `<!DOCTYPE html>
 | 
				
			||||||
 | 
					  <html>
 | 
				
			||||||
  <head lang=\"cs\">
 | 
					  <head lang=\"cs\">
 | 
				
			||||||
      <meta charset=\"UTF-8\">
 | 
					      <meta charset=\"UTF-8\">
 | 
				
			||||||
      <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">
 | 
					      <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">
 | 
				
			||||||
| 
						 | 
					@ -49,7 +55,7 @@ const bodyContent = `<!DOCTYPE html>
 | 
				
			||||||
                   <p>HTTP server vaší aplikace spusťte na portu <code>8080</code>. Na jiném nebude fungovat.</p>
 | 
					                   <p>HTTP server vaší aplikace spusťte na portu <code>8080</code>. Na jiném nebude fungovat.</p>
 | 
				
			||||||
              </div>
 | 
					              </div>
 | 
				
			||||||
              <p>V případě problémů se prosím obraťte na <a href=\"mailto:podpora@rosti.cz\">technickou podporu</a> nebo na <a href=\"https://docs.rosti.cz/\" target=\"_blank\">dokumentaci</a>.</p>
 | 
					              <p>V případě problémů se prosím obraťte na <a href=\"mailto:podpora@rosti.cz\">technickou podporu</a> nebo na <a href=\"https://docs.rosti.cz/\" target=\"_blank\">dokumentaci</a>.</p>
 | 
				
			||||||
              <p>Tým <a href=\"https://rosti.cz\">Roští.cz</a> | <a href=\"https://rosti.social/@we\">@we@rosti.social</a></p>
 | 
					              <p>Tým <a href=\"https://rosti.cz\">Roští.cz</a> | <a href=\"http://twitter.com/rosti_cz\">@rosti_cz</a></p>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
      <script type=\"application/javascript\">
 | 
					      <script type=\"application/javascript\">
 | 
				
			||||||
| 
						 | 
					@ -62,15 +68,7 @@ const bodyContent = `<!DOCTYPE html>
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
      </script>
 | 
					      </script>
 | 
				
			||||||
  </body>
 | 
					  </body>
 | 
				
			||||||
</html>`;
 | 
					  </html>`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
console.log(`HTTP webserver running.  Access it at:  http://localhost:8080/`);
 | 
					  request.respond({ status: 200, body: bodyContent });
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
Deno.serve({ port: 8080 }, (_req) => {
 | 
					 | 
				
			||||||
  return new Response(bodyContent, {
 | 
					 | 
				
			||||||
    status: 200,
 | 
					 | 
				
			||||||
    headers: {
 | 
					 | 
				
			||||||
      "content-type": "text/html; charset=utf-8",
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  });
 | 
					 | 
				
			||||||
});
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											Binary file not shown.
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| 
						 | 
					@ -1,14 +0,0 @@
 | 
				
			||||||
[program:app]
 | 
					 | 
				
			||||||
command=/srv/app/example_app
 | 
					 | 
				
			||||||
environment=PATH="/srv/bin/primary_tech:/usr/local/bin:/usr/bin:/bin:/srv/.npm-packages/bin"
 | 
					 | 
				
			||||||
stopasgroup=true
 | 
					 | 
				
			||||||
directory=/srv/app
 | 
					 | 
				
			||||||
process_name=app
 | 
					 | 
				
			||||||
autostart=true
 | 
					 | 
				
			||||||
autorestart=true
 | 
					 | 
				
			||||||
stdout_logfile=/srv/log/golang.log
 | 
					 | 
				
			||||||
stdout_logfile_maxbytes=2MB
 | 
					 | 
				
			||||||
stdout_logfile_backups=5
 | 
					 | 
				
			||||||
stdout_capture_maxbytes=2MB
 | 
					 | 
				
			||||||
stdout_events_enabled=false
 | 
					 | 
				
			||||||
redirect_stderr=true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,158 +0,0 @@
 | 
				
			||||||
FROM debian:bookworm
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
RUN DEBIAN_FRONTEND=noninteractive apt-get update
 | 
					 | 
				
			||||||
RUN DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
 | 
					 | 
				
			||||||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget gpg
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
RUN echo "deb http://deb.debian.org/debian/ bookworm main contrib non-free" > /etc/apt/sources.list && \
 | 
					 | 
				
			||||||
    echo "deb http://security.debian.org/debian-security bookworm-security main" >> /etc/apt/sources.list && \
 | 
					 | 
				
			||||||
    echo "deb http://deb.debian.org/debian/ bookworm-updates main contrib non-free" >> /etc/apt/sources.list
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales libffi-dev \
 | 
					 | 
				
			||||||
libssl-dev default-libmysqlclient-dev ca-certificates libpq-dev libjpeg62 libjpeg-dev \
 | 
					 | 
				
			||||||
libpng-dev libpng-dev build-essential git mercurial build-essential \
 | 
					 | 
				
			||||||
libbz2-dev libsqlite3-dev libreadline-dev zlib1g-dev libncurses5-dev \
 | 
					 | 
				
			||||||
libgdbm-dev libgd-dev cron git subversion vim nano mc htop procps \
 | 
					 | 
				
			||||||
dropbear gettext wget redis-server memcached supervisor curl ssh \
 | 
					 | 
				
			||||||
mariadb-client postgresql-client-15 postgresql-15-postgis-3-scripts bind9-host dnsutils nginx nginx-extras libnginx-mod-http-image-filter \
 | 
					 | 
				
			||||||
libxml2-dev libxslt1-dev openssh-sftp-server links2 lynx \
 | 
					 | 
				
			||||||
imagemagick libmagick++-6.q16-dev libmagick++-6.q16hdri-dev libmagickwand-dev ncdu libsodium-dev \
 | 
					 | 
				
			||||||
python3 python3-pip python3-virtualenv \
 | 
					 | 
				
			||||||
libcurl4-openssl-dev python3-dev libproj-dev gdal-bin libmemcached-dev swig mutt \
 | 
					 | 
				
			||||||
ffmpeg libyaml-dev libc-client2007e-dev libonig-dev libkrb5-dev dialog \
 | 
					 | 
				
			||||||
whiptail tmux rsync nmap libzip-dev libfreetype6-dev \
 | 
					 | 
				
			||||||
jpegoptim optipng pngquant gifsicle webp libvpx-dev libwebp-dev jq inotify-tools ripgrep \
 | 
					 | 
				
			||||||
wkhtmltopdf libzbar0
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# This is stange thing in Debian 12, it blocks installation of chromium
 | 
					 | 
				
			||||||
RUN DEBIAN_FRONTEND=noninteractive apt-get remove -y luit
 | 
					 | 
				
			||||||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y chromium
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
WORKDIR /srv
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
RUN useradd -d /srv app -s /bin/bash
 | 
					 | 
				
			||||||
RUN usermod -G crontab -a app
 | 
					 | 
				
			||||||
RUN rm /etc/localtime
 | 
					 | 
				
			||||||
RUN ln -s /usr/share/zoneinfo/Europe/Prague /etc/localtime
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ADD /etc/locale.gen /etc/
 | 
					 | 
				
			||||||
RUN locale-gen
 | 
					 | 
				
			||||||
ENV LANG       en_US.UTF-8
 | 
					 | 
				
			||||||
ENV LC_ALL     en_US.UTF-8
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ENV TERM       xterm
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#############
 | 
					 | 
				
			||||||
# Techs
 | 
					 | 
				
			||||||
#############
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Node.js
 | 
					 | 
				
			||||||
# https://nodejs.org/en/about/previous-releases
 | 
					 | 
				
			||||||
WORKDIR /usr/src
 | 
					 | 
				
			||||||
ADD build_node.sh /usr/local/bin/build_node.sh
 | 
					 | 
				
			||||||
RUN build_node.sh 18.20.4
 | 
					 | 
				
			||||||
RUN build_node.sh 20.15.1
 | 
					 | 
				
			||||||
RUN build_node.sh 21.7.3
 | 
					 | 
				
			||||||
RUN build_node.sh 22.4.1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Python
 | 
					 | 
				
			||||||
# https://www.python.org/downloads/
 | 
					 | 
				
			||||||
WORKDIR /usr/src
 | 
					 | 
				
			||||||
ADD build_python.sh /usr/local/bin/build_python.sh
 | 
					 | 
				
			||||||
RUN build_python.sh 3.11.9
 | 
					 | 
				
			||||||
RUN build_python.sh 3.12.4
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## PHP 8
 | 
					 | 
				
			||||||
# https://www.php.net/downloads.php
 | 
					 | 
				
			||||||
ADD build_php8.sh /usr/local/bin/build_php8.sh
 | 
					 | 
				
			||||||
RUN build_php8.sh 8.2.15
 | 
					 | 
				
			||||||
RUN build_php8.sh 8.2.21
 | 
					 | 
				
			||||||
RUN build_php8.sh 8.3.6
 | 
					 | 
				
			||||||
RUN build_php8.sh 8.3.9
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Ruby
 | 
					 | 
				
			||||||
# https://www.ruby-lang.org/en/downloads/releases/
 | 
					 | 
				
			||||||
WORKDIR /usr/src
 | 
					 | 
				
			||||||
ADD build_ruby.sh /usr/local/bin/build_ruby.sh
 | 
					 | 
				
			||||||
RUN build_ruby.sh 3.2.2
 | 
					 | 
				
			||||||
RUN build_ruby.sh 3.3.1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Deno
 | 
					 | 
				
			||||||
ADD build_deno.sh /usr/local/bin/build_deno.sh
 | 
					 | 
				
			||||||
# 2024/05
 | 
					 | 
				
			||||||
RUN build_deno.sh 1.43.6 
 | 
					 | 
				
			||||||
RUN build_deno.sh 1.45.1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Bun
 | 
					 | 
				
			||||||
ADD build_bun.sh /usr/local/bin/build_bun.sh
 | 
					 | 
				
			||||||
RUN build_bun.sh 1.1.18
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# OpenJDK
 | 
					 | 
				
			||||||
# From here: https://jdk.java.net/
 | 
					 | 
				
			||||||
ADD build_openjdk.sh /usr/local/bin/build_openjdk.sh
 | 
					 | 
				
			||||||
RUN build_openjdk.sh 22.0.2 c9ecb94cd31b495da20a27d4581645e8
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Golang
 | 
					 | 
				
			||||||
# From here: https://go.dev/dl/
 | 
					 | 
				
			||||||
ADD build_golang.sh /usr/local/bin/build_golang.sh
 | 
					 | 
				
			||||||
RUN build_golang.sh 1.22.5
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#############
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# WKHTMLTOX This is not in development anymore so we will remove it with next version of Debian
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
WORKDIR /usr/src
 | 
					 | 
				
			||||||
RUN apt install -f xfonts-75dpi && \
 | 
					 | 
				
			||||||
      wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb && \
 | 
					 | 
				
			||||||
      dpkg -i wkhtmltox_0.12.6.1-3.bookworm_amd64.deb && \
 | 
					 | 
				
			||||||
      rm wkhtmltox_0.12.6.1-3.bookworm_amd64.deb
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#############
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Support tools and miscellaneous stuff
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
RUN rm -f /etc/cron.d/* /etc/cron.daily/* /etc/cron.hourly/* /etc/cron.monthly/* /etc/cron.weekly/*
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ADD /scripts/enable_redis.sh /usr/local/bin/enable-redis
 | 
					 | 
				
			||||||
ADD /scripts/enable_memcached.sh /usr/local/bin/enable-memcached
 | 
					 | 
				
			||||||
RUN chmod 755 /usr/local/bin/*
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ADD /etc/supervisord.conf /etc/supervisor/supervisord.conf
 | 
					 | 
				
			||||||
ADD /examples /opt/examples
 | 
					 | 
				
			||||||
ADD /etc/bashrc_local /opt/etc/bashrc_local
 | 
					 | 
				
			||||||
ADD /etc/bash_profile /opt/etc/bash_profile
 | 
					 | 
				
			||||||
ADD /etc/vimrc /opt/etc/vimrc
 | 
					 | 
				
			||||||
RUN mkdir -p /opt/etc/bashrc
 | 
					 | 
				
			||||||
RUN mkdir -p /opt/etc/appinit
 | 
					 | 
				
			||||||
ADD /etc/bashrc/common.sh /opt/etc/bashrc/
 | 
					 | 
				
			||||||
ADD /etc/nginx.conf /etc/nginx/nginx.conf
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
RUN rmdir /var/lib/nginx
 | 
					 | 
				
			||||||
RUN ln -s /srv/var/nginx /var/lib/nginx
 | 
					 | 
				
			||||||
RUN chown app:app /var/log/nginx -R
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
RUN chown app:app /home -R
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Start script
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ADD /start.sh /start.sh
 | 
					 | 
				
			||||||
RUN chmod 755 /start.sh
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Roští script
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
RUN apt-get install -y fish
 | 
					 | 
				
			||||||
ADD ./gen_rosti.fish /usr/local/bin/
 | 
					 | 
				
			||||||
ADD ./rosti.tmpl.sh /usr/src/
 | 
					 | 
				
			||||||
ADD ./Dockerfile /usr/src/
 | 
					 | 
				
			||||||
RUN cd /usr/src && /usr/local/bin/gen_rosti.fish > /usr/local/bin/rosti && chmod 755 /usr/local/bin/rosti
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Cleaning
 | 
					 | 
				
			||||||
RUN apt-get clean && rm -rf /usr/src/*
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
VOLUME /srv
 | 
					 | 
				
			||||||
WORKDIR /srv
 | 
					 | 
				
			||||||
EXPOSE 8000 22
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ENTRYPOINT ["/start.sh"]
 | 
					 | 
				
			||||||
| 
						 | 
					@ -58,7 +58,7 @@ var server = http.createServer(function (request, response) {
 | 
				
			||||||
                 <p>HTTP server vaší aplikace spusťte na portu <code>8080</code>. Na jiném nebude fungovat. Původní port 8000 nyní patří Nginxu, za kterým je vaše aplikace schovaná.</p>
 | 
					                 <p>HTTP server vaší aplikace spusťte na portu <code>8080</code>. Na jiném nebude fungovat. Původní port 8000 nyní patří Nginxu, za kterým je vaše aplikace schovaná.</p>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <p>V případě problémů se prosím obraťte na <a href=\"mailto:podpora@rosti.cz\">technickou podporu</a> nebo na <a href=\"https://docs.rosti.cz/\" target=\"_blank\">dokumentaci</a>.</p>
 | 
					            <p>V případě problémů se prosím obraťte na <a href=\"mailto:podpora@rosti.cz\">technickou podporu</a> nebo na <a href=\"https://docs.rosti.cz/\" target=\"_blank\">dokumentaci</a>.</p>
 | 
				
			||||||
            <p>Tým <a href=\"https://rosti.cz\">Roští.cz</a> | <a href=\"https://rosti.social/@we\">@we@rosti.social</a></p>
 | 
					            <p>Tým <a href=\"https://rosti.cz\">Roští.cz</a> | <a href=\"http://twitter.com/rosti_cz\">@rosti_cz</a></p>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <script type=\"application/javascript\">
 | 
					    <script type=\"application/javascript\">
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| 
						 | 
					@ -1,14 +0,0 @@
 | 
				
			||||||
[program:app]
 | 
					 | 
				
			||||||
command=/srv/bin/primary_tech/java /srv/app/app.java
 | 
					 | 
				
			||||||
environment=PATH="/srv/bin/primary_tech:/usr/local/bin:/usr/bin:/bin:/srv/.npm-packages/bin"
 | 
					 | 
				
			||||||
stopasgroup=true
 | 
					 | 
				
			||||||
directory=/srv/app
 | 
					 | 
				
			||||||
process_name=app
 | 
					 | 
				
			||||||
autostart=true
 | 
					 | 
				
			||||||
autorestart=true
 | 
					 | 
				
			||||||
stdout_logfile=/srv/log/openjdk.log
 | 
					 | 
				
			||||||
stdout_logfile_maxbytes=2MB
 | 
					 | 
				
			||||||
stdout_logfile_backups=5
 | 
					 | 
				
			||||||
stdout_capture_maxbytes=2MB
 | 
					 | 
				
			||||||
stdout_events_enabled=false
 | 
					 | 
				
			||||||
redirect_stderr=true
 | 
					 | 
				
			||||||
| 
						 | 
					@ -49,7 +49,7 @@
 | 
				
			||||||
                </p>
 | 
					                </p>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <p>V případě problémů se prosím obraťte na <a href="mailto:podpora@rosti.cz">technickou podporu</a> nebo na <a href="https://docs.rosti.cz/" target="_blank">dokumentaci</a>.</p>
 | 
					            <p>V případě problémů se prosím obraťte na <a href="mailto:podpora@rosti.cz">technickou podporu</a> nebo na <a href="https://docs.rosti.cz/" target="_blank">dokumentaci</a>.</p>
 | 
				
			||||||
            <p>Tým <a href="https://rosti.cz">Roští.cz</a> | <a href="https://rosti.social/@we">@we@rosti.social</a></p>
 | 
					            <p>Tým <a href="https://rosti.cz">Roští.cz</a> | <a href="http://twitter.com/rosti_cz">@rosti_cz</a></p>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <script type="application/javascript">
 | 
					    <script type="application/javascript">
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -71,7 +71,7 @@ application = get_wsgi_application()
 | 
				
			||||||
                <p>Do souboru <code>/srv/app/init.sh</code> můžete napsat příkazy, které se mají spustit po každém restart kontejneru. Můžete si tak usnadnit třeba deployment.</p>
 | 
					                <p>Do souboru <code>/srv/app/init.sh</code> můžete napsat příkazy, které se mají spustit po každém restart kontejneru. Můžete si tak usnadnit třeba deployment.</p>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <p>V případě problémů se prosím obraťte na <a href="mailto:podpora@rosti.cz">technickou podporu</a> nebo na <a href="https://docs.rosti.cz/" target="_blank">dokumentaci</a>.</p>
 | 
					            <p>V případě problémů se prosím obraťte na <a href="mailto:podpora@rosti.cz">technickou podporu</a> nebo na <a href="https://docs.rosti.cz/" target="_blank">dokumentaci</a>.</p>
 | 
				
			||||||
            <p>Tým <a href="https://rosti.cz">Roští.cz</a> | <a href="https://rosti.social/@we">@we@rosti.social</a></p>
 | 
					            <p>Tým <a href="https://rosti.cz">Roští.cz</a> | <a href="http://twitter.com/rosti_cz">@rosti_cz</a></p>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <script type="application/javascript">
 | 
					    <script type="application/javascript">
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										81
									
								
								examples/ruby/app.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										81
									
								
								examples/ruby/app.rb
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
[program:app]
 | 
					[program:app]
 | 
				
			||||||
command=/srv/bin/primary_tech/passenger start --port 8000 --pid-file /srv/run/passenger.pid
 | 
					command=/srv/bin/primary_tech/ruby app.rb
 | 
				
			||||||
environment=PATH="/srv/bin/primary_tech:/usr/local/bin:/usr/bin:/bin:/srv/.npm-packages/bin",GEM_HOME=/srv/.gem,BUNDLE_PATH=/srv/tmp/cache
 | 
					environment=PATH="/srv/bin/primary_tech:/usr/local/bin:/usr/bin:/bin:/srv/.npm-packages/bin"
 | 
				
			||||||
stopasgroup=true
 | 
					stopasgroup=true
 | 
				
			||||||
directory=/srv/app
 | 
					directory=/srv/app
 | 
				
			||||||
process_name=app
 | 
					process_name=app
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,14 +4,9 @@ set TECHS_FILE /tmp/techs.txt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo -n > $TECHS_FILE
 | 
					echo -n > $TECHS_FILE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
for line in (cat Dockerfile | grep "build_" | grep -v "/usr/local")
 | 
					for line in (cat Dockerfile | grep "RUN build_")
 | 
				
			||||||
    set line (echo $line | sed "s/RUN //")
 | 
					    set VERSION (echo $line | cut -d " " -f 3)
 | 
				
			||||||
    set line (echo $line | sed "s/ADD //")
 | 
					    set TECH_SCRIPT (echo $line | cut -d " " -f 2)
 | 
				
			||||||
    set line (echo $line | sed "s/& \\\//")
 | 
					 | 
				
			||||||
    set line (echo $line | sed "s/^[ ]*//")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    set VERSION (echo $line | cut -d " " -f 2)
 | 
					 | 
				
			||||||
    set TECH_SCRIPT (echo $line | cut -d " " -f 1)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    switch $TECH_SCRIPT
 | 
					    switch $TECH_SCRIPT
 | 
				
			||||||
    case "build_php.sh"
 | 
					    case "build_php.sh"
 | 
				
			||||||
| 
						 | 
					@ -32,15 +27,6 @@ for line in (cat Dockerfile | grep "build_" | grep -v "/usr/local")
 | 
				
			||||||
    case "build_deno.sh"
 | 
					    case "build_deno.sh"
 | 
				
			||||||
        set TECH deno
 | 
					        set TECH deno
 | 
				
			||||||
        set TECH_VERBOSE Deno
 | 
					        set TECH_VERBOSE Deno
 | 
				
			||||||
    case "build_bun.sh"
 | 
					 | 
				
			||||||
        set TECH bun
 | 
					 | 
				
			||||||
        set TECH_VERBOSE Bun
 | 
					 | 
				
			||||||
    case "build_golang.sh"
 | 
					 | 
				
			||||||
        set TECH golang
 | 
					 | 
				
			||||||
        set TECH_VERBOSE Golang
 | 
					 | 
				
			||||||
    case "build_openjdk.sh"
 | 
					 | 
				
			||||||
        set TECH openjdk
 | 
					 | 
				
			||||||
        set TECH_VERBOSE OpenJDK
 | 
					 | 
				
			||||||
    case '*'
 | 
					    case '*'
 | 
				
			||||||
        set TECH unknown
 | 
					        set TECH unknown
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,16 +19,12 @@ with open("Dockerfile") as f:
 | 
				
			||||||
        if line.startswith("FROM debian:"):
 | 
					        if line.startswith("FROM debian:"):
 | 
				
			||||||
            image = line.split(" ")[1].strip()
 | 
					            image = line.split(" ")[1].strip()
 | 
				
			||||||
            continue
 | 
					            continue
 | 
				
			||||||
        if "build_" in line and "ADD" not in line:
 | 
					        if line.startswith("RUN build_"):
 | 
				
			||||||
            line = line.replace("RUN ", "").strip()
 | 
					 | 
				
			||||||
            line = line.replace("& \\", "")
 | 
					 | 
				
			||||||
            line = line.lstrip(" ")
 | 
					 | 
				
			||||||
            
 | 
					 | 
				
			||||||
            parts = line.split(" ")
 | 
					            parts = line.split(" ")
 | 
				
			||||||
            name = parts[0].replace("build_", "").replace(".sh", "")
 | 
					            name = parts[1].replace("build_", "").replace(".sh", "")
 | 
				
			||||||
            if name.startswith("php"):
 | 
					            if name.startswith("php"):
 | 
				
			||||||
                name = "php"
 | 
					                name = "php"
 | 
				
			||||||
            version = parts[1].strip()
 | 
					            version = line.split(" ")[2].strip()
 | 
				
			||||||
            if name not in output["techs"]:
 | 
					            if name not in output["techs"]:
 | 
				
			||||||
                output["techs"][name] = {
 | 
					                output["techs"][name] = {
 | 
				
			||||||
                    "versions": [],
 | 
					                    "versions": [],
 | 
				
			||||||
| 
						 | 
					@ -36,7 +32,7 @@ with open("Dockerfile") as f:
 | 
				
			||||||
            output["techs"][name]["versions"].append(version)
 | 
					            output["techs"][name]["versions"].append(version)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# os.system(f"docker pull {image}")
 | 
					# os.system(f"docker pull {image}")
 | 
				
			||||||
system_version = subprocess.check_output(f"docker run --rm {image} cat /etc/debian_version", shell=True)
 | 
					system_version = subprocess.check_output(f"podman run --rm {image} cat /etc/debian_version", shell=True)
 | 
				
			||||||
output["system"]["version"] = system_version.strip().decode()
 | 
					output["system"]["version"] = system_version.strip().decode()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
print(json.dumps(output, indent=4))
 | 
					print(json.dumps(output, indent=4))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,14 +3,11 @@
 | 
				
			||||||
. ~/.bashrc
 | 
					. ~/.bashrc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# DEFAULT VERSIONS
 | 
					# DEFAULT VERSIONS
 | 
				
			||||||
VERSION_NODE="24.7.0"
 | 
					VERSION_PYTHON="3.11.5"
 | 
				
			||||||
VERSION_PYTHON="3.13.7"
 | 
					VERSION_PHP="8.2.9"
 | 
				
			||||||
VERSION_PHP="8.4.12"
 | 
					VERSION_NODE="20.6.1"
 | 
				
			||||||
VERSION_RUBY="3.4.5"
 | 
					VERSION_RUBY="3.2.2"
 | 
				
			||||||
VERSION_DENO="2.4.5"
 | 
					VERSION_DENO="1.36.4"
 | 
				
			||||||
VERSION_BUN="1.2.21"
 | 
					 | 
				
			||||||
VERSION_OPENJDK="24.0.2"
 | 
					 | 
				
			||||||
VERSION_GOLANG="1.25.1"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
WIDTH=180
 | 
					WIDTH=180
 | 
				
			||||||
HEIGHT=25
 | 
					HEIGHT=25
 | 
				
			||||||
| 
						 | 
					@ -18,7 +15,7 @@ HEIGHT=25
 | 
				
			||||||
TECHDIR=/opt/techs
 | 
					TECHDIR=/opt/techs
 | 
				
			||||||
PRIMARYDIR=/srv/bin/primary_tech
 | 
					PRIMARYDIR=/srv/bin/primary_tech
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Usage: rosti php|python|node|bun|memcached|redis OPTINAL_VERSION
 | 
					# Usage: rosti php|python|node|memcached|redis OPTINAL_VERSION
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# This script helps to configure the environment for selected
 | 
					# This script helps to configure the environment for selected
 | 
				
			||||||
# language/technology/service. The language or service can be
 | 
					# language/technology/service. The language or service can be
 | 
				
			||||||
| 
						 | 
					@ -54,15 +51,6 @@ function setTech() {
 | 
				
			||||||
        if [ -e /srv/app/supervisor.conf ]; then
 | 
					        if [ -e /srv/app/supervisor.conf ]; then
 | 
				
			||||||
            mv /srv/app/supervisor.conf /srv/conf/supervisor.d/$name.conf
 | 
					            mv /srv/app/supervisor.conf /srv/conf/supervisor.d/$name.conf
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
 | 
					 | 
				
			||||||
        # Ruby initialization specifics
 | 
					 | 
				
			||||||
        if [ "$name" = "ruby" ]; then
 | 
					 | 
				
			||||||
            mkdir -p /srv/app/public
 | 
					 | 
				
			||||||
            rm /srv/conf/nginx.d/app.conf
 | 
					 | 
				
			||||||
            mv /srv/app/index.html /srv/app/public/index.html
 | 
					 | 
				
			||||||
            rm -rf /srv/conf/nginx.d
 | 
					 | 
				
			||||||
            rm -f /srv/conf/supervisor.d/nginx.conf
 | 
					 | 
				
			||||||
        fi
 | 
					 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        echo "IMPORTANT: /srv/app found so no configuration or files are copied, make sure the application is ok after this process"
 | 
					        echo "IMPORTANT: /srv/app found so no configuration or files are copied, make sure the application is ok after this process"
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
| 
						 | 
					@ -96,6 +84,7 @@ function setTech() {
 | 
				
			||||||
        test ! -e /srv/conf/php-fpm/php.ini && ln -s /srv/conf/php-fpm/php.ini /opt/techs/$tech/etc/conf.d/app.ini
 | 
					        test ! -e /srv/conf/php-fpm/php.ini && ln -s /srv/conf/php-fpm/php.ini /opt/techs/$tech/etc/conf.d/app.ini
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # And remove unneeded ones
 | 
					        # And remove unneeded ones
 | 
				
			||||||
 | 
					        # TODO: not sure how good idea this is
 | 
				
			||||||
        rm -f /srv/app/php-fpm.conf /srv/app/pool_app.conf /srv/app/php.ini
 | 
					        rm -f /srv/app/php-fpm.conf /srv/app/pool_app.conf /srv/app/php.ini
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -111,7 +100,7 @@ function setTech() {
 | 
				
			||||||
    # Same thing we do for nginx but if the file exist it's not rewritten.
 | 
					    # Same thing we do for nginx but if the file exist it's not rewritten.
 | 
				
			||||||
    # Except if the file is in /srv/app, then it's moved to /srv/conf/nginx.d
 | 
					    # Except if the file is in /srv/app, then it's moved to /srv/conf/nginx.d
 | 
				
			||||||
    if [ ! -e /srv/conf/nginx.d/app.conf -o -e /srv/app/nginx.conf ]; then
 | 
					    if [ ! -e /srv/conf/nginx.d/app.conf -o -e /srv/app/nginx.conf ]; then
 | 
				
			||||||
        mkdir -p /srv/conf/nginx.d;
 | 
					        mkdir -p /srv/conf/nginx.d
 | 
				
			||||||
        if [ -e /srv/app/nginx.conf ]; then
 | 
					        if [ -e /srv/app/nginx.conf ]; then
 | 
				
			||||||
            mv /srv/app/nginx.conf /srv/conf/nginx.d/app.conf
 | 
					            mv /srv/app/nginx.conf /srv/conf/nginx.d/app.conf
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
| 
						 | 
					@ -213,24 +202,6 @@ function quickTech() {
 | 
				
			||||||
            fi
 | 
					            fi
 | 
				
			||||||
            setTech $TECH-$VERSION
 | 
					            setTech $TECH-$VERSION
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
        "bun")
 | 
					 | 
				
			||||||
            if [ -z "$VERSION" ]; then
 | 
					 | 
				
			||||||
                VERSION=$VERSION_BUN
 | 
					 | 
				
			||||||
            fi
 | 
					 | 
				
			||||||
            setTech $TECH-$VERSION
 | 
					 | 
				
			||||||
        ;;
 | 
					 | 
				
			||||||
        "openjdk")
 | 
					 | 
				
			||||||
            if [ -z "$VERSION" ]; then
 | 
					 | 
				
			||||||
                VERSION=$VERSION_OPENJDK
 | 
					 | 
				
			||||||
            fi
 | 
					 | 
				
			||||||
            setTech $TECH-$VERSION
 | 
					 | 
				
			||||||
        ;;
 | 
					 | 
				
			||||||
        "golang")
 | 
					 | 
				
			||||||
            if [ -z "$VERSION" ]; then
 | 
					 | 
				
			||||||
                VERSION=$VERSION_GOLANG
 | 
					 | 
				
			||||||
            fi
 | 
					 | 
				
			||||||
            setTech $TECH-$VERSION
 | 
					 | 
				
			||||||
        ;;
 | 
					 | 
				
			||||||
        "memcached")
 | 
					        "memcached")
 | 
				
			||||||
            setService $TECH
 | 
					            setService $TECH
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										8
									
								
								start.sh
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								start.sh
									
									
									
									
									
								
							| 
						 | 
					@ -63,11 +63,7 @@ if [ ! -e /srv/.vimrc ]; then
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Crontab
 | 
					# Crontab
 | 
				
			||||||
if [ ! -e /srv/conf/crontab ]; then
 | 
					test ! -e /srv/conf/crontab && touch /srv/conf/crontab
 | 
				
			||||||
    echo 'PATH=/srv/bin/primary_tech:/srv/bin/primary_tech/sbin:/srv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/sbin:/srv/bin/primary_tech:/srv/bin/primary_tech/sbin:/srv/bin:/srv/bin/active_bun:/srv/bin/active_deno:/srv/bin/active_golang:/srv/bin/active_node:/srv/bin/active_openjdk:/srv/bin/active_php:/srv/bin/active_python:/srv/bin/active_ruby' > /srv/conf/crontab
 | 
					 | 
				
			||||||
    echo "" >> /srv/conf/crontab
 | 
					 | 
				
			||||||
    echo "" >> /srv/conf/crontab
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
if [ -e  /srv/conf/crontab ]; then
 | 
					if [ -e  /srv/conf/crontab ]; then
 | 
				
			||||||
    crontab -u app /srv/conf/crontab
 | 
					    crontab -u app /srv/conf/crontab
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
| 
						 | 
					@ -77,7 +73,7 @@ chown app:app /srv/conf/crontab
 | 
				
			||||||
echo "Starting cron .."
 | 
					echo "Starting cron .."
 | 
				
			||||||
/usr/sbin/cron
 | 
					/usr/sbin/cron
 | 
				
			||||||
echo "Starting dropbear .."
 | 
					echo "Starting dropbear .."
 | 
				
			||||||
dropbear -W 1048576 -w -d /srv/conf/dropbear/dropbear_dss_host_key -r /srv/conf/dropbear/dropbear_rsa_host_key
 | 
					dropbear -w -d /srv/conf/dropbear/dropbear_dss_host_key -r /srv/conf/dropbear/dropbear_rsa_host_key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# BASHRC
 | 
					# BASHRC
 | 
				
			||||||
if [ ! -e /srv/.bashrc ]; then
 | 
					if [ ! -e /srv/.bashrc ]; then
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,10 +24,10 @@ fi
 | 
				
			||||||
CONTAINER_NAME=dev_test
 | 
					CONTAINER_NAME=dev_test
 | 
				
			||||||
$DOCKER stop $CONTAINER_NAME &>/dev/null
 | 
					$DOCKER stop $CONTAINER_NAME &>/dev/null
 | 
				
			||||||
 | 
					
 | 
				
			||||||
COUNT=`cat Dockerfile | grep -e "build_" | grep -v "/usr/local" | sed "s/RUN //" |  sed "s/ADD //" | sed 's/& \\\//' | sed "s/^[ ]*//" | sed "s/build_//" | sed "s/\.sh//" | sed "s/php8/php/" | wc -l`
 | 
					COUNT=`cat Dockerfile | grep "RUN build_" | sed "s/RUN build_//" | sed "s/\.sh//" | sed "s/php8/php/" | wc -l`
 | 
				
			||||||
I=1
 | 
					I=1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cat Dockerfile | grep -e "build_" | grep -v "/usr/local" | sed "s/RUN //" |  sed "s/ADD //" | sed 's/& \\//' | sed "s/^[ ]*//" | sed "s/build_//" | sed "s/\.sh//" | sed "s/php8/php/" | \
 | 
					cat Dockerfile | grep "RUN build_" | sed "s/RUN build_//" | sed "s/\.sh//" | sed "s/php8/php/" | \
 | 
				
			||||||
while read line
 | 
					while read line
 | 
				
			||||||
do
 | 
					do
 | 
				
			||||||
    tech=`echo $line | cut -d " " -f 1`
 | 
					    tech=`echo $line | cut -d " " -f 1`
 | 
				
			||||||
| 
						 | 
					@ -53,7 +53,6 @@ do
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    echo -e "${BRed}.. ${Yel}cleaning this round${RCol}"
 | 
					    echo -e "${BRed}.. ${Yel}cleaning this round${RCol}"
 | 
				
			||||||
    $DOCKER stop $CONTAINER_NAME &>/dev/null || exit 1
 | 
					    $DOCKER stop $CONTAINER_NAME &>/dev/null || exit 1
 | 
				
			||||||
    sleep 1
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ((I++))
 | 
					    ((I++))
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue