feat: initial commit

This commit is contained in:
root 2025-04-01 17:40:03 +00:00
commit 2dfb19d1a1
457 changed files with 40577 additions and 0 deletions

View file

@ -0,0 +1,48 @@
class garage {
contain garage::install
contain garage::config
contain garage::service
contain garage::webui
}
class garage::install {
file { '/opt/garage':
ensure => directory,
mode => '0640'
}
file { '/opt/garage/garage':
ensure => file,
source => 'https://garagehq.deuxfleurs.fr/_releases/v1.1.0/x86_64-unknown-linux-musl/garage',
mode => '0740'
}
}
class garage::config {
file { '/opt/garage/garage.toml':
content => template('garage/conf.toml.erb'),
ensure => file,
mode => '0644',
notify => [Service['garage'], Service['garage-webui']]
}
}
class garage::service {
file { '/lib/systemd/system/garage.service':
mode => '0644',
owner => 'root',
group => 'root',
content => template('garage/garage.service.erb'),
}~>
exec { 'garage-systemd-reload':
command => 'systemctl daemon-reload',
path => [ '/usr/bin', '/bin', '/usr/sbin' ],
refreshonly => true,
}
service { 'garage':
ensure => running,
enable => true,
}
}

View file

@ -0,0 +1,35 @@
class garage::webui {
contain garage::webui::install
contain garage::webui::service
}
class garage::webui::install {
file { '/opt/garage-webui':
ensure => directory
}
file { '/opt/garage-webui/webui':
source => 'https://github.com/khairul169/garage-webui/releases/download/1.0.8/garage-webui-v1.0.8-linux-amd64',
ensure => 'file',
mode => '0740',
}
}
class garage::webui::service {
file { '/lib/systemd/system/garage-webui.service':
mode => '0644',
owner => 'root',
group => 'root',
content => template('garage/garage-webui.service.erb'),
}~>
exec { 'garage-webui-systemd-reload':
command => 'systemctl daemon-reload',
path => [ '/usr/bin', '/bin', '/usr/sbin' ],
refreshonly => true,
}
service { 'garage-webui':
ensure => running,
enable => true,
}
}

View file

@ -0,0 +1,28 @@
metadata_dir = "/opt/garage/meta"
data_dir = "/opt/garage/data"
db_engine = "sqlite"
replication_factor = 1
rpc_bind_addr = "[::]:3901"
rpc_public_addr = "127.0.0.1:3901"
rpc_secret = "<%= @garage_rpc_secret %>"
[s3_api]
s3_region = "garage"
api_bind_addr = "[::]:3900"
root_domain = ".s3.amy.mov"
[s3_web]
bind_addr = "[::]:3902"
root_domain = ".s3.amy.mov"
index = "index.html"
[k2v_api]
api_bind_addr = "[::]:3904"
[admin]
api_bind_addr = "[::]:3903"
admin_token = "<%= @garage_admin_token %>"
metrics_token = "<%= @garage_metrics_token %>"

View file

@ -0,0 +1,15 @@
[Unit]
Description=GarageHQ WebUI
Wants=basic.target
After=basic.target network.target
[Service]
WorkingDirectory=/opt/garage-webui
Environment="CONFIG_PATH=/opt/garage/garage.toml"
ExecStart=/opt/garage-webui/webui
KillMode=process
Restart=on-failure
RestartSec=30s
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,14 @@
[Unit]
Description=GarageHQ
Wants=basic.target
After=basic.target network.target
[Service]
WorkingDirectory=/opt/garage
ExecStart=/opt/garage/garage -c /opt/garage/garage.toml server
KillMode=process
Restart=on-failure
RestartSec=30s
[Install]
WantedBy=multi-user.target