Compare commits

..

No commits in common. "master" and "TP-202311-vhost-bookworm" have entirely different histories.

9 changed files with 43 additions and 62 deletions

View File

@ -1,15 +1,19 @@
-- Artikel mit Preis
INSERT INTO price ( article_number, price, vat, price_list )
VALUES ( 1012, 2.0, 19.0, 1 );
-- RAM Option fuer PAC/WEB
INSERT INTO component ( basepacket_id, basecomponent_id, admin_only, article_number, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity )
SELECT basepacket_id, basecomponent_id, false, 1012, 0, 102400000, 0, 0, 0 from basepacket, basecomponent where basepacket_code='PAC/WEB' and basecomponent_code='RAM';
-- RAM-Option fuer jeden einzelnen Webspace mit 640MB pro DAEMON
INSERT INTO packet_component ( basecomponent_id, packet_id, quantity )
SELECT 20, packet.packet_id, packet_component.quantity*640 FROM packet, packet_component
WHERE packet.packet_id=packet_component.packet_id AND packet.basepacket_id=21 AND packet_component.basecomponent_id=21;
-- Lösche Instanzen und DAEMON-Option
DELETE FROM packet_component WHERE basecomponent_id=21;
DELETE FROM component WHERE basecomponent_id=21;
DELETE FROM basecomponent WHERE basecomponent_id=21;
ALTER TABLE domain
ADD COLUMN passenger_python character varying(256) DEFAULT '/usr/bin/python3',
ADD COLUMN passenger_nodejs character varying(256) DEFAULT '/usr/bin/node',
ADD COLUMN passenger_ruby character varying(256) DEFAULT '/usr/bin/ruby',
ADD COLUMN fcgi_php_bin character varying(256) DEFAULT '/usr/lib/cgi-bin/php';
INSERT INTO domain_option (domain_option_name) VALUES
('passenger'),
('passengerfriendlyerrorpages'),
('cgi'),
('fastcgi');
INSERT INTO domain__domain_option ( domain_option_id, domain_id )
SELECT ( SELECT domain_option_id FROM domain_option WHERE domain_option_name='cgi' ), domain_id FROM domain;
INSERT INTO domain__domain_option ( domain_option_id, domain_id )
SELECT ( SELECT domain_option_id FROM domain_option WHERE domain_option_name='fastcgi' ), domain_id FROM domain;
INSERT INTO domain__domain_option ( domain_option_id, domain_id )
SELECT ( SELECT domain_option_id FROM domain_option WHERE domain_option_name='passenger' ), domain_id FROM domain;

View File

@ -5,7 +5,7 @@
<groupId>de.hsadmin</groupId>
<artifactId>hsar</artifactId>
<packaging>war</packaging>
<version>4.0.17</version>
<version>4.0.15</version>
<name>HSAdmin Stable Backend Webapp</name>
<url>http://maven.apache.org</url>
<properties>
@ -36,12 +36,12 @@
<dependency>
<groupId>de.hsadmin.core</groupId>
<artifactId>hsadmin-util</artifactId>
<version>4.0.17</version>
<version>4.0.15</version>
</dependency>
<dependency>
<groupId>de.hsadmin.core</groupId>
<artifactId>hsadmin-qserv</artifactId>
<version>4.0.17</version>
<version>4.0.15</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>

View File

@ -200,19 +200,6 @@ public class JsonPillarServlet extends HttpServlet {
int storage = pacStorage.getQuantity();
writer.println(" , \"storage\": " + storage);
}
final PacComponent pacDaemons = pac.getPacComponent("DAEMON");
int daemon = 0;
int ram = 16;
if (pacDaemons != null && pacDaemons.getQuantity() > 0) {
daemon = pacDaemons.getQuantity();
ram = daemon * 640;
}
writer.println(" , \"daemon\": " + daemon);
final PacComponent pacRAM = pac.getPacComponent("RAM");
if (pacRAM != null) {
ram = pacRAM.getQuantity();
}
writer.println(" , \"ram\": " + ram);
final PacComponent pacOffice = pac.getPacComponent("OFFICE");
if (pacOffice != null) {
int office = pacOffice.getQuantity();

View File

@ -1,9 +1,5 @@
<Context path="/hsar" reloadable="true" crossContext="true">
<Valve className="org.apache.catalina.valves.ErrorReportValve"
showReport="false"
showServerInfo="false" />
<ResourceLink
name="jdbc/HSAdminDB"
global="jdbc/HSAdminDB"
@ -15,18 +11,8 @@
type="javax.jms.QueueConnectionFactory"/>
<ResourceLink
name="jms/hsadminSystem-h96"
global="jms/hsadminSystem-h96"
type="javax.jms.Queue"/>
<ResourceLink
name="jms/hsadminSystem-h97"
global="jms/hsadminSystem-h97"
type="javax.jms.Queue"/>
<ResourceLink
name="jms/hsadminSystem-h98"
global="jms/hsadminSystem-h98"
name="jms/hsadminSystem-h99"
global="jms/hsadminSystem-h99"
type="javax.jms.Queue"/>
<ResourceLink

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.hsadmin.core</groupId>
<artifactId>hsadmin-qserv</artifactId>
<version>4.0.17</version>
<version>4.0.15</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>8</java.version>
@ -13,7 +13,7 @@
<dependency>
<groupId>de.hsadmin.core</groupId>
<artifactId>hsadmin-util</artifactId>
<version>4.0.17</version>
<version>4.0.15</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
@ -59,7 +59,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<version>3.11.0</version>
<configuration>
<source>8</source>
<target>8</target>

View File

@ -35,11 +35,7 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
UnixUser domUser = dom.getUser();
Pac pac = domUser.getPac();
WaitingTasksProcessor mainProcessor = new WaitingTasksProcessor(
new CompoundProcessor(
new ShellProcessor("salt-call state.sls pacs"),
createDomainDirectoriesProcessor(dom),
createApacheVHostSetupProcessor(em, dom)
)
new CompoundProcessor(new ShellProcessor("salt-call state.sls pacs"))
);
Config config = Config.getInstance();
for (String queueName : config.getProperty("queues.dns").split(",")) {
@ -48,23 +44,24 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
for (String queueName : config.getProperty("queues.mail").split(",")) {
mainProcessor.appendProcessor(queueName, createMailinSetupProcessor(em, dom, pac), queueName + ".hostsharing.net");
}
mainProcessor.appendProcessor(hiveName, createDomainDirectoriesProcessor(dom), "Setup Domain Directories");
mainProcessor.appendProcessor(hiveName, createApacheVHostSetupProcessor(em, dom), "Setup Apache VHost");
mainProcessor.appendProcessor(hiveName, createTriggerAcmebotProcessor(em, dom), "Trigger ACMEBot");
return mainProcessor;
}
public <T extends AbstractEntity> Processor createUpdateProcessor(final EntityManager em, final T entity) throws ProcessorException {
String hiveName = entity.getHiveName();
final Domain dom = (Domain) entity;
final UnixUser domUser = dom.getUser();
final Pac pac = domUser.getPac();
final Processor apacheVHostSetupProcessor = createApacheVHostSetupProcessor(em, dom);
final Processor triggerAcmebotProcessor = createTriggerAcmebotProcessor(em, dom);
final WaitingTasksProcessor processor = new WaitingTasksProcessor(
new CompoundProcessor(new ShellProcessor("salt-call state.sls pacs"), apacheVHostSetupProcessor));
new CompoundProcessor(new ShellProcessor("salt-call state.sls pacs"), apacheVHostSetupProcessor, triggerAcmebotProcessor));
final Config config = Config.getInstance();
for (String queueName : config.getProperty("queues.mail").split(",")) {
processor.appendProcessor(queueName, createMailinSetupProcessor(em, dom, pac), queueName + ".hostsharing.net");
}
processor.appendProcessor(hiveName, createTriggerAcmebotProcessor(em, dom), "Trigger ACMEBot");
return processor;
}

View File

@ -98,7 +98,6 @@ public class PacProcessorFactory implements EntityProcessorFactory {
createUnlinkSiteProc(pac.getName() + ".hostsharing.net"),
createHiveDNSRemoveProcessor(domainName),
createAccountingRulesProc(),
new ShellProcessor("rm -rf '/etc/systemd/system/pacs-" + pac.getName() + ".slice'"),
new ShellProcessor("salt-call state.sls pacs >/dev/null 2>&1")), "remove packet");
final Config config = Config.getInstance();
for (String queueName : config.getProperty("queues.dns").split(",")) {

View File

@ -28,6 +28,7 @@ public class UnixUserProcessorFactory implements EntityProcessorFactory {
+ ":" + user.getComment() + ":" + user.getHomedir()
+ ":" + user.getShell() + "\n"));
appendSetHomeACLProcessor(aCP, user);
appendMakeMaildirProcessor(aCP, user);
aCP.appendProcessor(new ShellProcessor("salt-call state.sls pacs >/dev/null 2>&1"));
return aCP;
}
@ -55,7 +56,6 @@ public class UnixUserProcessorFactory implements EntityProcessorFactory {
public <T extends AbstractEntity> Processor createDeleteProcessor(EntityManager em, T entity) {
UnixUser user = (UnixUser) entity;
String uid = user.getName();
long userId = user.getUserId();
String pac = user.getPac().getName();
if (uid != null && uid.length() > 4) {
Processor killProcessesProc = new ShellProcessor("killall -TERM -u " + uid + " && sleep 5 && killall -KILL -u " + uid + " && sleep 5 || true");
@ -70,7 +70,6 @@ public class UnixUserProcessorFactory implements EntityProcessorFactory {
proc.appendProcessor(new ShellProcessor("rm -f '/var/mail/" + uid + "'"));
proc.appendProcessor(new ShellProcessor("rm -f '/var/lib/systemd/linger/" + uid + "'"));
proc.appendProcessor(new ShellProcessor("rm -rf '/home/storage/" + pac + "/users/" + ( uid.length() > 6 ? uid.substring(6) : '_' ) + "/'"));
proc.appendProcessor(new ShellProcessor("rm -rf '/etc/systemd/system/user@" + userId + ".service.d'"));
proc.appendProcessor(new ShellProcessor("salt-call state.sls pacs >/dev/null 2>&1"));
return proc;
}
@ -81,4 +80,13 @@ public class UnixUserProcessorFactory implements EntityProcessorFactory {
aCP.appendProcessor(new ShellProcessor("chmod 700 " + user.getHomedir()));
}
private void appendMakeMaildirProcessor(CompoundProcessor aCP, UnixUser user) {
aCP.appendProcessor(
new ShellProcessor(
"su -l " + user.getName() + " -s \"/bin/bash\" -c \"maildirmake.dovecot " +
user.getHomedir() + "/Maildir" +
"\""
));
}
}

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.hsadmin.core</groupId>
<artifactId>hsadmin-util</artifactId>
<version>4.0.17</version>
<version>4.0.15</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>8</java.version>
@ -22,7 +22,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<version>3.11.0</version>
<configuration>
<source>8</source>
<target>8</target>