Skip to content
This repository was archived by the owner on Dec 30, 2025. It is now read-only.

Commit 11959b6

Browse files
committed
feat(prepare-config.sh): enhance configuration preparation for multiple services
Refactor the script to handle configuration preparation for both UnrealIRCd and Atheme services. This change allows the script to prepare multiple configuration files, improving the setup process for different services. It also adds logging for missing configuration files, enhancing error handling and user feedback. fix(atheme.conf, unrealircd.conf): update service domain names to "services.atl.dev" Change the service domain names from "services.atl.chat" to "services.atl.dev" in both Atheme and UnrealIRCd configuration files. This update reflects a change in the network's domain naming convention, ensuring consistency across the configuration files.
1 parent cf5c738 commit 11959b6

File tree

3 files changed

+35
-23
lines changed

3 files changed

+35
-23
lines changed

scripts/prepare-config.sh

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,10 @@ log_error() {
3434

3535
# Function to prepare configuration
3636
prepare_config() {
37-
local config_file="$PROJECT_ROOT/unrealircd/conf/unrealircd.conf"
38-
local temp_file="/tmp/unrealircd.conf.tmp"
37+
local unreal_config="$PROJECT_ROOT/unrealircd/conf/unrealircd.conf"
38+
local atheme_config="$PROJECT_ROOT/services/atheme/atheme.conf"
3939

40-
if [ ! -f "$config_file" ]; then
41-
log_error "Configuration file not found: $config_file"
42-
exit 1
43-
fi
44-
45-
log_info "Preparing UnrealIRCd configuration with environment variables..."
40+
log_info "Preparing IRC configuration files with environment variables..."
4641

4742
# Check if envsubst is available
4843
if ! command -v envsubst >/dev/null 2>&1; then
@@ -60,13 +55,29 @@ prepare_config() {
6055
log_info "Environment variables loaded"
6156
fi
6257

63-
# Substitute environment variables
64-
envsubst < "$config_file" > "$temp_file"
58+
# Prepare UnrealIRCd configuration
59+
if [ -f "$unreal_config" ]; then
60+
log_info "Preparing UnrealIRCd configuration..."
61+
local temp_file="/tmp/unrealircd.conf.tmp"
62+
envsubst < "$unreal_config" > "$temp_file"
63+
mv "$temp_file" "$unreal_config"
64+
log_success "UnrealIRCd configuration prepared"
65+
else
66+
log_warning "UnrealIRCd configuration file not found: $unreal_config"
67+
fi
6568

66-
# Replace the original file
67-
mv "$temp_file" "$config_file"
69+
# Prepare Atheme configuration
70+
if [ -f "$atheme_config" ]; then
71+
log_info "Preparing Atheme configuration..."
72+
local temp_file="/tmp/atheme.conf.tmp"
73+
envsubst < "$atheme_config" > "$temp_file"
74+
mv "$temp_file" "$atheme_config"
75+
log_success "Atheme configuration prepared"
76+
else
77+
log_warning "Atheme configuration file not found: $atheme_config"
78+
fi
6879

69-
log_success "Configuration prepared successfully"
80+
log_success "All configuration files prepared successfully"
7081

7182
# Show substituted values for verification
7283
log_info "Substituted values:"
@@ -75,6 +86,7 @@ prepare_config() {
7586
echo " IRC_CLOAK_PREFIX: ${IRC_CLOAK_PREFIX:-'not set'}"
7687
echo " IRC_ADMIN_NAME: ${IRC_ADMIN_NAME:-'not set'}"
7788
echo " IRC_ADMIN_EMAIL: ${IRC_ADMIN_EMAIL:-'not set'}"
89+
echo " IRC_SERVICES_SERVER: ${IRC_SERVICES_SERVER:-'not set'}"
7890
}
7991

8092
# Main function

services/atheme/atheme.conf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -985,11 +985,11 @@ loadmodule "/usr/local/atheme/modules/crypto/pbkdf2"; /* Verify-only
985985
* users in channel access entries. These target mapping entity types are
986986
* defined through the 'exttarget' modules listed below.
987987
*
988-
* $oper exttarget match type exttarget/oper
989-
* $registered exttarget match type exttarget/registered
990-
* $channel exttarget match type exttarget/channel
991-
* $chanacs exttarget match type exttarget/chanacs
992-
* $server exttarget match type exttarget/server
988+
* exttarget match type exttarget/oper
989+
* exttarget match type exttarget/registered
990+
* exttarget match type exttarget/channel
991+
* exttarget match type exttarget/chanacs
992+
* exttarget match type exttarget/server
993993
*/
994994
#loadmodule "exttarget/oper";
995995
#loadmodule "exttarget/registered";
@@ -1037,7 +1037,7 @@ loadmodule "/usr/local/atheme/modules/crypto/pbkdf2"; /* Verify-only
10371037
* - ./configure --prefix=foo ...
10381038
* - make
10391039
* - make install
1040-
* - ${foo}/bin/atheme-crypto-benchmark -o
1040+
* - /bin/atheme-crypto-benchmark -o
10411041
*
10421042
* If you wish to deploy SASL SCRAM support, please read 'doc/SASL-SCRAM' and
10431043
* pass the '-i' flag to the included cryptographic benchmarking utility too.
@@ -1386,7 +1386,7 @@ loadmodule "/usr/local/atheme/modules/crypto/pbkdf2"; /* Verify-only
13861386
* must be unique on the IRC network and contain at least one dot, but
13871387
* does not have to be equal to any DNS name.
13881388
*/
1389-
name = "services.atl.chat";
1389+
name = "services.atl.dev";
13901390

13911391
/* desc
13921392
*

unrealircd/conf/unrealircd.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ set {
291291
* For more information about what Services are,
292292
* see https://www.unrealircd.org/docs/Services
293293
*/
294-
link services.atl.chat
294+
link services.atl.dev
295295
{
296296
incoming {
297297
mask *;
@@ -310,7 +310,7 @@ link services.atl.chat
310310
* it's only for Services!
311311
*/
312312
ulines {
313-
services.atl.chat;
313+
services.atl.dev;
314314
}
315315

316316
/* Here you can add a password for the IRCOp-only /DIE and /RESTART commands.
@@ -625,7 +625,7 @@ set {
625625
// CHANGE THIS, ALL 4 ITEMS:
626626
network-name "atl.dev";
627627
default-server "irc.atl.dev";
628-
services-server "services.atl.chat";
628+
services-server "services.atl.dev";
629629
// stats-server "stats.example.org";
630630

631631
/* Normal defaults */

0 commit comments

Comments
 (0)