cloud infra
0

Configure Feed

Select the types of activity you want to include in your feed.

Install foundry: obs.nagee.dev

Add foundry + dns

nagee (Jul 5, 2026, 3:46 PM -0700) d42202d7 15035fe1

+122 -1
+17
README.md
··· 60 60 61 61 1. Update `SERVICES` in `configure/operations/services.py` with your new service 62 62 2. Run `mise run op-add-service` 63 + 64 + ### Foundry and SigNoz 65 + 66 + This is experimental, so was installed manually. 67 + 68 + First, foundry was installed using the instructions here https://github.com/SigNoz/foundry 69 + 70 + I did have to do the following to get foundryctl to work and I followed the prerequesites here: https://github.com/SigNoz/foundry/tree/main/docs/examples/systemd/binary#prerequisites 71 + 72 + I changed the storage option to sqlite instead of postgresql. 73 + 74 + 75 + # Secrets 76 + 77 + `infra_do_space_json`: 78 + 79 + 1. Go to
+82
configure/operations/postgresql.py
··· 1 + from pyinfra import host, state 2 + from pyinfra.facts.server import LinuxName 3 + from pyinfra.operations import apt, files, postgresql, python 4 + 5 + if host.get_fact(LinuxName) != "Ubuntu": 6 + # Raises an exception mid-deploy 7 + python.raise_exception( 8 + name="Ensure we are Ubuntu", 9 + exception=NotImplementedError, 10 + args=("`postgresql.py` only works on Ubuntu",), 11 + ) 12 + 13 + 14 + apt.packages(packages=["postgresql"], update=True, cache_time=3600) 15 + 16 + # Example from pyinfra: 17 + 18 + # # Setup a PostgreSQL role & database 19 + # # 20 + 21 + # postgresql.role( 22 + # name="Create the PostgreSQL role", 23 + # role="pyinfra", 24 + # password="somepassword", 25 + # superuser=True, 26 + # login=True, 27 + # sudo_user="postgres", 28 + # ) 29 + 30 + # postgresql.database( 31 + # name="Create the pyinfra_stuff database", 32 + # database="pyinfra_stuff", 33 + # owner="pyinfra", 34 + # encoding="UTF8", 35 + # sudo_user="postgres", 36 + # ) 37 + 38 + 39 + # # Upload & import a SQL file into the pyinfra_stuff database 40 + # # 41 + 42 + # filename = "files/a_db.sql" 43 + # temp_filename = state.get_temp_filename(filename) 44 + 45 + # files.put( 46 + # name="Upload the a_db.sql file", 47 + # src=filename, 48 + # dest=temp_filename, 49 + # ) 50 + 51 + # postgresql.load( 52 + # name="Import the uploaded a_db.sql file", 53 + # src=temp_filename, 54 + # database="pyinfra_stuff", 55 + # sudo_user="postgres", 56 + # ) 57 + 58 + 59 + # # Now duplicate the pyinfra_stuff database -> pyinfra_stuff_copy 60 + # # 61 + 62 + # postgresql.database( 63 + # name="Create the pyinfra_stuff_copy database", 64 + # database="pyinfra_stuff_copy", 65 + # sudo_user="postgres", 66 + # ) 67 + 68 + # dump_filename = state.get_temp_filename("psql_dump") 69 + 70 + # postgresql.dump( 71 + # name="Dump the pyinfra_stuff database", 72 + # dest=dump_filename, 73 + # database="pyinfra_stuff", 74 + # sudo_user="postgres", 75 + # ) 76 + 77 + # postgresql.load( 78 + # name="Import the pyinfra_stuff dump into pyinfra_stuff_copy", 79 + # src=dump_filename, 80 + # database="pyinfra_stuff_copy", 81 + # sudo_user="postgres", 82 + # )
+4 -1
configure/operations/release.py
··· 50 50 51 51 return bool(file_exists) 52 52 53 + 53 54 def service_definition_exists(conf: SystemdServiceConf) -> bool | None: 54 55 from pyinfra.facts.files import File as FileFact 55 56 from pyinfra import host ··· 57 58 file_exists = host.get_fact(FileFact, str(conf.service_definition_path)) 58 59 59 60 return bool(file_exists) 61 + 60 62 61 63 def service_running(conf: SystemdServiceConf) -> bool | None: 62 64 from pyinfra.facts.systemd import SystemdStatus ··· 119 121 120 122 systemd.service(service=conf.service_name, daemon_reload=True) 121 123 124 + 122 125 def stop_service(conf: SystemdServiceConf): 123 126 from pyinfra.operations import systemd 124 127 ··· 153 156 if not executable_exists(conf): 154 157 install_executable(conf) 155 158 needs_full_restart = True 156 - 159 + 157 160 if needs_full_restart: 158 161 start_service(conf) 159 162 else:
+9
configure/operations/services.py
··· 170 170 } 171 171 """), 172 172 ), 173 + # Experimental! 174 + Service( 175 + name="obs", 176 + subdomain="obs", 177 + port=8080, 178 + envs=[Env.PROD], 179 + systemd_config=None, # currently handled manually! 180 + caddy_config=f"reverse_proxy localhost:8080", 181 + ), 173 182 ] 174 183 ) 175 184
+10
provision/dns.tf
··· 138 138 } 139 139 140 140 141 + // point obs.nagee.dev to the app server 142 + resource "porkbun_dns_record" "obs_nagee_dev" { 143 + domain = "nagee.dev" 144 + subdomain = "obs" 145 + type = "A" 146 + content = digitalocean_droplet.app_1.ipv4_address 147 + ttl = 600 148 + } 149 + 150 + 141 151 resource "porkbun_dns_record" "bluesky_handle" { 142 152 domain = "nagee.dev" 143 153 subdomain = "_atproto"