From 6f01318bba2cf0d9a33e543a32d1fcad41d2ca24 Mon Sep 17 00:00:00 2001 From: Elouin Date: Wed, 10 Jul 2024 20:44:32 +0200 Subject: [PATCH] init --- README.md | 3 +++ forgejo/init.sls | 33 +++++++++++++++++++++++++++++++++ pillar.example | 17 +++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 README.md create mode 100644 forgejo/init.sls create mode 100644 pillar.example diff --git a/README.md b/README.md new file mode 100644 index 0000000..5cf6da8 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# forgejo formula + +Salt formula for deploying fogejo using docker. diff --git a/forgejo/init.sls b/forgejo/init.sls new file mode 100644 index 0000000..9660d2a --- /dev/null +++ b/forgejo/init.sls @@ -0,0 +1,33 @@ +forgejo data directory exists: + file.directory: + - name: /opt/forgejo/data + - makedirs: True + +forgejo docker conatiner running: + docker_container.running: + - name: forgejo + - image: {{ salt['pillar.get']('forgejo:image:path', 'codeberg.org/forgejo/forgejo') }}:{{ salt['pillar.get']('forgejo:image:version', '1.19') }} + - container_name: forgejo + - environment: + - USER_UID=1000 + - USER_GID=1000 + - FORGEJO__default__APP_NAME={{ salt['pillar.get']('forgejo:config:default:app_name', 'forgejo') }} + - FORGEJO__ui__SHOW_USER_EMAIL={{ salt['pillar.get']('forgejo:config:ui:show_user_email', 'false') }} + - FORGEJO__server__ROOT_URL={{ salt['pillar.get']('forgejo:config:server:root_url', 'http://localhost')}} + - FORGEJO__server__DOMAIN={{ salt['pillar.get']('forgejo:config:server:domain', 'localhost')}} + - FORGEJO__server__SSH_PORT={{ salt['pillar.get']('forgejo:config:server:ssh_port', 22)}} + - FORGEJO__server__SSH_DOMAIN={{ salt['pillar.get']('forgejo:config:server:ssh_domain', 'localhost')}} + - FORGEJO__server__START_SSH_SERVER={{ salt['pillar.get']('forgejo:config:server:start_ssh_server', "false")}} + - FORGEJO__service__DISABLE_REGISTRATION={{ salt['pillar.get']('forgejo:config:service:disable_registration', "true")}} + - restart: always + - networks: + - bridge + - extra_hosts: + - ldap.flipdot.space:192.168.3.233 + - binds: + - /opt/forgejo/data:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - port_bindings: + - "127.0.0.1:3000:3000" + - "222:22" diff --git a/pillar.example b/pillar.example new file mode 100644 index 0000000..186b4be --- /dev/null +++ b/pillar.example @@ -0,0 +1,17 @@ +forgejo: + image: + path: codeberg.org/forgejo/forgejo + version: 7.0.5 + + config: + default: + app_name: my awesome code forge + ui: + show_user_email: "false" + server: + domain: git.example.com + root_url: https://git.example.com/ + ssh_port: 22 + ssh_domain: git.example.com + service: + disable_registration=true