Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/default_profiles/servers
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2024-05-10 15:56:28 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2024-05-10 15:56:28 +0200
commit683da22298abbd90f51d4dd38a7ec4b0dfb04555 (patch)
treeec2ac04967f9277df038edc362201937b331abe5 /archinstall/default_profiles/servers
parentaf7ab9833c9f9944874f0162ae0975175ddc628d (diff)
parent3381cd55673e5105697d354cf4a1be9a7bcef062 (diff)
merged with upstreamHEADmaster
Diffstat (limited to 'archinstall/default_profiles/servers')
-rw-r--r--archinstall/default_profiles/servers/__init__.py0
-rw-r--r--archinstall/default_profiles/servers/cockpit.py19
-rw-r--r--archinstall/default_profiles/servers/docker.py33
-rw-r--r--archinstall/default_profiles/servers/httpd.py19
-rw-r--r--archinstall/default_profiles/servers/lighttpd.py19
-rw-r--r--archinstall/default_profiles/servers/mariadb.py25
-rw-r--r--archinstall/default_profiles/servers/nginx.py19
-rw-r--r--archinstall/default_profiles/servers/postgresql.py26
-rw-r--r--archinstall/default_profiles/servers/sshd.py19
-rw-r--r--archinstall/default_profiles/servers/tomcat.py19
10 files changed, 198 insertions, 0 deletions
diff --git a/archinstall/default_profiles/servers/__init__.py b/archinstall/default_profiles/servers/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/archinstall/default_profiles/servers/__init__.py
diff --git a/archinstall/default_profiles/servers/cockpit.py b/archinstall/default_profiles/servers/cockpit.py
new file mode 100644
index 00000000..8cac0976
--- /dev/null
+++ b/archinstall/default_profiles/servers/cockpit.py
@@ -0,0 +1,19 @@
+from typing import List
+
+from archinstall.default_profiles.profile import Profile, ProfileType
+
+
+class CockpitProfile(Profile):
+ def __init__(self):
+ super().__init__(
+ 'Cockpit',
+ ProfileType.ServerType
+ )
+
+ @property
+ def packages(self) -> List[str]:
+ return ['cockpit', 'udisks2', 'packagekit']
+
+ @property
+ def services(self) -> List[str]:
+ return ['cockpit.socket']
diff --git a/archinstall/default_profiles/servers/docker.py b/archinstall/default_profiles/servers/docker.py
new file mode 100644
index 00000000..f4800916
--- /dev/null
+++ b/archinstall/default_profiles/servers/docker.py
@@ -0,0 +1,33 @@
+from typing import List, Union, TYPE_CHECKING
+
+import archinstall
+
+from archinstall.default_profiles.profile import Profile, ProfileType
+from archinstall.lib.models import User
+
+if TYPE_CHECKING:
+ from archinstall.lib.installer import Installer
+
+
+class DockerProfile(Profile):
+ def __init__(self):
+ super().__init__(
+ 'Docker',
+ ProfileType.ServerType
+ )
+
+ @property
+ def packages(self) -> List[str]:
+ return ['docker']
+
+ @property
+ def services(self) -> List[str]:
+ return ['docker']
+
+ def post_install(self, install_session: 'Installer'):
+ users: Union[User, List[User]] = archinstall.arguments.get('!users', [])
+ if not isinstance(users, list):
+ users = [users]
+
+ for user in users:
+ install_session.arch_chroot(f'usermod -a -G docker {user.username}')
diff --git a/archinstall/default_profiles/servers/httpd.py b/archinstall/default_profiles/servers/httpd.py
new file mode 100644
index 00000000..595ce84f
--- /dev/null
+++ b/archinstall/default_profiles/servers/httpd.py
@@ -0,0 +1,19 @@
+from typing import List
+
+from archinstall.default_profiles.profile import Profile, ProfileType
+
+
+class HttpdProfile(Profile):
+ def __init__(self):
+ super().__init__(
+ 'httpd',
+ ProfileType.ServerType
+ )
+
+ @property
+ def packages(self) -> List[str]:
+ return ['apache']
+
+ @property
+ def services(self) -> List[str]:
+ return ['httpd']
diff --git a/archinstall/default_profiles/servers/lighttpd.py b/archinstall/default_profiles/servers/lighttpd.py
new file mode 100644
index 00000000..00aa5564
--- /dev/null
+++ b/archinstall/default_profiles/servers/lighttpd.py
@@ -0,0 +1,19 @@
+from typing import List
+
+from archinstall.default_profiles.profile import Profile, ProfileType
+
+
+class LighttpdProfile(Profile):
+ def __init__(self):
+ super().__init__(
+ 'Lighttpd',
+ ProfileType.ServerType
+ )
+
+ @property
+ def packages(self) -> List[str]:
+ return ['lighttpd']
+
+ @property
+ def services(self) -> List[str]:
+ return ['lighttpd']
diff --git a/archinstall/default_profiles/servers/mariadb.py b/archinstall/default_profiles/servers/mariadb.py
new file mode 100644
index 00000000..4506f1bc
--- /dev/null
+++ b/archinstall/default_profiles/servers/mariadb.py
@@ -0,0 +1,25 @@
+from typing import List, TYPE_CHECKING
+
+from archinstall.default_profiles.profile import Profile, ProfileType
+
+if TYPE_CHECKING:
+ from archinstall.lib.installer import Installer
+
+
+class MariadbProfile(Profile):
+ def __init__(self):
+ super().__init__(
+ 'Mariadb',
+ ProfileType.ServerType
+ )
+
+ @property
+ def packages(self) -> List[str]:
+ return ['mariadb']
+
+ @property
+ def services(self) -> List[str]:
+ return ['mariadb']
+
+ def post_install(self, install_session: 'Installer'):
+ install_session.arch_chroot('mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql')
diff --git a/archinstall/default_profiles/servers/nginx.py b/archinstall/default_profiles/servers/nginx.py
new file mode 100644
index 00000000..6038616c
--- /dev/null
+++ b/archinstall/default_profiles/servers/nginx.py
@@ -0,0 +1,19 @@
+from typing import List
+
+from archinstall.default_profiles.profile import Profile, ProfileType
+
+
+class NginxProfile(Profile):
+ def __init__(self):
+ super().__init__(
+ 'Nginx',
+ ProfileType.ServerType
+ )
+
+ @property
+ def packages(self) -> List[str]:
+ return ['nginx']
+
+ @property
+ def services(self) -> List[str]:
+ return ['nginx']
diff --git a/archinstall/default_profiles/servers/postgresql.py b/archinstall/default_profiles/servers/postgresql.py
new file mode 100644
index 00000000..dba722ce
--- /dev/null
+++ b/archinstall/default_profiles/servers/postgresql.py
@@ -0,0 +1,26 @@
+from typing import List, TYPE_CHECKING
+
+from archinstall.default_profiles.profile import Profile, ProfileType
+
+if TYPE_CHECKING:
+ from archinstall.lib.installer import Installer
+
+
+class PostgresqlProfile(Profile):
+ def __init__(self):
+ super().__init__(
+ 'Postgresql',
+ ProfileType.ServerType,
+ ''
+ )
+
+ @property
+ def packages(self) -> List[str]:
+ return ['postgresql']
+
+ @property
+ def services(self) -> List[str]:
+ return ['postgresql']
+
+ def post_install(self, install_session: 'Installer'):
+ install_session.arch_chroot("initdb -D /var/lib/postgres/data", run_as='postgres')
diff --git a/archinstall/default_profiles/servers/sshd.py b/archinstall/default_profiles/servers/sshd.py
new file mode 100644
index 00000000..7f855b1a
--- /dev/null
+++ b/archinstall/default_profiles/servers/sshd.py
@@ -0,0 +1,19 @@
+from typing import List
+
+from archinstall.default_profiles.profile import Profile, ProfileType
+
+
+class SshdProfile(Profile):
+ def __init__(self):
+ super().__init__(
+ 'sshd',
+ ProfileType.ServerType
+ )
+
+ @property
+ def packages(self) -> List[str]:
+ return ['openssh']
+
+ @property
+ def services(self) -> List[str]:
+ return ['sshd']
diff --git a/archinstall/default_profiles/servers/tomcat.py b/archinstall/default_profiles/servers/tomcat.py
new file mode 100644
index 00000000..9bd8837b
--- /dev/null
+++ b/archinstall/default_profiles/servers/tomcat.py
@@ -0,0 +1,19 @@
+from typing import List
+
+from archinstall.default_profiles.profile import Profile, ProfileType
+
+
+class TomcatProfile(Profile):
+ def __init__(self):
+ super().__init__(
+ 'Tomcat',
+ ProfileType.ServerType
+ )
+
+ @property
+ def packages(self) -> List[str]:
+ return ['tomcat10']
+
+ @property
+ def services(self) -> List[str]:
+ return ['tomcat10']