User Tools

Site Tools


computing:ente

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computing:ente [2026/09/21 02:50] oemb1905computing:ente [2026/09/21 03:13] (current) oemb1905
Line 34: Line 34:
   * legacy.gnulinux.pics   * legacy.gnulinux.pics
  
-## 1. Base system  
 Setup base system,  Setup base system, 
  
Line 48: Line 47:
 </code> </code>
  
-## 2. Go, Rust, Node+Now, Go, Rust, and Node setup: 
 <code> <code>
 sudo apt install -y golang-go rustup nodejs npm sudo apt install -y golang-go rustup nodejs npm
Line 58: Line 58:
 </code> </code>
  
-### 3. PostgreSQL +Setup PostgreSQL and create the db with ''sudo -u postgres psql'' and something like:
- +
-Create the db with ''sudo -u postgres psql'' and something like:+
      
-```sql+<code>
 CREATE USER ente WITH ENCRYPTED PASSWORD 'ENTE_DB_PASS'; CREATE USER ente WITH ENCRYPTED PASSWORD 'ENTE_DB_PASS';
 CREATE DATABASE ente_db OWNER ente; CREATE DATABASE ente_db OWNER ente;
 GRANT ALL PRIVILEGES ON DATABASE ente_db TO ente; GRANT ALL PRIVILEGES ON DATABASE ente_db TO ente;
 \q \q
-```+</code>
  
-Next, lock access:+Next, lock access to db:
  
-```bash+<code>
 echo 'host    ente_db    ente    127.0.0.1/32    scram-sha-256' | sudo tee -a /etc/postgresql/*/main/pg_hba.conf echo 'host    ente_db    ente    127.0.0.1/32    scram-sha-256' | sudo tee -a /etc/postgresql/*/main/pg_hba.conf
 echo 'host    ente_db    ente    ::1/128         scram-sha-256' | sudo tee -a /etc/postgresql/*/main/pg_hba.conf echo 'host    ente_db    ente    ::1/128         scram-sha-256' | sudo tee -a /etc/postgresql/*/main/pg_hba.conf
 sudo systemctl reload postgresql sudo systemctl reload postgresql
 PGPASSWORD='ENTE_DB_PASS' psql -h 127.0.0.1 -U ente -d ente_db -c 'SELECT 1;' PGPASSWORD='ENTE_DB_PASS' psql -h 127.0.0.1 -U ente -d ente_db -c 'SELECT 1;'
-``` +</code>
-## 4. Museum binary + yaml config +
-Run the go setup bits and migrate the example yaml config to production so we can edit params:+
  
-```bash+Edit museum.yaml and configure it, build its web apps, start it, and create unit: 
 + 
 +<code>
 cd /root/ente/server cd /root/ente/server
 go mod tidy go mod tidy
Line 86: Line 84:
 go run tools/gen-random-keys/main.go go run tools/gen-random-keys/main.go
 cp config/example.yaml museum.yaml cp config/example.yaml museum.yaml
-```+</code>
  
-Edit ''/root/ente/server/museum.yaml'' (keys from the generatorDB, then S3 after Garage). Do not regenerate keys on a live database. Create systemd unit.+Edit ''/root/ente/server/museum.yaml'' using keys from second to last step above. Nowcreate systemd unit.
  
-```bash+<code>
 sudo tee /etc/systemd/system/ente-museum.service >/dev/null << 'EOF' sudo tee /etc/systemd/system/ente-museum.service >/dev/null << 'EOF'
 [Unit] [Unit]
Line 109: Line 107:
 sudo systemctl enable --now ente-museum sudo systemctl enable --now ente-museum
 curl -sS http://127.0.0.1:8080/ping curl -sS http://127.0.0.1:8080/ping
-``` +</code>
-## 5. Web app building and migrating content from repo+
  
-```bash+Build the Web apps and migrating content from repo 
 + 
 +<code>
 cd /root/ente/web cd /root/ente/web
 npm ci npm ci
Line 135: Line 134:
 sudo cp -a apps/memories/out /var/www/ente/apps/memories sudo cp -a apps/memories/out /var/www/ente/apps/memories
 sudo chown -R caddy:caddy /var/www/ente sudo chown -R caddy:caddy /var/www/ente
-```+</code>
  
-## 6. Caddy reverse proxy, acme certs, load balancing, vhostsetc.+Setup Caddy reverse proxy / load balancer, acme certs, and vhosts with ''nano /etc/caddy/Caddyfile'' and enter the following:
  
-  nano `/etc/caddy/Caddyfile`: +<code>
- +
-Then, +
- +
-```caddy+
 { {
     email admin@gnulinux.pics     email admin@gnulinux.pics
Line 216: Line 211:
     reverse_proxy 127.0.0.1:3900     reverse_proxy 127.0.0.1:3900
 } }
-```+</code>
  
 Verify after making config, then restart service, debug as needed: Verify after making config, then restart service, debug as needed:
  
-```bash+<code>
 sudo caddy validate --config /etc/caddy/Caddyfile sudo caddy validate --config /etc/caddy/Caddyfile
 sudo systemctl enable --now caddy sudo systemctl enable --now caddy
Line 227: Line 222:
 curl -sSI https://gnulinux.pics curl -sSI https://gnulinux.pics
 curl -sS https://api.gnulinux.pics/ping curl -sS https://api.gnulinux.pics/ping
-```+</code>
  
-End point works now, go to url in browser+End point works now, go to url in browser and create first user then use the id# to lock it as admin.
  
-## 7. First user +  - Open https://gnulinux.pics and sign up. 
-1. Open https://gnulinux.pics and sign up. +  OTP: ''journalctl -u ente-museum -n 200 --no-pager'' 
-2. OTP: `journalctl -u ente-museum -n 200 --no-pager` +  User id: 34982349839489320843
-3. User id: +
-```bash+
  
-You need to locate the id# by searching logs for your email in close proximity. Or, make a one-liner:+You need to locate the id# by searching logs for your email in close proximity as per above. Or, alternately, make a one-liner: 
 + 
 +  journalctl -u ente-museum --no-pager | grep -F -A 80 'user@example.com' | grep -oE 'user_id=[1-9][0-9]*' | tail -1
  
-journalctl -u ente-museum --no-pager | grep -F -A 80 'user@example.com' | grep -oE 'user_id=[1-9][0-9]*' | tail -1 
-``` 
 Once that's done, go edit ''nano /root/ente/server/museum.yaml'': Once that's done, go edit ''nano /root/ente/server/museum.yaml'':
  
-```yaml+<code>
 internal: internal:
     admins:     admins:
         - USER_ID         - USER_ID
     trusted-client-ip-header: X-Forwarded-For     trusted-client-ip-header: X-Forwarded-For
-```+</code>
  
 Restart service, Restart service,
  
-```bash +  sudo systemctl restart ente-museum 
-sudo systemctl restart ente-museum +
-```+
 How to edit admin user to give them more storage: How to edit admin user to give them more storage:
  
-```bash+<code>
 PGPASSWORD='ENTE_DB_PASS' psql -h 127.0.0.1 -U ente -d ente_db -c "UPDATE subscriptions SET storage = 25::bigint * 1024 * 1024 * 1024 WHERE user_id = USER_ID RETURNING user_id, storage;" PGPASSWORD='ENTE_DB_PASS' psql -h 127.0.0.1 -U ente -d ente_db -c "UPDATE subscriptions SET storage = 25::bigint * 1024 * 1024 * 1024 WHERE user_id = USER_ID RETURNING user_id, storage;"
 # 100 250 500 750 → same, change 25 # 100 250 500 750 → same, change 25
 # 1TB = 1024   1.5TB = 1536   2TB = 2048 # 1TB = 1024   1.5TB = 1536   2TB = 2048
-```+</code>
  
 ## 8. Garage (needed before uploads work) ## 8. Garage (needed before uploads work)
 Warning: If you rerun layout/bucket/key it hoses the current bucket. Warning: If you rerun layout/bucket/key it hoses the current bucket.
  
-```bash+<code>
 sudo mkdir -p /var/lib/garage/meta /mnt/warehouse/media/glpics sudo mkdir -p /var/lib/garage/meta /mnt/warehouse/media/glpics
 curl -fL -o /tmp/garage https://garagehq.deuxfleurs.fr/_releases/v2.4.1/x86_64-unknown-linux-musl/garage curl -fL -o /tmp/garage https://garagehq.deuxfleurs.fr/_releases/v2.4.1/x86_64-unknown-linux-musl/garage
 sudo install -m 0755 /tmp/garage /usr/local/bin/garage sudo install -m 0755 /tmp/garage /usr/local/bin/garage
 garage --version garage --version
 +</code>
  
-Create config .toml file and start garage service:+Create config .toml file and start garage service:
  
 +<code>
 sudo tee /etc/garage.toml >/dev/null << 'EOF' sudo tee /etc/garage.toml >/dev/null << 'EOF'
 metadata_dir = "/var/lib/garage/meta" metadata_dir = "/var/lib/garage/meta"
Line 290: Line 284:
 admin_token = "GARAGE_ADMIN_TOKEN" admin_token = "GARAGE_ADMIN_TOKEN"
 EOF EOF
 +</code>
  
 Create systemd unit for garage to monitor and restart service: Create systemd unit for garage to monitor and restart service:
  
 +<code>
 sudo tee /etc/systemd/system/garage.service >/dev/null << 'EOF' sudo tee /etc/systemd/system/garage.service >/dev/null << 'EOF'
 [Unit] [Unit]
Line 308: Line 304:
 sudo systemctl enable --now garage sudo systemctl enable --now garage
 sudo systemctl status garage --no-pager sudo systemctl status garage --no-pager
-```+</code>
  
 Create bucket on the same host and name it / give perms for Ente's default s3-compatible endpoint: Create bucket on the same host and name it / give perms for Ente's default s3-compatible endpoint:
  
-```bash+<code>
 garage -c /etc/garage.toml status garage -c /etc/garage.toml status
 NODE=$(garage -c /etc/garage.toml node id -q | head -1) NODE=$(garage -c /etc/garage.toml node id -q | head -1)
Line 321: Line 317:
 garage -c /etc/garage.toml bucket allow b2-eu-cen --read --write --owner --key ente-photos garage -c /etc/garage.toml bucket allow b2-eu-cen --read --write --owner --key ente-photos
 garage -c /etc/garage.toml key info ente-photos garage -c /etc/garage.toml key info ente-photos
-```+</code>
  
-Once the bucket is built, add the creds it spit out into `/root/ente/server/museum.yamland restart Museum.+Once the bucket is built, add the creds it spit out into ''/root/ente/server/museum.yaml'' and restart Museum.
  
-```yaml+<code>
 s3: s3:
     are_local_buckets: false     are_local_buckets: false
Line 335: Line 331:
         region: garage         region: garage
         bucket: b2-eu-cen         bucket: b2-eu-cen
-```+</code>
  
 Restart the service Restart the service
  
-```bash +  sudo systemctl restart ente-museum
-sudo systemctl restart ente-museum +
-```+
  
-### Draft Upgrade Garage Steps +Draft Upgrade Garage Steps 
  
-```bash+<code>
 VER=v2.4.1 VER=v2.4.1
 ARCH=x86_64-unknown-linux-musl ARCH=x86_64-unknown-linux-musl
Line 356: Line 350:
 garage -c /etc/garage.toml status garage -c /etc/garage.toml status
 curl -sS https://api.gnulinux.pics/ping curl -sS https://api.gnulinux.pics/ping
-```+</code>
  
 Potential steps if garage upgrade fails: Potential steps if garage upgrade fails:
  
-```bash+<code>
 sudo systemctl stop garage sudo systemctl stop garage
 sudo cp /usr/local/bin/garage.bak-YYYY-MM-DD /usr/local/bin/garage sudo cp /usr/local/bin/garage.bak-YYYY-MM-DD /usr/local/bin/garage
 sudo systemctl start garage sudo systemctl start garage
-```+</code>
  
-Do not layout/bucket/key on upgrade - it will hose current bucket.+Do not layout/bucket/key on upgrade - it will hose current bucket. Example museum.yaml example config layout for base setup
  
-## 9. museum.yaml example config layout for base setup +<code>
- +
-```yaml+
 db: db:
     host: 127.0.0.1     host: 127.0.0.1
Line 411: Line 403:
     email: SMTP_FROM     email: SMTP_FROM
     sender-name: gnulinux.pics     sender-name: gnulinux.pics
-```+</code>
  
-## 10. Draft update sequence+Draft update sequence
  
-```bash+<code>
 sudo apt update && sudo apt upgrade sudo apt update && sudo apt upgrade
 rustup update rustup update
Line 445: Line 437:
 sudo systemctl reload caddy sudo systemctl reload caddy
 curl -sS https://api.gnulinux.pics/ping curl -sS https://api.gnulinux.pics/ping
-```+</code>
  
 Store secrets properly Store secrets properly
  
- --- //[[alerts@haacksnetworking.org|oemb1905]] 2026/09/21 02:27// + --- //[[alerts@haacksnetworking.org|oemb1905]] 2026/09/21 02:50//
computing/ente.1789959017.txt.gz · Last modified: by oemb1905